[geographiclib]Fix usage error and cmake path in Linux. (#8115)

This commit is contained in:
JackBoosY 2019-09-14 06:54:32 +08:00 committed by Griffin Downs
parent 5b42adda63
commit 28e77c7bd6
4 changed files with 27 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Source: geographiclib
Version: 1.47-patch1-8
Version: 1.47-patch1-9
Homepage: https://sourceforge.net/projects/geographiclib/
Description: a small set of C++ classes for performing conversions between geographic, UTM, UPS, MGRS, geocentric, and local cartesian coordinates, for gravity (e.g., EGM2008), geoid height, and geomagnetic field (e.g., WMM2010) calculations, and for solving geodesic problems.

View File

@ -0,0 +1,16 @@
diff --git a/cmake/project-config-version.cmake.in b/cmake/project-config-version.cmake.in
index 1f207b8..d469658 100644
--- a/cmake/project-config-version.cmake.in
+++ b/cmake/project-config-version.cmake.in
@@ -22,9 +22,9 @@ elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR
# Reject if there's a mismatch in MSVC compiler versions
# set (REASON "_MSC_VER = @MSVC_VERSION@")
# set (PACKAGE_VERSION_UNSUITABLE TRUE)
-elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@")
+elseif (NOT CMAKE_CROSSCOMPILING STREQUAL FALSE)
# Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}
- set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
+ set (REASON "cross-compiling = FALSE")
set (PACKAGE_VERSION_UNSUITABLE TRUE)
elseif (CMAKE_CROSSCOMPILING AND
NOT (CMAKE_SYSTEM_NAME STREQUAL "@CMAKE_SYSTEM_NAME@" AND

View File

@ -10,6 +10,7 @@ vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
PATCHES
remove-tools-and-fix-version.patch
fix-usage.patch
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
@ -37,7 +38,7 @@ vcpkg_install_cmake()
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
else()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/GeographicLib)
endif()
vcpkg_copy_pdbs()

View File

@ -0,0 +1,8 @@
The package geographiclib:x64-linux provides CMake targets:
find_package(GeographicLib CONFIG REQUIRED)
#dynamic
target_link_libraries(main PRIVATE GeographicLib GeographicLib::GeographicLib)
#static
target_link_libraries(main PRIVATE GeographicLib_STATIC GeographicLib::GeographicLib_STATIC)