mirror of
https://github.com/triqs/dft_tools
synced 2025-01-03 18:16:03 +01:00
[cmake] Generalize test/c++/CMakeLists.txt file to allow subdirectories and globbing
This commit is contained in:
parent
e5a4cfb47e
commit
63109a445b
@ -5,11 +5,14 @@ foreach(file ${all_h5_ref_files})
|
||||
endforeach()
|
||||
|
||||
# List of all tests
|
||||
set(all_tests toto)
|
||||
set(all_tests *.cpp)
|
||||
file(GLOB_RECURSE all_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${all_tests})
|
||||
|
||||
foreach(test ${all_tests})
|
||||
get_filename_component(test_name ${test} NAME_WE)
|
||||
get_filename_component(test_dir ${test} DIRECTORY)
|
||||
add_executable(${test_name} ${test})
|
||||
set_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
|
||||
target_link_libraries(${test_name} app4triqs_c triqs::gtest project_warnings)
|
||||
add_test(${test_name} ${test_name})
|
||||
# Run clang-tidy if found
|
||||
|
Loading…
Reference in New Issue
Block a user