-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (40 loc) · 1.93 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
cmake_minimum_required(VERSION 2.8)
project(fastpathways CXX)
set(${PROJECT_NAME}_MAJOR 0)
set(${PROJECT_NAME}_MINOR 0)
set(${PROJECT_NAME}_PATCH 1)
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR}.${${PROJECT_NAME}_MINOR}.${${PROJECT_NAME}_PATCH})
message(STATUS "fastpathways version: ${${PROJECT_NAME}_VERSION}")
if (UNIX AND NOT APPLE)
add_definitions("-Wall -Wextra -Werror -Wno-unused-parameter -std=c++17")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -pg")
elseif (APPLE)
add_definitions("-Wall -Wextra -Werror -Wno-unused-parameter -std=c++17")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
set(CMAKE_MACOSX_RPATH ON)
endif()
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg")
include_directories(include)
add_subdirectory(src)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
add_library(${PROJECT_NAME}_static ${${PROJECT_NAME}_SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME} VERSION ${${PROJECT_NAME}_VERSION})
set_target_properties(${PROJECT_NAME}_static PROPERTIES VERSION ${${PROJECT_NAME}_VERSION})
if (MSVC)
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/DLIBRARY_EXPORTS")
else()
set_target_properties(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
endif()
add_executable(intchains cmd/intchains.cpp)
target_link_libraries(intchains ${PROJECT_NAME}_static)
add_executable(vecchains cmd/vecchains.cpp)
target_link_libraries(vecchains ${PROJECT_NAME}_static)
add_executable(subsecond cmd/subsecond.cpp)
target_link_libraries(subsecond ${PROJECT_NAME}_static)
add_executable(strchains cmd/strchains.cpp)
target_link_libraries(strchains ${PROJECT_NAME}_static)
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME} DESTINATION lib)
install(TARGETS ${PROJECT_NAME}_static EXPORT ${PROJECT_NAME} DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
enable_testing()
add_subdirectory(test)