-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
31 lines (24 loc) · 1.07 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
cmake_minimum_required(VERSION 3.19)
project(concol)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|GNU)$")
set(PROJECT_COMPILE_OPTIONS -Wno-format-security)
endif()
set(PROJECT_COMPILE_DEFINES)
set(PROJECT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(PROJECT_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include/concol.h)
set(PROJECT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/concol.cpp)
set(PROJECT_LINK_LIBRARIES)
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCES})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDE_DIRS})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_COMPILE_DEFINES})
target_compile_options(${PROJECT_NAME} PUBLIC ${PROJECT_COMPILE_OPTIONS})
target_link_libraries(${PROJECT_NAME} ${PROJECT_LINK_LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE on) # -fPIC
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/)
if(TEST_ENABLE)
add_subdirectory(test)
endif()