From 8526fea973a03724a9121002512fae516c6000ed Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 25 Mar 2019 21:34:19 +0100 Subject: CMake: use function instead of macro Signed-off-by: Rolf Eike Beer --- tests/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c90453954..447a85033 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,9 +39,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") endif() endif() -# Helper macro TEST used to created rules to build, link, install and run tests -macro(TEST NAME FILE) - add_executable(${NAME} ${FILE} ) +# Helper function TEST used to created rules to build, link, install and run tests +function(TEST NAME FILE) + get_filename_component(HDR "${FILE}" NAME_WE) + add_executable(${NAME} ${FILE} ${HDR}.h) target_link_libraries( ${NAME} subsurface_corelib @@ -70,7 +71,7 @@ macro(TEST NAME FILE) else() add_test(NAME ${NAME} COMMAND $) endif() -endmacro() +endfunction() enable_testing() add_definitions(-g) -- cgit v1.2.3-70-g09d2