X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2FCMakeLists.txt;h=17483d63923f29fd5a770d14c4b130dab077e7b8;hb=adb7db9229db1d869b254ac18f1471bed464c508;hp=84acd3f0abf948ba9203cd345dba34fa6f05e20a;hpb=bc9b3f6ff1fcc5caa67c07ad99f971c0faacf91a;p=simgear.git diff --git a/simgear/io/CMakeLists.txt b/simgear/io/CMakeLists.txt index 84acd3f0..17483d63 100644 --- a/simgear/io/CMakeLists.txt +++ b/simgear/io/CMakeLists.txt @@ -36,43 +36,34 @@ set(SOURCES simgear_component(io io "${SOURCES}" "${HEADERS}") +if(ENABLE_TESTS) + +if (SIMGEAR_SHARED) + set(TEST_LIBS SimGearCore) +else() + set(TEST_LIBS SimGearCore + ${CMAKE_THREAD_LIBS_INIT} + ${WINSOCK_LIBRARY} + ${ZLIB_LIBRARY} + ${RT_LIBRARY}) +endif() + add_executable(test_sock socktest.cxx) -target_link_libraries(test_sock sgio sgstructure sgthreads sgdebug - ${CMAKE_THREAD_LIBS_INIT} - ${WINSOCK_LIBRARY} - ${RT_LIBRARY}) +target_link_libraries(test_sock ${TEST_LIBS}) add_executable(test_http test_HTTP.cxx) -target_link_libraries(test_http - sgio sgstructure sgthreads sgtiming sgmisc sgdebug - ${CMAKE_THREAD_LIBS_INIT} - ${WINSOCK_LIBRARY} - ${RT_LIBRARY}) +target_link_libraries(test_http ${TEST_LIBS}) add_test(http ${EXECUTABLE_OUTPUT_PATH}/test_http) add_executable(httpget httpget.cxx) -target_link_libraries(httpget - sgio sgstructure sgthreads sgtiming sgmisc sgdebug - ${CMAKE_THREAD_LIBS_INIT} - ${WINSOCK_LIBRARY} - ${RT_LIBRARY}) +target_link_libraries(httpget ${TEST_LIBS}) add_executable(decode_binobj decode_binobj.cxx) -target_link_libraries(decode_binobj - sgio sgbucket sgstructure sgthreads sgtiming sgmisc sgdebug - ${CMAKE_THREAD_LIBS_INIT} - ${WINSOCK_LIBRARY} - ${ZLIB_LIBRARY} - ${RT_LIBRARY}) +target_link_libraries(decode_binobj ${TEST_LIBS}) add_executable(test_binobj test_binobj.cxx) -target_link_libraries(test_binobj - sgio sgbucket sgstructure sgthreads sgtiming sgmisc sgdebug - ${CMAKE_THREAD_LIBS_INIT} - ${WINSOCK_LIBRARY} - ${ZLIB_LIBRARY} - ${RT_LIBRARY}) +target_link_libraries(test_binobj ${TEST_LIBS}) add_test(binobj ${EXECUTABLE_OUTPUT_PATH}/test_binobj) - \ No newline at end of file +endif(ENABLE_TESTS)