From 684989a1e48b6b7f0ac1c340a702236974762f05 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Tue, 16 Jul 2019 14:02:13 -0700 Subject: use additional env param --- scripts/get_triplet_environment.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index bc79b16ce..24ff40905 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -9,3 +9,4 @@ message("VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}") message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}") +message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}") -- cgit v1.2.3 From 44dcc3d4f3d2bc56cc9f6d0371a141ad0145d537 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Tue, 16 Jul 2019 15:34:13 -0700 Subject: First pass at port settings --- scripts/get_triplet_environment.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index 24ff40905..e561492de 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -1,4 +1,7 @@ include(${CMAKE_TRIPLET_FILE}) +if (DEFINED CMAKE_PORTFILE_SETTINGS) + include(${CMAKE_PORTFILE_SETTINGS} OPTIONAL) +endif() # GUID used as a flag - "cut here line" message("c35112b6-d1ba-415b-aa5d-81de856ef8eb") -- cgit v1.2.3 From 64198a8109b9d1cffcc3830f70d0c3f2b066638d Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Tue, 16 Jul 2019 15:51:50 -0700 Subject: Add to vcpkg.cmake --- scripts/get_triplet_environment.cmake | 4 ++-- scripts/ports.cmake | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index e561492de..f76054556 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -1,6 +1,6 @@ include(${CMAKE_TRIPLET_FILE}) -if (DEFINED CMAKE_PORTFILE_SETTINGS) - include(${CMAKE_PORTFILE_SETTINGS} OPTIONAL) +if (DEFINED CMAKE_PORT_SETTINGS) + include(${CMAKE_PORT_SETTINGS} OPTIONAL) endif() # GUID used as a flag - "cut here line" diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 860d08893..0c33fdffc 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -67,6 +67,7 @@ if(CMD MATCHES "^BUILD$") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR} ${CURRENT_PACKAGES_DIR}) include(${CMAKE_TRIPLET_FILE}) + include(${CMAKE_PORT_SETTINGS} OPTIONAL) set(TRIPLET_SYSTEM_ARCH ${VCPKG_TARGET_ARCHITECTURE}) include(${CMAKE_CURRENT_LIST_DIR}/cmake/vcpkg_common_definitions.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/vcpkg_common_functions.cmake) -- cgit v1.2.3 From d4ab567609495a5c239f537d7c1e200f7b8a19c0 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 17 Jul 2019 10:10:36 -0700 Subject: first pass at abi additional files --- scripts/get_triplet_environment.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index f76054556..ab5e8f8c3 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -13,3 +13,4 @@ message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}") message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}") +message("VCPKG_ABI_ADDITIONAL_FILES=${VCPKG_ABI_ADDITIONAL_FILES}") -- cgit v1.2.3 From 459908ae14458a615bb0a8c278c799cabd34e558 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Tue, 23 Jul 2019 10:07:39 -0700 Subject: add external file hashes to the binary paragraph --- scripts/get_triplet_environment.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index ab5e8f8c3..fa1e5cb39 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -13,4 +13,4 @@ message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}") message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}") -message("VCPKG_ABI_ADDITIONAL_FILES=${VCPKG_ABI_ADDITIONAL_FILES}") +message("VCPKG_EXTERNAL_FILES=${VCPKG_EXTERNAL_FILES}") -- cgit v1.2.3 From ad82c38cc1e8cc87f026cbd179e8bfaa62ce3553 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 9 Aug 2019 14:40:09 -0700 Subject: Actually only override the PUBLIC ABI, not the private one --- scripts/get_triplet_environment.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index 8ae365812..a838624ca 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -13,4 +13,4 @@ message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}") message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}") -message("VCPKG_EXTERNAL_FILES=${VCPKG_EXTERNAL_FILES}") +message("VCPKG_EXTERNAL_FILES=${VCPKG_PUBLIC_ABI_OVERRIDE}") -- cgit v1.2.3 From f9561a08db1add3052d4759adf051fc903e2e3e4 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Fri, 9 Aug 2019 14:47:58 -0700 Subject: remove unnecessary include, fix variable extraction --- scripts/get_triplet_environment.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index a838624ca..0457cee9b 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -13,4 +13,4 @@ message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") message("VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}") message("VCPKG_ENV_PASSTHROUGH=${VCPKG_ENV_PASSTHROUGH}") -message("VCPKG_EXTERNAL_FILES=${VCPKG_PUBLIC_ABI_OVERRIDE}") +message("VCPKG_PUBLIC_ABI_OVERRIDE=${VCPKG_PUBLIC_ABI_OVERRIDE}") -- cgit v1.2.3 From 0f3b6fc1638c3c0bf33a560d1ab89215b7af02fd Mon Sep 17 00:00:00 2001 From: dan-shaw <51385773+dan-shaw@users.noreply.github.com> Date: Mon, 12 Aug 2019 14:41:53 -0700 Subject: vs 2019 integration bug (#7623) --- scripts/buildsystems/vcpkg.cmake | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index f657e2710..6eb0f62dd 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -38,17 +38,7 @@ else() elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 16 2019$") - if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Xx]86$") - set(_VCPKG_TARGET_TRIPLET_ARCH x86) - elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Mm][Dd]64$") - set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Rr][Mm]$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Rr][Mm]64$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm64) - else() - - endif() + set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") -- cgit v1.2.3 From a3a6530631df905eb5c0e26d0b20d7d548e0c465 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Tue, 13 Aug 2019 20:13:55 -0700 Subject: [vcpkg_check_features] Set output variable explicitly and allow reverse-logic check (#7558) * [vcpkg_check_features] Set OUT_EXPAND_OPTIONS explicitly * [vcpkg_check_features] Allow reverse logic for features * [vcpkg_check_features] Document new parameters * [vcpkg_check_features] Remove unnecessary logging * Do not create variables for each feature only set OUT_FEATURE_OPTIONS * Improve documentation * Update ports that use vcpkg_check_features() * Missing documentation updates * [pcl] Fix tools feature * [opencv,opencv4] Fix usage of vcpkg_check_features() * [opencv4] Fix typo --- scripts/cmake/vcpkg_check_features.cmake | 255 +++++++++++++++++++----------- scripts/cmake/vcpkg_configure_cmake.cmake | 6 + 2 files changed, 173 insertions(+), 88 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_check_features.cmake b/scripts/cmake/vcpkg_check_features.cmake index d089ac5b1..81ebc234d 100644 --- a/scripts/cmake/vcpkg_check_features.cmake +++ b/scripts/cmake/vcpkg_check_features.cmake @@ -1,112 +1,191 @@ ## # vcpkg_check_features -## -## Check if one or more features are a part of the package installation. -## +## Check if one or more features are a part of a package installation. +## ## ## Usage ## ```cmake ## vcpkg_check_features( -## -## [ ] -## ... +## OUT_FEATURE_OPTIONS +## [FEATURES +## +## [ ] +## ...] +## [INVERTED_FEATURES +## +## [ ] +## ...] ## ) ## ``` -## -## `vcpkg_check_features` accepts a list of (feature, output_variable) pairs. If a feature is specified, the corresponding output variable will be set as `ON`, or `OFF` otherwise. The syntax is similar to the `PROPERTIES` argument of `set_target_properties`. -## -## `vcpkg_check_features` will create a variable `FEATURE_OPTIONS` in the parent scope, which you can pass as a part of `OPTIONS` argument when calling functions like `vcpkg_config_cmake`: -## ```cmake -## vcpkg_config_cmake( -## SOURCE_PATH ${SOURCE_PATH} -## PREFER_NINJA -## OPTIONS -## -DBUILD_TESTING=ON -## ${FEATURE_OPTIONS} -## ) -## ``` -## +## `vcpkg_check_features()` accepts these parameters: +## +## * `OUT_FEATURE_OPTIONS`: +## An output variable, the function will clear the variable passed to `OUT_FEATURE_OPTIONS` +## and then set it to contain a list of option definitions (`-D=ON|OFF`). +## +## This should be set to `FEATURE_OPTIONS` by convention. +## +## * `FEATURES`: +## A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs. +## For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: +## +## * `-D=ON`, if a feature is specified for installation, +## * `-D=OFF`, otherwise. +## +## * `INVERTED_FEATURES`: +## A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs, uses reversed logic from `FEATURES`. +## For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: +## +## * `-D=OFF`, if a feature is specified for installation, +## * `-D=ON`, otherwise. +## +## ## ## Notes +## +## The `FEATURES` name parameter can be omitted if no `INVERTED_FEATURES` are used. +## +## At least one (`FEATURE_NAME`, `OPTION_NAME`) pair must be passed to the function call. +## +## Arguments passed to `FEATURES` and `INVERTED_FEATURES` are not validated to prevent duplication. +## If the same (`FEATURE_NAME`, `OPTION_NAME`) pair is passed to both lists, +## two conflicting definitions are added to `OUT_FEATURE_OPTIONS`. +## +## +## ## Examples +## +## ### Example 1: Regular features +## ## ```cmake -## vcpkg_check_features( ) -## ``` -## can be used as a replacement of: -## ```cmake -## if( IN_LIST FEATURES) -## set( ON) -## else() -## set( OFF) -## endif() +## $ ./vcpkg install mimalloc[asm,secure] +## +## # ports/mimalloc/portfile.cmake +## vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +## # Keyword FEATURES is optional if INVERTED_FEATURES are not used +## asm MI_SEE_ASM +## override MI_OVERRIDE +## secure MI_SECURE +## ) +## +## vcpkg_configure_cmake( +## SOURCE_PATH ${SOURCE_PATH} +## PREFER_NINJA +## OPTIONS +## # Expands to "-DMI_SEE_ASM=ON; -DMI_OVERRIDE=OFF; -DMI_SECURE=ON" +## ${FEATURE_OPTIONS} +## ) ## ``` -## -## However, if you have a feature that was checked like this before: +## +## ### Example 2: Inverted features +## ## ```cmake -## if( IN_LIST FEATURES) -## set( OFF) -## else() -## set( ON) -## endif() +## $ ./vcpkg install cpprestsdk[websockets] +## +## # ports/cpprestsdk/portfile.cmake +## vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +## INVERTED_FEATURES # <- Keyword INVERTED_FEATURES required +## brotli CPPREST_EXCLUDE_BROTLI +## websockets CPPREST_EXCLUDE_WEBSOCKETS +## ) +## +## vcpkg_configure_cmake( +## SOURCE_PATH ${SOURCE_PATH} +## PREFER_NINJA +## OPTIONS +## # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON; -DCPPREST_EXCLUDE_WEBSOCKETS=OFF" +## ${FEATURE_OPTIONS} +## ) ## ``` -## then you should not use `vcpkg_check_features` instead. [```oniguruma```](https://github.com/microsoft/vcpkg/blob/master/ports/oniguruma/portfile.cmake), for example, has a feature named `non-posix` which is checked with: +## +## ### Example 3: Set multiple options for same feature +## ## ```cmake -## if("non-posix" IN_LIST FEATURES) -## set(ENABLE_POSIX_API OFF) -## else() -## set(ENABLE_POSIX_API ON) -## endif() -## ``` -## and by replacing these code with: +## $ ./vcpkg install pcl[cuda] +## +## # ports/pcl/portfile.cmake +## vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +## cuda WITH_CUDA +## cuda BUILD_CUDA +## cuda BUILD_GPU +## ) +## +## vcpkg_configure_cmake( +## SOURCE_PATH ${SOURCE_PATH} +## PREFER_NINJA +## OPTIONS +## # Expands to "-DWITH_CUDA=ON; -DBUILD_CUDA=ON; -DBUILD_GPU=ON" +## ${FEATURE_OPTIONS} +## ) +## ``` +## +## ### Example 4: Use regular and inverted features +## ## ```cmake -## vcpkg_check_features(non-posix ENABLE_POSIX_API) -## ``` -## is totally wrong. -## -## `vcpkg_check_features` is supposed to be called only once. Otherwise, the `FEATURE_OPTIONS` variable set by a previous call will be overwritten. -## -## ## Examples -## -## * [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake) -## * [xsimd](https://github.com/microsoft/vcpkg/blob/master/ports/xsimd/portfile.cmake) -## * [xtensor](https://github.com/microsoft/vcpkg/blob/master/ports/xtensor/portfile.cmake) +## $ ./vcpkg install rocksdb[tbb] +## +## # ports/rocksdb/portfile.cmake +## vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +## FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used +## tbb WITH_TBB +## INVERTED_FEATURES +## tbb ROCKSDB_IGNORE_PACKAGE_TBB +## ) +## +## vcpkg_configure_cmake( +## SOURCE_PATH ${SOURCE_PATH} +## PREFER_NINJA +## OPTIONS +## # Expands to "-DWITH_TBB=ON; -DROCKSDB_IGNORE_PACKAGE_TBB=OFF" +## ${FEATURE_OPTIONS} +## ) +## ``` +## +## ## Examples in portfiles +## +## * [cpprestsdk](https://github.com/microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [pcl](https://github.com/microsoft/vcpkg/blob/master/ports/pcl/portfile.cmake) +## * [rocksdb](https://github.com/microsoft/vcpkg/blob/master/ports/rocksdb/portfile.cmake) +## function(vcpkg_check_features) - cmake_parse_arguments(_vcf "" "" "" ${ARGN}) - - list(LENGTH ARGN _vcf_ARGC) - math(EXPR _vcf_INCORRECT_ARGN "${_vcf_ARGC} % 2") + cmake_parse_arguments(_vcf "" "OUT_FEATURE_OPTIONS" "FEATURES;INVERTED_FEATURES" ${ARGN}) - if(_vcf_INCORRECT_ARGN) - message(FATAL_ERROR "Called with incorrect number of arguments.") + if (NOT DEFINED _vcf_OUT_FEATURE_OPTIONS) + message(FATAL_ERROR "OUT_FEATURE_OPTIONS must be specified.") endif() - set(_vcf_IS_FEATURE_ARG ON) - set(_vcf_FEATURE_OPTIONS) - - # Process (feature, output_var) pairs - foreach(_vcf_ARG ${ARGN}) - if(_vcf_IS_FEATURE_ARG) - set(_vcf_FEATURE ${_vcf_ARG}) - - if(NOT ${_vcf_FEATURE} IN_LIST ALL_FEATURES) - message(FATAL_ERROR "Unknown feature: ${_vcf_FEATURE}") - endif() - - set(_vcf_IS_FEATURE_ARG OFF) - else() - set(_vcf_FEATURE_VAR ${_vcf_ARG}) + macro(_check_features _vcf_ARGUMENT _set_if _set_else) + list(LENGTH ${_vcf_ARGUMENT} FEATURES_SET_LEN) + math(EXPR _vcf_INCORRECT_ARGN "${FEATURES_SET_LEN} % 2") + if(_vcf_INCORRECT_ARGN) + message(FATAL_ERROR "Called with incorrect number of arguments.") + endif() - if(${_vcf_FEATURE} IN_LIST FEATURES) - set(${_vcf_FEATURE_VAR} ON PARENT_SCOPE) - list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VAR}=ON") + set(_vcf_IS_FEATURE_NAME_ARG ON) + foreach(_vcf_ARG ${${_vcf_ARGUMENT}}) + if(_vcf_IS_FEATURE_NAME_ARG) + set(_vcf_FEATURE_NAME ${_vcf_ARG}) + if(NOT ${_vcf_FEATURE_NAME} IN_LIST ALL_FEATURES) + message(FATAL_ERROR "Unknown feature: ${_vcf_FEATURE_NAME}") + endif() + set(_vcf_IS_FEATURE_NAME_ARG OFF) else() - set(${_vcf_FEATURE_VAR} OFF PARENT_SCOPE) - list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VAR}=OFF") + set(_vcf_FEATURE_VARIABLE ${_vcf_ARG}) + if(${_vcf_FEATURE_NAME} IN_LIST FEATURES) + list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VARIABLE}=${_set_if}") + else() + list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VARIABLE}=${_set_else}") + endif() + set(_vcf_IS_FEATURE_NAME_ARG ON) endif() + endforeach() + endmacro() - set(_vcf_IS_FEATURE_ARG ON) - endif() - endforeach() + set(_vcf_FEATURE_OPTIONS) - if(DEFINED FEATURE_OPTIONS) - message(WARNING "FEATURE_OPTIONS is already defined and will be overwritten.") + if (DEFINED _vcf_FEATURES OR DEFINED _vcf_INVERTED_FEATURES) + _check_features(_vcf_FEATURES ON OFF) + _check_features(_vcf_INVERTED_FEATURES OFF ON) + else() + # Skip arguments that correspond to OUT_FEATURE_OPTIONS and its value. + list(SUBLIST ARGN 2 -1 _vcf_ARGN) + _check_features(_vcf_ARGN ON OFF) endif() - - set(FEATURE_OPTIONS ${_vcf_FEATURE_OPTIONS} PARENT_SCOPE) + set(${_vcf_OUT_FEATURE_OPTIONS} "${_vcf_FEATURE_OPTIONS}" PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 37362a5a2..6c392d385 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -8,6 +8,7 @@ ## SOURCE_PATH <${SOURCE_PATH}> ## [PREFER_NINJA] ## [DISABLE_PARALLEL_CONFIGURE] +## [NO_CHARSET_FLAG] ## [GENERATOR <"NMake Makefiles">] ## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...] ## [OPTIONS_RELEASE <-DOPTIMIZE=1>...] @@ -28,6 +29,11 @@ ## Disables running the CMake configure step in parallel. ## This is needed for libraries which write back into their source directory during configure. ## +## ### NO_CHARSET_FLAG +## Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. +## +## This is needed for libraries that set their own source code's character set. +## ## ### GENERATOR ## Specifies the precise generator to use. ## -- cgit v1.2.3 From 300e21d59ebfe42e118cf4e97887f0680fbcfa2f Mon Sep 17 00:00:00 2001 From: Nicole Mazzuca Date: Fri, 9 Aug 2019 11:16:35 -0700 Subject: [vcpkg] Major tool CMakeLists.txt updates - Add the "VCPKG_DEVELOPMENT_WARNINGS" flag - setting "WERROR" will also set this flag - This flag is set by default - on GCC/clang, this will pass '-Wall -Wextra -Wpedantic -Werror' - on GCC, this will additionally pass '-Wmissing-declarations' - on clang, this will additionally pass '-Wmissing-prototypes' - on MSVC, this will pass '-W4 -WX' - On Visual Studio 2017 and later, pass '-permissive-' - Change the source for fallout of these changes - add `format` subcommand - formats all C++ source and header files using clang-format - move `include/vcpkg-test/catch.h` to `include/catch2/catch.hpp` - pass CONFIGURE_DEPENDS to file(GLOB) --- scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 09d77b07d..afdd9c1b3 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -249,7 +249,7 @@ buildDir="$vcpkgRootDir/toolsrc/build.rel" rm -rf "$buildDir" mkdir -p "$buildDir" -(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 +(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=Off" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1 (cd "$buildDir" && "$cmakeExe" --build .) || exit 1 rm -rf "$vcpkgRootDir/vcpkg" -- cgit v1.2.3 From 9c879883f6730c70cb654899e1966896740f33b5 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 19 Aug 2019 20:13:30 +0200 Subject: add variables for target specific library suffix and prefix. (#7600) also set the according cmakevariables in script mode enabling find_library calls in portfiles --- scripts/cmake/vcpkg_common_definitions.cmake | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 8dc05de3c..9724a33dc 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -1,3 +1,21 @@ +## # vcpkg_common_definitions +## +## File contains helpful variabls for portfiles which are commonly needed or used. +## +## ## The following variables are available: +## ```cmake +## VCPKG_TARGET_IS_ with being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if +## VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX) +## VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX) +## VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX) +## VCPKG_TARGET_SHARED_LIBRARY_SUFFIX shared library suffix for target (same as CMAKE_SHARED_LIBRARY_SUFFIX) +## ``` +## +## CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX are defined for the target so that +## portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. +## + +#Helper variable to identify the Target system. VCPKG_TARGET_IS_ if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(VCPKG_TARGET_IS_WINDOWS 1) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") @@ -12,3 +30,24 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set(VCPKG_TARGET_IS_FREEBSD 1) endif() + +#Helper variables for libraries +if(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".lib") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dll") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "") +else() + set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a") + set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".so") + set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib") + set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib") +endif() +#Setting these variables allows find_library to work in script mode and thus in portfiles! +#This allows us scale down on hardcoded target dependent paths in portfiles +set(CMAKE_STATIC_LIBRARY_SUFFIX ${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}) +set(CMAKE_SHARED_LIBRARY_SUFFIX ${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}) +set(CMAKE_STATIC_LIBRARY_PREFIX ${VCPKG_TARGET_STATIC_LIBRARY_PREFIX}) +set(CMAKE_SHARED_LIBRARY_PREFIX ${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}) + + -- cgit v1.2.3