early-access version 2853
This commit is contained in:
118
externals/vcpkg/ports/s2geometry/CMakeLists.txt.patch
vendored
Executable file
118
externals/vcpkg/ports/s2geometry/CMakeLists.txt.patch
vendored
Executable file
@@ -0,0 +1,118 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 5ecd280..9859890 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -20,16 +20,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/cmake")
|
||||
|
||||
-option(WITH_GFLAGS "Use gflags to change command line flags." OFF)
|
||||
-add_feature_info(GFLAGS WITH_GFLAGS
|
||||
- "allows changing command line flags.")
|
||||
|
||||
-# glog option can only be turned on if gflags is on.
|
||||
-cmake_dependent_option(WITH_GLOG "Use glog for logging." ON
|
||||
- "WITH_GFLAGS" OFF)
|
||||
-add_feature_info(GLOG WITH_GLOG "provides logging configurability.")
|
||||
-
|
||||
-option(BUILD_SHARED_LIBS "Build shared libraries instead of static." ON)
|
||||
+option(BUILD_SHARED_LIBS "Build shared libraries instead of static." OFF)
|
||||
add_feature_info(SHARED_LIBS BUILD_SHARED_LIBS
|
||||
"builds shared libraries instead of static.")
|
||||
|
||||
@@ -37,26 +29,19 @@ option(BUILD_EXAMPLES "Build s2 documentation examples." ON)
|
||||
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
-if (WITH_GLOG)
|
||||
- find_package(Glog REQUIRED)
|
||||
- # FindGFlags.cmake and FindGlog.cmake do not seem to implement REQUIRED;
|
||||
- # check manually.
|
||||
- if (NOT ${GLOG_FOUND})
|
||||
- message(FATAL_ERROR "Glog requested but not found")
|
||||
- endif()
|
||||
- add_definitions(-DS2_USE_GLOG)
|
||||
-else()
|
||||
- # Don't output anything for LOG(INFO).
|
||||
- add_definitions(-DABSL_MIN_LOG_LEVEL=1)
|
||||
+find_package(glog CONFIG REQUIRED)
|
||||
+# FindGFlags.cmake and FindGlog.cmake do not seem to implement REQUIRED;
|
||||
+# check manually.
|
||||
+if (NOT ${GLOG_FOUND})
|
||||
+ message(FATAL_ERROR "Glog requested but not found")
|
||||
endif()
|
||||
+add_definitions(-DS2_USE_GLOG)
|
||||
|
||||
-if (WITH_GFLAGS)
|
||||
- find_package(GFlags REQUIRED)
|
||||
- if (NOT ${GFLAGS_FOUND})
|
||||
- message(FATAL_ERROR "GFlags requested but not found")
|
||||
- endif()
|
||||
- add_definitions(-DS2_USE_GFLAGS)
|
||||
+find_package(gflags CONFIG REQUIRED)
|
||||
+if (NOT ${GFLAGS_FOUND})
|
||||
+ message(FATAL_ERROR "GFlags requested but not found")
|
||||
endif()
|
||||
+add_definitions(-DS2_USE_GFLAGS)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
# pthreads isn't used directly, but this is still required for std::thread.
|
||||
@@ -204,14 +189,18 @@ add_library(s2testing STATIC
|
||||
src/s2/s2testing.cc)
|
||||
target_link_libraries(
|
||||
s2
|
||||
- ${GFLAGS_LIBRARIES} ${GLOG_LIBRARIES} ${OPENSSL_LIBRARIES}
|
||||
+ gflags::gflags glog::glog OpenSSL::SSL OpenSSL::Crypto
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
# Allow other CMake projects to use this one with:
|
||||
# list(APPEND CMAKE_MODULE_PATH "<path_to_s2geometry_dir>/third_party/cmake")
|
||||
# add_subdirectory(<path_to_s2geometry_dir> s2geometry)
|
||||
# target_link_libraries(<target_name> s2)
|
||||
-target_include_directories(s2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
+target_include_directories(s2 PUBLIC
|
||||
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||
+ $<INSTALL_INTERFACE:include>
|
||||
+)
|
||||
+
|
||||
|
||||
# We don't need to install all headers, only those
|
||||
# transitively included by s2 headers we are exporting.
|
||||
@@ -407,7 +396,18 @@ install(FILES src/s2/util/math/mathutil.h
|
||||
install(FILES src/s2/util/units/length-units.h
|
||||
src/s2/util/units/physical-units.h
|
||||
DESTINATION include/s2/util/units)
|
||||
-install(TARGETS s2 s2testing DESTINATION lib)
|
||||
+ install(TARGETS s2 s2testing
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ ARCHIVE DESTINATION lib
|
||||
+ LIBRARY DESTINATION lib)
|
||||
+install(TARGETS s2
|
||||
+ EXPORT unofficial-s2Targets
|
||||
+ )
|
||||
+install(EXPORT unofficial-s2Targets
|
||||
+ NAMESPACE unofficial-s2
|
||||
+ FILE unofficial-s2Targets.cmake
|
||||
+ DESTINATION share/unofficial-s2/
|
||||
+)
|
||||
|
||||
message("GTEST_ROOT: ${GTEST_ROOT}")
|
||||
if (GTEST_ROOT)
|
||||
@@ -534,3 +534,17 @@ endif()
|
||||
if (${SWIG_FOUND} AND ${PYTHONLIBS_FOUND})
|
||||
add_subdirectory("src/python" python)
|
||||
endif()
|
||||
+
|
||||
+
|
||||
+include(CMakePackageConfigHelpers)
|
||||
+# generate the config file that is includes the exports
|
||||
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||
+ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-s2Config.cmake"
|
||||
+ INSTALL_DESTINATION "share/unofficial-s2/"
|
||||
+ NO_SET_AND_CHECK_MACRO
|
||||
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
+ )
|
||||
+ install(FILES
|
||||
+ ${CMAKE_CURRENT_BINARY_DIR}/unofficial-s2Config.cmake
|
||||
+ DESTINATION "share/unofficial-s2/"
|
||||
+ )
|
||||
9
externals/vcpkg/ports/s2geometry/Config.cmake.in.patch
vendored
Executable file
9
externals/vcpkg/ports/s2geometry/Config.cmake.in.patch
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
diff --git a/Config.cmake.in b/Config.cmake.in
|
||||
new file mode 100644
|
||||
index 0000000..42bcf00
|
||||
--- /dev/null
|
||||
+++ b/Config.cmake.in
|
||||
@@ -0,0 +1,3 @@
|
||||
+@PACKAGE_INIT@
|
||||
+
|
||||
+include ( "${CMAKE_CURRENT_LIST_DIR}/unofficial-s2Targets.cmake" )
|
||||
27
externals/vcpkg/ports/s2geometry/portfile.cmake
vendored
Executable file
27
externals/vcpkg/ports/s2geometry/portfile.cmake
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/s2geometry
|
||||
REF v0.9.0
|
||||
SHA512 854ec84a54aff036b3092a6233be0f5fc0e4846ac5f882326bbb3f2b9ce88bd5c866a80ae352d8e7d5ae00b9c9a8ab1cff6a95412f990b7bc1fdc5ca3d632b9c
|
||||
HEAD_REF main
|
||||
PATCHES
|
||||
CMakeLists.txt.patch
|
||||
Config.cmake.in.patch
|
||||
)
|
||||
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
MAYBE_UNUSED_VARIABLES BUILD_TESTING
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/s2geometry/" RENAME copyright)
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/s2geometry/")
|
||||
4
externals/vcpkg/ports/s2geometry/usage
vendored
Executable file
4
externals/vcpkg/ports/s2geometry/usage
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
The package s2geometry provides CMake targets:
|
||||
|
||||
find_package(unofficial-s2 CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE unofficial-s2::s2)
|
||||
18
externals/vcpkg/ports/s2geometry/vcpkg.json
vendored
Executable file
18
externals/vcpkg/ports/s2geometry/vcpkg.json
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "s2geometry",
|
||||
"version": "0.9.0",
|
||||
"port-version": 1,
|
||||
"description": "S2 is a library for spherical geometry that aims to have the same robustness, flexibility, and performance as the very best planar geometry libraries.",
|
||||
"homepage": "https://s2geometry.io",
|
||||
"supports": "!windows",
|
||||
"dependencies": [
|
||||
"gflags",
|
||||
"glog",
|
||||
"gtest",
|
||||
"openssl",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user