-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
32 lines (26 loc) · 1.21 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
cmake_minimum_required(VERSION 3.18)
set(TARGET IniParser)
project(${TARGET})
set(${TARGET}_Sources
"${CMAKE_CURRENT_SOURCE_DIR}/src/Ini.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/Value.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/src/TokenParser.cpp"
)
string(REGEX REPLACE "(.)([A-Z])" "\\1_\\2" MODULE_NAME ${TARGET})
string(TOUPPER ${MODULE_NAME} MODULE_NAME)
if ((NOT DEFINED BUILD_SHARED_LIBS) OR (NOT (${BUILD_SHARED_LIBS})))
set(BUILD_STATIC 1)
set(BUILD_SHARED 0)
message("Project: ${TARGET} (STATIC)")
else ()
set(BUILD_STATIC 0)
set(BUILD_SHARED 1)
message("Project: ${TARGET} (SHARED)")
endif ()
add_library(${TARGET} ${${TARGET}_Sources})
target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_definitions(${TARGET} PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} $<${BUILD_SHARED}:RC_${MODULE_NAME}_EXPORTS> $<${BUILD_STATIC}:RC_${MODULE_NAME}_BUILD_STATIC RC_PARSER_BASE_BUILD_STATIC>)
target_compile_options(${TARGET} PRIVATE ${PRIVATE_COMPILE_OPTIONS})
target_compile_features(${TARGET} PUBLIC ${PUBLIC_COMPILE_FEATURES})
target_link_options(${TARGET} PRIVATE ${PRIVATE_LINK_OPTIONS})
target_link_libraries(${TARGET} PUBLIC File Helpers ParserBase)