X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=50d2c10344dcc46fa0e29d2f01f1bfdcc622d3c6;hb=eb0f724c132aa765499bd6eb83226ac4150abe68;hp=59ff4bc04463bcc8b28f2b6168ce9357e6e08952;hpb=67d528a46cc134e154777aa4f3b5e9bf21d84841;p=flightgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ff4bc04..50d2c1034 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.6.4) +cmake_minimum_required (VERSION 2.8.11) include (CheckFunctionExists) include (CheckCSourceCompiles) @@ -9,27 +9,27 @@ if(COMMAND cmake_policy) if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif() + # Mac RPATH policy if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) endif() endif() -project(FlightGear) +if(APPLE) + # using 10.7 because boost requires libc++ and 10.6 doesn't include it + set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) + + set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks") + # when building, don't use the install RPATH already + # (but later on when installing) + SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +endif() -# using 10.7 because boost requires libc++ and 10.6 doesn't include it -set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) +project(FlightGear) # We have some custom .cmake scripts not in the official distribution. set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") -if(${CMAKE_VERSION} VERSION_GREATER 2.8.4) - # use official include provided by latest CMake - include(GNUInstallDirs) -else(${CMAKE_VERSION} VERSION_GREATER 2.8.4) - # backward compatibility: use our own module for older cmake versions - include(OldGNUInstallDirs) -endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4) - # Warning when build is not an out-of-source build. string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" InSourceBuild) if(InSourceBuild) @@ -38,6 +38,7 @@ if(InSourceBuild) message(WARNING " mkdir ../fgbuild && cd ../fgbuild && cmake ${CMAKE_SOURCE_DIR}") endif(InSourceBuild) +include(GNUInstallDirs) # System detection/default settings include( DetectDistro ) include( DetectBrowser ) @@ -108,8 +109,15 @@ IF(APPLE) find_library(COCOA_LIBRARY Cocoa) list(APPEND PLATFORM_LIBS ${COCOA_LIBRARY} ${CORESERVICES_LIBRARY}) + # this should be handled by setting CMAKE_OSX_DEPLOYMENT_TARGET + # but it's not working reliably, so forcing it for now + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7") elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + find_package(Threads REQUIRED) + find_package(X11 REQUIRED) + set(USE_DBUS_DEFAULT 1) find_package(UDev) @@ -153,9 +161,9 @@ endif() 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(JSBSIM_TERRAIN "Set to ON to build FlightGear with JSBSim terrain handling code" 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) -option(ENABLE_LARCSIM "Set to ON to build FlightGear with LaRCsim FDM" OFF) +option(SP_FDMS "Set to ON to build FlightGear with special-purpose FDMs" ON) +option(ENABLE_UIUC_MODEL "Set to ON to build FlightGear with UIUCModel FDM" ON) +option(ENABLE_LARCSIM "Set to ON to build FlightGear with LaRCsim FDM" ON) option(ENABLE_YASIM "Set to ON to build FlightGear with YASIM FDM (default)" ON) option(ENABLE_JSBSIM "Set to ON to build FlightGear with JSBSim FDM (default)" ON) option(EVENT_INPUT "Set to ON to build FlightGear with event-based Input support" ${EVENT_INPUT_DEFAULT}) @@ -169,6 +177,7 @@ option(SYSTEM_GSM "Set to ON to build IAXClient with the system's GSM lib option(SYSTEM_FLITE "Set to ON to build Flightgear with the system's Flite library" ${SYSTEM_FLITE_DEFAULT}) option(SYSTEM_HTS_ENGINE "Set to ON to build Flightgear with the system's HTS Engine library" ${SYSTEM_HTS_ENGINE_DEFAULT}) option(FG_NIGHTLY "Set to ON to mark this as a nightly build" OFF) +option(ENABLE_DEV_WARNINGS "Set to ON to include developer-warnings" OFF) # additional utilities option(ENABLE_FGADMIN "Set to ON to build the FGADMIN application (default)" ON) @@ -231,7 +240,6 @@ endif(EVENT_INPUT) # check required dependencies find_package(Boost REQUIRED) find_package(ZLIB REQUIRED) -find_package(Threads REQUIRED) find_package(OpenGL REQUIRED) find_package(OpenAL REQUIRED) find_package(OpenSceneGraph 3.2.0 REQUIRED @@ -335,11 +343,15 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif(CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set (WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual -Wno-redeclared-class-member") + set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual \ + -Wno-redeclared-class-member \ + -Wno-inconsistent-missing-override \ + -Wno-unused-local-typedef") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") - set (WARNING_FLAGS_C "-Wall") + set(WARNING_FLAGS_C "-Wall") endif() if(WIN32)