From 9cac2c1457d4ea6e507a31719a7ff2b1f8941f7c Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 7 Feb 2013 17:42:00 +0000 Subject: [PATCH] Fix math test linkage. --- simgear/math/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/simgear/math/CMakeLists.txt b/simgear/math/CMakeLists.txt index 0ebe7fd0..436b8f41 100644 --- a/simgear/math/CMakeLists.txt +++ b/simgear/math/CMakeLists.txt @@ -44,11 +44,18 @@ set(SOURCES simgear_component(math math "${SOURCES}" "${HEADERS}") if(ENABLE_TESTS) + +if (SIMGEAR_SHARED) + set(TEST_LIBS SimGearCore) +else() + set(TEST_LIBS SimGearCore ${CMAKE_THREAD_LIBS_INIT}) +endif() + add_executable(math_test SGMathTest.cxx) -target_link_libraries(math_test SimGearCore) +target_link_libraries(math_test ${TEST_LIBS}) add_test(math ${EXECUTABLE_OUTPUT_PATH}/math_test) add_executable(geometry_test SGGeometryTest.cxx) -target_link_libraries(geometry_test SimGearCore) +target_link_libraries(geometry_test ${TEST_LIBS}) add_test(geometry ${EXECUTABLE_OUTPUT_PATH}/geometry_test) endif(ENABLE_TESTS)