X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=4616736126ca97928ad356089aabbf0d1f909aad;hb=fce2a53fc7cf5fb8e392a5e0570ad81f24e3ab0c;hp=47519337cc96ceebbd2c7b3c95615f103d4c98c5;hpb=acb7fb8e9526a26f5b40f1a08c8e7375b2608a86;p=flightgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 47519337c..461673612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,39 @@ else() set(HUDSON_BUILD_ID "none") endif() +##################################################################################### +# Configure library search paths +##################################################################################### + +if(APPLE) + # Custom library directories for Mac, which should have precedence over any other + list(APPEND ADDITIONAL_LIBRARY_PATHS + ~/Library/Frameworks + /Library/Frameworks) +endif(APPLE) + +if(NOT "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "") + # Workaround for Ubuntu/Debian which introduced the "multiarch" library + # directory structure, which is unsupported by CMake < 2.8.10, so we need to + # add paths manually + # see http://www.cmake.org/Bug/view.php?id=12049 and + # http://www.cmake.org/Bug/view.php?id=12037 + list(APPEND ADDITIONAL_LIBRARY_PATHS + /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} + /lib/${CMAKE_LIBRARY_ARCHITECTURE}) + message(STATUS "additional library directories: ${ADDITIONAL_LIBRARY_PATHS}") +endif() + +if(NOT MSVC) + # TBD: are these really necessary? Aren't they considered by cmake automatically? + list(APPEND ADDITIONAL_LIBRARY_PATHS + /opt/local + /usr/local + /usr) +endif() +##################################################################################### + IF(APPLE) set(EVENT_INPUT_DEFAULT 1) @@ -95,6 +128,7 @@ else() endif() # FlightGear build options +option(SIMGEAR_SHARED "Set to ON when SimGear was built as a shared library" OFF) option(LOGGING "Set to ON to build FlightGear with logging support (default)" ON) option(SP_FDMS "Set to ON to build FlightGear with special-purpose FDMs" OFF) option(ENABLE_UIUC_MODEL "Set to ON to build FlightGear with UIUCModel FDM" OFF) @@ -104,12 +138,23 @@ option(ENABLE_JSBSIM "Set to ON to build FlightGear with JSBSim FDM (default option(EVENT_INPUT "Set to ON to build FlightGear with event-based Input support" ${EVENT_INPUT_DEFAULT}) option(ENABLE_LIBSVN "Set to ON to build FlightGear/terrasync with libsvnclient support (default)" ON) option(ENABLE_RTI "Set to ON to build FlightGear with RTI support" OFF) +option(ENABLE_PROFILE "Set to ON to build FlightGear with gperftools profiling support" OFF) option(JPEG_FACTORY "Set to ON to build FlightGear with JPEG-factory support" OFF) option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite3 library" OFF) # 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) @@ -132,6 +177,7 @@ if(EVENT_INPUT) message(WARNING "UDev not found, event input is disabled!") set(EVENT_INPUT 0) else() + add_definitions(-DWITH_EVENTINPUT) set(EVENT_INPUT_LIBRARIES ${UDEV_LIBRARIES}) message(STATUS "event-based input enabled. Using ${UDEV_LIBRARIES}") endif() @@ -194,8 +240,27 @@ list(APPEND SQLITE3_LIBRARY ${CMAKE_THREAD_LIBS_INIT}) find_package(PLIB REQUIRED puaux pu js fnt) -# FlightGear and SimGear versions need to match -find_package(SimGear ${FLIGHTGEAR_VERSION} REQUIRED) +if (EMBEDDED_SIMGEAR) + message(STATUS "Using embedded SimGear") + # create the same variables that FindSimGear would define + set(SIMGEAR_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/simgear) + set(SIMGEAR_CORE_LIBRARIES SimGearCore) + set(SIMGEAR_LIBRARIES SimGearScene) + + if (NOT SIMGEAR_SHARED) + set(SIMGEAR_CORE_LIBRARY_DEPENDENCIES + ${CMAKE_THREAD_LIBS_INIT} + ${ZLIB_LIBRARY} + ${LIBSVN_LIBRARIES} + ${WINMM_LIBRARY}) + + set(SIMGEAR_SCENE_LIBRARY_DEPENDENCIES + ${OPENAL_LIBRARY}) + endif() +else(EMBEDDED_SIMGEAR) + # FlightGear and SimGear versions need to match + find_package(SimGear ${FLIGHTGEAR_VERSION} REQUIRED) +endif (EMBEDDED_SIMGEAR) if (JPEG_FACTORY) # check simgear was built with JPEG-factory support @@ -221,11 +286,20 @@ check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(sys/time.h HAVE_SYS_TIME_H) check_include_file(windows.h HAVE_WINDOWS_H) +if(ENABLE_PROFILE) + find_package(GooglePerfTools REQUIRED) + set(FG_HAVE_GPERFTOOLS 1) + message(STATUS "Built-in profiler using gperftools available") +endif() + if(ENABLE_RTI) + message(STATUS "RTI: ENABLED") find_package(RTI) if(RTI_FOUND) set(FG_HAVE_HLA 1) endif(RTI_FOUND) +else() + message(STATUS "RTI: DISABLED") endif(ENABLE_RTI) if(CMAKE_COMPILER_IS_GNUCXX) @@ -293,6 +367,14 @@ configure_file ( "${PROJECT_BINARY_DIR}/src/Include/version.h" ) +if (EMBEDDED_SIMGEAR) + add_subdirectory(simgear) + # since we build without SimGear installed, we need to + # search this path directly to find the generated + # simgear_config.h + include_directories(${PROJECT_BINARY_DIR}/simgear) +endif(EMBEDDED_SIMGEAR) + add_subdirectory(src) add_subdirectory(utils) add_subdirectory(man)