Browse Source

Change test function

The "create_test_target()" function will now create a test target (with
optional libraries), but it won't create the test. The "create_test()"
function will take an existing test target and create a test, using
extra arguments as arguments to the test.
master
Gavin Howard 4 years ago
parent
commit
35c4d8ca8f
Signed by: gavin GPG Key ID: C08038BDF280D33E
  1. 7
      functions.cmake

7
functions.cmake

@ -261,13 +261,16 @@ function(merge_libs outlib)
endfunction(merge_libs)
function(create_test target)
function(create_test_target target)
# Create an executable, link libs to it, and add it as a test.
add_executable("${target}" "${target}.c")
target_link_libraries("${target}" "${ARGN}")
add_test(NAME ${target} COMMAND "$<TARGET_FILE:${target}>")
endfunction(create_test_target)
function(create_test target)
add_test(NAME ${target} COMMAND "$<TARGET_FILE:${target}>" ${ARGN})
endfunction(create_test)
function(create_shared_library name output_name src doinstall)

Loading…
Cancel
Save