27 lines
2.0 KiB
CMake
27 lines
2.0 KiB
CMake
add_library(structive_property_core INTERFACE)
|
|
add_library(structive::property_core ALIAS structive_property_core)
|
|
target_include_directories(structive_property_core INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
|
|
target_compile_features(structive_property_core INTERFACE cxx_std_20)
|
|
add_executable(structive_property_core_example "${CMAKE_CURRENT_LIST_DIR}/example/main.cpp")
|
|
target_link_libraries(structive_property_core_example PRIVATE structive::property_core)
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(structive_property_core_example PRIVATE -Wall -Wextra -Wpedantic)
|
|
endif ()
|
|
if (BUILD_TESTING)
|
|
find_package(Threads REQUIRED)
|
|
add_executable(structive_property_core_test "${CMAKE_CURRENT_LIST_DIR}/tests/property_core_test.cpp")
|
|
add_executable(structive_property_runtime_api_test "${CMAKE_CURRENT_LIST_DIR}/tests/runtime_api_test.cpp")
|
|
add_executable(structive_property_synchronization_test "${CMAKE_CURRENT_LIST_DIR}/tests/synchronization_test.cpp")
|
|
target_link_libraries(structive_property_core_test PRIVATE structive::property_core Threads::Threads)
|
|
target_link_libraries(structive_property_runtime_api_test PRIVATE structive::property_core Threads::Threads)
|
|
target_link_libraries(structive_property_synchronization_test PRIVATE structive::property_core Threads::Threads)
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
target_compile_options(structive_property_core_test PRIVATE -Wall -Wextra -Wpedantic)
|
|
target_compile_options(structive_property_runtime_api_test PRIVATE -Wall -Wextra -Wpedantic)
|
|
target_compile_options(structive_property_synchronization_test PRIVATE -Wall -Wextra -Wpedantic)
|
|
endif ()
|
|
add_test(NAME structive_property_core_test COMMAND structive_property_core_test)
|
|
add_test(NAME structive_property_runtime_api_test COMMAND structive_property_runtime_api_test)
|
|
add_test(NAME structive_property_synchronization_test COMMAND structive_property_synchronization_test)
|
|
endif ()
|