-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
81 lines (66 loc) · 1.72 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
# Absolute minimum cmake version
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
#Include MologieDetours cmake file
include(MologieDetours.cmake)
# The name of the project
set(LIB_NAME BLoader)
# The libraries to load
set(LIBRARIES
"MologieDetours"
"psapi"
)
# Activate C++14 on MingW cross-compiling situations.
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Sources and headers to be included in compilation
set(SOURCES_TORQUE
"source/torque/functions.cpp"
"source/torque/scanner.cpp"
"source/torque/torque.cpp"
"source/torque/utility.cpp"
)
set(HEADERS_TORQUE
"include/torque/functions.h"
"include/torque/scanner.h"
"include/torque/torque.h"
"include/torque/types.h"
"include/torque/utility.h"
)
set(SOURCES
"source/bloader.cpp"
"source/dllmain.cpp"
"source/engine.cpp"
"source/filesystem.cpp"
"source/library.cpp"
"${SOURCES_TORQUE}"
)
set(HEADERS
"include/blmodule.h"
"include/bloader.h"
"include/bloader.hpp"
"include/engine.h"
"include/filesystem.h"
"include/library.h"
"include/library_impl.h"
"${HEADERS_TORQUE}"
"project/blibrary.h"
)
# Include directories
include_directories("include/")
include_directories("include/torque")
include_directories("project/")
# Make sure functions are exported
add_definitions(-DBLOADER_DLL=1)
# Compile as a library
add_library(${LIB_NAME} SHARED ${SOURCES} ${HEADERS})
# Multi threaded
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
else()
SET_TARGET_PROPERTIES(BLoader PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
endif()
# VS filters
source_group("torque" FILES ${SOURCES_TORQUE} ${HEADERS_TORQUE})
# Link the library with more libraries, if needed
target_link_libraries(${LIB_NAME} ${LIBRARIES})