2020-06-18 11:58:09 +00:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2010-11-30 10:08:30 +00:00
|
|
|
|
|
|
|
include (CheckFunctionExists)
|
2016-02-18 15:08:20 +00:00
|
|
|
include (CheckVariableExists)
|
2010-11-30 10:08:30 +00:00
|
|
|
include (CheckCSourceCompiles)
|
2010-12-25 23:44:02 +00:00
|
|
|
include (CheckCXXSourceCompiles)
|
|
|
|
include (CheckIncludeFile)
|
2020-06-24 15:36:45 +00:00
|
|
|
include (CheckIncludeFileCXX)
|
2011-10-22 15:07:09 +00:00
|
|
|
|
2020-06-18 11:58:09 +00:00
|
|
|
cmake_policy(SET CMP0054 NEW)
|
|
|
|
cmake_policy(SET CMP0042 NEW) # Mac RPATH policy
|
2020-06-05 12:33:19 +00:00
|
|
|
|
2020-06-18 11:58:09 +00:00
|
|
|
# AUTOMOC/AUTOUIC on generated files policy. Since we only
|
|
|
|
# generate resource files with fgrcc which don't use Qt,
|
|
|
|
# we set those files source property. See the help for this
|
|
|
|
# policy for more info
|
|
|
|
cmake_policy(SET CMP0071 NEW)
|
|
|
|
|
|
|
|
# OpenGL VND policy : use the old definition for now, until we can audit this
|
|
|
|
if(POLICY CMP0072)
|
|
|
|
cmake_policy(SET CMP0072 OLD)
|
2015-02-09 15:11:28 +00:00
|
|
|
endif()
|
|
|
|
|
2017-01-20 13:56:50 +00:00
|
|
|
message("CMAKE Build type: ${CMAKE_BUILD_TYPE}")
|
2017-01-26 13:48:35 +00:00
|
|
|
# Set a default build type if none was specified
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
|
|
message(STATUS "Setting build type to 'Debug' as none was specified.")
|
|
|
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
|
|
|
# Set the possible values of build type for cmake-gui
|
|
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
|
|
|
|
"MinSizeRel" "RelWithDebInfo")
|
|
|
|
endif()
|
2017-01-20 13:56:50 +00:00
|
|
|
|
2017-02-27 23:15:07 +00:00
|
|
|
if(NOT FG_BUILD_TYPE)
|
|
|
|
message(STATUS "Setting build type to 'Dev' as none was specified.")
|
|
|
|
set(FG_BUILD_TYPE Dev CACHE STRING "Choose the FlightGear build type" FORCE)
|
|
|
|
# Set the possible values of build type for cmake-gui
|
|
|
|
set_property(CACHE FG_BUILD_TYPE PROPERTY STRINGS "Dev" "Nightly" "Release")
|
|
|
|
endif()
|
|
|
|
|
2015-06-07 15:20:30 +00:00
|
|
|
if(APPLE)
|
2020-03-15 22:31:05 +00:00
|
|
|
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)
|
2015-06-07 15:20:30 +00:00
|
|
|
endif()
|
2015-04-11 20:58:55 +00:00
|
|
|
|
2020-06-22 19:40:29 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2016-10-24 20:53:55 +00:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
|
|
|
2020-06-18 11:58:09 +00:00
|
|
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version")
|
2018-10-01 21:28:08 +00:00
|
|
|
|
2015-02-24 12:35:26 +00:00
|
|
|
project(FlightGear)
|
|
|
|
|
2019-04-25 16:45:52 +00:00
|
|
|
# Define SRC_PARENT_DIR as the parent directory of the project source directory
|
|
|
|
get_filename_component(SRC_PARENT_DIR ${PROJECT_SOURCE_DIR} DIRECTORY)
|
|
|
|
|
2011-11-30 22:33:03 +00:00
|
|
|
# We have some custom .cmake scripts not in the official distribution.
|
|
|
|
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
2017-09-28 14:11:38 +00:00
|
|
|
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
|
2011-11-30 22:33:03 +00:00
|
|
|
|
2012-07-17 17:19:17 +00:00
|
|
|
# Warning when build is not an out-of-source build.
|
|
|
|
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" InSourceBuild)
|
|
|
|
if(InSourceBuild)
|
|
|
|
message(WARNING "Avoid building inside the source tree!")
|
|
|
|
message(WARNING "Create a separate build directory instead (i.e. 'fgbuild') and call CMake from there: ")
|
|
|
|
message(WARNING " mkdir ../fgbuild && cd ../fgbuild && cmake ${CMAKE_SOURCE_DIR}")
|
|
|
|
endif(InSourceBuild)
|
|
|
|
|
2015-09-28 20:12:07 +00:00
|
|
|
include(GNUInstallDirs)
|
2012-08-18 11:40:57 +00:00
|
|
|
# System detection/default settings
|
|
|
|
include( DetectDistro )
|
2012-08-18 12:11:31 +00:00
|
|
|
include( DetectBrowser )
|
2020-04-07 08:38:13 +00:00
|
|
|
include( ExportDebugSymbols )
|
2012-03-12 20:18:37 +00:00
|
|
|
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
|
|
|
|
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
|
|
|
|
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
|
|
|
|
set(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
|
2011-01-05 16:19:42 +00:00
|
|
|
|
2011-01-01 21:46:16 +00:00
|
|
|
# read 'version' file into a variable (stripping any newlines or spaces)
|
2020-06-27 12:30:14 +00:00
|
|
|
file(READ flightgear-version versionFile)
|
2012-08-26 13:28:51 +00:00
|
|
|
if (NOT versionFile)
|
|
|
|
message(FATAL_ERROR "Unable to determine FlightGear version. Version file is missing.")
|
|
|
|
endif()
|
|
|
|
string(STRIP "${versionFile}" FLIGHTGEAR_VERSION)
|
2018-08-11 09:09:11 +00:00
|
|
|
# add a dependency on the version file
|
2016-06-09 10:04:09 +00:00
|
|
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS version)
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2012-08-18 11:40:08 +00:00
|
|
|
# FlightGear packaging (to build a source tarball)
|
|
|
|
include( ConfigureCPack )
|
2011-10-22 15:07:09 +00:00
|
|
|
|
2012-08-18 11:40:08 +00:00
|
|
|
# FlightGear base package path
|
2011-11-01 17:05:54 +00:00
|
|
|
if (FG_DATA_DIR)
|
2012-08-18 11:40:08 +00:00
|
|
|
message(STATUS "Using explicit data directory for base package: ${FG_DATA_DIR}")
|
2019-04-25 16:45:52 +00:00
|
|
|
elseif(IS_DIRECTORY "${SRC_PARENT_DIR}/fgdata")
|
|
|
|
set(FG_DATA_DIR "${SRC_PARENT_DIR}/fgdata")
|
|
|
|
message(STATUS "Using data directory for base package: ${FG_DATA_DIR}")
|
2011-11-01 17:05:54 +00:00
|
|
|
else()
|
2011-11-05 13:17:08 +00:00
|
|
|
set(FG_DATA_DIR "${CMAKE_INSTALL_PREFIX}/lib/FlightGear" CACHE PATH "Default location where data files are located")
|
2012-08-18 11:40:08 +00:00
|
|
|
message(STATUS "Using default data directory for base package: ${FG_DATA_DIR}")
|
2011-11-01 17:05:54 +00:00
|
|
|
endif()
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2011-09-12 06:10:48 +00:00
|
|
|
# Change the default build type to something fast
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
2012-03-12 20:18:37 +00:00
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
|
|
|
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
|
|
|
FORCE)
|
2011-09-12 06:10:48 +00:00
|
|
|
endif(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
2012-12-01 10:01:25 +00:00
|
|
|
#####################################################################################
|
|
|
|
# Configure library search paths
|
|
|
|
#####################################################################################
|
|
|
|
|
2011-09-21 16:13:13 +00:00
|
|
|
IF(APPLE)
|
|
|
|
set(EVENT_INPUT_DEFAULT 1)
|
2012-03-12 20:18:37 +00:00
|
|
|
|
2011-10-16 18:55:04 +00:00
|
|
|
find_library(CORESERVICES_LIBRARY CoreServices)
|
2011-11-20 13:23:52 +00:00
|
|
|
find_library(COCOA_LIBRARY Cocoa)
|
|
|
|
list(APPEND PLATFORM_LIBS ${COCOA_LIBRARY} ${CORESERVICES_LIBRARY})
|
2016-07-03 13:38:14 +00:00
|
|
|
elseif(WIN32)
|
2020-04-01 14:29:58 +00:00
|
|
|
set(EVENT_INPUT_DEFAULT 1)
|
2016-07-03 13:38:14 +00:00
|
|
|
list(APPEND PLATFORM_LIBS "Shlwapi.lib")
|
2017-10-02 11:30:56 +00:00
|
|
|
|
|
|
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "bin")
|
|
|
|
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
|
|
|
include(InstallRequiredSystemLibraries)
|
|
|
|
MESSAGE("Installing: ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}")
|
|
|
|
|
2014-11-13 15:15:52 +00:00
|
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
|
2020-03-15 22:31:05 +00:00
|
|
|
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
|
|
|
${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
2015-03-17 23:33:57 +00:00
|
|
|
find_package(Threads REQUIRED)
|
2015-04-03 18:15:52 +00:00
|
|
|
find_package(X11 REQUIRED)
|
2015-04-11 20:58:55 +00:00
|
|
|
|
2013-12-09 00:13:44 +00:00
|
|
|
set(USE_DBUS_DEFAULT 1)
|
2011-12-04 13:37:25 +00:00
|
|
|
|
2019-05-28 16:14:49 +00:00
|
|
|
find_package(UDev QUIET)
|
2012-03-12 20:18:37 +00:00
|
|
|
if(UDEV_FOUND)
|
|
|
|
set(EVENT_INPUT_DEFAULT 1)
|
|
|
|
endif(UDEV_FOUND)
|
2014-01-23 16:46:49 +00:00
|
|
|
|
|
|
|
find_package(Speex)
|
|
|
|
find_package(Speexdsp)
|
|
|
|
if(SPEEX_FOUND AND SPEEXDSP_FOUND)
|
|
|
|
set(SYSTEM_SPEEX_DEFAULT 1)
|
|
|
|
endif(SPEEX_FOUND AND SPEEXDSP_FOUND)
|
|
|
|
|
|
|
|
find_package(Gsm)
|
|
|
|
if(GSM_FOUND)
|
|
|
|
set(SYSTEM_GSM_DEFAULT 1)
|
|
|
|
endif(GSM_FOUND)
|
2014-04-28 19:33:48 +00:00
|
|
|
|
|
|
|
find_package(Flite)
|
|
|
|
if(FLITE_FOUND)
|
|
|
|
set(SYSTEM_FLITE_DEFAULT 1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(HtsEngine)
|
2014-04-30 07:26:58 +00:00
|
|
|
if(HTS_ENGINE_FOUND)
|
2014-04-28 19:33:48 +00:00
|
|
|
set(SYSTEM_HTS_ENGINE_DEFAULT 1)
|
|
|
|
endif()
|
2011-09-21 16:13:13 +00:00
|
|
|
endif()
|
|
|
|
|
2012-08-26 13:28:51 +00:00
|
|
|
# FlightGear build options
|
|
|
|
option(LOGGING "Set to ON to build FlightGear with logging support (default)" ON)
|
2014-02-09 13:10:42 +00:00
|
|
|
option(JSBSIM_TERRAIN "Set to ON to build FlightGear with JSBSim terrain handling code" ON)
|
2015-12-05 13:35:23 +00:00
|
|
|
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)
|
2012-08-26 13:28:51 +00:00
|
|
|
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)
|
2012-03-12 20:18:37 +00:00
|
|
|
option(EVENT_INPUT "Set to ON to build FlightGear with event-based Input support" ${EVENT_INPUT_DEFAULT})
|
2012-08-26 13:28:51 +00:00
|
|
|
option(ENABLE_RTI "Set to ON to build FlightGear with RTI support" OFF)
|
2012-11-19 12:10:38 +00:00
|
|
|
option(ENABLE_PROFILE "Set to ON to build FlightGear with gperftools profiling support" OFF)
|
2012-09-19 13:28:25 +00:00
|
|
|
option(SYSTEM_SQLITE "Set to ON to build FlightGear with the system's SQLite3 library" OFF)
|
2013-09-27 18:24:19 +00:00
|
|
|
option(ENABLE_IAX "Set to ON to build FlightGear with IAXClient/fgcom built-in (default)" ON)
|
2013-12-09 00:13:44 +00:00
|
|
|
option(USE_DBUS "Set to ON to build FlightGear with DBus screensaver interaction (default on Linux)" ${USE_DBUS_DEFAULT})
|
2014-01-23 16:46:49 +00:00
|
|
|
option(SYSTEM_SPEEX "Set to ON to build IAXClient with the system's speex and speexdsp library" ${SYSTEM_SPEEX_DEFAULT})
|
|
|
|
option(SYSTEM_GSM "Set to ON to build IAXClient with the system's GSM library" ${SYSTEM_GSM_DEFAULT})
|
2014-04-28 19:33:48 +00:00
|
|
|
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})
|
2019-04-11 20:01:10 +00:00
|
|
|
option(SYSTEM_CPPUNIT "Set to ON to build Flightgear with the system's CppUnit library")
|
2012-08-26 13:28:51 +00:00
|
|
|
|
|
|
|
# additional utilities
|
2013-02-12 16:38:46 +00:00
|
|
|
option(ENABLE_FGELEV "Set to ON to build the fgelev application (default)" ON)
|
2012-08-26 13:28:51 +00:00
|
|
|
option(WITH_FGPANEL "Set to ON to build the fgpanel application (default)" ON)
|
2013-02-12 16:38:46 +00:00
|
|
|
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)
|
2018-06-14 15:46:55 +00:00
|
|
|
option(ENABLE_STGMERGE "Set to ON to build the stgmerge application (default)" OFF)
|
2013-09-27 14:05:45 +00:00
|
|
|
option(ENABLE_FGCOM "Set to ON to build the FGCom application (default)" ON)
|
2015-01-10 14:05:23 +00:00
|
|
|
option(ENABLE_QT "Set to ON to build the internal Qt launcher" ON)
|
2016-11-20 11:52:21 +00:00
|
|
|
option(ENABLE_TRAFFIC "Set to ON to build the external traffic generator modules" ON)
|
2017-01-24 10:34:56 +00:00
|
|
|
option(ENABLE_FGQCANVAS "Set to ON to build the Qt-based remote canvas application" OFF)
|
2016-07-30 12:26:45 +00:00
|
|
|
option(ENABLE_DEMCONVERT "Set to ON to build the dem conversion tool (default)" ON)
|
2019-05-28 16:09:58 +00:00
|
|
|
option(ENABLE_HID_INPUT "Set to ON to build HID-based input code" ${EVENT_INPUT_DEFAULT})
|
2016-01-13 04:44:28 +00:00
|
|
|
option(ENABLE_PLIB_JOYSTICK "Set to ON to enable legacy joystick code (default)" ON)
|
2019-02-04 17:01:15 +00:00
|
|
|
option(ENABLE_COMPOSITOR "Set to ON to enable the Compositor-based Viewer" OFF)
|
2019-05-24 10:57:01 +00:00
|
|
|
option(ENABLE_SWIFT "Set to ON to build the swift module" ON)
|
2016-01-13 04:44:28 +00:00
|
|
|
|
2011-09-26 12:33:06 +00:00
|
|
|
|
2018-03-16 10:28:18 +00:00
|
|
|
# Test-suite options.
|
|
|
|
option(ENABLE_AUTOTESTING "Set to ON to execute the test suite after building the test_suite target (default)" ON)
|
|
|
|
|
2016-12-16 09:50:24 +00:00
|
|
|
include (DetectArch)
|
|
|
|
|
2016-08-16 11:59:52 +00:00
|
|
|
# when building an OSG with commit 15ec7e2ae7a8b983ecc44e1ce7363a9a9fa7da95
|
|
|
|
# applied, we can use better link options
|
|
|
|
option(OSG_FSTREAM_EXPORT_FIXED "Set to ON if the osgDB fstream export patch is applied" OFF)
|
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
if(LOGGING)
|
2012-03-12 20:18:37 +00:00
|
|
|
# nothing
|
2010-11-30 10:08:30 +00:00
|
|
|
else()
|
2012-03-12 20:18:37 +00:00
|
|
|
set(FG_NDEBUG 1)
|
2010-11-30 10:08:30 +00:00
|
|
|
endif()
|
|
|
|
|
2014-01-29 12:50:06 +00:00
|
|
|
if(JSBSIM_TERRAIN)
|
|
|
|
set(JSBSIM_USE_GROUNDREACTIONS 1)
|
|
|
|
endif()
|
|
|
|
|
2011-06-12 13:17:03 +00:00
|
|
|
if(SP_FDMS)
|
2012-03-12 20:18:37 +00:00
|
|
|
set(ENABLE_SP_FDM 1)
|
2010-11-30 10:08:30 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-12 16:52:53 +00:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/iaxclient/lib/libspeex/include)
|
|
|
|
endif()
|
|
|
|
|
2013-09-27 18:24:19 +00:00
|
|
|
if(ENABLE_FGCOM)
|
|
|
|
set(ENABLE_IAX 1)
|
2014-05-31 11:50:28 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/iaxclient/lib ) # for iaxclient.h
|
2013-09-27 18:24:19 +00:00
|
|
|
endif()
|
|
|
|
|
2012-08-18 11:40:08 +00:00
|
|
|
# Setup MSVC 3rd party directories
|
|
|
|
include( ConfigureMsvc3rdParty )
|
2011-01-01 21:22:37 +00:00
|
|
|
|
2011-09-21 16:13:13 +00:00
|
|
|
if(EVENT_INPUT)
|
2012-08-18 11:40:08 +00:00
|
|
|
if(APPLE)
|
2016-09-29 02:11:47 +00:00
|
|
|
add_definitions(-DWITH_EVENTINPUT)
|
2017-12-11 17:10:29 +00:00
|
|
|
find_library(IOKIT_FRAMEWORK IOKit)
|
2018-06-12 19:16:35 +00:00
|
|
|
list(APPEND EVENT_INPUT_LIBRARIES ${IOKIT_FRAMEWORK})
|
2019-08-12 16:52:53 +00:00
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
|
2012-03-12 20:18:37 +00:00
|
|
|
if(NOT UDEV_FOUND)
|
|
|
|
message(WARNING "UDev not found, event input is disabled!")
|
|
|
|
set(EVENT_INPUT 0)
|
2018-04-30 10:23:53 +00:00
|
|
|
|
|
|
|
# HIDraw backend for hidapi also needs UDev, so also force
|
|
|
|
# HID-input to off in this scenario
|
|
|
|
set(ENABLE_HID_INPUT 0)
|
2012-03-12 20:18:37 +00:00
|
|
|
else()
|
2012-09-22 12:20:49 +00:00
|
|
|
add_definitions(-DWITH_EVENTINPUT)
|
2012-03-12 20:18:37 +00:00
|
|
|
set(EVENT_INPUT_LIBRARIES ${UDEV_LIBRARIES})
|
2012-08-18 11:40:08 +00:00
|
|
|
message(STATUS "event-based input enabled. Using ${UDEV_LIBRARIES}")
|
2012-03-12 20:18:37 +00:00
|
|
|
endif()
|
|
|
|
else()
|
2020-04-01 14:29:58 +00:00
|
|
|
add_definitions(-DWITH_EVENTINPUT)
|
2012-03-12 20:18:37 +00:00
|
|
|
endif()
|
2011-12-04 13:37:25 +00:00
|
|
|
|
2017-12-11 17:10:29 +00:00
|
|
|
if (ENABLE_HID_INPUT)
|
2018-04-09 21:03:49 +00:00
|
|
|
message(STATUS "Enabling HID-API input")
|
2017-12-11 17:10:29 +00:00
|
|
|
list(APPEND EVENT_INPUT_LIBRARIES hidapi)
|
|
|
|
endif()
|
2011-09-21 16:13:13 +00:00
|
|
|
endif(EVENT_INPUT)
|
2011-01-01 21:22:37 +00:00
|
|
|
|
2019-03-04 21:18:15 +00:00
|
|
|
if (ENABLE_SWIFT)
|
2020-04-08 15:54:20 +00:00
|
|
|
# DBUS
|
|
|
|
|
|
|
|
# our local FindDBus.cmake file uses pkg-config on non-Windows
|
|
|
|
# we want to ensure our local prefixes are searched, so set this
|
|
|
|
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH 1)
|
|
|
|
|
|
|
|
# unfortunately CMAKE_INSTALL_PREFIX is not searched, so add that manually
|
|
|
|
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
|
|
|
|
|
2019-05-17 08:19:35 +00:00
|
|
|
find_package(DBus)
|
2019-03-04 21:18:15 +00:00
|
|
|
|
|
|
|
#libevent
|
2019-05-17 08:19:35 +00:00
|
|
|
find_package(LibEvent)
|
2019-03-04 21:18:15 +00:00
|
|
|
|
2019-05-24 10:57:01 +00:00
|
|
|
if (DBUS_FOUND AND LIBEVENT_FOUND)
|
2019-05-27 10:37:35 +00:00
|
|
|
message(STATUS "SWIFT support enabled")
|
2019-05-24 10:57:01 +00:00
|
|
|
list(APPEND PLATFORM_LIBS ${LIBEVENT_LIB})
|
|
|
|
# FIXME, make this target specific, not a global include setting
|
2019-05-27 10:37:35 +00:00
|
|
|
include_directories(${LIBEVENT_INCLUDE_DIR})
|
2019-05-17 08:19:35 +00:00
|
|
|
else()
|
2019-05-24 10:57:01 +00:00
|
|
|
message(WARNING "SWIFT support disabled, dbus and/or LibEvent not found")
|
2019-05-17 08:19:35 +00:00
|
|
|
set(ENABLE_SWIFT 0)
|
2019-03-04 21:18:15 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-04-11 20:01:10 +00:00
|
|
|
if (SYSTEM_CPPUNIT)
|
|
|
|
find_package(CppUnit REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
# check required dependencies
|
2016-11-14 23:07:32 +00:00
|
|
|
find_package(Boost REQUIRED)
|
2012-03-12 20:18:37 +00:00
|
|
|
find_package(OpenGL REQUIRED)
|
2020-06-18 16:25:01 +00:00
|
|
|
find_package(OpenSceneGraph 3.4.1 REQUIRED
|
2014-08-09 17:13:39 +00:00
|
|
|
osgText
|
|
|
|
osgSim
|
|
|
|
osgDB
|
|
|
|
osgParticle
|
|
|
|
osgFX
|
|
|
|
osgUtil
|
|
|
|
osgViewer
|
|
|
|
osgGA
|
|
|
|
)
|
2011-01-06 16:56:07 +00:00
|
|
|
|
2020-04-09 13:00:19 +00:00
|
|
|
find_package(sentry QUIET)
|
2020-04-07 08:38:13 +00:00
|
|
|
|
2020-05-12 11:01:59 +00:00
|
|
|
set(sentry_api_key $ENV{FLIGHTGEAR_SENTRY_API_KEY})
|
2020-04-07 08:38:13 +00:00
|
|
|
if (TARGET sentry::sentry)
|
2020-05-12 11:01:59 +00:00
|
|
|
if (NOT sentry_api_key)
|
|
|
|
message(STATUS "Sentry.io crash reporting detected, but FLIGHTGEAR_SENTRY_API_KEY not set")
|
|
|
|
else()
|
|
|
|
message(STATUS "Sentry.io crash reporting enabled")
|
|
|
|
set(HAVE_SENTRY 1)
|
|
|
|
endif()
|
2020-04-07 08:38:13 +00:00
|
|
|
endif()
|
|
|
|
|
2019-08-12 16:52:53 +00:00
|
|
|
#if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
|
|
|
# include_directories("${CMAKE_SOURCE_DIR}/3rdparty/iaxclient/lib/libspeex/include")
|
|
|
|
#endif()
|
|
|
|
|
2013-09-25 12:54:16 +00:00
|
|
|
##############################################################################
|
|
|
|
## Sqlite3 setup
|
|
|
|
|
2012-09-19 13:28:25 +00:00
|
|
|
if (SYSTEM_SQLITE)
|
|
|
|
find_package(SQLite3 REQUIRED)
|
|
|
|
message(STATUS "Using system SQLite3 library")
|
2013-09-25 12:54:16 +00:00
|
|
|
else()
|
|
|
|
set(SQLITE3_INCLUDED_DIR "${CMAKE_SOURCE_DIR}/3rdparty/sqlite3")
|
|
|
|
# this target is defined in src/Navaids/CMakeLists.txt
|
|
|
|
list(APPEND SQLITE3_LIBRARY fgsqlite3)
|
2012-09-19 13:28:25 +00:00
|
|
|
endif (SYSTEM_SQLITE)
|
|
|
|
|
2012-09-21 20:32:07 +00:00
|
|
|
# Sqlite always depends on the threading lib
|
|
|
|
list(APPEND SQLITE3_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
|
2013-12-09 00:13:44 +00:00
|
|
|
##############################################################################
|
|
|
|
## DBus setup
|
|
|
|
|
|
|
|
if (USE_DBUS)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
if (PKG_CONFIG_FOUND)
|
|
|
|
pkg_check_modules(DBUS dbus-1)
|
|
|
|
endif (PKG_CONFIG_FOUND) #if we don't have pkg-config, assume we don't have libdbus-1-dev either http://packages.debian.org/sid/libdbus-1-dev
|
|
|
|
if (DBUS_FOUND)
|
|
|
|
set(HAVE_DBUS 1)
|
|
|
|
message(STATUS "Using DBus")
|
|
|
|
include_directories( ${DBUS_INCLUDE_DIRS})
|
|
|
|
else()
|
|
|
|
message(STATUS "DBus not found, screensaver control disabled")
|
|
|
|
endif (DBUS_FOUND)
|
|
|
|
else()
|
|
|
|
endif (USE_DBUS)
|
|
|
|
|
2014-12-26 12:20:51 +00:00
|
|
|
##############################################################################
|
|
|
|
## Qt5 setup setup
|
2015-01-10 14:05:23 +00:00
|
|
|
if (ENABLE_QT)
|
2020-06-18 11:58:09 +00:00
|
|
|
message(STATUS "Qt launcher enabled, checking for Qt >= 5.9 / qmake")
|
|
|
|
find_package(Qt5 5.9 COMPONENTS Widgets Gui Network Qml Quick Svg)
|
2017-06-22 09:45:47 +00:00
|
|
|
if (Qt5Widgets_FOUND)
|
|
|
|
message(STATUS "Will enable Qt launcher GUI")
|
|
|
|
set(HAVE_QT 1)
|
2018-08-27 12:20:23 +00:00
|
|
|
include (Translations)
|
2020-06-10 16:59:09 +00:00
|
|
|
|
|
|
|
# extract the Qt root direction, since we need it for a few things
|
|
|
|
if (TARGET Qt5::qmake)
|
|
|
|
get_target_property(_qt5_qmake_path Qt5::qmake LOCATION)
|
|
|
|
get_filename_component(FG_QT_BIN_DIR ${_qt5_qmake_path} DIRECTORY)
|
|
|
|
get_filename_component(FG_QT_ROOT_DIR ${FG_QT_BIN_DIR} DIRECTORY)
|
|
|
|
endif()
|
|
|
|
|
2017-06-22 09:45:47 +00:00
|
|
|
else()
|
|
|
|
# don't try to build FGQCanvas if Qt wasn't found correctly
|
|
|
|
set(ENABLE_FGQCANVAS OFF)
|
|
|
|
endif()
|
2020-06-06 10:57:18 +00:00
|
|
|
|
2020-06-24 15:36:45 +00:00
|
|
|
# we would ideally use TARGET::Qt5GuiPrivate but Fedora broke it
|
|
|
|
# perform a manual check instead
|
|
|
|
# see https://bugzilla.redhat.com/show_bug.cgi?id=1846613
|
|
|
|
set (CMAKE_REQUIRED_INCLUDES ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS})
|
|
|
|
check_include_file_cxx("private/qopenglcontext_p.h" REALLY_HAVE_QGUIPRIVATE)
|
|
|
|
|
|
|
|
if (REALLY_HAVE_QGUIPRIVATE)
|
2020-06-06 10:57:18 +00:00
|
|
|
message(STATUS "Have QtGUI private headers")
|
|
|
|
set(ENABLE_QQ_UI 1)
|
|
|
|
else()
|
|
|
|
message(STATUS "QtGui private headers not available.")
|
|
|
|
endif()
|
2016-12-19 17:54:37 +00:00
|
|
|
else()
|
2017-06-22 09:45:47 +00:00
|
|
|
message(STATUS "Qt support disabled")
|
|
|
|
set(ENABLE_FGQCANVAS OFF)
|
2015-01-10 14:05:23 +00:00
|
|
|
endif (ENABLE_QT)
|
2013-09-25 12:54:16 +00:00
|
|
|
##############################################################################
|
|
|
|
|
2020-03-13 11:27:11 +00:00
|
|
|
find_package(PLIB REQUIRED puaux pu)
|
2012-01-31 20:42:37 +00:00
|
|
|
|
2017-01-05 10:57:00 +00:00
|
|
|
# FlightGear and SimGear versions need to match major + minor
|
|
|
|
# split version string into components, note CMAKE_MATCH_0 is the entire regexp match
|
|
|
|
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" VERSION_REGEX ${FLIGHTGEAR_VERSION} )
|
|
|
|
set(FG_VERSION_MAJOR ${CMAKE_MATCH_1})
|
|
|
|
set(FG_VERSION_MINOR ${CMAKE_MATCH_2})
|
|
|
|
set(FG_VERSION_PATCH ${CMAKE_MATCH_3})
|
|
|
|
|
|
|
|
set(MIN_SIMGEAR_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.0")
|
|
|
|
message(STATUS "Min Simgear version is ${MIN_SIMGEAR_VERSION}")
|
|
|
|
|
|
|
|
find_package(SimGear ${MIN_SIMGEAR_VERSION} CONFIG REQUIRED)
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2013-09-28 13:15:47 +00:00
|
|
|
##############################################################################
|
|
|
|
|
2016-02-18 15:08:20 +00:00
|
|
|
check_include_file(unistd.h HAVE_UNISTD_H)
|
|
|
|
check_include_file(sys/time.h HAVE_SYS_TIME_H)
|
|
|
|
check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H)
|
|
|
|
check_include_file(windows.h HAVE_WINDOWS_H)
|
|
|
|
check_function_exists(timegm HAVE_TIMEGM)
|
|
|
|
check_variable_exists(daylight HAVE_DAYLIGHT)
|
|
|
|
check_function_exists(ftime HAVE_FTIME)
|
|
|
|
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
|
2010-12-25 23:44:02 +00:00
|
|
|
|
2012-11-15 12:56:31 +00:00
|
|
|
if(ENABLE_PROFILE)
|
2012-11-19 12:10:38 +00:00
|
|
|
find_package(GooglePerfTools REQUIRED)
|
|
|
|
set(FG_HAVE_GPERFTOOLS 1)
|
|
|
|
message(STATUS "Built-in profiler using gperftools available")
|
2012-11-15 12:56:31 +00:00
|
|
|
endif()
|
2012-11-15 10:55:25 +00:00
|
|
|
|
2011-09-05 18:25:30 +00:00
|
|
|
if(ENABLE_RTI)
|
2020-03-15 22:31:05 +00:00
|
|
|
message(STATUS "RTI: ENABLED")
|
|
|
|
set(FG_HAVE_HLA 1)
|
2013-02-15 23:03:40 +00:00
|
|
|
else()
|
|
|
|
message(STATUS "RTI: DISABLED")
|
2011-09-05 18:25:30 +00:00
|
|
|
endif(ENABLE_RTI)
|
2010-12-26 12:55:52 +00:00
|
|
|
|
2016-07-30 12:26:45 +00:00
|
|
|
if(ENABLE_GDAL)
|
|
|
|
find_package(GDAL 2.0.0 REQUIRED)
|
|
|
|
endif(ENABLE_GDAL)
|
|
|
|
include_directories(${GDAL_INCLUDE_DIR})
|
|
|
|
|
|
|
|
if (ENABLE_OPENMP)
|
|
|
|
find_package(OpenMP)
|
|
|
|
if(OPENMP_FOUND)
|
|
|
|
message(STATUS "OpenMP: ENABLED")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
|
|
|
else()
|
|
|
|
message(STATUS "OpenMP: NOT FOUND")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "OpenMP: DISABLED")
|
|
|
|
endif()
|
|
|
|
|
2017-02-06 23:04:56 +00:00
|
|
|
if (ENABLE_SIMD)
|
2017-02-04 19:21:19 +00:00
|
|
|
message(STATUS "SSE/SSE2 support: ENABLED")
|
|
|
|
else()
|
|
|
|
message(STATUS "SSE/SSE2 support: DISABLED")
|
|
|
|
endif()
|
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
2012-05-05 07:42:25 +00:00
|
|
|
set(WARNING_FLAGS_CXX "-Wall")
|
|
|
|
set(WARNING_FLAGS_C "-Wall")
|
2016-12-16 09:50:24 +00:00
|
|
|
|
2020-05-26 12:06:22 +00:00
|
|
|
if (X86 OR X86_64)
|
|
|
|
set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize")
|
2016-12-16 09:50:24 +00:00
|
|
|
endif()
|
2010-11-30 10:08:30 +00:00
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
2016-10-24 20:53:55 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
|
2015-09-28 01:40:34 +00:00
|
|
|
set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual \
|
|
|
|
-Wno-redeclared-class-member \
|
|
|
|
-Wno-inconsistent-missing-override \
|
|
|
|
-Wno-unused-local-typedef")
|
|
|
|
|
2020-05-10 18:42:25 +00:00
|
|
|
# disabled by James - these cause weridness for multi-config generators
|
|
|
|
# since they set thge flags for all configurations
|
|
|
|
# need to find a better way to adjust these
|
|
|
|
|
|
|
|
# if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
# set(CMAKE_C_FLAGS
|
|
|
|
# "${CMAKE_C_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
|
|
|
|
# set(CMAKE_CXX_FLAGS
|
|
|
|
# "${CMAKE_CXX_FLAGS} -O0 -fno-omit-frame-pointer -fno-inline-functions")
|
|
|
|
# endif()
|
2018-04-18 06:27:10 +00:00
|
|
|
|
2020-05-12 23:08:19 +00:00
|
|
|
# override CMake default RelWithDebInfo flags.
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
|
|
|
|
|
2020-05-26 12:06:22 +00:00
|
|
|
set(SIMD_COMPILER_FLAGS "-msse2 -mfpmath=sse -ftree-vectorize -ftree-slp-vectorize")
|
2016-12-17 09:51:01 +00:00
|
|
|
|
2016-10-24 20:53:55 +00:00
|
|
|
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
2015-09-28 01:40:34 +00:00
|
|
|
set(WARNING_FLAGS_C "-Wall")
|
2020-08-19 13:02:45 +00:00
|
|
|
endif()
|
2020-08-14 10:10:59 +00:00
|
|
|
|
2020-08-19 13:02:45 +00:00
|
|
|
# ASan is enabled in SimGear's configuration, in case you are
|
|
|
|
# wondering why there is no option() for it above.
|
|
|
|
if (ENABLE_ASAN)
|
2020-08-14 10:10:59 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
|
|
|
|
|
|
|
# needed for check_cxx_source_compiles
|
|
|
|
set(CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=address")
|
2015-01-07 09:38:02 +00:00
|
|
|
endif()
|
2012-03-25 17:46:50 +00:00
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
if(WIN32)
|
|
|
|
if(MSVC)
|
2020-05-07 13:13:10 +00:00
|
|
|
# override CMake default RelWithDebInfo flags. This is important to ensure
|
|
|
|
# good performance
|
2020-05-08 13:32:40 +00:00
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Zi /O2 /Ob2 /D NDEBUG")
|
2020-05-07 13:13:10 +00:00
|
|
|
|
2020-06-22 19:40:29 +00:00
|
|
|
set(MSVC_FLAGS "/bigobj -DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS -D_HAS_STD_BYTE=0")
|
2020-05-28 09:47:29 +00:00
|
|
|
if (X86)
|
|
|
|
set(SIMD_COMPILER_FLAGS "/arch:SSE /arch:SSE2")
|
|
|
|
endif()
|
2016-12-16 09:50:24 +00:00
|
|
|
|
2016-08-16 11:59:52 +00:00
|
|
|
if (NOT OSG_FSTREAM_EXPORT_FIXED AND ${MSVC_VERSION} GREATER 1599)
|
|
|
|
message(STATUS "For better linking performance, use OSG with fixed fstream header")
|
|
|
|
# needed to avoid link errors on multiply-defined standard C++
|
|
|
|
# symbols. This issue was fixed in OSG commit 15ec7e2ae7a8b983ecc44e1ce7363a9a9fa7da95
|
|
|
|
set( MSVC_LD_FLAGS "/FORCE:MULTIPLE" )
|
|
|
|
endif ()
|
2010-11-30 10:08:30 +00:00
|
|
|
endif(MSVC)
|
|
|
|
|
|
|
|
set(NOMINMAX 1)
|
2012-03-12 20:18:37 +00:00
|
|
|
endif(WIN32)
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2020-06-21 18:29:50 +00:00
|
|
|
set (BOOST_CXX_FLAGS "-DBOOST_BIMAP_DISABLE_SERIALIZATION -DBOOST_NO_STDLIB_CONFIG -DBOOST_NO_AUTO_PTR -DBOOST_NO_CXX98_BINDERS")
|
2012-05-12 15:20:28 +00:00
|
|
|
|
2020-05-26 12:06:22 +00:00
|
|
|
# append the SIMD flags if requested
|
|
|
|
if (ENABLE_SIMD)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
|
|
|
|
# set for multi-configuration generators
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SIMD_COMPILER_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
2012-05-05 07:42:25 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS_C} ${MSVC_FLAGS} -D_REENTRANT")
|
2012-05-12 15:20:28 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS_CXX} ${MSVC_FLAGS} -D_REENTRANT ${BOOST_CXX_FLAGS}")
|
2011-01-28 14:15:20 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MSVC_LD_FLAGS}")
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2010-12-26 12:55:52 +00:00
|
|
|
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
|
2012-03-12 20:18:37 +00:00
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
${OPENGL_INCLUDE_DIR}
|
2017-02-04 21:53:22 +00:00
|
|
|
${SIMGEAR_INCLUDE_DIRS}
|
2013-09-25 12:54:16 +00:00
|
|
|
${PLIB_INCLUDE_DIR}
|
2019-05-17 08:19:35 +00:00
|
|
|
${SQLITE3_INCLUDED_DIR} )
|
2010-11-30 10:08:30 +00:00
|
|
|
|
2016-07-06 11:27:14 +00:00
|
|
|
if (USE_AEONWAVE)
|
2018-06-02 12:06:36 +00:00
|
|
|
find_package(AAX REQUIRED)
|
2016-07-06 11:27:14 +00:00
|
|
|
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
|
|
|
|
${AAX_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
|
|
|
|
${OPENAL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2013-05-19 14:29:49 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR})
|
2010-11-30 10:08:30 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/src)
|
2011-01-01 21:46:16 +00:00
|
|
|
# following is needed, because config.h is include 'bare', whereas
|
|
|
|
# version.h is included as <Include/version.h> - this should be cleaned up
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src)
|
2010-11-30 10:08:30 +00:00
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src/Include)
|
|
|
|
|
2019-06-03 15:51:08 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/hts_engine_API/include )
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/flite_hts_engine/include )
|
2014-03-10 09:32:03 +00:00
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
add_definitions(-DHAVE_CONFIG_H)
|
|
|
|
|
2020-05-24 13:14:35 +00:00
|
|
|
set(FG_TEST_SUITE_DATA "${CMAKE_SOURCE_DIR}/test_suite/test_data")
|
|
|
|
|
2011-06-02 22:01:17 +00:00
|
|
|
check_function_exists(mkfifo HAVE_MKFIFO)
|
|
|
|
|
2010-11-30 10:08:30 +00:00
|
|
|
# configure a header file to pass some of the CMake settings
|
|
|
|
# to the source code
|
|
|
|
configure_file (
|
2012-03-12 20:18:37 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/src/Include/config_cmake.h.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/src/Include/config.h"
|
|
|
|
)
|
2011-01-01 18:24:53 +00:00
|
|
|
|
|
|
|
#and the same for the version header
|
|
|
|
configure_file (
|
2012-03-12 20:18:37 +00:00
|
|
|
"${PROJECT_SOURCE_DIR}/src/Include/version.h.cmake-in"
|
|
|
|
"${PROJECT_BINARY_DIR}/src/Include/version.h"
|
|
|
|
)
|
2011-01-01 18:24:53 +00:00
|
|
|
|
2018-08-19 15:06:16 +00:00
|
|
|
# Setup build.h header, each build
|
|
|
|
include( GenerateBuildInfo )
|
2018-08-11 09:09:11 +00:00
|
|
|
|
2013-09-25 12:54:16 +00:00
|
|
|
add_subdirectory(3rdparty)
|
2010-11-30 10:08:30 +00:00
|
|
|
add_subdirectory(utils)
|
2010-12-28 13:43:14 +00:00
|
|
|
|
2017-03-26 11:15:29 +00:00
|
|
|
add_subdirectory(src)
|
2017-05-20 13:03:25 +00:00
|
|
|
add_subdirectory(icons)
|
2017-03-26 11:15:29 +00:00
|
|
|
add_subdirectory(man)
|
2017-05-20 13:03:25 +00:00
|
|
|
add_subdirectory(package)
|
|
|
|
add_subdirectory(scripts)
|
2017-03-26 11:15:29 +00:00
|
|
|
|
2018-06-16 12:03:23 +00:00
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
### MSVC startup project - ensure you can just hit build & run in MSVC
|
|
|
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT fgfs)
|
|
|
|
|
2010-12-28 13:43:14 +00:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
### uninstall target
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
CONFIGURE_FILE(
|
2012-03-12 20:18:37 +00:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
|
|
IMMEDIATE @ONLY)
|
2010-12-28 13:43:14 +00:00
|
|
|
ADD_CUSTOM_TARGET(uninstall
|
2012-03-12 20:18:37 +00:00
|
|
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
2016-01-28 15:56:10 +00:00
|
|
|
|
|
|
|
# The test suite.
|
2018-06-11 09:39:57 +00:00
|
|
|
enable_testing()
|
2018-03-06 09:24:13 +00:00
|
|
|
add_subdirectory(test_suite EXCLUDE_FROM_ALL)
|