forked from ErrorFlynn/Borderless-Window-Helper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
67 lines (52 loc) · 1.51 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(Borderless-Window-Helper VERSION 2.2.0 LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX
"Borderless-Window-Helper-${PROJECT_VERSION}"
CACHE
PATH
"installation directory"
FORCE)
endif()
find_program(CCACHE ccache)
if(CCACHE)
message(STATUS "found ccache: ${CCACHE}")
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
endif()
add_executable(Borderless-Window-Helper
WIN32
src/inifile.cpp
src/main.cpp
src/util.cpp
)
target_sources(Borderless-Window-Helper PRIVATE "src/Borderless Window Helper.rc")
target_compile_definitions(Borderless-Window-Helper PRIVATE UNICODE _UNICODE)
include(cmake/CPM.cmake)
option(NANA_CMAKE_ENABLE_CONF "enable config.hpp" ON)
CPMAddPackage(
NAME nana
GITHUB_REPOSITORY cnjinhao/nana
GIT_TAG 006feae
)
target_compile_definitions(nana PRIVATE NANA_ENABLE_VIRTUAL_KEYBOARD)
target_link_libraries(Borderless-Window-Helper PRIVATE nana::nana)
if(NOT MSVC)
target_link_options(Borderless-Window-Helper
PRIVATE
-municode
-static
-static-libgcc
-static-libstdc++
)
endif()
if(MSVC)
target_compile_options(Borderless-Window-Helper
PRIVATE
/MT # build static exe
)
endif()
target_compile_features(Borderless-Window-Helper PRIVATE cxx_std_17)
set(CPACK_GENERATOR ZIP)
include(CPack)
install(TARGETS Borderless-Window-Helper RUNTIME DESTINATION .)