diff --git a/ports/libcpplocate/fix-install-paths.patch b/ports/libcpplocate/fix-install-paths.patch new file mode 100644 index 00000000000000..62d4722c2ce94d --- /dev/null +++ b/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/ + set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share//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/ports/libcpplocate/portfile.cmake b/ports/libcpplocate/portfile.cmake new file mode 100644 index 00000000000000..963700fcb8cbcd --- /dev/null +++ b/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/ports/libcpplocate/vcpkg.json b/ports/libcpplocate/vcpkg.json new file mode 100644 index 00000000000000..3dbe9db2e63091 --- /dev/null +++ b/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 + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index f12e219c24f03d..0f3e100487c52b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3400,6 +3400,10 @@ "baseline": "1.4.1", "port-version": 1 }, + "libcpplocate": { + "baseline": "2.3.0", + "port-version": 0 + }, "libcrafter": { "baseline": "1.0", "port-version": 2 diff --git a/versions/l-/libcpplocate.json b/versions/l-/libcpplocate.json new file mode 100644 index 00000000000000..ae128c72087af7 --- /dev/null +++ b/versions/l-/libcpplocate.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "5f15b69e558a8774ebbc5bde4f5ddf70da27611c", + "version-semver": "2.3.0", + "port-version": 0 + } + ] +}