-
-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
78 lines (61 loc) · 1.9 KB
/
CMakeLists.txt
File metadata and controls
78 lines (61 loc) · 1.9 KB
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
set(PROJECT Server)
file(GLOB_RECURSE source_list "*.cpp" "*.hpp")
add_executable(Server ${source_list})
GroupSourcesByFolder(Server ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(Server PUBLIC
WIN32_LEAN_AND_MEAN
VC_EXTRALEAN
NOGDI
)
target_compile_definitions(Server PRIVATE
OMP_EXPORTS
)
target_link_libraries(Server PUBLIC
OMP-SDK
OMP-NetCode
)
target_link_libraries(Server PRIVATE
CONAN_PKG::nlohmann_json
CONAN_PKG::openssl
CONAN_PKG::cxxopts
CONAN_PKG::ghc-filesystem
)
if(MSVC)
target_link_libraries(Server PRIVATE
mpr
shlwapi
winmm
)
else()
if(UNIX AND NOT APPLE)
target_link_libraries(Server PRIVATE dl atomic)
endif()
if(SHARED_STDCXXFS)
target_link_libraries(Server PRIVATE stdc++fs)
endif()
endif()
if(UNIX AND NOT SHARED_OPENSSL)
target_compile_definitions(Server PRIVATE OMP_STATIC_OPENSSL)
endif()
target_compile_definitions(Server PRIVATE
OMP_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR}
OMP_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR}
OMP_VERSION_PATCH=${CMAKE_PROJECT_VERSION_PATCH}
)
if(DEFINED ENV{OMP_BUILD_VERSION})
message("open.mp server build version: $ENV{OMP_BUILD_VERSION}")
target_compile_definitions(Server PUBLIC BUILD_NUMBER=$ENV{OMP_BUILD_VERSION})
endif()
if(DEFINED ENV{OMP_BUILD_COMMIT})
message("open.mp server build commit: $ENV{OMP_BUILD_COMMIT}")
target_compile_definitions(Server PUBLIC OMP_VERSION_HASH=$ENV{OMP_BUILD_COMMIT})
endif()
if(NOT MSVC)
target_compile_options(Server PRIVATE -fno-eliminate-unused-debug-types)
endif()
set_property(TARGET Server PROPERTY OUTPUT_NAME omp-server)
set_property(TARGET Server PROPERTY FOLDER "Server")
set_property(TARGET Server PROPERTY ENABLE_EXPORTS ON)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Server)
set_property(TARGET Server PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
include_directories(${CMAKE_SOURCE_DIR}/lib/cpp-httplib)