]> git.mxchange.org Git - simgear.git/commitdiff
cmake: add option to disable building tests
authorThorstenB <brehmt@gmail.com>
Sat, 26 Nov 2011 15:39:40 +0000 (16:39 +0100)
committerThorstenB <brehmt@gmail.com>
Sat, 26 Nov 2011 15:39:40 +0000 (16:39 +0100)
CMakeLists.txt
simgear/environment/CMakeLists.txt
simgear/io/CMakeLists.txt
simgear/magvar/CMakeLists.txt
simgear/math/CMakeLists.txt
simgear/misc/CMakeLists.txt
simgear/props/CMakeLists.txt
simgear/sound/CMakeLists.txt

index 825a5b022e7019e41497b796ea1fa15d2cdc8a49..07363346e9bce01f0ed44c5e5ca48ac790beb3e5 100644 (file)
@@ -53,7 +53,7 @@ endif(NOT CMAKE_BUILD_TYPE)
 if(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
   include(GNUInstallDirs)
 else(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
- include(OldGNUInstallDirs)
 include(OldGNUInstallDirs)
 endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
 message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
 
@@ -62,6 +62,7 @@ option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support
 option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
 option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON)
 option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF)
+option(ENABLE_TESTS "Set to OFF to disable building SimGear's test applications" ON)
 
 if (MSVC)
   GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH)
@@ -236,12 +237,14 @@ configure_file (
   "${PROJECT_SOURCE_DIR}/simgear/simgear_config_cmake.h.in"
   "${PROJECT_BINARY_DIR}/simgear/simgear_config.h"
   )
-  
+
+if(ENABLE_TESTS)
 # enable CTest / make test target
 
 include (Dart)
 enable_testing()
-  
+endif(ENABLE_TESTS)
+
 install (FILES ${PROJECT_BINARY_DIR}/simgear/simgear_config.h  DESTINATION include/simgear/)
 add_subdirectory(simgear)
 
@@ -255,5 +258,3 @@ CONFIGURE_FILE(
 ADD_CUSTOM_TARGET(uninstall
   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
 
-
-
index c59f98a7575f6673d3936fb865d163ac769db712..ae641d181c622cf41cb60dd9dfff568d9aa5f3ec 100644 (file)
@@ -6,6 +6,7 @@ set(SOURCES metar.cxx precipitation.cxx)
 
 simgear_component(environment environment "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 add_executable(test_metar test_metar.cxx)
 target_link_libraries(test_metar
     sgenvironment sgstructure sgmisc sgdebug
@@ -13,4 +14,5 @@ target_link_libraries(test_metar
     ${ZLIB_LIBRARY}
     ${RT_LIBRARY}) 
     
-add_test(metar ${EXECUTABLE_OUTPUT_PATH}/test_metar)
\ No newline at end of file
+add_test(metar ${EXECUTABLE_OUTPUT_PATH}/test_metar)
+endif(ENABLE_TESTS)
index 84acd3f0abf948ba9203cd345dba34fa6f05e20a..dd39d2eaf27c09d3ac645f40b8003acbad21358d 100644 (file)
@@ -36,6 +36,7 @@ set(SOURCES
 
 simgear_component(io io "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 add_executable(test_sock socktest.cxx)
 target_link_libraries(test_sock sgio sgstructure sgthreads sgdebug
     ${CMAKE_THREAD_LIBS_INIT}
@@ -75,4 +76,4 @@ target_link_libraries(test_binobj
     ${RT_LIBRARY}) 
     
 add_test(binobj ${EXECUTABLE_OUTPUT_PATH}/test_binobj)
-       
\ No newline at end of file
+endif(ENABLE_TESTS)
index 0686ada1b56286df810e04ace8c6e0ad7d436055..08ce1e8ae4c0d08afca65065e45e33452cdb7b95 100644 (file)
@@ -6,7 +6,7 @@ set(SOURCES magvar.cxx coremag.cxx)
 
 simgear_component(magvar magvar "${SOURCES}" "${HEADERS}")
 
-
+if(ENABLE_TESTS)
 add_executable(test_magvar testmagvar.cxx )
 target_link_libraries(test_magvar sgmagvar)
-
+endif(ENABLE_TESTS)
index 55f2b1510712255e260e3c0dc1eb0381b63776e9..49e1b7852190eaf84b4840b8e2e6bfae2eaee719 100644 (file)
@@ -45,6 +45,7 @@ set(SOURCES
 
 simgear_component(math math "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 add_executable(math_test SGMathTest.cxx)
 target_link_libraries(math_test sgmath sgstructure sgdebug)
 add_test(math ${EXECUTABLE_OUTPUT_PATH}/math_test)
@@ -52,3 +53,4 @@ add_test(math ${EXECUTABLE_OUTPUT_PATH}/math_test)
 add_executable(geometry_test SGGeometryTest.cxx)
 target_link_libraries(geometry_test sgmath sgstructure sgdebug)
 add_test(geometry ${EXECUTABLE_OUTPUT_PATH}/geometry_test)
+endif(ENABLE_TESTS)
index 43904321ad534d8fc4490a85705bfe993c0edc8f..597e80facf117f824e408e451091754179bde9fd 100644 (file)
@@ -32,6 +32,7 @@ set(SOURCES
 
 simgear_component(misc misc "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 add_executable(test_tabbed_values tabbed_values_test.cxx)
 add_test(tabbed_values ${EXECUTABLE_OUTPUT_PATH}/test_tabbed_values)
 target_link_libraries(test_tabbed_values sgmisc)
@@ -43,4 +44,4 @@ target_link_libraries(test_strings sgmisc)
 add_executable(test_path path_test.cxx )
 add_test(test_path ${EXECUTABLE_OUTPUT_PATH}/test_path)
 target_link_libraries(test_path sgmisc sgdebug)
-
+endif(ENABLE_TESTS)
index 46d81b35626808cbdcff1bb952d05f5ec864e372..dfd1916094222ed410dd6582deee3bc28a402848 100644 (file)
@@ -22,6 +22,7 @@ set(SOURCES
 
 simgear_component(props props "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 add_executable(test_props props_test.cxx)
 target_link_libraries(test_props sgprops sgxml sgstructure sgmisc sgdebug)
 add_test(test_props ${EXECUTABLE_OUTPUT_PATH}/test_props)
@@ -29,3 +30,4 @@ add_test(test_props ${EXECUTABLE_OUTPUT_PATH}/test_props)
 add_executable(test_propertyObject propertyObject_test.cxx)
 target_link_libraries(test_propertyObject sgprops sgstructure sgdebug)
 add_test(test_propertyObject ${EXECUTABLE_OUTPUT_PATH}/test_propertyObject)
+endif(ENABLE_TESTS)
index 6670190a492868028db8b2fd598bbe99f5a842a8..69e1acd20c171217baac0238c15b6d7f1e969c12 100644 (file)
@@ -18,6 +18,7 @@ set(SOURCES
 
 simgear_component(sound sound "${SOURCES}" "${HEADERS}")
 
+if(ENABLE_TESTS)
 set(SOUND_TEST_LIBS
     sgsound sgio sgmath sgstructure sgthreads sgtiming sgmisc sgdebug
     ${CMAKE_THREAD_LIBS_INIT}
@@ -35,3 +36,4 @@ create_test(openal_test1)
 create_test(openal_test2)
 create_test(openal_test3)
 create_test(openal_test4)
+endif(ENABLE_TESTS)