forked from surge-synthesizer/sst-plugininfra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
52 lines (40 loc) · 2.01 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
49
50
51
52
cmake_minimum_required(VERSION 3.10)
project(sst-plugininfra VERSION 0.5 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(libs/filesystem)
add_subdirectory(libs/tinyxml)
add_library(${PROJECT_NAME}::tinyxml ALIAS tinyxml)
add_subdirectory(libs/strnatcmp)
add_library(${PROJECT_NAME}::strnatcmp ALIAS strnatcmp)
configure_file(src/paths_subst.cpp.in ${CMAKE_BINARY_DIR}/gen/paths_subst.cpp)
add_library(${PROJECT_NAME} EXCLUDE_FROM_ALL ${CMAKE_BINARY_DIR}/gen/paths_subst.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}::filesystem ${PROJECT_NAME}::strnatcmp)
target_sources(${PROJECT_NAME} PRIVATE src/cpufeatures.cpp)
if (WIN32)
target_sources(${PROJECT_NAME} PRIVATE src/paths_windows.cpp src/misc_windows.cpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOWS=1)
target_compile_definitions(${PROJECT_NAME} PUBLIC SST_COMMAND_CTRL_SAME_KEY=1)
elseif (APPLE)
target_sources(${PROJECT_NAME} PRIVATE src/paths_macos.mm src/misc_macos.mm)
target_compile_definitions(${PROJECT_NAME} PRIVATE MAC=1)
target_compile_definitions(${PROJECT_NAME} PUBLIC SST_COMMAND_CTRL_SAME_KEY=0)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Foundation")
else ()
target_sources(${PROJECT_NAME} PRIVATE src/paths_linux.cpp src/misc_linux.cpp)
target_compile_definitions(${PROJECT_NAME} PRIVATE LINUX=1)
target_compile_definitions(${PROJECT_NAME} PUBLIC SST_COMMAND_CTRL_SAME_KEY=1)
target_link_libraries(${PROJECT_NAME} PUBLIC dl)
endif ()
set_property(TARGET ${PROJECT_NAME} PROPERTY C_VISIBILITY_PRESET hidden)
set_property(TARGET ${PROJECT_NAME} PROPERTY VISIBILITY_INLINES_HIDDEN ON)
get_directory_property(parent_dir PARENT_DIRECTORY)
if ("${parent_dir}" STREQUAL "")
set(is_toplevel 1)
else ()
set(is_toplevel 0)
endif ()
option(SST_PLUGININFRA_BUILD_TESTS "Add targets for building and running sst-cpputils tests" ${is_toplevel})
if (SST_PLUGININFRA_BUILD_TESTS)
add_subdirectory(tests)
endif ()