mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CMake: use function instead of macro
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
This commit is contained in:
parent
ac0650865c
commit
8526fea973
1 changed files with 5 additions and 4 deletions
|
@ -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 $<TARGET_FILE:${NAME}>)
|
||||
endif()
|
||||
endmacro()
|
||||
endfunction()
|
||||
|
||||
enable_testing()
|
||||
add_definitions(-g)
|
||||
|
|
Loading…
Add table
Reference in a new issue