From: Thomas Geymayer Date: Tue, 12 Feb 2013 16:38:46 +0000 (+0100) Subject: Make compiling of all utils/tools optional X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6c10f99573ec8046afb8a120d191a7d2e5e6c3af;p=flightgear.git Make compiling of all utils/tools optional --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 37fbcfda1..80c579b47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,17 @@ option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite # additional utilities option(ENABLE_FGADMIN "Set to ON to build the FGADMIN application (default)" ON) +option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON) option(WITH_FGPANEL "Set to ON to build the fgpanel application (default)" ON) +option(ENABLE_FGVIEWER "Set to ON to build the fgviewer application (default)" ON) +option(ENABLE_GPSSMOOTH "Set to ON to build the GPSsmooth application (default)" ON) +option(ENABLE_TERRASYNC "Set to ON to build the terrasync application (default)" ON) + +option(ENABLE_FGJS "Set to ON to build the fgjs application (default)" ON) +option(ENABLE_JS_DEMO "Set to ON to build the js_demo application (default)" ON) + +option(ENABLE_METAR "Set to ON to build the metar application (default)" ON) + option(ENABLE_TESTS "Set to ON to build test applications (default)" ON) if(LOGGING) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 66bc113fb..8c3e82c4b 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -12,11 +12,24 @@ endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4) set(MANPAGES fgfs.1 - fgjs.1 - fgpanel.1 gl-info.1 - js_demo.1 - terrasync.1) +) + +if(WITH_FGPANEL) + list(APPEND MANPAGES fgpanel.1) +endif() + +if(ENABLE_TERRASYNC) + list(APPEND MANPAGES terrasync.1) +endif() + +if(ENABLE_FGJS) + list(APPEND MANPAGES fgjs.1) +endif() + +if(ENABLE_JS_DEMO) + list(APPEND MANPAGES js_demo.1) +endif() # map some variables to what the man-pages expect set(PACKAGE ${CMAKE_PROJECT_NAME}) diff --git a/src/Input/CMakeLists.txt b/src/Input/CMakeLists.txt index 009929dce..11b277ef2 100644 --- a/src/Input/CMakeLists.txt +++ b/src/Input/CMakeLists.txt @@ -39,26 +39,32 @@ if(EVENT_INPUT) include_directories(${UDEV_INCLUDE_DIR}) endif() -set(FGJS_SOURCES - fgjs.cxx - jsinput.cxx - jssuper.cxx - ) - -add_executable(fgjs ${FGJS_SOURCES}) +if(ENABLE_FGJS) + set(FGJS_SOURCES + fgjs.cxx + jsinput.cxx + jssuper.cxx + ) -target_link_libraries(fgjs - ${SIMGEAR_CORE_LIBRARIES} - ${PLIB_LIBRARIES} - ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}) + add_executable(fgjs ${FGJS_SOURCES}) + target_link_libraries(fgjs + ${SIMGEAR_CORE_LIBRARIES} + ${PLIB_LIBRARIES} + ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} + ) -add_executable(js_demo js_demo.cxx) + install(TARGETS fgjs RUNTIME DESTINATION bin) +endif() -target_link_libraries(js_demo - ${SIMGEAR_CORE_LIBRARIES} - ${PLIB_LIBRARIES} - ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}) +if(ENABLE_JS_DEMO) + add_executable(js_demo js_demo.cxx) + target_link_libraries(js_demo + ${SIMGEAR_CORE_LIBRARIES} + ${PLIB_LIBRARIES} + ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} + ) -flightgear_component(Input "${SOURCES}" "${HEADERS}") + install(TARGETS js_demo RUNTIME DESTINATION bin) +endif() -install(TARGETS fgjs js_demo RUNTIME DESTINATION bin) +flightgear_component(Input "${SOURCES}" "${HEADERS}") \ No newline at end of file diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index e69a6d39b..254a44c1e 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -111,13 +111,14 @@ target_link_libraries(fgfs install(TARGETS fgfs RUNTIME DESTINATION bin) -add_executable(metar metar_main.cxx) - -target_link_libraries(metar - ${SIMGEAR_LIBRARIES} - ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - ${SIMGEAR_SCENE_LIBRARY_DEPENDENCIES} - ${PLATFORM_LIBS} -) - -install(TARGETS metar RUNTIME DESTINATION bin) +if(ENABLE_METAR) + add_executable(metar metar_main.cxx) + target_link_libraries(metar + ${SIMGEAR_LIBRARIES} + ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} + ${SIMGEAR_SCENE_LIBRARY_DEPENDENCIES} + ${PLATFORM_LIBS} + ) + + install(TARGETS metar RUNTIME DESTINATION bin) +endif() diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index f176e749f..0775c2719 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,21 +1,32 @@ -add_subdirectory(TerraSync) -add_subdirectory(fgviewer) -add_subdirectory(fgelev) -add_subdirectory(GPSsmooth) - -if (FLTK_FOUND) +if(FLTK_FOUND) if (EXISTS ${FLTK_FLUID_EXECUTABLE}) add_subdirectory(fgadmin) else () message(STATUS "fluid executable not found, disabling fgadmin") endif () -endif (FLTK_FOUND) - -if (WITH_FGPANEL) - add_subdirectory(fgpanel) -endif (WITH_FGPANEL) +endif() # win32 is just excluded because of not having argument parsing there ... if(RTI_FOUND AND NOT WIN32) - add_subdirectory(fgai) -endif(RTI_FOUND AND NOT WIN32) + add_subdirectory(fgai) +endif() + +if(ENABLE_FGELEV) + add_subdirectory(fgelev) +endif() + +if(WITH_FGPANEL) + add_subdirectory(fgpanel) +endif() + +if(ENABLE_FGVIEWER) + add_subdirectory(fgviewer) +endif() + +if(ENABLE_GPSSMOOTH) + add_subdirectory(GPSsmooth) +endif() + +if(ENABLE_TERRASYNC) + add_subdirectory(TerraSync) +endif() \ No newline at end of file