Skip to content

Commit

Permalink
[vcpkg-cmake] Fix the application of VCPKG_CMAKE_CONFIGURE_OPTIONS wi…
Browse files Browse the repository at this point in the history
…th more than one option (#25123)

* Fix the application of VCPKG_CMAKE_CONFIGURE_OPTIONS with more than one option

VCPKG_CMAKE_CONFIGURE_OPTIONS (plural) is meant to be a list of options to be added to a cmake invocation.

But it was being applied quoted, which disallowed it from containing multiple options.
- If it was initialized with a list, cmake would get the options ";"-separated.
- If it was initialized with a blank-separated string, cmake would get the entire astring quoted as a single argument.

The fix is simple: don't (ever) quote arguments to list(APPEND) unless they are really meant to be a single element to append to the list.

* Update the version-date of vcpkg-cmake

* Update hash after rebase

* Fix vcpkg-cmake.json

In my defence, I'm new to this...

Co-authored-by: Juan Carlos Arevalo Baeza (JCAB) <jcab@ntdev.microsoft.com>
  • Loading branch information
TheJCAB and TheJCAB committed Jun 20, 2022
1 parent d83d14d commit 61e686b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
3 changes: 1 addition & 2 deletions ports/vcpkg-cmake/vcpkg.json
@@ -1,7 +1,6 @@
{
"name": "vcpkg-cmake",
"version-date": "2022-05-10",
"port-version": 1,
"version-date": "2022-06-07",
"documentation": "https://vcpkg.io/en/docs/README.html",
"license": "MIT"
}
6 changes: 3 additions & 3 deletions ports/vcpkg-cmake/vcpkg_cmake_configure.cmake
Expand Up @@ -185,13 +185,13 @@ function(vcpkg_cmake_configure)

# Allow overrides / additional configuration variables from triplets
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS)
vcpkg_list(APPEND arg_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS}")
vcpkg_list(APPEND arg_OPTIONS ${VCPKG_CMAKE_CONFIGURE_OPTIONS})
endif()
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE)
vcpkg_list(APPEND arg_OPTIONS_RELEASE "${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}")
vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE})
endif()
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG)
vcpkg_list(APPEND arg_OPTIONS_DEBUG "${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}")
vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG})
endif()

vcpkg_list(SET rel_command
Expand Down
6 changes: 3 additions & 3 deletions scripts/cmake/vcpkg_configure_cmake.cmake
Expand Up @@ -246,13 +246,13 @@ function(vcpkg_configure_cmake)

# Allow overrides / additional configuration variables from triplets
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS)
vcpkg_list(APPEND arg_OPTIONS "${VCPKG_CMAKE_CONFIGURE_OPTIONS}")
vcpkg_list(APPEND arg_OPTIONS ${VCPKG_CMAKE_CONFIGURE_OPTIONS})
endif()
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE)
vcpkg_list(APPEND arg_OPTIONS_RELEASE "${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}")
vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE})
endif()
if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG)
vcpkg_list(APPEND arg_OPTIONS_DEBUG "${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}")
vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG})
endif()

vcpkg_list(SET rel_command
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Expand Up @@ -7385,8 +7385,8 @@
"port-version": 0
},
"vcpkg-cmake": {
"baseline": "2022-05-10",
"port-version": 1
"baseline": "2022-06-07",
"port-version": 0
},
"vcpkg-cmake-config": {
"baseline": "2022-02-06",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-cmake.json
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "819e45a14fb875ec7e8373143c994b7bd8d8f7cb",
"version-date": "2022-06-07",
"port-version": 0
},
{
"git-tree": "8b07d914c90cf8f611973318c85d3af13201e3f9",
"version-date": "2022-05-10",
Expand Down

0 comments on commit 61e686b

Please sign in to comment.