-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
71 lines (53 loc) · 1.46 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
cmake_minimum_required(VERSION 3.0.0)
project(MokLib)
include(CTest)
file(GLOB_RECURSE SOURCES ./*.cpp)
set(MOKLIB_COMPILE_STANDALONE_IMPORTERS On CACHE FILEPATH "Additional")
file(GLOB SOURCES
"*.cpp"
"Debugging/*.cpp"
"FileSystem/*.cpp"
"Memory/*.cpp"
"Platform/*.cpp"
"Serialization/*.cpp"
"Test/*.cpp"
"Thread/*.cpp"
"Time/*.cpp"
"Compat/*.cpp"
"Containers/*.cpp"
)
file(GLOB_RECURSE HEADERS
"*.h")
# if (MOKLIB_COMPILE_STANDALONE_IMPORTERS)
# set(SOURCES ${SOURCES}
# "Importers/Image/BMP.cpp"
# "Importers/Model/OBJ.cpp"
# )
# endif()
# Add Natvis file if we're on Windows
if (WIN32)
set(SOURCES ${SOURCES}
"Lib.natvis"
)
endif()
option(MOKLIB_COMPILE_STATIC "Build static library" ON)
if (MOKLIB_COMPILE_STATIC)
add_library(MokLib STATIC ${SOURCES} ${HEADERS})
else()
add_library(MokLib SHARED ${SOURCES} ${HEADERS})
endif()
target_compile_features(MokLib PUBLIC
cxx_std_17)
target_compile_definitions(MokLib PRIVATE
MOK_LIB_INTERNAL=1
_CRT_SECURE_NO_WARNINGS
)
if (MOKLIB_COMPILE_STATIC)
target_compile_definitions(MokLib PUBLIC
MOK_LIB_STATIC=1
_CRT_SECURE_NO_WARNINGS
)
endif()
target_include_directories(MokLib PUBLIC ".")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" CACHE INTERNAL "")
add_subdirectory("Tests")