ADD: new track message, Entity class and Position class
This commit is contained in:
105
libs/geographiclib/cmake/CMakeLists.txt
Normal file
105
libs/geographiclib/cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,105 @@
|
||||
# config file support for find_package (GeographicLib). This needs to
|
||||
# deal with two environments: (1) finding the build tree and (2)
|
||||
# finding the install tree. geographiclib-config.cmake detects which
|
||||
# situation it is handing by looking at @PROJECT_ROOT_DIR@. If
|
||||
# this is an absolute path, it's in the build tree; otherwise, it's in the
|
||||
# install tree. (Note that the whole install tree can be relocated.)
|
||||
|
||||
# Variables needed by ${PROJECT_NAME_LOWER}-config-version.cmake
|
||||
if (MSVC)
|
||||
# For checking the compatibility of MSVC_TOOLSET_VERSION; see
|
||||
# https://docs.microsoft.com/en-us/cpp/porting/overview-of-potential-upgrade-issues-visual-cpp
|
||||
# Assume major version number is obtained by dropping the last decimal
|
||||
# digit.
|
||||
math (EXPR MSVC_TOOLSET_MAJOR "${MSVC_TOOLSET_VERSION}/10")
|
||||
else ()
|
||||
set (MSVC_TOOLSET_VERSION 0)
|
||||
set (MSVC_TOOLSET_MAJOR 0)
|
||||
endif ()
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
# Ensure that all "true" (resp. "false") settings are represented by
|
||||
# the same string.
|
||||
set (CMAKE_CROSSCOMPILING_STR "ON")
|
||||
else ()
|
||||
set (CMAKE_CROSSCOMPILING_STR "OFF")
|
||||
endif ()
|
||||
|
||||
# geographiclib-config.cmake for the build tree
|
||||
set (PROJECT_ROOT_DIR "${PROJECT_BINARY_DIR}")
|
||||
set (PROJECT_INCLUDE_DIRS
|
||||
"${PROJECT_BINARY_DIR}/include" "${PROJECT_SOURCE_DIR}/include")
|
||||
|
||||
if (PROJECT_STATIC_LIBRARIES)
|
||||
set (CONFIG_STATIC_LIBRARIES "${PROJECT_NAME}::${PROJECT_STATIC_LIBRARIES}")
|
||||
else ()
|
||||
set (CONFIG_STATIC_LIBRARIES)
|
||||
endif ()
|
||||
if (PROJECT_SHARED_LIBRARIES)
|
||||
set (CONFIG_SHARED_LIBRARIES "${PROJECT_NAME}::${PROJECT_SHARED_LIBRARIES}")
|
||||
else ()
|
||||
set (CONFIG_SHARED_LIBRARIES)
|
||||
endif ()
|
||||
|
||||
configure_file (project-config.cmake.in
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake" @ONLY)
|
||||
configure_file (project-config-version.cmake.in
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY)
|
||||
export (TARGETS
|
||||
${PROJECT_ALL_LIBRARIES} ${TOOLS}
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-targets.cmake")
|
||||
|
||||
# geographiclib-config.cmake for the install tree. It's installed in
|
||||
# ${CMAKEDIR} and @PROJECT_ROOT_DIR@ is the relative path to the root
|
||||
# from there. (Note that the whole install tree can be relocated.)
|
||||
|
||||
if (CMAKEDIR)
|
||||
# Find root of install tree relative to CMAKEDIR
|
||||
file (RELATIVE_PATH PROJECT_ROOT_DIR
|
||||
"${CMAKE_INSTALL_PREFIX}/${CMAKEDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||
# strip trailing slash
|
||||
get_filename_component (PROJECT_ROOT_DIR "${PROJECT_ROOT_DIR}/." PATH)
|
||||
|
||||
# @PROJECT_INCLUDE_DIRS@ is not used in the install tree; reset
|
||||
# it to prevent the source and build paths appearing in the installed
|
||||
# config files
|
||||
set (PROJECT_INCLUDE_DIRS)
|
||||
configure_file (project-config.cmake.in project-config.cmake @ONLY)
|
||||
configure_file (project-config-version.cmake.in
|
||||
project-config-version.cmake @ONLY)
|
||||
install (FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
|
||||
DESTINATION "${CMAKEDIR}"
|
||||
RENAME "${PROJECT_NAME_LOWER}-config.cmake")
|
||||
install (FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
|
||||
DESTINATION "${CMAKEDIR}"
|
||||
RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
|
||||
# Make information about the cmake targets (the library and the tools)
|
||||
# available.
|
||||
install (EXPORT targets
|
||||
NAMESPACE ${PROJECT_NAME}::
|
||||
FILE ${PROJECT_NAME_LOWER}-targets.cmake
|
||||
DESTINATION "${CMAKEDIR}")
|
||||
|
||||
if (MSVC AND PACKAGE_DEBUG_LIBS)
|
||||
install (FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Export/${CMAKEDIR}/${PROJECT_NAME_LOWER}-targets-debug.cmake"
|
||||
DESTINATION "${CMAKEDIR}" CONFIGURATIONS Release)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Support for pkgconfig/geographiclib.pc
|
||||
set (prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set (exec_prefix "\${prefix}")
|
||||
set (libdir "\${exec_prefix}/${LIBDIR}")
|
||||
set (includedir "\${prefix}/${INCDIR}")
|
||||
set (bindir "\${exec_prefix}/${BINDIR}")
|
||||
set (PACKAGE_NAME "${PROJECT_NAME}")
|
||||
set (PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
|
||||
configure_file (project.pc.in geographiclib.pc @ONLY)
|
||||
if (PKGDIR)
|
||||
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/geographiclib.pc"
|
||||
DESTINATION "${PKGDIR}")
|
||||
endif ()
|
||||
41
libs/geographiclib/cmake/FindGeographicLib.cmake
Normal file
41
libs/geographiclib/cmake/FindGeographicLib.cmake
Normal file
@@ -0,0 +1,41 @@
|
||||
# Look for GeographicLib
|
||||
#
|
||||
# Set
|
||||
# GeographicLib_FOUND = TRUE
|
||||
# GeographicLib_INCLUDE_DIRS = /usr/local/include
|
||||
# GeographicLib_LIBRARIES = /usr/local/lib/libGeographicLib.so
|
||||
# GeographicLib_LIBRARY_DIRS = /usr/local/lib
|
||||
|
||||
find_library (GeographicLib_LIBRARIES GeographicLib
|
||||
PATHS "${CMAKE_INSTALL_PREFIX}/../GeographicLib/lib")
|
||||
|
||||
if (GeographicLib_LIBRARIES)
|
||||
get_filename_component (GeographicLib_LIBRARY_DIRS
|
||||
"${GeographicLib_LIBRARIES}" PATH)
|
||||
get_filename_component (_ROOT_DIR "${GeographicLib_LIBRARY_DIRS}" PATH)
|
||||
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
|
||||
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
|
||||
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
|
||||
# On Debian systems the library is in e.g.,
|
||||
# /usr/lib/x86_64-linux-gnu/libGeographicLib.so
|
||||
# so try stripping another element off _ROOT_DIR
|
||||
get_filename_component (_ROOT_DIR "${_ROOT_DIR}" PATH)
|
||||
set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include")
|
||||
set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin")
|
||||
if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h")
|
||||
unset (GeographicLib_INCLUDE_DIRS)
|
||||
unset (GeographicLib_LIBRARIES)
|
||||
unset (GeographicLib_LIBRARY_DIRS)
|
||||
unset (GeographicLib_BINARY_DIRS)
|
||||
endif ()
|
||||
endif ()
|
||||
unset (_ROOT_DIR)
|
||||
endif ()
|
||||
|
||||
# This sets GeographicLib_FOUND (and GEOGRAPHICLIB_FOUND, deprecated) to TRUE
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (GeographicLib DEFAULT_MSG
|
||||
GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
|
||||
GeographicLib_INCLUDE_DIRS)
|
||||
mark_as_advanced (GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES
|
||||
GeographicLib_INCLUDE_DIRS)
|
||||
14
libs/geographiclib/cmake/Makefile.am
Normal file
14
libs/geographiclib/cmake/Makefile.am
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Makefile.am
|
||||
#
|
||||
# Copyright (C) 2011-2022, Charles Karney <charles@karney.com>
|
||||
|
||||
cmakedir=$(datadir)/cmake/GeographicLib
|
||||
|
||||
install:
|
||||
$(INSTALL) -d $(DESTDIR)$(cmakedir)
|
||||
$(INSTALL) -m 644 $(srcdir)/FindGeographicLib.cmake \
|
||||
$(DESTDIR)$(cmakedir)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt FindGeographicLib.cmake \
|
||||
project-config-version.cmake.in project-config.cmake.in
|
||||
82
libs/geographiclib/cmake/maintainer-man.cmake
Normal file
82
libs/geographiclib/cmake/maintainer-man.cmake
Normal file
@@ -0,0 +1,82 @@
|
||||
# In non-RELEASE mode the mans pages are in pod format
|
||||
|
||||
add_custom_target (man ALL)
|
||||
set (MANPAGES)
|
||||
set (USAGE)
|
||||
set (HTMLMAN)
|
||||
|
||||
foreach (TOOL ${TOOLS})
|
||||
set (MANPAGES ${MANPAGES} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.1)
|
||||
set (USAGE ${USAGE} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.usage)
|
||||
set (HTMLMAN ${HTMLMAN} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.1.html)
|
||||
|
||||
if (MAINTAINER)
|
||||
|
||||
# A maintainer can transform these to man, html, and usage formats.
|
||||
add_custom_command (OUTPUT ${TOOL}.1
|
||||
COMMAND ${POD2MAN} --center=\"GeographicLib Utilities\"
|
||||
--release=\"GeographicLib ${PROJECT_VERSION}\"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod > ${TOOL}.1
|
||||
COMMENT "Building man page for ${TOOL}"
|
||||
MAIN_DEPENDENCY ${TOOL}.pod)
|
||||
add_custom_command (OUTPUT ${TOOL}.1.html COMMAND
|
||||
${POD2HTML} --title "'${TOOL}(1)'"
|
||||
--noindex ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod |
|
||||
sed
|
||||
-e 's%<head>%<head><link href="http://search.cpan.org/s/style.css" rel="stylesheet" type="text/css">%'
|
||||
-e 's%<code>\\\([^<>]*\\\)\(\\\(.\\\)\)</code>%<a href="\\1.\\2.html">&</a>%'g > ${TOOL}.1.html
|
||||
COMMENT "Building html version of man page for ${TOOL}"
|
||||
MAIN_DEPENDENCY ${TOOL}.pod)
|
||||
add_custom_command (OUTPUT ${TOOL}.usage
|
||||
COMMAND env POD2MAN=${POD2MAN} COL=${COL}
|
||||
sh ${CMAKE_CURRENT_SOURCE_DIR}/makeusage.sh
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod ${PROJECT_VERSION}
|
||||
> ${TOOL}.usage
|
||||
COMMENT "Building usage code for ${TOOL}"
|
||||
MAIN_DEPENDENCY ${TOOL}.pod)
|
||||
|
||||
else ()
|
||||
|
||||
# Otherwise, dummy versions of these pages are created from
|
||||
# templates dummy.XXX.in. These dummy versions point to the online
|
||||
# documentation.
|
||||
configure_file (dummy.usage.in ${TOOL}.usage @ONLY)
|
||||
configure_file (dummy.1.in ${TOOL}.1 @ONLY)
|
||||
configure_file (dummy.1.html.in ${TOOL}.1.html @ONLY)
|
||||
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (MANDIR AND BINDIR)
|
||||
install (FILES ${MANPAGES} DESTINATION ${MANDIR}/man1)
|
||||
endif ()
|
||||
|
||||
if (MAINTAINER)
|
||||
add_custom_target (manpages ALL DEPENDS ${MANPAGES}
|
||||
COMMENT "Building all the man pages")
|
||||
add_custom_target (usage ALL DEPENDS ${USAGE}
|
||||
COMMENT "Converting the man pages to online usage")
|
||||
add_custom_target (htmlman ALL DEPENDS ${HTMLMAN}
|
||||
COMMENT "Building html versions of the man pages")
|
||||
else ()
|
||||
add_custom_target (manpages ALL DEPENDS ${MANPAGES}
|
||||
COMMENT "Building dummy man pages")
|
||||
add_custom_target (usage ALL DEPENDS ${USAGE}
|
||||
COMMENT "Converting dummy man pages to online usage")
|
||||
add_custom_target (htmlman ALL DEPENDS ${HTMLMAN}
|
||||
COMMENT "Building dummy html versions of the man pages")
|
||||
endif ()
|
||||
|
||||
add_dependencies (man manpages usage htmlman)
|
||||
|
||||
if (MAINTAINER)
|
||||
# The distrib-man target copies the derived documentation files into
|
||||
# the source tree.
|
||||
add_custom_target (distrib-man)
|
||||
add_dependencies (distrib-man man)
|
||||
add_custom_command (TARGET distrib-man
|
||||
COMMAND
|
||||
for f in ${MANPAGES} ${USAGE} ${HTMLMAN}\; do
|
||||
install -C -m 644 "$$f" ../distrib/${PACKAGE_DIR}/man\; done
|
||||
COMMENT "Installing man documentation page in source tree")
|
||||
endif ()
|
||||
123
libs/geographiclib/cmake/maintainer-top.cmake
Normal file
123
libs/geographiclib/cmake/maintainer-top.cmake
Normal file
@@ -0,0 +1,123 @@
|
||||
set (DISTRIB_DIR "${CMAKE_BINARY_DIR}/distrib")
|
||||
set (DISTRIB_NAME "${DISTRIB_DIR}/${PACKAGE_DIR}")
|
||||
add_custom_target (prep-source
|
||||
COMMAND ${CMAKE_MAKE_PROGRAM} package_source
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf ${DISTRIB_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
_CPack_Packages/Linux-Source/TGZ/${PACKAGE_DIR} ${DISTRIB_NAME}
|
||||
COMMAND cd ${DISTRIB_NAME} &&
|
||||
find * -type f | sort -u > ${DISTRIB_DIR}/files.1 &&
|
||||
( cd ${PROJECT_SOURCE_DIR} && git ls-files ) |
|
||||
sort -u > ${DISTRIB_DIR}/files.2 &&
|
||||
comm -23 ${DISTRIB_DIR}/files.[12] | xargs -r -d '\\n' rm
|
||||
# Remove now empty directories
|
||||
COMMAND for p in 1 2 3 4 5\; do
|
||||
find ${DISTRIB_NAME} -type d -empty -print0 | xargs -0r rmdir\; done
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -f autogen.done)
|
||||
add_custom_command (OUTPUT autogen.done
|
||||
COMMAND cd ${DISTRIB_NAME} && ${PROJECT_SOURCE_DIR}/autogen.sh &&
|
||||
touch ${PROJECT_BINARY_DIR}/autogen.done
|
||||
DEPENDS prep-source autogen.sh configure.ac
|
||||
Makefile.am src/Makefile.am include/Makefile.am tools/Makefile.am
|
||||
doc/Makefile.am man/Makefile.am cmake/Makefile.am
|
||||
examples/Makefile.am tests/Makefile.am)
|
||||
add_dependencies (distrib-man prep-source)
|
||||
add_custom_target (distrib-all DEPENDS distrib-man autogen.done)
|
||||
add_custom_command (TARGET distrib-all
|
||||
COMMAND cd ${DISTRIB_NAME} && echo ${PROJECT_VERSION} > VERSION &&
|
||||
chmod -R g-w .)
|
||||
add_custom_target (dist
|
||||
COMMAND
|
||||
cd ${DISTRIB_DIR} &&
|
||||
find ${PACKAGE_DIR} -type f | tar cfzT ${PACKAGE_NAME}.tar.gz -
|
||||
COMMAND
|
||||
rm -f ${DISTRIB_DIR}/${PACKAGE_NAME}.zip &&
|
||||
cd ${DISTRIB_DIR} &&
|
||||
find ${PACKAGE_DIR} -type f | zip -q ${PACKAGE_NAME}.zip -@
|
||||
COMMENT "created distrib/${PACKAGE_NAME}.{tar.gz,zip}")
|
||||
add_dependencies (dist distrib-all)
|
||||
|
||||
if (RSYNC)
|
||||
set (USER karney)
|
||||
set (DATATOP $ENV{HOME}/web/geographiclib-files)
|
||||
set (DATAROOT ${DATATOP}/distrib-C++)
|
||||
set (DOCTOP $ENV{HOME}/web/geographiclib-web)
|
||||
set (DOCROOT ${DOCTOP}/htdocs/C++)
|
||||
set (CGIROOT ${DOCTOP}/cgi-bin)
|
||||
set (GEOIDROOT ${DOCTOP}/geoids)
|
||||
set (FRSDEPLOY ${USER}@frs.sourceforge.net:/home/frs/project/geographiclib)
|
||||
set (WEBDEPLOY ${USER},geographiclib@web.sourceforge.net:.)
|
||||
|
||||
add_custom_target (stage-dist
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${DISTRIB_DIR}/${PACKAGE_NAME}.tar.gz
|
||||
${DISTRIB_DIR}/${PACKAGE_NAME}.zip
|
||||
${PROJECT_SOURCE_DIR}/data-distrib/distrib-C++/)
|
||||
add_dependencies (stage-dist dist)
|
||||
|
||||
if (BUILD_DOCUMENTATION)
|
||||
add_custom_target (stage-doc
|
||||
COMMAND ${RSYNC} --delete -a doc/html/ ${DOCROOT}/${PROJECT_VERSION}/)
|
||||
add_dependencies (stage-doc doc)
|
||||
endif ()
|
||||
|
||||
add_custom_target (deploy-dist
|
||||
COMMAND
|
||||
${RSYNC} --delete -av --exclude '*~'
|
||||
${PROJECT_SOURCE_DIR}/data-distrib/distrib-C++/ ${DATAROOT}/ &&
|
||||
${RSYNC} --delete -av
|
||||
${PROJECT_SOURCE_DIR}/data-distrib/00README.md
|
||||
${PROJECT_SOURCE_DIR}/data-distrib/distrib ${DATATOP}/
|
||||
COMMAND ${RSYNC} --delete -av
|
||||
${DATAROOT} ${DATATOP}/00README.md ${DATATOP}/distrib
|
||||
${USER}@frs.sourceforge.net:/home/frs/project/geographiclib/)
|
||||
add_custom_target (deploy-data
|
||||
COMMAND
|
||||
${RSYNC} --delete -av --exclude '*~'
|
||||
${PROJECT_SOURCE_DIR}/data-distrib/*-distrib ${DATATOP}/
|
||||
COMMAND ${RSYNC} --delete -av ${DATATOP}/*-distrib
|
||||
${USER}@frs.sourceforge.net:/home/frs/project/geographiclib/)
|
||||
add_custom_target (deploy-doc
|
||||
COMMAND ${RSYNC} --delete -av -e ssh ${DOCROOT} ${WEBDEPLOY}/htdocs/)
|
||||
|
||||
set (CGI_SCRIPTS
|
||||
GeoConvert GeodSolve GeoidEval Planimeter RhumbSolve printlogs Geod)
|
||||
set (CGI_UTILS utils)
|
||||
|
||||
add_custom_target (stage-cgi
|
||||
COMMAND for f in ${CGI_SCRIPTS}\; do
|
||||
install -C $$f.cgi ${CGIROOT}/$$f\; done
|
||||
COMMAND for f in ${CGI_UTILS}\; do
|
||||
install -C -m 644 $$f.sh ${CGIROOT}/$$f.sh\; done
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cgi-bin)
|
||||
|
||||
add_custom_target (deploy-cgi
|
||||
COMMAND ${RSYNC} --delete -av -e ssh ${CGIROOT} ${GEOIDROOT} ${WEBDEPLOY}/)
|
||||
|
||||
endif ()
|
||||
|
||||
if (NOT WIN32)
|
||||
set (BINARY_EXT "m4|gif|pdf|png|kmz")
|
||||
add_custom_target (checktrailingspace
|
||||
COMMAND git ls-files |
|
||||
egrep -v '\\.\(${BINARY_EXT}\)$$' |
|
||||
xargs grep '[ \t]$$' || true
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Looking for trailing spaces")
|
||||
add_custom_target (checktabs
|
||||
COMMAND git ls-files |
|
||||
egrep -v '\([Mm]akefile|test-distribution.sh|\\.\(${BINARY_EXT}\)$$\)' |
|
||||
xargs grep -l '\t' || true
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Looking for tabs")
|
||||
add_custom_target (checkblanklines
|
||||
COMMAND git ls-files |
|
||||
egrep -v '\\.\(${BINARY_EXT}\)$$' |
|
||||
while read f\; do tr 'X\\n' 'YX' < $$f |
|
||||
egrep '\(^X|XXX|XX$$|[^X]$$\)' > /dev/null && echo $$f\; done || true
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Looking for extra blank lines")
|
||||
|
||||
add_custom_target (sanitize)
|
||||
add_dependencies (sanitize checktrailingspace checktabs checkblanklines)
|
||||
endif ()
|
||||
90
libs/geographiclib/cmake/project-config-version.cmake.in
Normal file
90
libs/geographiclib/cmake/project-config-version.cmake.in
Normal file
@@ -0,0 +1,90 @@
|
||||
# Version checking for @PROJECT_NAME@
|
||||
|
||||
set (PACKAGE_VERSION "@PROJECT_VERSION@")
|
||||
set (PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
|
||||
set (PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
|
||||
set (PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@")
|
||||
|
||||
# These variable definitions parallel those in @PROJECT_NAME@'s
|
||||
# cmake/CMakeLists.txt.
|
||||
if (MSVC)
|
||||
# For checking the compatibility of MSVC_TOOLSET_VERSION; see
|
||||
# https://docs.microsoft.com/en-us/cpp/porting/overview-of-potential-upgrade-issues-visual-cpp
|
||||
# Assume major version number is obtained by dropping the last decimal
|
||||
# digit.
|
||||
math (EXPR MSVC_TOOLSET_MAJOR "${MSVC_TOOLSET_VERSION}/10")
|
||||
endif ()
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
# Ensure that all "true" (resp. "false") settings are represented by
|
||||
# the same string.
|
||||
set (CMAKE_CROSSCOMPILING_STR "ON")
|
||||
else ()
|
||||
set (CMAKE_CROSSCOMPILING_STR "OFF")
|
||||
endif ()
|
||||
|
||||
if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@")
|
||||
# Check package name (in particular, because of the way cmake finds
|
||||
# package config files, the capitalization could easily be "wrong").
|
||||
# This is necessary to ensure that the automatically generated
|
||||
# variables, e.g., <package>_FOUND, are consistently spelled.
|
||||
set (REASON "package = @PROJECT_NAME@, NOT ${PACKAGE_FIND_NAME}")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR
|
||||
CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@))
|
||||
# Reject if there's a 32-bit/64-bit mismatch (not necessary with Apple
|
||||
# since a multi-architecture library is built for that platform).
|
||||
set (REASON "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (MSVC AND NOT (
|
||||
# toolset version must be at least as great as @PROJECT_NAME@'s.
|
||||
MSVC_TOOLSET_VERSION GREATER_EQUAL @MSVC_TOOLSET_VERSION@
|
||||
# and major versions must match
|
||||
AND MSVC_TOOLSET_MAJOR EQUAL @MSVC_TOOLSET_MAJOR@ ))
|
||||
# Reject if there's a mismatch in MSVC compiler versions.
|
||||
set (REASON "MSVC_TOOLSET_VERSION = @MSVC_TOOLSET_VERSION@")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (GEOGRAPHICLIB_PRECISION MATCHES "^[1-5]\$" AND NOT (
|
||||
GEOGRAPHICLIB_PRECISION EQUAL @GEOGRAPHICLIB_PRECISION@ ))
|
||||
# Reject if the user asks for an incompatible precsision.
|
||||
set (REASON "GEOGRAPHICLIB_PRECISION = @GEOGRAPHICLIB_PRECISION@")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (NOT CMAKE_CROSSCOMPILING_STR STREQUAL "@CMAKE_CROSSCOMPILING_STR@")
|
||||
# Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}.
|
||||
set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (CMAKE_CROSSCOMPILING AND
|
||||
NOT (CMAKE_SYSTEM_NAME STREQUAL "@CMAKE_SYSTEM_NAME@" AND
|
||||
CMAKE_SYSTEM_PROCESSOR STREQUAL "@CMAKE_SYSTEM_PROCESSOR@"))
|
||||
# Reject if cross-compiling and there's a mismatch in the target system.
|
||||
set (REASON "target = @CMAKE_SYSTEM_NAME@-@CMAKE_SYSTEM_PROCESSOR@")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
elseif (PACKAGE_FIND_VERSION)
|
||||
if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
|
||||
set (PACKAGE_VERSION_EXACT TRUE)
|
||||
elseif (PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION
|
||||
AND PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR)
|
||||
set (PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set (@PROJECT_NAME@_SHARED_FOUND @GEOGRAPHICLIB_SHARED_LIB@)
|
||||
set (@PROJECT_NAME@_STATIC_FOUND @GEOGRAPHICLIB_STATIC_LIB@)
|
||||
|
||||
# Check for the components requested. The convention is that
|
||||
# @PROJECT_NAME@_${comp}_FOUND should be true for all the required
|
||||
# components.
|
||||
if (@PROJECT_NAME@_FIND_COMPONENTS)
|
||||
foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS})
|
||||
if (@PROJECT_NAME@_FIND_REQUIRED_${comp} AND
|
||||
NOT @PROJECT_NAME@_${comp}_FOUND)
|
||||
set (REASON "without ${comp}")
|
||||
set (PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
# If unsuitable, append the reason to the package version so that it's
|
||||
# visible to the user.
|
||||
if (PACKAGE_VERSION_UNSUITABLE)
|
||||
set (PACKAGE_VERSION "${PACKAGE_VERSION} (${REASON})")
|
||||
endif ()
|
||||
97
libs/geographiclib/cmake/project-config.cmake.in
Normal file
97
libs/geographiclib/cmake/project-config.cmake.in
Normal file
@@ -0,0 +1,97 @@
|
||||
# Configure @PROJECT_NAME@
|
||||
#
|
||||
# Set
|
||||
# @PROJECT_NAME@_FOUND = TRUE
|
||||
# @PROJECT_NAME@_INCLUDE_DIRS = /usr/local/include
|
||||
# @PROJECT_NAME@_SHARED_LIBRARIES = GeographicLib_SHARED (or empty)
|
||||
# @PROJECT_NAME@_STATIC_LIBRARIES = GeographicLib_STATIC (or empty)
|
||||
# @PROJECT_NAME@_LIBRARY_DIRS = /usr/local/lib
|
||||
# @PROJECT_NAME@_BINARY_DIRS = /usr/local/bin
|
||||
# @PROJECT_NAME@_VERSION = 1.34 (for example)
|
||||
# @PROJECT_NAME_UPPER@_DATA = /usr/local/share/GeographicLib (for example)
|
||||
# Depending on @PROJECT_NAME@_USE_STATIC_LIBS
|
||||
# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_SHARED_LIBRARIES}, if OFF
|
||||
# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_STATIC_LIBRARIES}, if ON
|
||||
# If only one of the libraries is provided, then
|
||||
# @PROJECT_NAME@_USE_STATIC_LIBS is ignored.
|
||||
#
|
||||
# Since cmake 2.8.11 or later, there's no need to include
|
||||
# include_directories (${GeographicLib_INCLUDE_DIRS})
|
||||
# The variables are retained for information.
|
||||
#
|
||||
# The following variables are only relevant if the library has been
|
||||
# compiled with a default precision different from double:
|
||||
# @PROJECT_NAME_UPPER@_PRECISION = the precision of the library (usually 2)
|
||||
# @PROJECT_NAME@_HIGHPREC_LIBRARIES = the libraries need for high precision
|
||||
|
||||
message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
|
||||
# @PROJECT_NAME@_VERSION is set by version file
|
||||
message (STATUS
|
||||
"@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}")
|
||||
|
||||
# Tell the user project where to find our headers and libraries
|
||||
get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
if (IS_ABSOLUTE "@PROJECT_ROOT_DIR@")
|
||||
# This is an uninstalled package (still in the build tree)
|
||||
set (_ROOT "@PROJECT_ROOT_DIR@")
|
||||
set (@PROJECT_NAME@_INCLUDE_DIRS "@PROJECT_INCLUDE_DIRS@")
|
||||
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/src")
|
||||
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/tools")
|
||||
else ()
|
||||
# This is an installed package; figure out the paths relative to the
|
||||
# current directory.
|
||||
get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
|
||||
set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/include")
|
||||
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/lib@LIB_SUFFIX@")
|
||||
set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/bin")
|
||||
endif ()
|
||||
set (@PROJECT_NAME_UPPER@_DATA "@GEOGRAPHICLIB_DATA@")
|
||||
set (@PROJECT_NAME_UPPER@_PRECISION @GEOGRAPHICLIB_PRECISION@)
|
||||
set (@PROJECT_NAME@_HIGHPREC_LIBRARIES "@HIGHPREC_LIBRARIES@")
|
||||
|
||||
set (@PROJECT_NAME@_SHARED_LIBRARIES @CONFIG_SHARED_LIBRARIES@)
|
||||
set (@PROJECT_NAME@_STATIC_LIBRARIES @CONFIG_STATIC_LIBRARIES@)
|
||||
# Read in the exported definition of the library
|
||||
include ("${_DIR}/@PROJECT_NAME_LOWER@-targets.cmake")
|
||||
|
||||
# For interoperability with older installations of GeographicLib and
|
||||
# with packages which depend on GeographicLib, @PROJECT_NAME@_LIBRARIES
|
||||
# etc. still point to the non-namespace variables. Tentatively plan to
|
||||
# transition to namespace variables as follows:
|
||||
#
|
||||
# * namespace targets were introduced with version 1.47 (2017-02-15)
|
||||
# * switch @PROJECT_NAME@_LIBRARIES to point to namespace variable after
|
||||
# 2020-02
|
||||
# * remove non-namespace variables after 2023-02
|
||||
|
||||
unset (_ROOT)
|
||||
unset (_DIR)
|
||||
|
||||
if ((NOT @PROJECT_NAME@_SHARED_LIBRARIES) OR
|
||||
(@PROJECT_NAME@_USE_STATIC_LIBS AND @PROJECT_NAME@_STATIC_LIBRARIES))
|
||||
set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_STATIC_LIBRARIES})
|
||||
message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to static library")
|
||||
else ()
|
||||
set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_SHARED_LIBRARIES})
|
||||
message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to shared library")
|
||||
endif ()
|
||||
|
||||
# Check for the components requested. This only supports components
|
||||
# STATIC and SHARED by checking the value of
|
||||
# @PROJECT_NAME@_${comp}_LIBRARIES. No need to check if the component
|
||||
# is required or not--the version file took care of that.
|
||||
# @PROJECT_NAME@_${comp}_FOUND is set appropriately for each component.
|
||||
if (@PROJECT_NAME@_FIND_COMPONENTS)
|
||||
foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS})
|
||||
if (@PROJECT_NAME@_${comp}_LIBRARIES)
|
||||
set (@PROJECT_NAME@_${comp}_FOUND TRUE)
|
||||
message (STATUS "@PROJECT_NAME@ component ${comp} found")
|
||||
else ()
|
||||
set (@PROJECT_NAME@_${comp}_FOUND FALSE)
|
||||
message (WARNING "@PROJECT_NAME@ component ${comp} not found")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
# @PROJECT_NAME@_FOUND is set to TRUE automatically
|
||||
set (@PROJECT_NAME_UPPER@_FOUND TRUE) # for backwards compatibility, deprecated
|
||||
14
libs/geographiclib/cmake/project.pc.in
Normal file
14
libs/geographiclib/cmake/project.pc.in
Normal file
@@ -0,0 +1,14 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
bindir=@bindir@
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Description: A library for geographic projections
|
||||
Version: @PACKAGE_VERSION@
|
||||
URL: https://geographiclib.sourceforge.io
|
||||
|
||||
Requires:
|
||||
Libs: -L${libdir} -l@PACKAGE_NAME@
|
||||
Cflags: -I${includedir}
|
||||
Reference in New Issue
Block a user