1
0
Fork 0

Make compiling of all utils/tools optional

This commit is contained in:
Thomas Geymayer 2013-02-12 17:38:46 +01:00
parent b0a879a5b1
commit 6c10f99573
5 changed files with 85 additions and 44 deletions

View file

@ -144,7 +144,17 @@ option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite
# additional utilities # additional utilities
option(ENABLE_FGADMIN "Set to ON to build the FGADMIN application (default)" ON) 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(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) option(ENABLE_TESTS "Set to ON to build test applications (default)" ON)
if(LOGGING) if(LOGGING)

View file

@ -12,11 +12,24 @@ endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
set(MANPAGES set(MANPAGES
fgfs.1 fgfs.1
fgjs.1
fgpanel.1
gl-info.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 # map some variables to what the man-pages expect
set(PACKAGE ${CMAKE_PROJECT_NAME}) set(PACKAGE ${CMAKE_PROJECT_NAME})

View file

@ -39,26 +39,32 @@ if(EVENT_INPUT)
include_directories(${UDEV_INCLUDE_DIR}) include_directories(${UDEV_INCLUDE_DIR})
endif() endif()
set(FGJS_SOURCES if(ENABLE_FGJS)
fgjs.cxx set(FGJS_SOURCES
jsinput.cxx fgjs.cxx
jssuper.cxx jsinput.cxx
) jssuper.cxx
)
add_executable(fgjs ${FGJS_SOURCES}) add_executable(fgjs ${FGJS_SOURCES})
target_link_libraries(fgjs
${SIMGEAR_CORE_LIBRARIES}
${PLIB_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
)
target_link_libraries(fgjs install(TARGETS fgjs RUNTIME DESTINATION bin)
${SIMGEAR_CORE_LIBRARIES} endif()
${PLIB_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
add_executable(js_demo js_demo.cxx) 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}
)
target_link_libraries(js_demo install(TARGETS js_demo RUNTIME DESTINATION bin)
${SIMGEAR_CORE_LIBRARIES} endif()
${PLIB_LIBRARIES}
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES})
flightgear_component(Input "${SOURCES}" "${HEADERS}") flightgear_component(Input "${SOURCES}" "${HEADERS}")
install(TARGETS fgjs js_demo RUNTIME DESTINATION bin)

View file

@ -111,13 +111,14 @@ target_link_libraries(fgfs
install(TARGETS fgfs RUNTIME DESTINATION bin) install(TARGETS fgfs RUNTIME DESTINATION bin)
add_executable(metar metar_main.cxx) 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}
)
target_link_libraries(metar install(TARGETS metar RUNTIME DESTINATION bin)
${SIMGEAR_LIBRARIES} endif()
${SIMGEAR_CORE_LIBRARY_DEPENDENCIES}
${SIMGEAR_SCENE_LIBRARY_DEPENDENCIES}
${PLATFORM_LIBS}
)
install(TARGETS metar RUNTIME DESTINATION bin)

View file

@ -1,21 +1,32 @@
add_subdirectory(TerraSync) if(FLTK_FOUND)
add_subdirectory(fgviewer)
add_subdirectory(fgelev)
add_subdirectory(GPSsmooth)
if (FLTK_FOUND)
if (EXISTS ${FLTK_FLUID_EXECUTABLE}) if (EXISTS ${FLTK_FLUID_EXECUTABLE})
add_subdirectory(fgadmin) add_subdirectory(fgadmin)
else () else ()
message(STATUS "fluid executable not found, disabling fgadmin") message(STATUS "fluid executable not found, disabling fgadmin")
endif () endif ()
endif (FLTK_FOUND) endif()
if (WITH_FGPANEL)
add_subdirectory(fgpanel)
endif (WITH_FGPANEL)
# win32 is just excluded because of not having argument parsing there ... # win32 is just excluded because of not having argument parsing there ...
if(RTI_FOUND AND NOT WIN32) if(RTI_FOUND AND NOT WIN32)
add_subdirectory(fgai) add_subdirectory(fgai)
endif(RTI_FOUND AND NOT WIN32) 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()