From 8641dfd9dd6d3bf190515822060872a56ee37906 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Thu, 28 Feb 2019 23:53:42 -0800 Subject: Modify `vcpkg_fixup_cmake_targets()` (#5459) * some libraries export LibraryDepends.cmake instead of Targets.cmake. Those file also need the fix of #1044 should close #4753 * prefered the general solution #4622. hopefully solved the issue within #4150 replaced the regex with something more readable (also ident is lost) should close: #4753 #4633 #4150 and maybe more * Hash vcpkg_fixup_cmake_targets.cmake * [boost] Fix use of find_package(Boost) with cache variables [socket-io-client] Fix install * reversed change back to use regex replace * [glbinding] Fix _IMPORT_PREFIX depth in *-export.cmake files * [tinyspline] Ignore warnings treated as errors * [libevent, liblemon, libpng, smpeg2, zlib] Fix apply patches * [libsodium] Fix apply patches * [folly] Link correct libraries in debug and release * [vtk] Remove unset of _IMPORT_PREFIX * [tinyspline] Do not treat warnings as errors * [smpeg2] Fix double* to int comparison * [nvtt] Define value for HAVE_UNISTD_H in MacOS * [libui] Fix MacOS X build * [zlib] Fix download URL * [qhull] Update to v7.2.1 * [podofo] Set value for HAVE_UNISTD_H in MacOS * [mongo-cxx-driver,ogre,podofo,qhull] Bump CONTROL version * [mongo-c-driver] Set _IMPORT_PREFIX * [tmxparser] Bump CONTROL version * [qhull,vxl] Bump CONTROL version --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 33 +++++++++++---------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index ea9923df3..982f414b6 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -6,6 +6,9 @@ # # Transform all references matching /bin/*.exe to /tools//*.exe # +# Fix ${_IMPORT_PREFIX} in auto generated targets to be one folder deeper. +# Replace ${CURRENT_INSTALLED_DIR} with ${_IMPORT_PREFIX} in configs/targets. +# # :: # vcpkg_fixup_cmake_targets([CONFIG_PATH ]) # @@ -126,32 +129,22 @@ function(vcpkg_fixup_cmake_targets) endforeach() endif() - file(GLOB_RECURSE MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") - foreach(MAIN_TARGET IN LISTS MAIN_TARGETS) - file(READ ${MAIN_TARGET} _contents) + #Fix ${_IMPORT_PREFIX} in cmake generated targets and configs; + #Since those can be renamed we have to check in every *.cmake + file(GLOB_RECURSE MAIN_CMAKES "${RELEASE_SHARE}/*.cmake") + foreach(MAIN_CMAKE IN LISTS MAIN_CMAKES) + file(READ ${MAIN_CMAKE} _contents) string(REGEX REPLACE "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" - _contents "${_contents}") - string(REPLACE "${CURRENT_INSTALLED_DIR}" "_INVALID_ROOT_" _contents "${_contents}") - string(REGEX REPLACE "_INVALID_ROOT_/[^\";>]*" "" _contents "${_contents}") - string(REGEX REPLACE ";;+" ";" _contents "${_contents}") - string(REGEX REPLACE "\";\"" "\"\"" _contents "${_contents}") - file(WRITE ${MAIN_TARGET} "${_contents}") - endforeach() - - file(GLOB_RECURSE MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") - foreach(MAIN_CONFIG IN LISTS MAIN_CONFIGS) - file(READ ${MAIN_CONFIG} _contents) - string(REGEX REPLACE - "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" - "get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)" - _contents "${_contents}") - string(REGEX REPLACE + _contents "${_contents}") # see #1044 for details why this replacement is necessary. See #4782 why it must be a regex. + string(REGEX REPLACE "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" _contents "${_contents}") - file(WRITE ${MAIN_CONFIG} "${_contents}") + #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} + string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] _contents "${_contents}") + file(WRITE ${MAIN_CMAKE} "${_contents}") endforeach() # Remove /debug// if it's empty. -- cgit v1.2.3 From 9164049386b38655aa6ce74fa4d0ec6edd9e0d80 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 5 Mar 2019 14:42:07 -0800 Subject: [vcpkg] Add more detailed error message when trying to use v142 and an msbuild generator (#5422) --- scripts/cmake/vcpkg_configure_cmake.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index f7b81de93..584e93251 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -109,7 +109,20 @@ function(vcpkg_configure_cmake) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") set(ARCH "ARM64") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v142") + if(NOT VCPKG_CMAKE_SYSTEM_NAME) + set(VCPKG_CMAKE_SYSTEM_NAME Windows) + endif() + message(FATAL_ERROR +"Unable to determine appropriate CMake MSBuild generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}. +This is because CMake 3.12.4 does not currently have a 'Visual Studio 16 2019' option. +This can be worked around by either: + 1. Install Visual Studio 2017 Stable +") else() + if(NOT VCPKG_CMAKE_SYSTEM_NAME) + set(VCPKG_CMAKE_SYSTEM_NAME Windows) + endif() message(FATAL_ERROR "Unable to determine appropriate generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") endif() -- cgit v1.2.3 From d92ad530a99508e028de261eb13ad2319dbea3c4 Mon Sep 17 00:00:00 2001 From: Ernest Zaslavsky Date: Thu, 7 Mar 2019 09:37:24 +0200 Subject: Add DPDK package (#5388) DPDK is a set of libraries and drivers for fast packet processing. (cherry picked from commit 8127cb7b23557f21281186980883fdfb4fa08c47) --- scripts/cmake/vcpkg_execute_required_process.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 5b8922c14..2e9ba7058 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -56,6 +56,7 @@ function(vcpkg_execute_required_process) message(FATAL_ERROR " Command failed: ${vcpkg_execute_required_process_COMMAND}\n" " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" + " Error code: ${error_code}\n" " See logs for more information:\n" ${STRINGIFIED_LOGS} ) -- cgit v1.2.3 From 37ddeed0ead71cf4fa3770b5affb83a2a9230976 Mon Sep 17 00:00:00 2001 From: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Date: Tue, 12 Mar 2019 01:01:57 +0800 Subject: [libepoxy/fribidi] Update version of meson to support VS2019 (#5629) --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 1f856b69e..d46013a72 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -140,10 +140,10 @@ function(vcpkg_find_acquire_program VAR) else() set(SCRIPTNAME meson) endif() - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.47.1) - set(URL "https://github.com/mesonbuild/meson/archive/0.47.1.zip") - set(ARCHIVE "meson-0.47.1.zip") - set(HASH 0f6462835583a51707bee82d852018cfcb7444c0dad95b2ba08814e500a5cfe3f731dc6c1fb73c765d1120ee2a2d6600e15d8d393bab1993e84bd4354b2e6855) + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.50.0) + set(URL "https://github.com/mesonbuild/meson/archive/0.50.0.zip") + set(ARCHIVE "meson-0.50.0.zip") + set(HASH 587cafe0cd551e3fb3507ecab904912dc3e053aa95c864b435526a20d52406536ba970a50be6c9f20d83314c5853aaefa102c5ca14623d0928b091a43e7b6d64) elseif(VAR MATCHES "FLEX") if(CMAKE_HOST_WIN32) set(PROGNAME win_flex) -- cgit v1.2.3 From 62462f7162c93d43e3708faf3eb8b28c76efb3c0 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Thu, 14 Mar 2019 00:10:11 -0700 Subject: Add nuget to vcpkg_find_acquire_program (#4568) * Add nuget to vcpkg_find_acquire_program * Add niget to list of programs one can download --- scripts/cmake/vcpkg_find_acquire_program.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index d46013a72..d8dd10b2b 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -24,6 +24,7 @@ ## - MESON ## - NASM ## - NINJA +## - NUGET ## - YASM ## - ARIA2 (Downloader) ## @@ -130,6 +131,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip") set(ARCHIVE "ninja-1.8.2-win.zip") set(HASH 9b9ce248240665fcd6404b989f3b3c27ed9682838225e6dc9b67b551774f251e4ff8a207504f941e7c811e7a8be1945e7bcb94472a335ef15e23a0200a32e6d5) + elseif(VAR MATCHES "NUGET") + set(PROGNAME nuget) + set(PATHS "${DOWNLOADS}/tools/nuget") + set(BREW_PACKAGE_NAME "nuget") + set(URL "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe") + set(HASH 42CB744338AF8DECC033A75BCE5B4C4DF28E102BAFC45F9A8BA86D7BC010F5B43EBACAE80D7B28C4F85AC900EEFC2A349620AE65F27F6CA1C21C53B63B92924B) elseif(VAR MATCHES "MESON") set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) -- cgit v1.2.3 From f409536f5e8119376ee65d1f25d278b36b7f8136 Mon Sep 17 00:00:00 2001 From: Sean Warren Date: Thu, 14 Mar 2019 09:33:48 -0400 Subject: [qt5] Fix mac build (#5624) * [qt5] Fix mac build * [qt5] Disable parallel build on mac * [qt5] Fix qmake find on mac * [qt5] Update find jom for mac * [qt5] Fix invocation of build command * [qt5-base] Rebuild packages for #5624 * [harfbuzz] Remove disabled assert (failing due to -Werror) * [qt5] Bump control version * [qt5] Disable harfbuzz on mac * [qt5-base] Disable harfbuzz on mac --- scripts/cmake/vcpkg_build_qmake.cmake | 11 +++++++++-- scripts/cmake/vcpkg_configure_qmake.cmake | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 947178686..5b686527d 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -9,7 +9,14 @@ function(vcpkg_build_qmake) cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS" ${ARGN}) - vcpkg_find_acquire_program(JOM) + + if(CMAKE_HOST_WIN32) + vcpkg_find_acquire_program(JOM) + set(INVOKE "${JOM}") + else() + find_program(MAKE make) + set(INVOKE "${MAKE}") + endif() # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") @@ -29,7 +36,7 @@ function(vcpkg_build_qmake) function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") vcpkg_execute_required_process( - COMMAND ${JOM} ${TARGETS} + COMMAND ${INVOKE} ${TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} ) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index 3aa30e70d..11178174e 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -17,7 +17,7 @@ function(vcpkg_configure_qmake) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) # Find qmake executable - find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) + find_program(QMAKE_COMMAND NAMES qmake PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") -- cgit v1.2.3 From a421f43ed153cf0c86c7e0e01c9790785e7353e6 Mon Sep 17 00:00:00 2001 From: Don Date: Thu, 14 Mar 2019 13:43:49 -0700 Subject: Add headers to vcpkg_download_distfile (#5640) * Add headers to vcpkg_download_distfile Allows headers to be appended when downloading a distribution. This allows for setting authentication headers to download from a private repository. * [scripts,docs] Regenerate docs for portfile functions * [docs,scripts] Fix typo regressions * [docs,scripts] Fix broken link --- scripts/cmake/vcpkg_add_to_path.cmake | 6 ++++++ scripts/cmake/vcpkg_build_msbuild.cmake | 2 +- scripts/cmake/vcpkg_download_distfile.cmake | 20 ++++++++++++++++++-- scripts/cmake/vcpkg_from_gitlab.cmake | 6 +++++- scripts/cmake/vcpkg_install_msbuild.cmake | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_add_to_path.cmake b/scripts/cmake/vcpkg_add_to_path.cmake index 6890dfe31..7ab08c88e 100644 --- a/scripts/cmake/vcpkg_add_to_path.cmake +++ b/scripts/cmake/vcpkg_add_to_path.cmake @@ -15,6 +15,12 @@ ## Prepends the directory. ## ## The default is to append. +## +## ## Examples: +## * [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75) +## * [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15) +## * [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13) +## function(vcpkg_add_to_path) if(NOT "${ARGC}" STREQUAL "1" AND NOT "${ARGC}" STREQUAL "2") message(FATAL_ERROR "vcpkg_add_to_path() only accepts 1 or 2 arguments.") diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 7a65127f0..50432f8fa 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -1,6 +1,6 @@ ## # vcpkg_build_msbuild ## -## Build an msbuild-based project. Deprecated in favor of `vcpkg_install_msbuild()`. +## Build a msbuild-based project. Deprecated in favor of `vcpkg_install_msbuild()`. ## ## ## Usage ## ```cmake diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 949036c88..72016b8c9 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -33,6 +33,11 @@ ## ## This switch is only valid when building with the `--head` command line flag. ## +## ### HEADERS +## A list of headers to append to the download request. This can be used for authentication during a download. +## +## Headers should be specified as ": ". +## ## ## Notes ## The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downloading from GitHub projects. ## @@ -44,7 +49,7 @@ function(vcpkg_download_distfile VAR) set(options SKIP_SHA512) set(oneValueArgs FILENAME SHA512) - set(multipleValuesArgs URLS) + set(multipleValuesArgs URLS HEADERS) cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) if(NOT DEFINED vcpkg_download_distfile_URLS) @@ -110,10 +115,16 @@ function(vcpkg_download_distfile VAR) if(_VCPKG_DOWNLOAD_TOOL STREQUAL "ARIA2" AND NOT SAMPLE_URL MATCHES "aria2") vcpkg_find_acquire_program("ARIA2") message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...") + if(vcpkg_download_distfile_HEADERS) + foreach(header ${vcpkg_download_distfile_HEADERS}) + list(APPEND request_headers "--header=${header}") + endforeach() + endif() execute_process( COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} -o temp/${vcpkg_download_distfile_FILENAME} -l download-${vcpkg_download_distfile_FILENAME}-detailed.log + ${request_headers} OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log RESULT_VARIABLE error_code @@ -140,7 +151,12 @@ function(vcpkg_download_distfile VAR) else() foreach(url IN LISTS vcpkg_download_distfile_URLS) message(STATUS "Downloading ${url}...") - file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) + if(vcpkg_download_distfile_HEADERS) + foreach(header ${vcpkg_download_distfile_HEADERS}) + list(APPEND request_headers HTTPHEADER ${header}) + endforeach() + endif() + file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status ${request_headers}) list(GET download_status 0 status_code) if (NOT "${status_code}" STREQUAL "0") message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") diff --git a/scripts/cmake/vcpkg_from_gitlab.cmake b/scripts/cmake/vcpkg_from_gitlab.cmake index f13bc054c..6bbe81ed6 100644 --- a/scripts/cmake/vcpkg_from_gitlab.cmake +++ b/scripts/cmake/vcpkg_from_gitlab.cmake @@ -56,7 +56,11 @@ ## ## This exports the `VCPKG_HEAD_VERSION` variable during head builds. ## - +## ## Examples: +## * [curl][https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake#L75] +## * [folly](https://github.com/Microsoft/vcpkg/blob/master/ports/folly/portfile.cmake#L15) +## * [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13) +## function(vcpkg_from_gitlab) set(oneValueArgs OUT_SOURCE_PATH GITLAB_URL USER REPO REF SHA512 HEAD_REF) set(multipleValuesArgs PATCHES) diff --git a/scripts/cmake/vcpkg_install_msbuild.cmake b/scripts/cmake/vcpkg_install_msbuild.cmake index 11bcdf189..92c84bf0b 100644 --- a/scripts/cmake/vcpkg_install_msbuild.cmake +++ b/scripts/cmake/vcpkg_install_msbuild.cmake @@ -1,6 +1,6 @@ ## # vcpkg_install_msbuild ## -## Build and install an msbuild-based project. This replaces `vcpkg_build_msbuild()`. +## Build and install a msbuild-based project. This replaces `vcpkg_build_msbuild()`. ## ## ## Usage ## ```cmake -- cgit v1.2.3 From bdc5d538a59e4983ab184d65963bac2678d35947 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Thu, 14 Mar 2019 22:26:16 +0100 Subject: cmake sometimes requires a generator if it is not defined beforehand. extra code comments. Maybe the test should actually try to link targets from the package instead of just testing find_package --- scripts/cmake/vcpkg_test_cmake.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index 29654346a..f02f0cf07 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -36,17 +36,32 @@ function(vcpkg_test_cmake) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + #Generate Dummy source +# set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) +# file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") +# file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") # Generate test source CMakeLists.txt set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") + #To properly test if the package is actually working haveway correctly we have to link all targets of a package to + #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked + #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? +# file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") +# file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") + + if(DEFINED _VCPKG_CMAKE_GENERATOR) + set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") + else() + set(VCPKG_CMAKE_TEST_GENERATOR Ninja) + endif() # Run cmake config with a generated CMakeLists.txt set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") execute_process( - COMMAND ${CMAKE_COMMAND} . + COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . OUTPUT_FILE "${LOGPREFIX}-out.log" ERROR_FILE "${LOGPREFIX}-err.log" RESULT_VARIABLE error_code -- cgit v1.2.3 From b755c30bc7f4a48db344eb1a25873e56b31925c0 Mon Sep 17 00:00:00 2001 From: kiwixz Date: Sat, 16 Mar 2019 17:40:31 +0100 Subject: update to cmake 3.14 (allow VS2019RC) --- scripts/cmake/vcpkg_configure_cmake.cmake | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 584e93251..83acf1bae 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -109,16 +109,11 @@ function(vcpkg_configure_cmake) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") set(ARCH "ARM64") + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v142") - if(NOT VCPKG_CMAKE_SYSTEM_NAME) - set(VCPKG_CMAKE_SYSTEM_NAME Windows) - endif() - message(FATAL_ERROR -"Unable to determine appropriate CMake MSBuild generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}. -This is because CMake 3.12.4 does not currently have a 'Visual Studio 16 2019' option. -This can be worked around by either: - 1. Install Visual Studio 2017 Stable -") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "${VCPKG_TARGET_ARCHITECTURE}") + else() if(NOT VCPKG_CMAKE_SYSTEM_NAME) set(VCPKG_CMAKE_SYSTEM_NAME Windows) -- cgit v1.2.3 From caa7981dcfbdc2da76335d82920bb781f7b047d6 Mon Sep 17 00:00:00 2001 From: kiwixz Date: Sat, 16 Mar 2019 17:53:31 +0100 Subject: fix vs2019 arch specification --- scripts/cmake/vcpkg_configure_cmake.cmake | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 83acf1bae..ceff199ab 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -110,9 +110,18 @@ function(vcpkg_configure_cmake) set(GENERATOR "Visual Studio 15 2017") set(ARCH "ARM64") - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v142") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v142") set(GENERATOR "Visual Studio 16 2019") - set(ARCH "${VCPKG_TARGET_ARCHITECTURE}") + set(ARCH "Win32") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "x64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "ARM") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v142") + set(GENERATOR "Visual Studio 16 2019") + set(ARCH "ARM64") else() if(NOT VCPKG_CMAKE_SYSTEM_NAME) -- cgit v1.2.3 From c2ad1baafccc91bf7e9e60a390eb91cf4e130062 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Fri, 22 Mar 2019 16:26:27 -0700 Subject: Disable vcpkg_test_cmake() --- scripts/cmake/vcpkg_test_cmake.cmake | 92 +++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 43 deletions(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake index f02f0cf07..20343bf64 100644 --- a/scripts/cmake/vcpkg_test_cmake.cmake +++ b/scripts/cmake/vcpkg_test_cmake.cmake @@ -16,58 +16,64 @@ ## Indicates that the library expects to be found via built-in CMake targets. ## function(vcpkg_test_cmake) - cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) + # The following issues need to be addressed before re-enabling this function. + # 1. Use the actual vcpkg toolchain file. + # 2. Select a generator in the same method as vcpkg_configure_cmake() as though the PREFER_NINJA flag was always passed. + # 3. Fully emulate the toolchain file for the just-built package (just adding it to CMAKE_PREFIX_PATH is not enough). + return() - if(NOT DEFINED _tc_PACKAGE_NAME) - message(FATAL_ERROR "PACKAGE_NAME must be specified") - endif() - if(_tc_MODULE) - set(PACKAGE_TYPE MODULE) - else() - set(PACKAGE_TYPE CONFIG) - endif() + cmake_parse_arguments(_tc "MODULE" "PACKAGE_NAME" "" ${ARGN}) - if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") - message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") - return() - endif() + if(NOT DEFINED _tc_PACKAGE_NAME) + message(FATAL_ERROR "PACKAGE_NAME must be specified") + endif() + if(_tc_MODULE) + set(PACKAGE_TYPE MODULE) + else() + set(PACKAGE_TYPE CONFIG) + endif() - message(STATUS "Performing CMake integration test") - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142") + message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues") + return() + endif() - #Generate Dummy source + message(STATUS "Performing CMake integration test") + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test) + + #Generate Dummy source # set(VCPKG_TEST_SOURCE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeIntegration.cpp) # file(WRITE ${VCPKG_TEST_SOURCE} "int main() \{\n") # file(APPEND ${VCPKG_TEST_SOURCE} "return 0;}") - # Generate test source CMakeLists.txt - set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) - file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") - file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") - #To properly test if the package is actually working haveway correctly we have to link all targets of a package to - #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked - #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? + # Generate test source CMakeLists.txt + set(VCPKG_TEST_CMAKELIST ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test/CMakeLists.txt) + file(WRITE ${VCPKG_TEST_CMAKELIST} "cmake_minimum_required(VERSION 3.10)\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "set(CMAKE_PREFIX_PATH \"${CURRENT_PACKAGES_DIR};${CURRENT_INSTALLED_DIR}\")\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "\n") + file(APPEND ${VCPKG_TEST_CMAKELIST} "find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)\n") + #To properly test if the package is actually working haveway correctly we have to link all targets of a package to + #a test executable and than actually build it. This will not discover if every symbol exported by the library is available/linked + #but it will doscover if all files which are linked by a target actual exist. Problem is: How to discover all targets? # file(APPEND ${VCPKG_TEST_CMAKELIST} "add_executable(${_tc_PACKAGE_NAME}_exe ${VCPKG_TEST_SOURCE})\n") # file(APPEND ${VCPKG_TEST_CMAKELIST} "target_link_libraries(${_tc_PACKAGE_NAME}_exe PRIVATE ${_tc_PACKAGE_NAME})\n") - if(DEFINED _VCPKG_CMAKE_GENERATOR) - set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") - else() - set(VCPKG_CMAKE_TEST_GENERATOR Ninja) - endif() + if(DEFINED _VCPKG_CMAKE_GENERATOR) + set(VCPKG_CMAKE_TEST_GENERATOR "${_VCPKG_CMAKE_GENERATOR}") + else() + set(VCPKG_CMAKE_TEST_GENERATOR Ninja) + endif() - # Run cmake config with a generated CMakeLists.txt - set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") - execute_process( - COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . - OUTPUT_FILE "${LOGPREFIX}-out.log" - ERROR_FILE "${LOGPREFIX}-err.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test - ) - if(error_code) - message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") - endif() + # Run cmake config with a generated CMakeLists.txt + set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/test-cmake-${TARGET_TRIPLET}") + execute_process( + COMMAND ${CMAKE_COMMAND} -G ${VCPKG_CMAKE_TEST_GENERATOR} . + OUTPUT_FILE "${LOGPREFIX}-out.log" + ERROR_FILE "${LOGPREFIX}-err.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test + ) + if(error_code) + message(FATAL_ERROR "CMake integration test failed; unable to find_package(${_tc_PACKAGE_NAME} ${PACKAGE_TYPE} REQUIRED)") + endif() endfunction() -- cgit v1.2.3 From 0fffb47ed02507aeacc29c64d91e9d4639f981f6 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Tue, 2 Apr 2019 15:49:03 -0500 Subject: Fix vcpkg_find_acquire_program(NUGET) (#5871) Set the ARCHIVE and NOEXTRACT variables so that downloading works. Also HASH is case-sensitive, so make it lower case. vcpkg_find_acquire_program(NUGET) was failing with the following error message: -- Downloading https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe... CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:159 (file): file DOWNLOAD error: cannot create directory 'C:/Users/david/Documents/GitHub/vcpkg/downloads/temp/C:/Users/david/Documents/GitHub/vcpkg/downloads' - Specify file by full path name and verify that you have directory creation and file write privileges. Call Stack (most recent call first): scripts/cmake/vcpkg_find_acquire_program.cmake:255 (vcpkg_download_distfile) ports/gobject-introspection/portfile.cmake:20 (vcpkg_find_acquire_program) scripts/ports.cmake:71 (include) --- scripts/cmake/vcpkg_find_acquire_program.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index d8dd10b2b..1642bf3b4 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -136,7 +136,9 @@ function(vcpkg_find_acquire_program VAR) set(PATHS "${DOWNLOADS}/tools/nuget") set(BREW_PACKAGE_NAME "nuget") set(URL "https://dist.nuget.org/win-x86-commandline/v4.8.1/nuget.exe") - set(HASH 42CB744338AF8DECC033A75BCE5B4C4DF28E102BAFC45F9A8BA86D7BC010F5B43EBACAE80D7B28C4F85AC900EEFC2A349620AE65F27F6CA1C21C53B63B92924B) + set(ARCHIVE "nuget.exe") + set(NOEXTRACT ON) + set(HASH 42cb744338af8decc033a75bce5b4c4df28e102bafc45f9a8ba86d7bc010f5b43ebacae80d7b28c4f85ac900eefc2a349620ae65f27f6ca1c21c53b63b92924b) elseif(VAR MATCHES "MESON") set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) -- cgit v1.2.3 From d788ada4e97ce5b36fc397a94da453814342ec43 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 3 Apr 2019 02:16:30 -0700 Subject: [vtk] Fix flakiness by relying on vcpkg-provided dependencies [libharu] Add patches required for vtk [vcpkg-build-cmake] Add retry logic for mt.exe failures --- scripts/cmake/vcpkg_build_cmake.cmake | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'scripts/cmake') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 2f0da07f9..e86632c7e 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -162,6 +162,33 @@ function(vcpkg_build_cmake) endif() endwhile() endif() + elseif(out_contents MATCHES "mt : general error c101008d: ") + # Antivirus workaround - occasionally files are locked and cause mt.exe to fail + set(ITERATION 0) + while (ITERATION LESS 3 AND out_contents MATCHES "mt : general error c101008d: ") + MATH(EXPR ITERATION "${ITERATION}+1") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of mt.exe file locking issue. Iteration: ${ITERATION}") + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} + OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" + ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) + file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") + endif() + else() + break() + endif() + endwhile() endif() if(error_code) @@ -170,7 +197,7 @@ function(vcpkg_build_cmake) file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") endforeach() - set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG}) + set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG}) set(_eb_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) message(FATAL_ERROR " Command failed: ${_eb_COMMAND}\n" -- cgit v1.2.3