From dd462392f4651dcbce3051225a20b161035bef5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 10 Aug 2021 08:30:02 +0800 Subject: [proj4] Add usage, fixup target PROJ::proj (#19298) * [proj4] Export target both proj and proj4 * version * fix the generated cmake file name * Fix config.cmake * version * update * Update ports/proj4/usage * Update versions/p-/proj4.json --- ports/proj4/portfile.cmake | 33 +++++++++++++++++++-------------- ports/proj4/usage | 4 ++++ ports/proj4/vcpkg.json | 10 +++++++++- versions/baseline.json | 2 +- versions/p-/proj4.json | 5 +++++ 5 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 ports/proj4/usage diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake index e0880683a..feff73e4f 100644 --- a/ports/proj4/portfile.cmake +++ b/ports/proj4/portfile.cmake @@ -22,14 +22,15 @@ else() endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - database BUILD_PROJ_DATABASE - tools BUILD_CCT - tools BUILD_CS2CS - tools BUILD_GEOD - tools BUILD_GIE - tools BUILD_PROJ - tools BUILD_PROJINFO - ${EXTRA_FEATURES} + FEATURES + database BUILD_PROJ_DATABASE + tools BUILD_CCT + tools BUILD_CS2CS + tools BUILD_GEOD + tools BUILD_GIE + tools BUILD_PROJ + tools BUILD_PROJINFO + ${EXTRA_FEATURES} ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -41,7 +42,7 @@ if ("database" IN_LIST FEATURES) set(EXE_SQLITE3 ${CURRENT_HOST_INSTALLED_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}) endif() -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} @@ -52,15 +53,19 @@ vcpkg_configure_cmake( -DEXE_SQLITE3=${EXE_SQLITE3} ) -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME PROJ CONFIG_PATH lib/cmake/proj DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME PROJ4 CONFIG_PATH lib/cmake/proj4) + if ("tools" IN_LIST FEATURES) vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN) endif () -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY) +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) vcpkg_copy_pdbs() diff --git a/ports/proj4/usage b/ports/proj4/usage new file mode 100644 index 000000000..a2297ca02 --- /dev/null +++ b/ports/proj4/usage @@ -0,0 +1,4 @@ +The package ${PORT}:${TARGET_TRIPLET} provides CMake targets: + + find_package(PROJ CONFIG REQUIRED) + target_link_libraries(main PRIVATE PROJ::proj) diff --git a/ports/proj4/vcpkg.json b/ports/proj4/vcpkg.json index a6c8f8b43..234f92494 100644 --- a/ports/proj4/vcpkg.json +++ b/ports/proj4/vcpkg.json @@ -1,13 +1,21 @@ { "name": "proj4", "version-string": "7.2.1", - "port-version": 2, + "port-version": 3, "description": "PROJ.4 library for cartographic projections", "homepage": "https://github.com/OSGeo/PROJ", "dependencies": [ { "name": "sqlite3", "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true } ], "default-features": [ diff --git a/versions/baseline.json b/versions/baseline.json index 6fcde02b8..17cb988ed 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5070,7 +5070,7 @@ }, "proj4": { "baseline": "7.2.1", - "port-version": 2 + "port-version": 3 }, "prometheus-cpp": { "baseline": "0.12.3", diff --git a/versions/p-/proj4.json b/versions/p-/proj4.json index 703424c68..d5bbf1d9a 100644 --- a/versions/p-/proj4.json +++ b/versions/p-/proj4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8fc1b6bdde08a3b1f131df5a4f042885dcc7a58d", + "version-string": "7.2.1", + "port-version": 3 + }, { "git-tree": "e692e884172877640f3de4009d810061382714b7", "version-string": "7.2.1", -- cgit v1.2.3