aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/CMakeLists.txt')
-rw-r--r--tests/libtest/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt
index 1fdfc0da2..cc38a97c6 100644
--- a/tests/libtest/CMakeLists.txt
+++ b/tests/libtest/CMakeLists.txt
@@ -22,7 +22,8 @@
set(TARGET_LABEL_PREFIX "Test ")
function(setup_test TEST_NAME) # ARGN are the files in the test
- add_executable( ${TEST_NAME} ${ARGN} )
+ add_executable(${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
+ add_dependencies(testdeps ${TEST_NAME})
string(TOUPPER ${TEST_NAME} UPPER_TEST_NAME)
include_directories(
@@ -58,7 +59,8 @@ endforeach()
# Allows for hostname override to make tests machine independent.
# TODO this cmake build assumes a shared build, detect static linking here!
if(NOT WIN32)
- add_library(hostname MODULE sethostname.c sethostname.h)
+ add_library(hostname MODULE EXCLUDE_FROM_ALL sethostname.c sethostname.h)
+ add_dependencies(testdeps hostname)
# Output to .libs for compatibility with autotools, the test data expects a
# library at (tests)/libtest/.libs/libhostname.so
set_target_properties(hostname PROPERTIES