aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libcpplocate
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libcpplocate')
-rw-r--r--vcpkg/ports/libcpplocate/fix-install-paths.patch39
-rw-r--r--vcpkg/ports/libcpplocate/portfile.cmake41
-rw-r--r--vcpkg/ports/libcpplocate/vcpkg.json18
3 files changed, 98 insertions, 0 deletions
diff --git a/vcpkg/ports/libcpplocate/fix-install-paths.patch b/vcpkg/ports/libcpplocate/fix-install-paths.patch
new file mode 100644
index 0000000..62d4722
--- /dev/null
+++ b/vcpkg/ports/libcpplocate/fix-install-paths.patch
@@ -0,0 +1,39 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 854214c..9c4d98a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -124,7 +124,7 @@ if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQU
+ endif()
+
+ # Installation paths
+-if(UNIX AND SYSTEM_DIR_INSTALL)
++if(1)
+ # Install into the system (/usr/bin or /usr/local/bin)
+ set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/<project>
+ set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share/<project>/cmake
+diff --git a/cpplocate-config.cmake b/cpplocate-config.cmake
+index 8693fa4..cdb2828 100644
+--- a/cpplocate-config.cmake
++++ b/cpplocate-config.cmake
+@@ -26,7 +26,7 @@ macro(find_modules PREFIX)
+ if(TARGET ${module_name})
+ set(MODULE_FOUND TRUE)
+ else()
+- find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake")
++ find_module("${CMAKE_CURRENT_LIST_DIR}/${module_name}-export.cmake")
+ endif()
+ endforeach(module_name)
+ endmacro()
+diff --git a/liblocate-config.cmake b/liblocate-config.cmake
+index 3bf4823..7245353 100644
+--- a/liblocate-config.cmake
++++ b/liblocate-config.cmake
+@@ -25,7 +25,7 @@ macro(find_modules PREFIX)
+ if(TARGET ${module_name})
+ set(MODULE_FOUND TRUE)
+ else()
+- find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake")
++ find_module("${CMAKE_CURRENT_LIST_DIR}/${module_name}-export.cmake")
+ endif()
+ endforeach(module_name)
+ endmacro()
diff --git a/vcpkg/ports/libcpplocate/portfile.cmake b/vcpkg/ports/libcpplocate/portfile.cmake
new file mode 100644
index 0000000..963700f
--- /dev/null
+++ b/vcpkg/ports/libcpplocate/portfile.cmake
@@ -0,0 +1,41 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO cginternals/cpplocate
+ REF v2.3.0
+ SHA512 4028d552d0c3c0161d5dd5aea27bb22f0c61297a4b461a067c082cfcf84e3a709c9895453e750d819433529089011c2512293b2064c42bb5ba11f957eebc2206
+ HEAD_REF master
+ PATCHES
+ fix-install-paths.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DOPTION_BUILD_TESTS=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(
+ PACKAGE_NAME cpplocate
+ CONFIG_PATH share/cpplocate/cmake/cpplocate
+ DO_NOT_DELETE_PARENT_CONFIG_PATH
+)
+
+vcpkg_cmake_config_fixup(
+ PACKAGE_NAME liblocate
+ CONFIG_PATH share/cpplocate/cmake/liblocate
+)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/cpplocate/cmake")
+
+# Patched liblocate config file needs moving to the correct directory
+file(RENAME
+ "${CURRENT_PACKAGES_DIR}/share/cpplocate/liblocate-config.cmake"
+ "${CURRENT_PACKAGES_DIR}/share/liblocate/liblocate-config.cmake"
+)
+
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/libcpplocate/vcpkg.json b/vcpkg/ports/libcpplocate/vcpkg.json
new file mode 100644
index 0000000..3dbe9db
--- /dev/null
+++ b/vcpkg/ports/libcpplocate/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "libcpplocate",
+ "version-semver": "2.3.0",
+ "description": "Cross-platform C++ library providing tools for applications to locate themselves, their data assets as well as dependent modules.",
+ "homepage": "https://cpplocate.org/",
+ "license": "MIT",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}