forked from SergiusTheBest/plog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
22 lines (21 loc) · 1019 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# some systems have no shared libraries support, so check it
if(NOT DEFINED TARGET_SUPPORTS_SHARED_LIBS OR TARGET_SUPPORTS_SHARED_LIBS)
add_executable(SharedApp SharedApp/Main.cpp)
target_link_libraries(SharedApp SharedLib plog)
set_target_properties(SharedApp PROPERTIES FOLDER Samples/Shared)
# set PLOG to PLOG_GLOBAL/PLOG_IMPORT to share instances across modules (and import on Windows)
if(WIN32)
target_compile_definitions(SharedApp PRIVATE PLOG_IMPORT)
else()
target_compile_definitions(SharedApp PRIVATE PLOG_GLOBAL)
endif()
add_library(SharedLib SHARED SharedLib/Main.cpp)
target_link_libraries(SharedLib plog)
set_target_properties(SharedLib PROPERTIES FOLDER Samples/Shared)
# set PLOG to PLOG_GLOBAL/PLOG_EXPORT to share instances across modules (and export on Windows)
if(WIN32)
target_compile_definitions(SharedLib PRIVATE PLOG_EXPORT)
else()
target_compile_definitions(SharedLib PRIVATE PLOG_GLOBAL)
endif()
endif()