Skip to content

Commit

Permalink
[vcpkg.cmake] Cleanup every special case in the find_package override (
Browse files Browse the repository at this point in the history
…microsoft#18047)

* move boost out of the toolchain

* move icu out of the toolchain

* remove CURL from the toolchain (was already unreachable?)

* remove gsl from toolchain

* remove grpc from toolchain

* version stuff

* fix indent and missing endif()

* version stuff

* Revert changes to vcpkg.cmake

* push port version

* version stuff
  • Loading branch information
Neumann-A authored May 28, 2021
1 parent 9d7244f commit 0de4612
Show file tree
Hide file tree
Showing 20 changed files with 71 additions and 9 deletions.
2 changes: 2 additions & 0 deletions ports/boost-uninstall/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

message(STATUS "\nPlease use the following command when you need to remove all boost ports/components:\n\
\"./vcpkg remove boost-uninstall:${TARGET_TRIPLET} --recurse\"\n")

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/boost/vcpkg-cmake-wrapper.cmake" @ONLY)
11 changes: 11 additions & 0 deletions ports/boost-uninstall/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
unset(Boost_USE_STATIC_RUNTIME)
set(Boost_NO_BOOST_CMAKE ON)
unset(Boost_USE_STATIC_RUNTIME CACHE)
if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v120")
set(Boost_COMPILER "-vc120")
else()
set(Boost_COMPILER "-vc140")
endif()
_find_package(${ARGS})
1 change: 1 addition & 0 deletions ports/boost-uninstall/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "boost-uninstall",
"version-string": "1.75.0",
"port-version": 1,
"description": "boost uninstall port",
"homepage": "https://boost.org"
}
2 changes: 1 addition & 1 deletion ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ endif()

vcpkg_fixup_pkgconfig()

file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2 changes: 1 addition & 1 deletion ports/curl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "curl",
"version": "7.74.0",
"port-version": 6,
"port-version": 7,
"description": "A library for transferring data with URLs",
"homepage": "https://github.com/curl/curl",
"dependencies": [
Expand Down
1 change: 1 addition & 0 deletions ports/grpc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
2 changes: 2 additions & 0 deletions ports/grpc/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
list(REMOVE_AT ARGS 0)
_find_package(gRPC ${ARGS}) # Shouldn't this be fixed downstream instead of using a Wrapper?
2 changes: 1 addition & 1 deletion ports/grpc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grpc",
"version-semver": "1.37.0",
"port-version": 1,
"port-version": 2,
"description": "An RPC library and framework",
"homepage": "https://github.com/grpc/grpc",
"dependencies": [
Expand Down
1 change: 1 addition & 0 deletions ports/gsl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Source: gsl
Version: 2.6
Port-Version: 1
Homepage: https://www.gnu.org/software/gsl/
Description: The GNU Scientific Library is a numerical library for C and C++ programmers
1 change: 1 addition & 0 deletions ports/gsl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ vcpkg_copy_pdbs()

file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
11 changes: 11 additions & 0 deletions ports/gsl/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_find_package(${ARGS})
if(GSL_FOUND AND TARGET GSL::gsl)
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release )
set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Release )
if( EXISTS "${GSL_LIBRARY_DEBUG}" AND EXISTS "${GSL_CBLAS_LIBRARY_DEBUG}")
set_property( TARGET GSL::gsl APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gsl PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_LIBRARY_DEBUG}" )
set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Debug )
set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" )
endif()
endif()
1 change: 1 addition & 0 deletions ports/icu/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,4 @@ vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES pthread m)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
6 changes: 6 additions & 0 deletions ports/icu/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
list(FIND ARGS "COMPONENTS" COMPONENTS_IDX)
if(NOT COMPONENTS_IDX EQUAL -1)
_find_package(${ARGS} COMPONENTS data)
else()
_find_package(${ARGS})
endif()
2 changes: 1 addition & 1 deletion ports/icu/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "icu",
"version": "69.1",
"port-version": 9,
"port-version": 10,
"description": "Mature and widely used Unicode and localization library.",
"homepage": "http://icu-project.org/apiref/icu4c/",
"supports": "!uwp",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-uninstall.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "092a563d81779e6bfb0ee656bc4c8f01f57c7666",
"version-string": "1.75.0",
"port-version": 1
},
{
"git-tree": "08933bad27b6d41caef0940c31e2069ecb6a079c",
"version-string": "1.75.0",
Expand Down
10 changes: 5 additions & 5 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@
},
"boost-uninstall": {
"baseline": "1.75.0",
"port-version": 0
"port-version": 1
},
"boost-units": {
"baseline": "1.75.0",
Expand Down Expand Up @@ -1546,7 +1546,7 @@
},
"curl": {
"baseline": "7.74.0",
"port-version": 6
"port-version": 7
},
"curlpp": {
"baseline": "2018-06-15-3",
Expand Down Expand Up @@ -2382,15 +2382,15 @@
},
"grpc": {
"baseline": "1.37.0",
"port-version": 1
"port-version": 2
},
"grppi": {
"baseline": "0.4.0",
"port-version": 0
},
"gsl": {
"baseline": "2.6",
"port-version": 0
"port-version": 1
},
"gsl-lite": {
"baseline": "0.38.1",
Expand Down Expand Up @@ -2522,7 +2522,7 @@
},
"icu": {
"baseline": "69.1",
"port-version": 9
"port-version": 10
},
"ideviceinstaller": {
"baseline": "1.1.2.23-1",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/curl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2184d79bb98ed36af015203385175cade013d8af",
"version": "7.74.0",
"port-version": 7
},
{
"git-tree": "73eb56fb6fa870b5959ba36b931817fc85208efe",
"version": "7.74.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/grpc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9bcee29de46cc5f1edbe016d192f243f65e64a5f",
"version-semver": "1.37.0",
"port-version": 2
},
{
"git-tree": "8f98b29393d0964e617d4182cc4915925b737285",
"version-semver": "1.37.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gsl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "da6e274c9febfeb37b716f136cbf43225c55d997",
"version-string": "2.6",
"port-version": 1
},
{
"git-tree": "a102b1a49d711cdf9b8cfe4bc1e06836dc2c2423",
"version-string": "2.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/i-/icu.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "07e8fca3896a13ac7b4196e104015174429a6c74",
"version": "69.1",
"port-version": 10
},
{
"git-tree": "5c039f72ee659cc0522524889b9219615f28263a",
"version": "69.1",
Expand Down

0 comments on commit 0de4612

Please sign in to comment.