first commit
This commit is contained in:
9
CMakeModules/CheckPOSIXFeatures.cmake
Normal file
9
CMakeModules/CheckPOSIXFeatures.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
check_function_exists(mkfifo HAVE_MKFIFO)
|
||||
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)
|
||||
25
CMakeModules/ConfigureCPack.cmake
Normal file
25
CMakeModules/ConfigureCPack.cmake
Normal file
@@ -0,0 +1,25 @@
|
||||
# ConfigureCPack.cmake -- Configure CPack packaging
|
||||
|
||||
if(EXISTS ${PROJECT_SOURCE_DIR}/.gitignore)
|
||||
file(READ .gitignore CPACK_SOURCE_IGNORE_FILES)
|
||||
else()
|
||||
# clean tar-balls do not contain SCM (.git/.gitignore/...) files.
|
||||
set(CPACK_SOURCE_IGNORE_FILES
|
||||
"Makefile.am;~$;${CPACK_SOURCE_IGNORE_FILES}")
|
||||
endif()
|
||||
|
||||
list (APPEND CPACK_SOURCE_IGNORE_FILES "${PROJECT_SOURCE_DIR}/.git;\\\\.gitignore")
|
||||
|
||||
# split version string into components, note CMAKE_MATCH_0 is the entire regexp match
|
||||
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CPACK_PACKAGE_VERSION ${FLIGHTGEAR_VERSION} )
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README")
|
||||
|
||||
set(CPACK_SOURCE_GENERATOR TBZ2)
|
||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "flightgear-${FLIGHTGEAR_VERSION}" CACHE INTERNAL "tarball basename")
|
||||
|
||||
include (CPack)
|
||||
|
||||
133
CMakeModules/ConfigureMsvc3rdParty.cmake
Normal file
133
CMakeModules/ConfigureMsvc3rdParty.cmake
Normal file
@@ -0,0 +1,133 @@
|
||||
# ConfigureMsvc3rdParty.cmake - Configure 3rd Party Library Paths on Windows
|
||||
|
||||
# we want to handle various cases here:
|
||||
# fgmeta layout, where windows-3rd-party is a sibling of our flightgear source dir
|
||||
# - this should work with no manual options
|
||||
# explicitly specifying MSVC_3RDPARTY_ROOT: we'll select a subdir based on MSVC version
|
||||
# and architecture. We want to allow for people specify various paths here:
|
||||
# - path to windows-3rd-party
|
||||
# - path to an MSVC versioned subdir, eg -DMSVC_3RDPARTY_ROOT=C:\FGFS\windows-3rd-party\msvc140
|
||||
# - path to an architecture specific subdir, eg -DMSVC_3RDPARTY_ROOT=C:\FGFS\windows-3rd-party\msvc140\3rdparty.x64
|
||||
|
||||
set(_FOUND_3RDPARTY_DIR "NOTFOUND")
|
||||
set(_FOUND_BOOST_INCLUDE_DIR "NOTFOUND")
|
||||
|
||||
# try various suffixes of a base directory, and
|
||||
# set the variables above on success
|
||||
function(_check_candidate_msvc_path pathToCheck)
|
||||
unset (_freeTypeHeader CACHE )
|
||||
unset (_zlibDll CACHE )
|
||||
unset (_boostHeaders CACHE )
|
||||
|
||||
find_path(_freeTypeHeader include/ft2build.h
|
||||
PATHS
|
||||
${pathToCheck}
|
||||
PATH_SUFFIXES
|
||||
${ARCH_SUBDIR_NAME}
|
||||
${MSVC_SUBDIR_NAME}/${ARCH_SUBDIR_NAME}
|
||||
${COMPAT_SUBDIR_NAME}/${ARCH_SUBDIR_NAME}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(_zlibDll bin/zlib.dll
|
||||
PATHS
|
||||
${pathToCheck}
|
||||
PATH_SUFFIXES
|
||||
${ARCH_SUBDIR_NAME}
|
||||
${MSVC_SUBDIR_NAME}/${ARCH_SUBDIR_NAME}
|
||||
${COMPAT_SUBDIR_NAME}/${ARCH_SUBDIR_NAME}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_path(_boostHeaders boost/atomic.hpp
|
||||
PATHS
|
||||
${pathToCheck}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
if (_freeTypeHeader AND _zlibDll)
|
||||
set(_FOUND_3RDPARTY_DIR "${_freeTypeHeader}" PARENT_SCOPE)
|
||||
|
||||
if (_boostHeaders)
|
||||
set(_FOUND_BOOST_INCLUDE_DIR "${_boostHeaders}" PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
if (MSVC)
|
||||
# compute values for the compiler and arch subdirs
|
||||
string(SUBSTRING ${MSVC_VERSION} 0 2 MSVC_VERSION_MAJOR)
|
||||
string(SUBSTRING ${MSVC_VERSION} 2 2 MSVC_VERSION_MINOR)
|
||||
|
||||
if (${MSVC_VERSION_MAJOR} EQUAL "19")
|
||||
if (${MSVC_VERSION_MINOR} EQUAL "00")
|
||||
set( MSVC_SUBDIR_NAME msvc140 )
|
||||
else ()
|
||||
set( MSVC_SUBDIR_NAME msvc141 )
|
||||
set( COMPAT_SUBDIR_NAME msvc140 )
|
||||
endif()
|
||||
else ()
|
||||
message(FATAL_ERROR "Visual Studio 2017 is required")
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CL_64)
|
||||
SET(ARCH_SUBDIR_NAME "3rdParty.x64")
|
||||
else (CMAKE_CL_64)
|
||||
SET(ARCH_SUBDIR_NAME "3rdParty")
|
||||
endif (CMAKE_CL_64)
|
||||
|
||||
|
||||
# try the explicitly specified value first
|
||||
if (EXISTS ${MSVC_3RDPARTY_ROOT})
|
||||
_check_candidate_msvc_path("${MSVC_3RDPARTY_ROOT}")
|
||||
endif()
|
||||
|
||||
# then try the fgmeta setup: look for a windows-3rdparty sibling of
|
||||
# our source dir
|
||||
get_filename_component(PARENT_SOURCE_DIR ${PROJECT_SOURCE_DIR} DIRECTORY)
|
||||
get_filename_component(PARENT_BINARY_DIR ${PROJECT_BINARY_DIR} DIRECTORY)
|
||||
|
||||
|
||||
if (NOT _FOUND_3RDPARTY_DIR AND EXISTS "${PARENT_SOURCE_DIR}/windows-3rd-party")
|
||||
message(STATUS "Trying src 3rdparty")
|
||||
_check_candidate_msvc_path("${PARENT_SOURCE_DIR}/windows-3rd-party")
|
||||
endif()
|
||||
|
||||
if (NOT _FOUND_3RDPARTY_DIR AND EXISTS "${PARENT_BINARY_DIR}/windows-3rd-party")
|
||||
message(STATUS "Trying bin 3rdparty")
|
||||
_check_candidate_msvc_path("${PARENT_BINARY_DIR}/windows-3rd-party")
|
||||
endif()
|
||||
|
||||
# try the Jenkins setup, whre the arch dir is copied into the WORKSPACE
|
||||
if (NOT _FOUND_3RDPARTY_DIR AND EXISTS "${PARENT_BINARY_DIR}/${ARCH_SUBDIR_NAME}")
|
||||
message(STATUS "Trying arch subdir ${PARENT_BINARY_DIR}/${ARCH_SUBDIR_NAME}")
|
||||
_check_candidate_msvc_path("${PARENT_BINARY_DIR}/${ARCH_SUBDIR_NAME}")
|
||||
endif()
|
||||
|
||||
if (NOT _FOUND_3RDPARTY_DIR)
|
||||
message(WARNING "Failed to find the Windows 3rdparty files at all.")
|
||||
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LIBS "winmm.lib")
|
||||
else (MSVC)
|
||||
set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
|
||||
endif (MSVC)
|
||||
|
||||
if (MSVC AND _FOUND_3RDPARTY_DIR)
|
||||
message(STATUS "3rdparty files located in ${_FOUND_3RDPARTY_DIR}")
|
||||
list(APPEND CMAKE_PREFIX_PATH ${_FOUND_3RDPARTY_DIR})
|
||||
set(FINAL_MSVC_3RDPARTY_DIR ${_FOUND_3RDPARTY_DIR})
|
||||
|
||||
if (CMAKE_CL_64)
|
||||
set( BOOST_LIB lib64 )
|
||||
else (CMAKE_CL_64)
|
||||
set( BOOST_LIB lib )
|
||||
endif (CMAKE_CL_64)
|
||||
|
||||
if(NOT BOOST_INCLUDEDIR AND _FOUND_BOOST_INCLUDE_DIR)
|
||||
set(BOOST_INCLUDEDIR ${_FOUND_BOOST_INCLUDE_DIR})
|
||||
message(STATUS "found Boost headers at ${_FOUND_BOOST_INCLUDE_DIR}")
|
||||
endif()
|
||||
endif ()
|
||||
37
CMakeModules/DetectArch.cmake
Normal file
37
CMakeModules/DetectArch.cmake
Normal file
@@ -0,0 +1,37 @@
|
||||
IF(CMAKE_SYSTEM_PROCESSOR MATCHES amd64.*|x86_64.* OR CMAKE_GENERATOR MATCHES "Visual Studio.*Win64")
|
||||
IF(CMAKE_C_FLAGS MATCHES -m32 OR CMAKE_CXX_FLAGS MATCHES -m32)
|
||||
SET(X86 1)
|
||||
ELSE(CMAKE_C_FLAGS MATCHES -m32 OR CMAKE_CXX_FLAGS MATCHES -m32)
|
||||
SET(X86_64 1)
|
||||
ENDIF(CMAKE_C_FLAGS MATCHES -m32 OR CMAKE_CXX_FLAGS MATCHES -m32)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES i686.*|i386.*|x86.* OR WIN32)
|
||||
IF(CMAKE_C_FLAGS MATCHES -m64 OR CMAKE_CXX_FLAGS MATCHES -m64)
|
||||
SET(X86_64 1)
|
||||
ELSE(CMAKE_C_FLAGS MATCHES -m64 OR CMAKE_CXX_FLAGS MATCHES -m64)
|
||||
SET(X86 1)
|
||||
ENDIF(CMAKE_C_FLAGS MATCHES -m64 OR CMAKE_CXX_FLAGS MATCHES -m64)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES arm.* AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
SET(ARM 1)
|
||||
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES mips)
|
||||
SET(MIPS 1)
|
||||
ENDIF()
|
||||
|
||||
IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
|
||||
# using Clang
|
||||
SET(CLANG 1)
|
||||
ELSEIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "TinyCC")
|
||||
# using TinyCC
|
||||
SET(TINYCC 1)
|
||||
ELSEIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||
# using GCC
|
||||
SET(GCC 1)
|
||||
ELSEIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
|
||||
# using Intel C++
|
||||
SET(INTELCC 1)
|
||||
ELSEIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
SET(MSVC 1)
|
||||
ELSEIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "MIPSpro")
|
||||
# using SGI MIPSpro
|
||||
SET(MIPSPRO 1)
|
||||
ENDIF()
|
||||
22
CMakeModules/DetectBrowser.cmake
Normal file
22
CMakeModules/DetectBrowser.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
# DetectBrowser.cmake -- Detect web browser launcher application
|
||||
|
||||
# Set default command to open browser. Override with -DWEB_BROWSER=...
|
||||
if (APPLE OR MSVC)
|
||||
# opening the web browser is hardcoded for Mac and Windows,
|
||||
# so this doesn't really have an effect...
|
||||
set(WEB_BROWSER "open")
|
||||
else()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# "xdg-open" provides run-time detection of user's preferred browser on (most) Linux.
|
||||
if (NOT LINUX_DISTRO MATCHES "Debian")
|
||||
set(WEB_BROWSER "xdg-open" CACHE STRING "Command to open web browser")
|
||||
else()
|
||||
# Debian is different: "sensible-browser" provides auto-detection
|
||||
set(WEB_BROWSER "sensible-browser" CACHE STRING "Command to open web browser")
|
||||
endif()
|
||||
else()
|
||||
# Default for non Linux/non Mac/non Windows platform...
|
||||
set(WEB_BROWSER "firefox" CACHE STRING "Command to open web browser")
|
||||
endif()
|
||||
message(STATUS "Web browser launcher command is: ${WEB_BROWSER}")
|
||||
endif()
|
||||
13
CMakeModules/DetectDistro.cmake
Normal file
13
CMakeModules/DetectDistro.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
# DetectDistro.cmake -- Detect Linux distribution
|
||||
|
||||
message(STATUS "System is: ${CMAKE_SYSTEM_NAME}")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
# Detect Linux distribution (if possible)
|
||||
execute_process(COMMAND "/usr/bin/lsb_release" "-is"
|
||||
TIMEOUT 4
|
||||
OUTPUT_VARIABLE LINUX_DISTRO
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
message(STATUS "Linux distro is: ${LINUX_DISTRO}")
|
||||
endif()
|
||||
22
CMakeModules/ExportDebugSymbols.cmake
Normal file
22
CMakeModules/ExportDebugSymbols.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
# placehodler target for other ones to depend upon
|
||||
add_custom_target(
|
||||
debug_symbols
|
||||
)
|
||||
|
||||
function(export_debug_symbols target)
|
||||
|
||||
if (APPLE)
|
||||
add_custom_target(${target}.dSYM
|
||||
COMMENT "Generating dSYM files for ${target}"
|
||||
COMMAND dsymutil --out=${target}.dSYM $<TARGET_FILE:${target}>
|
||||
DEPENDS $<TARGET_FILE:${target}>
|
||||
)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM DESTINATION symbols OPTIONAL)
|
||||
|
||||
add_dependencies(debug_symbols ${target}.dSYM)
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
74
CMakeModules/FindAAX.cmake
Normal file
74
CMakeModules/FindAAX.cmake
Normal file
@@ -0,0 +1,74 @@
|
||||
# Try to find AAX (AeonWave)
|
||||
# This module defines
|
||||
#
|
||||
# AAX_FOUND - if false, do not try to link to AAX
|
||||
# AAX_INCLUDE_DIR - where to find the headers
|
||||
# AAX_LIBRARY - Link these to use AAX
|
||||
#
|
||||
# Copyright (C) 2016-2018 by Erik Hofman.
|
||||
# Copyright (C) 2016-2018 by Adalin B.V.
|
||||
#
|
||||
# $AAXDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$AAXDIR
|
||||
# used in building AAX.
|
||||
#
|
||||
# This file is Public Domain (www.unlicense.org)
|
||||
# This is free and unencumbered software released into the public domain.
|
||||
|
||||
if (AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
||||
# in cache already
|
||||
set(AAX_FOUND TRUE)
|
||||
message(STATUS "Found AeonWave: ${AAX_LIBRARY}")
|
||||
else()
|
||||
find_path(AAX_INCLUDE_DIR aax/aax.h
|
||||
HINTS
|
||||
$ENV{AAXDIR}
|
||||
$ENV{ProgramFiles}/aax
|
||||
$ENV{ProgramFiles}/AeonWave
|
||||
$ENV{ProgramFiles}/Adalin/AeonWave
|
||||
${CMAKE_SOURCE_DIR}/aax
|
||||
PATH_SUFFIXES include
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt
|
||||
)
|
||||
|
||||
find_library(AAX_LIBRARY
|
||||
NAMES AAX aax libAAX
|
||||
HINTS
|
||||
$ENV{AAXDIR}
|
||||
$ENV{ProgramFiles}/AAX
|
||||
$ENV{ProgramFiles}/AeonWave
|
||||
$ENV{ProgramFiles}/Adalin/AeonWave
|
||||
${CMAKE_BUILD_DIR}/aax
|
||||
PATH_SUFFIXES lib64 lib lib/${CMAKE_LIBRARY_ARCHITECTURE} libs64 libs libs/Win32 libs/Win64 bin
|
||||
PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/opt
|
||||
)
|
||||
|
||||
set(AAX_DEFINITIONS "")
|
||||
if (AAX_LIBRARY AND AAX_INCLUDE_DIR)
|
||||
set(AAX_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
if (AAX_FOUND)
|
||||
if (NOT Udns_FIND_QUIETLY)
|
||||
message(STATUS "Found AeonWave: ${AAX_LIBRARY}")
|
||||
endif ()
|
||||
else ()
|
||||
if (Udns_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find AeonWave")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(AAX_LIBRARY AAX_INCLUDE_DIR)
|
||||
|
||||
endif()
|
||||
|
||||
203
CMakeModules/FindCURL.cmake
Normal file
203
CMakeModules/FindCURL.cmake
Normal file
@@ -0,0 +1,203 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindCURL
|
||||
--------
|
||||
|
||||
Find the native CURL headers and libraries.
|
||||
|
||||
This module accept optional COMPONENTS to check supported features and
|
||||
protocols::
|
||||
|
||||
PROTOCOLS: ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3
|
||||
POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
|
||||
FEATURES: SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO
|
||||
Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
|
||||
curl has been found.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines the following variables:
|
||||
|
||||
``CURL_FOUND``
|
||||
"True" if ``curl`` found.
|
||||
|
||||
``CURL_INCLUDE_DIRS``
|
||||
where to find ``curl``/``curl.h``, etc.
|
||||
|
||||
``CURL_LIBRARIES``
|
||||
List of libraries when using ``curl``.
|
||||
|
||||
``CURL_VERSION_STRING``
|
||||
The version of ``curl`` found.
|
||||
|
||||
CURL CMake
|
||||
^^^^^^^^^^
|
||||
|
||||
If CURL was built using the CMake buildsystem then it provides its own
|
||||
``CURLConfig.cmake`` file for use with the :command:`find_package` command's
|
||||
config mode. This module looks for this file and, if found,
|
||||
returns its results with no further action.
|
||||
|
||||
Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if(NOT CURL_NO_CURL_CMAKE)
|
||||
# do a find package call to specifically look for the CMake version
|
||||
# of curl
|
||||
find_package(CURL QUIET NO_MODULE)
|
||||
mark_as_advanced(CURL_DIR)
|
||||
|
||||
# if we found the CURL cmake package then we are done, and
|
||||
# can print what we found and return.
|
||||
if(CURL_FOUND)
|
||||
find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_CURL QUIET libcurl)
|
||||
if(PC_CURL_FOUND)
|
||||
set(CURL_VERSION_STRING ${PC_CURL_VERSION})
|
||||
pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
|
||||
pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Look for the header file.
|
||||
find_path(CURL_INCLUDE_DIR
|
||||
NAMES curl/curl.h
|
||||
HINTS ${PC_CURL_INCLUDE_DIRS})
|
||||
mark_as_advanced(CURL_INCLUDE_DIR)
|
||||
|
||||
if(NOT CURL_LIBRARY)
|
||||
# Look for the library (sorted from most current/relevant entry to least).
|
||||
find_library(CURL_LIBRARY_RELEASE NAMES
|
||||
curl
|
||||
# Windows MSVC prebuilts:
|
||||
curllib
|
||||
libcurl_imp
|
||||
curllib_static
|
||||
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
|
||||
libcurl
|
||||
HINTS ${PC_CURL_LIBRARY_DIRS}
|
||||
)
|
||||
mark_as_advanced(CURL_LIBRARY_RELEASE)
|
||||
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES
|
||||
# Windows MSVC CMake builds in debug configuration on vcpkg:
|
||||
libcurl-d_imp
|
||||
libcurl-d
|
||||
HINTS ${PC_CURL_LIBRARY_DIRS}
|
||||
)
|
||||
mark_as_advanced(CURL_LIBRARY_DEBUG)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(CURL)
|
||||
endif()
|
||||
|
||||
if(CURL_INCLUDE_DIR AND NOT CURL_VERSION_STRING)
|
||||
foreach(_curl_version_header curlver.h curl.h)
|
||||
if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
|
||||
file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
|
||||
unset(curl_version_str)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CURL_FIND_COMPONENTS)
|
||||
set(CURL_KNOWN_PROTOCOLS ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP)
|
||||
set(CURL_KNOWN_FEATURES SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy)
|
||||
foreach(component IN LISTS CURL_KNOWN_PROTOCOLS CURL_KNOWN_FEATURES)
|
||||
set(CURL_${component}_FOUND FALSE)
|
||||
endforeach()
|
||||
if(NOT PC_CURL_FOUND)
|
||||
find_program(CURL_CONFIG_EXECUTABLE NAMES curl-config)
|
||||
if(CURL_CONFIG_EXECUTABLE)
|
||||
execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE CURL_CONFIG_VERSION_STRING
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --feature
|
||||
OUTPUT_VARIABLE CURL_CONFIG_FEATURES_STRING
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE "\n" ";" CURL_SUPPORTED_FEATURES "${CURL_CONFIG_FEATURES_STRING}")
|
||||
execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --protocols
|
||||
OUTPUT_VARIABLE CURL_CONFIG_PROTOCOLS_STRING
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE "\n" ";" CURL_SUPPORTED_PROTOCOLS "${CURL_CONFIG_PROTOCOLS_STRING}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
foreach(component IN LISTS CURL_FIND_COMPONENTS)
|
||||
list(FIND CURL_KNOWN_PROTOCOLS ${component} _found)
|
||||
if(_found)
|
||||
list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
|
||||
if(_found)
|
||||
set(CURL_${component}_FOUND TRUE)
|
||||
elseif(CURL_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "CURL: Required protocol ${component} is not found")
|
||||
endif()
|
||||
else()
|
||||
list(FIND CURL_SUPPORTED_FEATURES ${component} _found)
|
||||
if(_found)
|
||||
set(CURL_${component}_FOUND TRUE)
|
||||
elseif(CURL_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "CURL: Required feature ${component} is not found")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(CURL
|
||||
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
|
||||
VERSION_VAR CURL_VERSION_STRING
|
||||
HANDLE_COMPONENTS)
|
||||
|
||||
if(CURL_FOUND)
|
||||
set(CURL_LIBRARIES ${CURL_LIBRARY})
|
||||
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||
|
||||
if(NOT TARGET CURL::libcurl)
|
||||
add_library(CURL::libcurl UNKNOWN IMPORTED)
|
||||
set_target_properties(CURL::libcurl PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
|
||||
|
||||
if(EXISTS "${CURL_LIBRARY}")
|
||||
set_target_properties(CURL::libcurl PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${CURL_LIBRARY}")
|
||||
endif()
|
||||
if(CURL_LIBRARY_RELEASE)
|
||||
set_property(TARGET CURL::libcurl APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(CURL::libcurl PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION_RELEASE "${CURL_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
if(CURL_LIBRARY_DEBUG)
|
||||
set_property(TARGET CURL::libcurl APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(CURL::libcurl PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
42
CMakeModules/FindCppUnit.cmake
Normal file
42
CMakeModules/FindCppUnit.cmake
Normal file
@@ -0,0 +1,42 @@
|
||||
# Locate CppUnit.
|
||||
#
|
||||
# This module defines
|
||||
# CPPUNIT_FOUND
|
||||
# CPPUNIT_LIBRARIES
|
||||
# CPPUNIT_INCLUDE_DIR
|
||||
|
||||
# Find CppUnit.
|
||||
if (NOT CPPUNIT_LIBRARIES AND NOT CPPUNIT_INCLUDE_DIR)
|
||||
# Find the headers.
|
||||
find_path(CPPUNIT_INCLUDE_DIR
|
||||
NAMES
|
||||
cppunit/Test.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
# Find the library.
|
||||
find_library(CPPUNIT_LIBRARIES
|
||||
NAMES
|
||||
cppunit
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
endif ()
|
||||
|
||||
|
||||
# Pre-set or found.
|
||||
if (CPPUNIT_LIBRARIES AND CPPUNIT_INCLUDE_DIR)
|
||||
set(CPPUNIT_FOUND TRUE)
|
||||
message(STATUS "CppUnit library found: ${CPPUNIT_LIBRARIES}")
|
||||
message(STATUS "CppUnit include directory found: ${CPPUNIT_INCLUDE_DIR}")
|
||||
endif ()
|
||||
37
CMakeModules/FindDBus.cmake
Normal file
37
CMakeModules/FindDBus.cmake
Normal file
@@ -0,0 +1,37 @@
|
||||
# Finding dbus (https://www.freedesktop.org/wiki/Software/dbus/)
|
||||
# Defining:
|
||||
# DBUS_LIBRARY
|
||||
# DBUS_INCLUDE_DIR
|
||||
|
||||
set(dbus_target "_no_target_")
|
||||
|
||||
if(WIN32)
|
||||
FIND_PATH(DBUS_INCLUDE_DIRS dbus/dbus.h PATH_SUFFIXES include HINTS ${ADDITIONAL_LIBRARY_PATHS})
|
||||
FIND_LIBRARY(DBUS_LIBRARIES NAMES dbus-1 PATH_SUFFIXES lib HINTS ${ADDITIONAL_LIBRARY_PATHS})
|
||||
|
||||
# define an imported target for DBus manually
|
||||
if (DBUS_INCLUDE_DIRS AND DBUS_LIBRARIES)
|
||||
add_library(DBus UNKNOWN IMPORTED)
|
||||
set_target_properties(DBus PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${DBUS_INCLUDE_DIRS}"
|
||||
IMPORTED_LOCATION "${DBUS_LIBRARIES}"
|
||||
)
|
||||
|
||||
set(HAVE_DBUS 1)
|
||||
set(dbus_target "DBus")
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(DBUS IMPORTED_TARGET dbus-1)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
|
||||
if(DBUS_FOUND)
|
||||
set(HAVE_DBUS 1)
|
||||
|
||||
# can't use an ALIAS here, needs CMake 3.11
|
||||
# use a global property instead
|
||||
set(dbus_target "PkgConfig::DBUS")
|
||||
endif(DBUS_FOUND)
|
||||
endif(WIN32)
|
||||
130
CMakeModules/FindFlite.cmake
Normal file
130
CMakeModules/FindFlite.cmake
Normal file
@@ -0,0 +1,130 @@
|
||||
# - Try to find Flite
|
||||
# Once done this will define
|
||||
#
|
||||
# FLITE_FOUND - system has Flite
|
||||
# FLITE_INCLUDE_DIRS - the Flite include directory
|
||||
# FLITE_LIBRARIES - Link these to use Flite
|
||||
# FLITE_DEFINITIONS - Compiler switches required for using Flite
|
||||
#
|
||||
# Copyright (c) 2013 Saikrishna Arcot <saiarcot895@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (FLITE_LIBRARIES AND FLITE_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(FLITE_FOUND TRUE)
|
||||
else (FLITE_LIBRARIES AND FLITE_INCLUDE_DIRS)
|
||||
#set(FLITE_DEFINITIONS ${_FliteCflags})
|
||||
set(FLITE_DEFINITIONS "")
|
||||
|
||||
find_path(FLITE_INCLUDE_DIR
|
||||
NAMES
|
||||
flite.h
|
||||
PATHS
|
||||
${_FliteIncDir}
|
||||
/usr/include
|
||||
/usr/include/flite
|
||||
/usr/local/include
|
||||
/usr/local/include/flite
|
||||
/opt/local/include
|
||||
/opt/local/include/flite
|
||||
/sw/include
|
||||
/sw/include/flite
|
||||
)
|
||||
|
||||
find_library(FLITE_LIBRARY
|
||||
NAMES
|
||||
flite
|
||||
Flite
|
||||
PATHS
|
||||
${_FliteLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
find_library(FLITE_CMU_US_KAL_LIBRARY
|
||||
NAMES
|
||||
flite_cmu_us_kal
|
||||
PATHS
|
||||
${_FliteLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
find_library(FLITE_CMULEX_LIBRARY
|
||||
NAMES
|
||||
flite_cmulex
|
||||
PATHS
|
||||
${_FliteLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
find_library(FLITE_USENGLISH_LIBRARY
|
||||
NAMES
|
||||
flite_usenglish
|
||||
PATHS
|
||||
${_FliteLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (FLITE_LIBRARY AND FLITE_CMU_US_KAL_LIBRARY AND FLITE_CMULEX_LIBRARY AND FLITE_USENGLISH_LIBRARY)
|
||||
set(FLITE_FOUND TRUE)
|
||||
endif (FLITE_LIBRARY AND FLITE_CMU_US_KAL_LIBRARY AND FLITE_CMULEX_LIBRARY AND FLITE_USENGLISH_LIBRARY)
|
||||
|
||||
set(FLITE_INCLUDE_DIRS
|
||||
${FLITE_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (FLITE_FOUND)
|
||||
set(FLITE_LIBRARIES
|
||||
${FLITE_LIBRARIES}
|
||||
${FLITE_LIBRARY}
|
||||
${FLITE_CMU_US_KAL_LIBRARY}
|
||||
${FLITE_CMULEX_LIBRARY}
|
||||
${FLITE_USENGLISH_LIBRARY}
|
||||
)
|
||||
endif (FLITE_FOUND)
|
||||
|
||||
if (FLITE_INCLUDE_DIRS AND FLITE_LIBRARIES)
|
||||
set(FLITE_FOUND TRUE)
|
||||
endif (FLITE_INCLUDE_DIRS AND FLITE_LIBRARIES)
|
||||
|
||||
if (FLITE_FOUND)
|
||||
if (NOT Flite_FIND_QUIETLY)
|
||||
message(STATUS "Found Flite and needed components: ${FLITE_LIBRARIES}")
|
||||
endif (NOT Flite_FIND_QUIETLY)
|
||||
|
||||
|
||||
if(NOT TARGET Flightgear::Flite)
|
||||
add_library(Flightgear::Flite UNKNOWN IMPORTED)
|
||||
set_target_properties(Flightgear::Flite PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FLITE_INCLUDE_DIRS}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${FLITE_LIBRARY}"
|
||||
INTERFACE_LINK_LIBRARIES "${FLITE_USENGLISH_LIBRARY};${FLITE_CMU_US_KAL_LIBRARY};${FLITE_CMULEX_LIBRARY}")
|
||||
endif()
|
||||
|
||||
else (FLITE_FOUND)
|
||||
if (Flite_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Flite or all components of Flite")
|
||||
endif (Flite_FIND_REQUIRED)
|
||||
endif (FLITE_FOUND)
|
||||
|
||||
# show the FLITE_INCLUDE_DIRS and FLITE_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(FLITE_INCLUDE_DIRS FLITE_LIBRARIES)
|
||||
|
||||
endif (FLITE_LIBRARIES AND FLITE_INCLUDE_DIRS)
|
||||
166
CMakeModules/FindGDAL.cmake
Normal file
166
CMakeModules/FindGDAL.cmake
Normal file
@@ -0,0 +1,166 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindGDAL
|
||||
--------
|
||||
|
||||
Find Geospatial Data Abstraction Library (GDAL).
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines :prop_tgt:`IMPORTED` target ``GDAL::GDAL``
|
||||
if GDAL has been found.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``GDAL_FOUND``
|
||||
True if GDAL is found.
|
||||
``GDAL_INCLUDE_DIRS``
|
||||
Include directories for GDAL headers.
|
||||
``GDAL_LIBRARIES``
|
||||
Libraries to link to GDAL.
|
||||
``GDAL_VERSION``
|
||||
The version of GDAL found.
|
||||
|
||||
Cache variables
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
The following cache variables may also be set:
|
||||
|
||||
``GDAL_LIBRARY``
|
||||
The libgdal library file.
|
||||
``GDAL_INCLUDE_DIR``
|
||||
The directory containing ``gdal.h``.
|
||||
|
||||
Hints
|
||||
^^^^^
|
||||
|
||||
Set ``GDAL_DIR`` or ``GDAL_ROOT`` in the environment to specify the
|
||||
GDAL installation prefix.
|
||||
#]=======================================================================]
|
||||
|
||||
# $GDALDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$GDAL_DIR
|
||||
# used in building gdal.
|
||||
#
|
||||
# Created by Eric Wing. I'm not a gdal user, but OpenSceneGraph uses it
|
||||
# for osgTerrain so I whipped this module together for completeness.
|
||||
# I actually don't know the conventions or where files are typically
|
||||
# placed in distros.
|
||||
# Any real gdal users are encouraged to correct this (but please don't
|
||||
# break the OS X framework stuff when doing so which is what usually seems
|
||||
# to happen).
|
||||
|
||||
# This makes the presumption that you are include gdal.h like
|
||||
#
|
||||
#include "gdal.h"
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(GDAL_INCLUDE_DIR gdal.h
|
||||
HINTS
|
||||
ENV GDAL_DIR
|
||||
ENV GDAL_ROOT
|
||||
PATH_SUFFIXES
|
||||
include/gdal
|
||||
include/GDAL
|
||||
include
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
# Use gdal-config to obtain the library version (this should hopefully
|
||||
# allow us to -lgdal1.x.y where x.y are correct version)
|
||||
# For some reason, libgdal development packages do not contain
|
||||
# libgdal.so...
|
||||
find_program(GDAL_CONFIG gdal-config
|
||||
HINTS
|
||||
ENV GDAL_DIR
|
||||
ENV GDAL_ROOT
|
||||
PATH_SUFFIXES bin
|
||||
)
|
||||
|
||||
if(GDAL_CONFIG)
|
||||
exec_program(${GDAL_CONFIG} ARGS --libs OUTPUT_VARIABLE GDAL_CONFIG_LIBS)
|
||||
|
||||
if(GDAL_CONFIG_LIBS)
|
||||
# treat the output as a command line and split it up
|
||||
separate_arguments(args NATIVE_COMMAND "${GDAL_CONFIG_LIBS}")
|
||||
|
||||
# only consider libraries whose name matches this pattern
|
||||
set(name_pattern "[gG][dD][aA][lL]")
|
||||
|
||||
# consider each entry as a possible library path, name, or parent directory
|
||||
foreach(arg IN LISTS args)
|
||||
# library name
|
||||
if("${arg}" MATCHES "^-l(.*)$")
|
||||
set(lib "${CMAKE_MATCH_1}")
|
||||
|
||||
# only consider libraries whose name matches the expected pattern
|
||||
if("${lib}" MATCHES "${name_pattern}")
|
||||
list(APPEND _gdal_lib "${lib}")
|
||||
endif()
|
||||
# library search path
|
||||
elseif("${arg}" MATCHES "^-L(.*)$")
|
||||
list(APPEND _gdal_libpath "${CMAKE_MATCH_1}")
|
||||
# assume this is a full path to a library
|
||||
elseif(IS_ABSOLUTE "${arg}" AND EXISTS "${arg}")
|
||||
# extract the file name
|
||||
get_filename_component(lib "${arg}" NAME)
|
||||
|
||||
# only consider libraries whose name matches the expected pattern
|
||||
if(NOT "${lib}" MATCHES "${name_pattern}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# extract the file directory
|
||||
get_filename_component(dir "${arg}" DIRECTORY)
|
||||
|
||||
# remove library prefixes/suffixes
|
||||
string(REGEX REPLACE "^(${CMAKE_SHARED_LIBRARY_PREFIX}|${CMAKE_STATIC_LIBRARY_PREFIX})" "" lib "${lib}")
|
||||
string(REGEX REPLACE "(${CMAKE_SHARED_LIBRARY_SUFFIX}|${CMAKE_STATIC_LIBRARY_SUFFIX})$" "" lib "${lib}")
|
||||
|
||||
# use the file name and directory as hints
|
||||
list(APPEND _gdal_libpath "${dir}")
|
||||
list(APPEND _gdal_lib "${lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(GDAL_LIBRARY
|
||||
NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
|
||||
HINTS
|
||||
ENV GDAL_DIR
|
||||
ENV GDAL_ROOT
|
||||
${_gdal_libpath}
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
|
||||
if (EXISTS "${GDAL_INCLUDE_DIR}/gdal_version.h")
|
||||
file(STRINGS "${GDAL_INCLUDE_DIR}/gdal_version.h" _gdal_version
|
||||
REGEX "GDAL_RELEASE_NAME")
|
||||
string(REGEX REPLACE ".*\"\(.*\)\"" "\\1" GDAL_VERSION "${_gdal_version}")
|
||||
unset(_gdal_version)
|
||||
else ()
|
||||
set(GDAL_VERSION GDAL_VERSION-NOTFOUND)
|
||||
endif ()
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL
|
||||
VERSION_VAR GDAL_VERSION
|
||||
REQUIRED_VARS GDAL_LIBRARY GDAL_INCLUDE_DIR)
|
||||
|
||||
if (GDAL_FOUND AND NOT TARGET GDAL::GDAL)
|
||||
add_library(GDAL::GDAL UNKNOWN IMPORTED)
|
||||
set_target_properties(GDAL::GDAL PROPERTIES
|
||||
IMPORTED_LOCATION "${GDAL_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
||||
set(GDAL_LIBRARIES ${GDAL_LIBRARY})
|
||||
set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
|
||||
97
CMakeModules/FindGit.cmake
Normal file
97
CMakeModules/FindGit.cmake
Normal file
@@ -0,0 +1,97 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindGit
|
||||
-------
|
||||
|
||||
The module defines the following ``IMPORTED`` targets (when
|
||||
:prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
|
||||
|
||||
``Git::Git``
|
||||
Executable of the Git command-line client.
|
||||
|
||||
The module defines the following variables:
|
||||
|
||||
``GIT_EXECUTABLE``
|
||||
Path to Git command-line client.
|
||||
``Git_FOUND``, ``GIT_FOUND``
|
||||
True if the Git command-line client was found.
|
||||
``GIT_VERSION_STRING``
|
||||
The version of Git found.
|
||||
|
||||
Example usage:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(Git)
|
||||
if(Git_FOUND)
|
||||
message("Git found: ${GIT_EXECUTABLE}")
|
||||
endif()
|
||||
#]=======================================================================]
|
||||
|
||||
# Look for 'git' or 'eg' (easy git)
|
||||
#
|
||||
set(git_names git eg)
|
||||
|
||||
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||
# in the MSYS shell.
|
||||
#
|
||||
if(CMAKE_HOST_WIN32)
|
||||
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||
set(git_names git.cmd git eg.cmd eg)
|
||||
# GitHub search path for Windows
|
||||
file(GLOB github_path
|
||||
"$ENV{LOCALAPPDATA}/Github/PortableGit*/cmd"
|
||||
"$ENV{LOCALAPPDATA}/Github/PortableGit*/bin"
|
||||
)
|
||||
# SourceTree search path for Windows
|
||||
set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# First search the PATH and specific locations.
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATHS ${github_path} ${_git_sourcetree_path}
|
||||
DOC "Git command line client"
|
||||
)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
# Now look for installations in Git/ directories under typical installation
|
||||
# prefixes on Windows. Exclude PATH from this search because VS 2017's
|
||||
# command prompt happens to have a PATH entry with a Git/ subdirectory
|
||||
# containing a minimal git not meant for general use.
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATH_SUFFIXES Git/cmd Git/bin
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
DOC "Git command line client"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GIT_EXECUTABLE)
|
||||
|
||||
unset(git_names)
|
||||
unset(_git_sourcetree_path)
|
||||
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE git_version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (git_version MATCHES "^git version [0-9]")
|
||||
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
|
||||
endif()
|
||||
unset(git_version)
|
||||
|
||||
get_property(_findgit_role GLOBAL PROPERTY CMAKE_ROLE)
|
||||
if(_findgit_role STREQUAL "PROJECT" AND NOT TARGET Git::Git)
|
||||
add_executable(Git::Git IMPORTED)
|
||||
set_property(TARGET Git::Git PROPERTY IMPORTED_LOCATION "${GIT_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(Git
|
||||
REQUIRED_VARS GIT_EXECUTABLE
|
||||
VERSION_VAR GIT_VERSION_STRING)
|
||||
86
CMakeModules/FindGsm.cmake
Normal file
86
CMakeModules/FindGsm.cmake
Normal file
@@ -0,0 +1,86 @@
|
||||
# - Try to find GSM
|
||||
# Once done this will define
|
||||
#
|
||||
# GSM_FOUND - system has GSM
|
||||
# GSM_INCLUDE_DIRS - the GSM include directory
|
||||
# GSM_LIBRARIES - Link these to use GSM
|
||||
# GSM_DEFINITIONS - Compiler switches required for using GSM
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
# Edited by Saikrishna Arcot <saiarcot895@gmail.com> to find the GSM library
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(GSM_FOUND TRUE)
|
||||
else (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||
|
||||
set(GSM_DEFINITIONS "")
|
||||
|
||||
# gsm.h might be at $prefix/include/gsm/gsm.h, but our internal
|
||||
# version is at inc/gsm.h, so we need to include that as a PATH_SUFFIX
|
||||
# otherwise we get into a mess.
|
||||
# see: https://sourceforge.net/p/flightgear/codetickets/2368/
|
||||
find_path(GSM_INCLUDE_DIR
|
||||
NAMES
|
||||
gsm.h
|
||||
PATHS
|
||||
${_GsmIncDir}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
PATH_SUFFIXES
|
||||
gsm
|
||||
)
|
||||
|
||||
find_library(GSM_LIBRARY
|
||||
NAMES
|
||||
gsm
|
||||
Gsm
|
||||
PATHS
|
||||
${_GsmLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (GSM_LIBRARY)
|
||||
set(GSM_FOUND TRUE)
|
||||
endif (GSM_LIBRARY)
|
||||
|
||||
set(GSM_INCLUDE_DIRS
|
||||
${GSM_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (GSM_FOUND)
|
||||
set(GSM_LIBRARIES
|
||||
${GSM_LIBRARIES}
|
||||
${GSM_LIBRARY}
|
||||
)
|
||||
endif (GSM_FOUND)
|
||||
|
||||
if (GSM_INCLUDE_DIRS AND GSM_LIBRARIES)
|
||||
set(GSM_FOUND TRUE)
|
||||
endif (GSM_INCLUDE_DIRS AND GSM_LIBRARIES)
|
||||
|
||||
if (GSM_FOUND)
|
||||
if (NOT Gsm_FIND_QUIETLY)
|
||||
message(STATUS "Found GSM: ${GSM_LIBRARIES}")
|
||||
endif (NOT Gsm_FIND_QUIETLY)
|
||||
else (GSM_FOUND)
|
||||
if (Gsm_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find GSM")
|
||||
endif (Gsm_FIND_REQUIRED)
|
||||
endif (GSM_FOUND)
|
||||
|
||||
# show the GSM_INCLUDE_DIRS and GSM_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(GSM_INCLUDE_DIRS GSM_LIBRARIES)
|
||||
|
||||
endif (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
|
||||
88
CMakeModules/FindHtsEngine.cmake
Normal file
88
CMakeModules/FindHtsEngine.cmake
Normal file
@@ -0,0 +1,88 @@
|
||||
# - Try to find HTS Engine
|
||||
# Once done this will define
|
||||
#
|
||||
# HTS_ENGINE_FOUND - system has HTS Engine
|
||||
# HTS_ENGINE_INCLUDE_DIRS - the HTS Engine include directory
|
||||
# HTS_ENGINE_LIBRARIES - Link these to use HTS Engine
|
||||
# HTS_ENGINE_DEFINITIONS - Compiler switches required for using HTS Engine
|
||||
#
|
||||
# Copyright (c) 2013 Saikrishna Arcot <saiarcot895@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(HTS_ENGINE_FOUND TRUE)
|
||||
else (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
|
||||
#set(HTS_ENGINE_DEFINITIONS ${_HTS_EngineCflags})
|
||||
set(HTS_ENGINE_DEFINITIONS "")
|
||||
|
||||
find_path(HTS_ENGINE_INCLUDE_DIR
|
||||
NAMES
|
||||
HTS_engine.h
|
||||
PATHS
|
||||
${_HTS_EngineIncDir}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
find_library(HTS_ENGINE_LIBRARY
|
||||
NAMES
|
||||
HTSEngine
|
||||
PATHS
|
||||
${_HTS_EngineLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (HTS_ENGINE_LIBRARY)
|
||||
set(HTS_ENGINE_FOUND TRUE)
|
||||
endif (HTS_ENGINE_LIBRARY)
|
||||
|
||||
set(HTS_ENGINE_INCLUDE_DIRS
|
||||
${HTS_ENGINE_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (HTS_ENGINE_FOUND)
|
||||
set(HTS_ENGINE_LIBRARIES
|
||||
${HTS_ENGINE_LIBRARIES}
|
||||
${HTS_ENGINE_LIBRARY}
|
||||
)
|
||||
endif (HTS_ENGINE_FOUND)
|
||||
|
||||
if (HTS_ENGINE_INCLUDE_DIRS AND HTS_ENGINE_LIBRARIES)
|
||||
set(HTS_ENGINE_FOUND TRUE)
|
||||
endif (HTS_ENGINE_INCLUDE_DIRS AND HTS_ENGINE_LIBRARIES)
|
||||
|
||||
if (HTS_ENGINE_FOUND)
|
||||
if (NOT HTS_Engine_FIND_QUIETLY)
|
||||
message(STATUS "Found HTS Engine: ${HTS_ENGINE_LIBRARIES}")
|
||||
endif (NOT HTS_Engine_FIND_QUIETLY)
|
||||
|
||||
if(NOT TARGET Flightgear::HTSEngine)
|
||||
add_library(Flightgear::HTSEngine UNKNOWN IMPORTED)
|
||||
set_target_properties(Flightgear::HTSEngine PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${HTS_ENGINE_INCLUDE_DIRS}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${HTS_ENGINE_LIBRARY}")
|
||||
endif()
|
||||
|
||||
else (HTS_ENGINE_FOUND)
|
||||
if (HTS_Engine_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find HTS Engine")
|
||||
endif (HTS_Engine_FIND_REQUIRED)
|
||||
endif (HTS_ENGINE_FOUND)
|
||||
|
||||
# show the HTS_ENGINE_INCLUDE_DIRS and HTS_ENGINE_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(HTS_ENGINE_INCLUDE_DIRS HTS_ENGINE_LIBRARIES)
|
||||
|
||||
endif (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
|
||||
|
||||
33
CMakeModules/FindLibEvent.cmake
Normal file
33
CMakeModules/FindLibEvent.cmake
Normal file
@@ -0,0 +1,33 @@
|
||||
# Finding LibEvent (https://libevent.org/)
|
||||
# Defining:
|
||||
# LIBEVENT_LIB
|
||||
# LIBEVENT_INCLUDE_DIR
|
||||
|
||||
set(libEvent_target "_no_target_")
|
||||
|
||||
if(WIN32)
|
||||
FIND_PATH(LIBEVENT_INCLUDE_DIR event2/event.h PATH_SUFFIXES include HINTS ${ADDITIONAL_LIBRARY_PATHS})
|
||||
FIND_LIBRARY(LIBEVENT_LIB NAMES event_core PATH_SUFFIXES lib HINTS ${ADDITIONAL_LIBRARY_PATHS})
|
||||
if (LIBEVENT_INCLUDE_DIR AND LIBEVENT_LIB)
|
||||
add_library(libEvent UNKNOWN IMPORTED)
|
||||
set_target_properties(libEvent PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT_INCLUDE_DIR}"
|
||||
IMPORTED_LOCATION "${LIBEVENT_LIB}"
|
||||
)
|
||||
set(libEvent_target "libEvent")
|
||||
endif()
|
||||
|
||||
|
||||
else()
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(libEvent IMPORTED_TARGET libevent)
|
||||
endif()
|
||||
|
||||
if(libEvent_FOUND)
|
||||
# can't use an ALIAS here, needs CMake 3.11
|
||||
# use a global property instead
|
||||
set(libEvent_target "PkgConfig::libEvent")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
124
CMakeModules/FindLibLZMA.cmake
Normal file
124
CMakeModules/FindLibLZMA.cmake
Normal file
@@ -0,0 +1,124 @@
|
||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#[=======================================================================[.rst:
|
||||
FindLibLZMA
|
||||
-----------
|
||||
|
||||
Find LZMA compression algorithm headers and library.
|
||||
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if
|
||||
liblzma has been found.
|
||||
|
||||
Result variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module will set the following variables in your project:
|
||||
|
||||
``LIBLZMA_FOUND``
|
||||
True if liblzma headers and library were found.
|
||||
``LIBLZMA_INCLUDE_DIRS``
|
||||
Directory where liblzma headers are located.
|
||||
``LIBLZMA_LIBRARIES``
|
||||
Lzma libraries to link against.
|
||||
``LIBLZMA_HAS_AUTO_DECODER``
|
||||
True if lzma_auto_decoder() is found (required).
|
||||
``LIBLZMA_HAS_EASY_ENCODER``
|
||||
True if lzma_easy_encoder() is found (required).
|
||||
``LIBLZMA_HAS_LZMA_PRESET``
|
||||
True if lzma_lzma_preset() is found (required).
|
||||
``LIBLZMA_VERSION_MAJOR``
|
||||
The major version of lzma
|
||||
``LIBLZMA_VERSION_MINOR``
|
||||
The minor version of lzma
|
||||
``LIBLZMA_VERSION_PATCH``
|
||||
The patch version of lzma
|
||||
``LIBLZMA_VERSION_STRING``
|
||||
version number as a string (ex: "5.0.3")
|
||||
#]=======================================================================]
|
||||
|
||||
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
|
||||
if(NOT LIBLZMA_LIBRARY)
|
||||
find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
|
||||
find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(LIBLZMA)
|
||||
else()
|
||||
file(TO_CMAKE_PATH "${LIBLZMA_LIBRARY}" LIBLZMA_LIBRARY)
|
||||
endif()
|
||||
|
||||
if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
|
||||
file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+")
|
||||
|
||||
string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
|
||||
string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
|
||||
string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
|
||||
|
||||
set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
|
||||
unset(LIBLZMA_HEADER_CONTENTS)
|
||||
endif()
|
||||
|
||||
# We're using new code known now as XZ, even library still been called LZMA
|
||||
# it can be found in http://tukaani.org/xz/
|
||||
# Avoid using old codebase
|
||||
if (LIBLZMA_LIBRARY)
|
||||
include(CheckLibraryExists)
|
||||
set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
|
||||
set(CMAKE_REQUIRED_QUIET ${LibLZMA_FIND_QUIETLY})
|
||||
if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
|
||||
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY})
|
||||
elseif(LIBLZMA_LIBRARY_RELEASE)
|
||||
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_RELEASE})
|
||||
elseif(LIBLZMA_LIBRARY_DEBUG)
|
||||
set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_DEBUG})
|
||||
endif()
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
|
||||
CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
|
||||
unset(LIBLZMA_LIBRARY_check)
|
||||
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY
|
||||
LIBLZMA_INCLUDE_DIR
|
||||
LIBLZMA_HAS_AUTO_DECODER
|
||||
LIBLZMA_HAS_EASY_ENCODER
|
||||
LIBLZMA_HAS_LZMA_PRESET
|
||||
VERSION_VAR LIBLZMA_VERSION_STRING
|
||||
)
|
||||
mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
|
||||
|
||||
if (LIBLZMA_FOUND)
|
||||
set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
|
||||
set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
|
||||
if(NOT TARGET LibLZMA::LibLZMA)
|
||||
add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED)
|
||||
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR}
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES C)
|
||||
|
||||
if(LIBLZMA_LIBRARY_RELEASE)
|
||||
set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${LIBLZMA_LIBRARY_RELEASE}")
|
||||
endif()
|
||||
|
||||
if(LIBLZMA_LIBRARY_DEBUG)
|
||||
set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY
|
||||
IMPORTED_CONFIGURATIONS DEBUG)
|
||||
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||
IMPORTED_LOCATION_DEBUG "${LIBLZMA_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
|
||||
if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
|
||||
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||
IMPORTED_LOCATION "${LIBLZMA_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
endif ()
|
||||
107
CMakeModules/FindPLIB.cmake
Normal file
107
CMakeModules/FindPLIB.cmake
Normal file
@@ -0,0 +1,107 @@
|
||||
# Locate PLIB
|
||||
# This module defines
|
||||
# PLIB_LIBRARIES
|
||||
# PLIB_FOUND, if false, do not try to link to PLIB
|
||||
# PLIB_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $PLIBDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$PLIBDIR
|
||||
# used in building PLIB.
|
||||
#
|
||||
# Created by James Turner. This was influenced by the FindOpenAL.cmake module.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
|
||||
FIND_PATH(PLIB_INCLUDE_DIR plib/ul.h
|
||||
PATH_SUFFIXES include
|
||||
HINTS $ENV{PLIBDIR}
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
set (PUNAME "pui")
|
||||
else (MSVC)
|
||||
set (PUNAME "pu")
|
||||
endif (MSVC)
|
||||
|
||||
|
||||
macro(find_static_component comp libs)
|
||||
# account for alternative Windows PLIB distribution naming
|
||||
if(MSVC)
|
||||
set(compLib "${comp}")
|
||||
else(MSVC)
|
||||
set(compLib "plib${comp}")
|
||||
endif(MSVC)
|
||||
|
||||
string(TOUPPER "PLIB_${comp}" compLibBase)
|
||||
set( compLibName ${compLibBase}_LIBRARY )
|
||||
|
||||
FIND_LIBRARY(${compLibName}_DEBUG
|
||||
NAMES ${compLib}_d plib_${compLib}_d
|
||||
HINTS $ENV{PLIBDIR}
|
||||
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
)
|
||||
FIND_LIBRARY(${compLibName}_RELEASE
|
||||
NAMES ${compLib} plib_${compLib}
|
||||
HINTS $ENV{PLIBDIR}
|
||||
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
)
|
||||
select_library_configurations( ${compLibBase} )
|
||||
|
||||
set(componentLibRelease ${${compLibName}_RELEASE})
|
||||
#message(STATUS "Simgear ${compLibName}_RELEASE ${componentLibRelease}")
|
||||
set(componentLibDebug ${${compLibName}_DEBUG})
|
||||
#message(STATUS "Simgear ${compLibName}_DEBUG ${componentLibDebug}")
|
||||
if (NOT ${compLibName}_DEBUG)
|
||||
if (NOT ${compLibName}_RELEASE)
|
||||
#message(STATUS "found ${componentLib}")
|
||||
list(APPEND ${libs} ${componentLibRelease})
|
||||
endif()
|
||||
else()
|
||||
list(APPEND ${libs} optimized ${componentLibRelease} debug ${componentLibDebug})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# based on the contents of deps, add other required PLIB
|
||||
# static library dependencies. Eg PUI requires FNT
|
||||
set(outDeps ${PLIB_FIND_COMPONENTS})
|
||||
|
||||
foreach(c ${PLIB_FIND_COMPONENTS})
|
||||
if (${c} STREQUAL "pu")
|
||||
# handle MSVC confusion over pu/pui naming, by removing
|
||||
# 'pu' and then adding it back
|
||||
list(REMOVE_ITEM outDeps "pu" "fnt" "sg")
|
||||
list(APPEND outDeps ${PUNAME} "sg")
|
||||
elseif (${c} STREQUAL "puaux")
|
||||
list(APPEND outDeps ${PUNAME} "sg")
|
||||
elseif (${c} STREQUAL "ssg")
|
||||
list(APPEND outDeps "sg")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(APPEND outDeps "ul") # everything needs ul
|
||||
list(REMOVE_DUPLICATES outDeps) # clean up
|
||||
|
||||
|
||||
# look for traditional static libraries
|
||||
foreach(component ${outDeps})
|
||||
find_static_component(${component} PLIB_LIBRARIES)
|
||||
endforeach()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PLIB DEFAULT_MSG PLIB_LIBRARIES PLIB_INCLUDE_DIR)
|
||||
47
CMakeModules/FindSQLite3.cmake
Normal file
47
CMakeModules/FindSQLite3.cmake
Normal file
@@ -0,0 +1,47 @@
|
||||
# Find Sqlite3
|
||||
# ~~~~~~~~~~~~
|
||||
# Copyright (c) 2007, Martin Dobias <wonder.sk at gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# CMake module to search for Sqlite3 library
|
||||
#
|
||||
# If it's found it sets SQLITE3_FOUND to TRUE
|
||||
# and following variables are set:
|
||||
# SQLITE3_INCLUDE_DIR
|
||||
# SQLITE3_LIBRARY
|
||||
|
||||
|
||||
# FIND_PATH and FIND_LIBRARY normally search standard locations
|
||||
# before the specified paths. To search non-standard paths first,
|
||||
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
|
||||
# and then again with no specified paths to search the default
|
||||
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
|
||||
# searching for the same item do nothing.
|
||||
|
||||
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
|
||||
PATH_SUFFIXES include
|
||||
HINTS $ENV{SQLITE3DIR}
|
||||
PATHS
|
||||
${ADDITIONAL_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 sqlite3
|
||||
HINTS $ENV{SQLITE3DIR}
|
||||
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
)
|
||||
|
||||
find_package(Threads)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLITE3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)
|
||||
|
||||
if(NOT TARGET fgsqlite3)
|
||||
add_library(fgsqlite3 UNKNOWN IMPORTED)
|
||||
set_target_properties(fgsqlite3 PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${SQLITE3_LIBRARY}"
|
||||
INTERFACE_LINK_LIBRARIES Threads::Threads)
|
||||
endif()
|
||||
87
CMakeModules/FindSpeex.cmake
Normal file
87
CMakeModules/FindSpeex.cmake
Normal file
@@ -0,0 +1,87 @@
|
||||
# - Try to find Speex
|
||||
# Once done this will define
|
||||
#
|
||||
# SPEEX_FOUND - system has Speex
|
||||
# SPEEX_INCLUDE_DIRS - the Speex include directory
|
||||
# SPEEX_LIBRARIES - Link these to use Speex
|
||||
# SPEEX_DEFINITIONS - Compiler switches required for using Speex
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(SPEEX_FOUND TRUE)
|
||||
else (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
#include(UsePkgConfig)
|
||||
|
||||
#FIXME pkgconfig does not work: return a carriage return that makes compilation failed
|
||||
#pkgconfig(speex _SpeexIncDir _SpeexLinkDir _SpeexLinkFlags _SpeexCflags)
|
||||
|
||||
#set(SPEEX_DEFINITIONS ${_SpeexCflags})
|
||||
set(SPEEX_DEFINITIONS "")
|
||||
|
||||
find_path(SPEEX_INCLUDE_DIR
|
||||
NAMES
|
||||
speex/speex.h
|
||||
speex.h
|
||||
PATHS
|
||||
${_SpeexIncDir}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
find_library(SPEEX_LIBRARY
|
||||
NAMES
|
||||
speex
|
||||
Speex
|
||||
PATHS
|
||||
${_SpeexLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (SPEEX_LIBRARY)
|
||||
set(SPEEX_FOUND TRUE)
|
||||
endif (SPEEX_LIBRARY)
|
||||
|
||||
set(SPEEX_INCLUDE_DIRS
|
||||
${SPEEX_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (SPEEX_FOUND)
|
||||
set(SPEEX_LIBRARIES
|
||||
${SPEEX_LIBRARIES}
|
||||
${SPEEX_LIBRARY}
|
||||
)
|
||||
endif (SPEEX_FOUND)
|
||||
|
||||
if (SPEEX_INCLUDE_DIRS AND SPEEX_LIBRARIES)
|
||||
set(SPEEX_FOUND TRUE)
|
||||
endif (SPEEX_INCLUDE_DIRS AND SPEEX_LIBRARIES)
|
||||
|
||||
if (SPEEX_FOUND)
|
||||
if (NOT Speex_FIND_QUIETLY)
|
||||
message(STATUS "Found Speex: ${SPEEX_LIBRARIES}")
|
||||
endif (NOT Speex_FIND_QUIETLY)
|
||||
else (SPEEX_FOUND)
|
||||
if (Speex_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Speex")
|
||||
endif (Speex_FIND_REQUIRED)
|
||||
endif (SPEEX_FOUND)
|
||||
|
||||
# show the SPEEX_INCLUDE_DIRS and SPEEX_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES)
|
||||
|
||||
endif (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)
|
||||
88
CMakeModules/FindSpeexdsp.cmake
Normal file
88
CMakeModules/FindSpeexdsp.cmake
Normal file
@@ -0,0 +1,88 @@
|
||||
# - Try to find Speex extended library
|
||||
# Once done this will define
|
||||
#
|
||||
# SPEEXDSP_FOUND - system has Speex extended library
|
||||
# SPEEXDSP_INCLUDE_DIRS - the Speex extended library include directory
|
||||
# SPEEXDSP_LIBRARIES - Link these to use Speex extended library
|
||||
# SPEEXDSP_DEFINITIONS - Compiler switches required for using Speex extended library
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
# Edited by Saikrishna Arcot <saiarcot895@gmail.com> to find the Speex extended library
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(SPEEXDSP_FOUND TRUE)
|
||||
else (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
#include(UsePkgConfig)
|
||||
|
||||
#FIXME pkgconfig does not work: return a carriage return that makes compilation failed
|
||||
#pkgconfig(speexdsp _SpeexDspIncDir _SpeexDspLinkDir _SpeexDspLinkFlags _SpeexDspCflags)
|
||||
|
||||
#set(SPEEXDSP_DEFINITIONS ${_SpeexDspCflags})
|
||||
set(SPEEXDSP_DEFINITIONS "")
|
||||
|
||||
find_path(SPEEXDSP_INCLUDE_DIR
|
||||
NAMES
|
||||
speex/speex_preprocess.h
|
||||
speex_preprocess.h
|
||||
PATHS
|
||||
${_SpeexDspIncDir}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
)
|
||||
|
||||
find_library(SPEEXDSP_LIBRARY
|
||||
NAMES
|
||||
speexdsp
|
||||
Speexdsp
|
||||
PATHS
|
||||
${_SpeexDspLinkDir}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (SPEEXDSP_LIBRARY)
|
||||
set(SPEEXDSP_FOUND TRUE)
|
||||
endif (SPEEXDSP_LIBRARY)
|
||||
|
||||
set(SPEEXDSP_INCLUDE_DIRS
|
||||
${SPEEXDSP_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (SPEEXDSP_FOUND)
|
||||
set(SPEEXDSP_LIBRARIES
|
||||
${SPEEXDSP_LIBRARIES}
|
||||
${SPEEXDSP_LIBRARY}
|
||||
)
|
||||
endif (SPEEXDSP_FOUND)
|
||||
|
||||
if (SPEEXDSP_INCLUDE_DIRS AND SPEEXDSP_LIBRARIES)
|
||||
set(SPEEXDSP_FOUND TRUE)
|
||||
endif (SPEEXDSP_INCLUDE_DIRS AND SPEEXDSP_LIBRARIES)
|
||||
|
||||
if (SPEEXDSP_FOUND)
|
||||
if (NOT Speexdsp_FIND_QUIETLY)
|
||||
message(STATUS "Found Speex extended library: ${SPEEXDSP_LIBRARIES}")
|
||||
endif (NOT Speexdsp_FIND_QUIETLY)
|
||||
else (SPEEXDSP_FOUND)
|
||||
if (Speexdsp_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Speex extended library")
|
||||
endif (Speexdsp_FIND_REQUIRED)
|
||||
endif (SPEEXDSP_FOUND)
|
||||
|
||||
# show the SPEEXDSP_INCLUDE_DIRS and SPEEXDSP_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(SPEEXDSP_INCLUDE_DIRS SPEEXDSP_LIBRARIES)
|
||||
|
||||
endif (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)
|
||||
51
CMakeModules/FindUDev.cmake
Normal file
51
CMakeModules/FindUDev.cmake
Normal file
@@ -0,0 +1,51 @@
|
||||
# Configure libudev environment
|
||||
#
|
||||
# UDEV_FOUND - system has a libudev
|
||||
# UDEV_INCLUDE_DIR - where to find header files
|
||||
# UDEV_LIBRARIES - the libraries to link against udev
|
||||
# UDEV_STABLE - it's true when is the version greater or equals to 143 - version when the libudev was stabilized in its API
|
||||
#
|
||||
# copyright (c) 2011 Petr Vanek <petr@scribus.info>
|
||||
# Redistribution and use of this file is allowed according to the terms of the BSD license.
|
||||
#
|
||||
|
||||
FIND_PATH(
|
||||
UDEV_INCLUDE_DIR
|
||||
libudev.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
${UDEV_PATH_INCLUDES}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
UDEV_LIBRARIES
|
||||
NAMES udev libudev
|
||||
PATHS ${ADDITIONAL_LIBRARY_PATHS}
|
||||
${UDEV_PATH_LIB}
|
||||
)
|
||||
|
||||
IF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
|
||||
SET(UDEV_FOUND "YES")
|
||||
execute_process(COMMAND pkg-config --atleast-version=143 libudev RESULT_VARIABLE UDEV_STABLE)
|
||||
# retvale is 0 of the condition is "true" so we need to negate the value...
|
||||
if (UDEV_STABLE)
|
||||
set(UDEV_STABLE 0)
|
||||
else (UDEV_STABLE)
|
||||
set(UDEV_STABLE 1)
|
||||
endif (UDEV_STABLE)
|
||||
message(STATUS "libudev stable: ${UDEV_STABLE}")
|
||||
ENDIF (UDEV_LIBRARIES AND UDEV_INCLUDE_DIR)
|
||||
|
||||
IF (UDEV_FOUND)
|
||||
MESSAGE(STATUS "Found UDev: ${UDEV_LIBRARIES}")
|
||||
MESSAGE(STATUS " include: ${UDEV_INCLUDE_DIR}")
|
||||
ELSE (UDEV_FOUND)
|
||||
MESSAGE(STATUS "UDev not found.")
|
||||
MESSAGE(STATUS "UDev: You can specify includes: -DUDEV_PATH_INCLUDES=/opt/udev/include")
|
||||
MESSAGE(STATUS " currently found includes: ${UDEV_INCLUDE_DIR}")
|
||||
MESSAGE(STATUS "UDev: You can specify libs: -DUDEV_PATH_LIB=/opt/udev/lib")
|
||||
MESSAGE(STATUS " currently found libs: ${UDEV_LIBRARIES}")
|
||||
IF (UDev_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find UDev library")
|
||||
ENDIF (UDev_FIND_REQUIRED)
|
||||
ENDIF (UDEV_FOUND)
|
||||
49
CMakeModules/FlightGearBundleInfo.plist.in
Normal file
49
CMakeModules/FlightGearBundleInfo.plist.in
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
|
||||
<!-- needed for FlightGear launch to function -->
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
|
||||
<!-- when launched via LaunchServices, run the launcher GUI -->
|
||||
<key>LSEnvironment</key>
|
||||
<dict>
|
||||
<key>FG_LAUNCHER</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
36
CMakeModules/FlightGearComponent.cmake
Normal file
36
CMakeModules/FlightGearComponent.cmake
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
macro(flightgear_component name sources)
|
||||
set(fc ${name})
|
||||
set(fh ${name})
|
||||
foreach(s ${sources})
|
||||
set_property(GLOBAL
|
||||
APPEND PROPERTY FG_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${s}")
|
||||
set(fc "${fc}#${CMAKE_CURRENT_SOURCE_DIR}/${s}")
|
||||
|
||||
# becuase we can't require CMake 3.13, we can't use CMP0076
|
||||
# so we need to manually resolve relative paths into absolute paths
|
||||
target_sources(fgfsObjects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${s})
|
||||
|
||||
endforeach()
|
||||
|
||||
foreach(h ${ARGV2})
|
||||
set_property(GLOBAL
|
||||
APPEND PROPERTY FG_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/${h}")
|
||||
set(fh "${fh}#${CMAKE_CURRENT_SOURCE_DIR}/${h}")
|
||||
|
||||
# becuase we can't require CMake 3.13, we can't use CMP0076
|
||||
# so we need to manually resolve relative paths into absolute paths
|
||||
target_sources(fgfsObjects PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${h})
|
||||
endforeach()
|
||||
|
||||
# third argument is TEST_SOURCES
|
||||
foreach(t ${ARGV3})
|
||||
set_property(GLOBAL
|
||||
APPEND PROPERTY FG_TEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${t}")
|
||||
set(fc "${fh}#${CMAKE_CURRENT_SOURCE_DIR}/${t}")
|
||||
endforeach()
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_C "${fc}@")
|
||||
set_property(GLOBAL APPEND PROPERTY FG_GROUPS_H "${fh}@")
|
||||
|
||||
endmacro()
|
||||
8
CMakeModules/GenerateBuildInfo.cmake
Normal file
8
CMakeModules/GenerateBuildInfo.cmake
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
add_custom_target(
|
||||
buildId
|
||||
${CMAKE_COMMAND} -D SRC=${CMAKE_SOURCE_DIR}
|
||||
-D DST=${CMAKE_BINARY_DIR}/src/Include/flightgearBuildId.h
|
||||
-P ${CMAKE_SOURCE_DIR}/CMakeModules/buildId.cmake
|
||||
)
|
||||
|
||||
22
CMakeModules/Installation.cmake
Normal file
22
CMakeModules/Installation.cmake
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
if (TARGET sentry_crashpad::handler)
|
||||
if (APPLE)
|
||||
# install inside the bundle
|
||||
install(FILES $<TARGET_FILE:sentry_crashpad::handler> DESTINATION fgfs.app/Contents/MacOS OPTIONAL)
|
||||
else()
|
||||
# install in the bin-dir, next to the application binary
|
||||
install(FILES $<TARGET_FILE:sentry_crashpad::handler> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
### uninstall target
|
||||
#-----------------------------------------------------------------------------
|
||||
CONFIGURE_FILE(
|
||||
"${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
|
||||
"${PROJECT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
"${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
|
||||
82
CMakeModules/SelectLibraryConfigurations.cmake
Normal file
82
CMakeModules/SelectLibraryConfigurations.cmake
Normal file
@@ -0,0 +1,82 @@
|
||||
# select_library_configurations( basename )
|
||||
#
|
||||
# This macro takes a library base name as an argument, and will choose good
|
||||
# values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and
|
||||
# basename_LIBRARY_RELEASE depending on what has been found and set. If only
|
||||
# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG,
|
||||
# and basename_LIBRARY_RELEASE will be set to the release value. If only
|
||||
# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY,
|
||||
# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value.
|
||||
#
|
||||
# If the generator supports configuration types, then basename_LIBRARY and
|
||||
# basename_LIBRARIES will be set with debug and optimized flags specifying the
|
||||
# library to be used for the given configuration. If no build type has been set
|
||||
# or the generator in use does not support configuration types, then
|
||||
# basename_LIBRARY and basename_LIBRARIES will take only the release values.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2009 Will Dicharry <wdicharry@stellarscience.com>
|
||||
# Copyright 2005-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
|
||||
# Dicharry <wdicharry@stellarscience.com>.
|
||||
|
||||
# Utility macro to check if one variable exists while another doesn't, and set
|
||||
# one that doesn't exist to the one that exists.
|
||||
macro( _set_library_name basename GOOD BAD )
|
||||
if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
|
||||
set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
|
||||
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
|
||||
endif( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
|
||||
endmacro( _set_library_name )
|
||||
|
||||
macro( select_library_configurations basename )
|
||||
# if only the release version was found, set the debug to be the release
|
||||
# version.
|
||||
_set_library_name( ${basename} RELEASE DEBUG )
|
||||
# if only the debug version was found, set the release value to be the
|
||||
# debug value.
|
||||
_set_library_name( ${basename} DEBUG RELEASE )
|
||||
if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
|
||||
# if the generator supports configuration types or CMAKE_BUILD_TYPE
|
||||
# is set, then set optimized and debug options.
|
||||
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
set( ${basename}_LIBRARY
|
||||
optimized ${${basename}_LIBRARY_RELEASE}
|
||||
debug ${${basename}_LIBRARY_DEBUG} )
|
||||
set( ${basename}_LIBRARIES
|
||||
optimized ${${basename}_LIBRARY_RELEASE}
|
||||
debug ${${basename}_LIBRARY_DEBUG} )
|
||||
else( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
# If there are no configuration types or build type, just use
|
||||
# the release version
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
|
||||
set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
|
||||
endif( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
|
||||
endif( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE )
|
||||
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
|
||||
"The ${basename} library" )
|
||||
|
||||
if( ${basename}_LIBRARY )
|
||||
set( ${basename}_FOUND TRUE )
|
||||
endif( ${basename}_LIBRARY )
|
||||
|
||||
mark_as_advanced( ${basename}_LIBRARY
|
||||
${basename}_LIBRARY_RELEASE
|
||||
${basename}_LIBRARY_DEBUG
|
||||
)
|
||||
endmacro( select_library_configurations )
|
||||
|
||||
19
CMakeModules/SetupFGFSBundle.cmake
Normal file
19
CMakeModules/SetupFGFSBundle.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
function(setup_fgfs_bundle target)
|
||||
execute_process(COMMAND date +%Y
|
||||
OUTPUT_VARIABLE CURRENT_YEAR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
# in our local CMakeModules dir
|
||||
set_target_properties(${target} PROPERTIES
|
||||
MACOSX_BUNDLE_INFO_PLIST FlightGearBundleInfo.plist.in
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER "org.flightgear.mac-nightly"
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${FLIGHTGEAR_VERSION}
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING "FlightGear ${FLIGHTGEAR_VERSION} Nightly"
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${FLIGHTGEAR_VERSION}
|
||||
MACOSX_BUNDLE_COPYRIGHT "FlightGear ${FLIGHTGEAR_VERSION} © 1997-${CURRENT_YEAR}, The FlightGear Project. Licensed under the GNU Public License version 2."
|
||||
MACOSX_BUNDLE_INFO_STRING "Nightly build of FlightGear ${FLIGHTGEAR_VERSION} for testing and development"
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "FlightGear"
|
||||
MACOSX_BUNDLE_ICON_FILE "FlightGear.icns"
|
||||
)
|
||||
endfunction()
|
||||
11
CMakeModules/SetupFGFSEmbeddedResources.cmake
Normal file
11
CMakeModules/SetupFGFSEmbeddedResources.cmake
Normal file
@@ -0,0 +1,11 @@
|
||||
function(setup_fgfs_embedded_resources)
|
||||
# On Windows, make sure fgrcc can be run (it needs third-party libraries)
|
||||
if(MSVC)
|
||||
if (FINAL_MSVC_3RDPARTY_DIR)
|
||||
set(CMAKE_MSVCIDE_RUN_PATH ${FINAL_MSVC_3RDPARTY_DIR}/bin PARENT_SCOPE)
|
||||
else()
|
||||
message(FATAL_ERROR "FINAL_MSVC_3RDPARTY_DIR is empty or unset")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
12
CMakeModules/SetupFGFSIncludes.cmake
Normal file
12
CMakeModules/SetupFGFSIncludes.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
function(setup_fgfs_includes target)
|
||||
if(ENABLE_JSBSIM)
|
||||
# FIXME - remove once JSBSim doesn't expose private headers
|
||||
target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/src/FDM/JSBSim)
|
||||
endif()
|
||||
|
||||
target_include_directories(${target} PRIVATE ${PLIB_INCLUDE_DIR})
|
||||
target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/cjson)
|
||||
# only actually needed for httpd.cxx
|
||||
target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/3rdparty/mongoose)
|
||||
|
||||
endfunction()
|
||||
148
CMakeModules/SetupFGFSLibraries.cmake
Normal file
148
CMakeModules/SetupFGFSLibraries.cmake
Normal file
@@ -0,0 +1,148 @@
|
||||
function(setup_fgfs_libraries target)
|
||||
if(RTI_FOUND)
|
||||
set(HLA_LIBRARIES ${RTI_LDFLAGS})
|
||||
else()
|
||||
set(HLA_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
if(ENABLE_JSBSIM)
|
||||
target_link_libraries(${target} JSBSim)
|
||||
endif()
|
||||
|
||||
if(ENABLE_IAX)
|
||||
target_link_libraries(${target} iaxclient_lib)
|
||||
endif()
|
||||
|
||||
if(HAVE_DBUS)
|
||||
# ALIAS doesn't work with CMake 3.10, so we need
|
||||
# variable to store the target name
|
||||
target_link_libraries(${target} ${dbus_target})
|
||||
endif()
|
||||
|
||||
if(X11_FOUND)
|
||||
target_link_libraries(${target} ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(ENABLE_OSGXR)
|
||||
target_link_libraries(${target} osgXR)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${target} fgsqlite3 fgvoicesynth fgembeddedresources)
|
||||
|
||||
target_link_libraries(${target}
|
||||
SimGearCore
|
||||
SimGearScene
|
||||
Boost::boost
|
||||
${EVENT_INPUT_LIBRARIES}
|
||||
${HLA_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${PLATFORM_LIBS}
|
||||
${PLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
if (ENABLE_SWIFT)
|
||||
# ALIAS doesn't work with CMake 3.10, so we need
|
||||
# variable to store the target name
|
||||
target_link_libraries(${target} ${dbus_target} ${libEvent_target})
|
||||
endif()
|
||||
|
||||
if (ENABLE_PLIB_JOYSTICK)
|
||||
target_link_libraries(${target} PLIBJoystick)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${target} PLIBFont)
|
||||
|
||||
if (HAVE_QT)
|
||||
target_link_libraries(${target} fglauncher fgqmlui)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
target_link_libraries(${target} execinfo)
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
target_link_libraries(${target} execinfo)
|
||||
endif()
|
||||
|
||||
if (TARGET sentry::sentry)
|
||||
target_link_libraries(${target} sentry::sentry)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
# CMake < 3.12 can't define a link to an OBJECT library to specify its include
|
||||
# paths, so we have to essentially duplicate the above and configure the paths manually.
|
||||
# Once we require CMake 3.12, delete all this and use the function above.
|
||||
|
||||
function (_apply_target_includes dest target)
|
||||
if (NOT TARGET ${target})
|
||||
return()
|
||||
endif()
|
||||
|
||||
# retrieve the list of includes from the target
|
||||
get_target_property(includes ${target} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
foreach(i ${includes})
|
||||
# skip any invalid includes
|
||||
if (NOT i)
|
||||
return()
|
||||
endif()
|
||||
|
||||
target_include_directories(${dest} PUBLIC ${i})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function (_apply_all_target_includes dest)
|
||||
foreach(arg IN LISTS ARGN)
|
||||
_apply_target_includes(${dest} ${arg})
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function (setup_fgfs_library_includes target)
|
||||
|
||||
_apply_all_target_includes(${target}
|
||||
SimGearCore
|
||||
SimGearScene
|
||||
Boost::boost
|
||||
${EVENT_INPUT_LIBRARIES}
|
||||
${HLA_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${PLATFORM_LIBS}
|
||||
${PLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
if(ENABLE_JSBSIM)
|
||||
_apply_target_includes(${target} JSBSim)
|
||||
endif()
|
||||
|
||||
if(ENABLE_OSGXR)
|
||||
_apply_target_includes(${target} osgXR)
|
||||
endif()
|
||||
|
||||
_apply_target_includes(${target} fgsqlite3)
|
||||
_apply_target_includes(${target} fgvoicesynth)
|
||||
_apply_target_includes(${target} fgembeddedresources)
|
||||
|
||||
if(ENABLE_IAX)
|
||||
_apply_target_includes(${target} iaxclient_lib)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SWIFT)
|
||||
_apply_all_target_includes(${target} ${dbus_target} ${libEvent_target})
|
||||
elseif(HAVE_DBUS)
|
||||
_apply_all_target_includes(${target} ${dbus_target})
|
||||
endif()
|
||||
|
||||
if (ENABLE_PLIB_JOYSTICK)
|
||||
_apply_target_includes(${target} PLIBJoystick)
|
||||
endif()
|
||||
|
||||
_apply_target_includes(${target} PLIBFont)
|
||||
|
||||
if (TARGET sentry::sentry)
|
||||
_apply_target_includes(${target} sentry::sentry)
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
19
CMakeModules/SetupMSVCGrouping.cmake
Normal file
19
CMakeModules/SetupMSVCGrouping.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
function(setup_msvc_grouping)
|
||||
get_property(FG_GROUPS_C GLOBAL PROPERTY FG_GROUPS_C)
|
||||
string(REPLACE "@" ";" groups ${FG_GROUPS_C} )
|
||||
foreach(g ${groups})
|
||||
string(REPLACE "#" ";" g2 ${g})
|
||||
list(GET g2 0 name)
|
||||
list(REMOVE_AT g2 0)
|
||||
source_group("${name}\\Sources" FILES ${g2})
|
||||
endforeach()
|
||||
|
||||
get_property(FG_GROUPS_H GLOBAL PROPERTY FG_GROUPS_H)
|
||||
string(REPLACE "@" ";" groups ${FG_GROUPS_H} )
|
||||
foreach(g ${groups})
|
||||
string(REPLACE "#" ";" g2 ${g})
|
||||
list(GET g2 0 name)
|
||||
list(REMOVE_AT g2 0)
|
||||
source_group("${name}\\Headers" FILES ${g2})
|
||||
endforeach()
|
||||
endfunction()
|
||||
19
CMakeModules/SetupSwiftLibraries.cmake
Normal file
19
CMakeModules/SetupSwiftLibraries.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
if (ENABLE_SWIFT)
|
||||
# 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})
|
||||
|
||||
find_package(DBus)
|
||||
find_package(LibEvent)
|
||||
|
||||
if (TARGET ${dbus_target} AND TARGET ${libEvent_target})
|
||||
message(STATUS "SWIFT support enabled")
|
||||
else()
|
||||
message(STATUS "SWIFT support disabled, dbus and/or LibEvent not found")
|
||||
set(ENABLE_SWIFT 0)
|
||||
endif()
|
||||
endif()
|
||||
96
CMakeModules/Translations.cmake
Normal file
96
CMakeModules/Translations.cmake
Normal file
@@ -0,0 +1,96 @@
|
||||
set(xlf_file "en_US/FlightGear-Qt.xlf")
|
||||
|
||||
if(EXISTS "${TRANSLATIONS_SRC_DIR}/${xlf_file}")
|
||||
message(STATUS "Using explicitly defined translations from: ${TRANSLATIONS_SRC_DIR}")
|
||||
set(do_translate TRUE)
|
||||
elseif(EXISTS "${FG_DATA_DIR}/Translations/${xlf_file}")
|
||||
set(TRANSLATIONS_SRC_DIR "${FG_DATA_DIR}/Translations")
|
||||
set(do_translate TRUE)
|
||||
message(STATUS "Found translations dir implicitly: ${TRANSLATIONS_SRC_DIR}")
|
||||
else()
|
||||
message(STATUS "Couldn't find translations data, will not include translated string in the executable")
|
||||
set(do_translate FALSE)
|
||||
endif()
|
||||
|
||||
find_package(Qt5 5.4 COMPONENTS LinguistTools)
|
||||
if (${do_translate} AND NOT TARGET Qt5::lrelease)
|
||||
set(do_translate FALSE)
|
||||
message(STATUS "Built-in translations disabled becuase Qt5 lrelease tool was not found."
|
||||
"\n(on Linux You may need to install an additional package containing the Qt5 translation tools)")
|
||||
endif()
|
||||
|
||||
|
||||
function(translation_dir_list result curdir)
|
||||
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
||||
set(dirlist "")
|
||||
foreach(child ${children})
|
||||
if (${child} STREQUAL "default")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
if (IS_DIRECTORY ${curdir}/${child})
|
||||
list(APPEND dirlist ${child})
|
||||
endif()
|
||||
endforeach()
|
||||
set(${result} ${dirlist} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if (${do_translate})
|
||||
translation_dir_list(LANGUAGES ${TRANSLATIONS_SRC_DIR})
|
||||
message(STATUS "Detected language files: ${LANGUAGES}")
|
||||
|
||||
set(translation_res "${PROJECT_BINARY_DIR}/translations.qrc")
|
||||
|
||||
add_custom_target(fgfs_qm_files ALL)
|
||||
|
||||
file(WRITE ${translation_res} "<RCC>\n<qresource prefix=\"/\">\n")
|
||||
|
||||
# qm generation and installation
|
||||
foreach(LANG ${LANGUAGES})
|
||||
# avoid issue if the FGData we found is a different version, and a translation is
|
||||
# missing: just skip it
|
||||
if (NOT EXISTS ${TRANSLATIONS_SRC_DIR}/${LANG}/FlightGear-Qt.xlf)
|
||||
continue()
|
||||
endif()
|
||||
|
||||
set(out_file "${PROJECT_BINARY_DIR}/FlightGear_${LANG}.qm")
|
||||
add_custom_command(
|
||||
OUTPUT ${out_file}
|
||||
COMMAND Qt5::lrelease ${TRANSLATIONS_SRC_DIR}/${LANG}/FlightGear-Qt.xlf
|
||||
-qm ${out_file}
|
||||
DEPENDS ${TRANSLATIONS_SRC_DIR}/${LANG}/FlightGear-Qt.xlf
|
||||
)
|
||||
add_custom_target(fgfs_${LANG}_qm ALL DEPENDS ${out_file})
|
||||
|
||||
add_dependencies(fgfs_qm_files fgfs_${LANG}_qm)
|
||||
|
||||
# fix for bug https://sourceforge.net/p/flightgear/codetickets/2406/
|
||||
# ensure we expose the English translations in a 'short' form, so that
|
||||
# the QTranslator search order finds it
|
||||
if (${LANG} STREQUAL "en_US")
|
||||
message(STATUS "Wibble")
|
||||
file(APPEND ${translation_res} "<file alias=\"FlightGear_en.qm\">FlightGear_${LANG}.qm</file>\n")
|
||||
else()
|
||||
# local path needed here, not absolute
|
||||
file(APPEND ${translation_res} "<file>FlightGear_${LANG}.qm</file>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${translation_res} "</qresource>\n</RCC>")
|
||||
|
||||
# set this so config.h can detect it
|
||||
set(HAVE_QRC_TRANSLATIONS TRUE)
|
||||
|
||||
add_custom_target(ts)
|
||||
|
||||
foreach(lang ${LANGUAGES})
|
||||
add_custom_target(
|
||||
ts_${lang}
|
||||
COMMAND Qt5::lupdate ${CMAKE_SOURCE_DIR}/src/GUI
|
||||
-locations relative -no-ui-lines -ts ${TRANSLATIONS_SRC_DIR}/${lang}/FlightGear-Qt.xlf
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
add_dependencies(ts ts_${lang})
|
||||
endforeach()
|
||||
endif() # of do translate
|
||||
|
||||
20
CMakeModules/buildId.cmake
Normal file
20
CMakeModules/buildId.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
if(NOT "$ENV{BUILD_ID}" STREQUAL "")
|
||||
set(JENKINS_BUILD_ID $ENV{BUILD_ID})
|
||||
set(JENKINS_BUILD_NUMBER $ENV{BUILD_NUMBER})
|
||||
message(STATUS "running under Jenkins, build-number is ${JENKINS_BUILD_NUMBER}")
|
||||
else()
|
||||
set(JENKINS_BUILD_NUMBER 0)
|
||||
set(JENKINS_BUILD_ID "none")
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if (Git_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir ${SRC}/.git rev-parse HEAD
|
||||
OUTPUT_VARIABLE REVISION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
message(STATUS "Git revision is ${REVISION}")
|
||||
else()
|
||||
set(REVISION "none")
|
||||
endif()
|
||||
|
||||
configure_file (${SRC}/src/Include/flightgearBuildId.h.cmake-in ${DST})
|
||||
22
CMakeModules/cmake_uninstall.cmake.in
Normal file
22
CMakeModules/cmake_uninstall.cmake.in
Normal file
@@ -0,0 +1,22 @@
|
||||
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
ENDIF()
|
||||
|
||||
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling \"${file}\"")
|
||||
IF(EXISTS "${file}")
|
||||
EXEC_PROGRAM(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF(NOT "${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(STATUS "File \"${file}\" does not exist.")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
Reference in New Issue
Block a user