This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathCMakeLists.txt
81 lines (67 loc) · 2.85 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.2)
project(Win11SysCheck CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../Bin/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ../Bin/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ../Bin/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ../Bin/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ../Bin/)
add_definitions(-DFMT_HEADER_ONLY)
add_definitions(-DIMGUI_IMPL_WIN32_DISABLE_GAMEPAD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DTARGET_ARCH_STR="64")
set(ARCH_STR "64")
else()
add_definitions(-DTARGET_ARCH_STR="86")
set(ARCH_STR "86")
endif()
execute_process ( COMMAND git rev-list HEAD OUTPUT_VARIABLE GIT_REV_LIST_OUTPUT ERROR_VARIABLE GIT_REV_LIST_OUTPUT RESULT_VARIABLE GIT_REV_LIST_RESULT WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
if( NOT ${GIT_REV_LIST_RESULT} EQUAL 0 )
message( FATAL_ERROR "get_git_revision(): can not get git revision. log followed: ${GIT_REV_LIST_OUTPUT}")
endif()
string(STRIP ${GIT_REV_LIST_OUTPUT} GIT_REV_LIST_OUTPUT)
string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_OUTPUT} )
list(LENGTH GIT_REV_LIST gitVersion )
add_definitions(-D_GIT_VERSION_="${gitVersion}")
if(MSVC)
set(LIB_RT_SUFFIX "mt")
set(LIB_RT_OPTION "/MT")
foreach(flag_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
foreach(config_name "" DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
set(var_name "${flag_var}")
if(NOT "${config_name}" STREQUAL "")
set(var_name "${var_name}_${config_name}")
endif()
string(REPLACE "/MD" "${LIB_RT_OPTION}" ${var_name} "${${var_name}}")
set(${var_name} "${${var_name}}" CACHE STRING "" FORCE)
endforeach()
endforeach()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MT_BUILD}")
endif()
include_directories(${PROJECT_SOURCE_DIR}/extern/imgui-1.83)
include_directories(${PROJECT_SOURCE_DIR}/extern/imgui-1.83/backends)
include_directories(${PROJECT_SOURCE_DIR}/extern/spdlog-1.8.5)
include_directories(${PROJECT_SOURCE_DIR}/extern/fmt-7.1.3)
include_directories(${PROJECT_SOURCE_DIR}/extern/mINI)
include_directories(${PROJECT_SOURCE_DIR}/extern/rapidjson)
include_directories(${PROJECT_SOURCE_DIR}/extern/imgui-notify)
link_directories(${PROJECT_SOURCE_DIR}/extern/d3d9/lib_x${ARCH_STR})
link_directories(${PROJECT_SOURCE_DIR}/extern/spdlog-1.8.5)
file(GLOB HEADERS
"${PROJECT_SOURCE_DIR}/include/*.hpp"
)
file(GLOB SOURCES
"${PROJECT_SOURCE_DIR}/extern/imgui-1.83/backends/imgui_impl_win32.cpp"
"${PROJECT_SOURCE_DIR}/extern/imgui-1.83/backends/imgui_impl_dx9.cpp"
"${PROJECT_SOURCE_DIR}/extern/imgui-1.83/*.cpp"
"${PROJECT_SOURCE_DIR}/src/*.cpp"
)
add_executable(
${PROJECT_NAME}
${HEADERS}
${SOURCES}
)
target_precompile_headers(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/include/pch.hpp)
target_link_libraries(${PROJECT_NAME} d3d9 d3dx9 DxErr dinput8 dwmapi dxguid PowrProf WinInet Tbs)