From 5b92575ed31ab0577d5ece4da42a88cfb88b4ad7 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 22 Jan 2013 20:56:57 +0100 Subject: [PATCH] Fix state-machine test linkage with static libs. Thanks to Thomas for the catch. --- simgear/structure/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/simgear/structure/CMakeLists.txt b/simgear/structure/CMakeLists.txt index 0c5dc4f6..2ce3646a 100644 --- a/simgear/structure/CMakeLists.txt +++ b/simgear/structure/CMakeLists.txt @@ -44,8 +44,17 @@ set(SOURCES simgear_component(structure structure "${SOURCES}" "${HEADERS}") if(ENABLE_TESTS) + +if (SIMGEAR_SHARED) + set(TEST_LIBS SimGearCore) +else() + set(TEST_LIBS SimGearCore ${CMAKE_THREAD_LIBS_INIT} + ${ZLIB_LIBRARY} + ${RT_LIBRARY}) +endif() + add_executable(test_state_machine state_machine_test.cxx) -target_link_libraries(test_state_machine SimGearCore) +target_link_libraries(test_state_machine ${TEST_LIBS}) add_test(test_state_machine ${EXECUTABLE_OUTPUT_PATH}/test_state_machine) endif(ENABLE_TESTS)