forked from Ferrster/Snowrunner-Manual-Gearbox-Mod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (31 loc) · 1.17 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
cmake_minimum_required(VERSION 3.14)
project(SMGM VERSION 0.1 LANGUAGES CXX)
if(NOT MSVC)
message(FATAL_ERROR "This project supports only Visual C++ compilers!")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SMGM_NO_CONSOLE OFF CACHE BOOL "Do not use console window for log display")
set(SMGM_USE_DETOURS ON CACHE BOOL "Use detours for hooking")
add_compile_definitions(
_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS
)
if(SMGM_USE_DETOURS)
set(SMGM_PATH_TO_VCVARS64 "G:\\Programs\\Visual Studio 19\\VC\\Auxiliary\\Build\\vcvars64.bat" CACHE PATH "Path to vcvars64.bat. Needed to build detours library")
include(ExternalProject)
ExternalProject_Add(DetoursLib
GIT_REPOSITORY https://github.com/microsoft/Detours.git
GIT_TAG origin/main
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(DetoursLib SOURCE_DIR)
ExternalProject_Add_Step(DetoursLib _build
COMMAND ${PROJECT_SOURCE_DIR}/misc/build_detours.bat ${SMGM_PATH_TO_VCVARS64} ${SOURCE_DIR}
ALWAYS ON
)
link_directories(${SOURCE_DIR}/lib.X64)
include_directories(${SOURCE_DIR}/include)
endif()
add_subdirectory(src)