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}")
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)
"${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)
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-
-
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
${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)
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}
${RT_LIBRARY})
add_test(binobj ${EXECUTABLE_OUTPUT_PATH}/test_binobj)
-
\ No newline at end of file
+endif(ENABLE_TESTS)
simgear_component(magvar magvar "${SOURCES}" "${HEADERS}")
-
+if(ENABLE_TESTS)
add_executable(test_magvar testmagvar.cxx )
target_link_libraries(test_magvar sgmagvar)
-
+endif(ENABLE_TESTS)
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)
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)
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)
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)
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)
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)
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}
create_test(openal_test2)
create_test(openal_test3)
create_test(openal_test4)
+endif(ENABLE_TESTS)