Skip to content

Commit

Permalink
Concessions for AnalysisBase CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
Tae Hyoun Park committed Sep 21, 2023
1 parent dc3f087 commit 52de77b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
42 changes: 22 additions & 20 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
file(GLOB ANALOGICAL_PLUGINS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/plugins/*.h)
if (ANALOGICAL_TESTS)
file(GLOB ANALOGICAL_PLUGINS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/plugins/*.h)

add_library(
analogical_plugins
SHARED
${ANALOGICAL_PLUGINS_HEADERS}
)
add_library(
analogical_plugins
SHARED
${ANALOGICAL_PLUGINS_HEADERS}
)

add_library(
ana::plugins ALIAS analogical_plugins
)
add_library(
ana::plugins ALIAS analogical_plugins
)

set_target_properties(analogical_plugins PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(analogical_plugins PROPERTIES LINKER_LANGUAGE CXX)

target_include_directories(
analogical_plugins
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/
)
target_include_directories(
analogical_plugins
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/
)

target_link_libraries(
analogical_plugins
INTERFACE ana::analogical
)
target_link_libraries(
analogical_plugins
INTERFACE ana::analogical
)

enable_testing()
add_subdirectory("units")
enable_testing()
add_subdirectory("units")
endif()
30 changes: 17 additions & 13 deletions tests/units/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
find_package(Threads REQUIRED)
if (ANALOGICAL_TESTS)

add_executable(test-selection ./test-selection.cxx)
target_compile_features(test-selection PUBLIC cxx_std_17)
target_link_libraries(test-selection ana::plugins pthread)
add_test(NAME test-selection COMMAND test-selection)
find_package(Threads REQUIRED)

add_executable(test-multithreading ./test-multithreading.cxx)
target_compile_features(test-multithreading PUBLIC cxx_std_17)
target_link_libraries(test-multithreading ana::plugins pthread)
add_test(NAME test-multithreading COMMAND test-multithreading)
add_executable(test-selection ./test-selection.cxx)
target_compile_features(test-selection PUBLIC cxx_std_17)
target_link_libraries(test-selection ana::plugins pthread)
add_test(NAME test-selection COMMAND test-selection)

add_executable(test-aggregation ./test-aggregation.cxx)
target_compile_features(test-aggregation PUBLIC cxx_std_17)
target_link_libraries(test-aggregation ana::plugins pthread)
add_test(NAME test-aggregation COMMAND test-aggregation)
add_executable(test-multithreading ./test-multithreading.cxx)
target_compile_features(test-multithreading PUBLIC cxx_std_17)
target_link_libraries(test-multithreading ana::plugins pthread)
add_test(NAME test-multithreading COMMAND test-multithreading)

add_executable(test-aggregation ./test-aggregation.cxx)
target_compile_features(test-aggregation PUBLIC cxx_std_17)
target_link_libraries(test-aggregation ana::plugins pthread)
add_test(NAME test-aggregation COMMAND test-aggregation)

endif()

0 comments on commit 52de77b

Please sign in to comment.