From 30ea0b801f631ab31a6b612ccf09142f6ff85c63 Mon Sep 17 00:00:00 2001 From: Daniel Shaw Date: Mon, 22 May 2017 12:10:20 -0700 Subject: [rttr] initial commit of version 0.9.5 --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 7c1891584..3b0c794d9 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -19,7 +19,7 @@ function(vcpkg_fixup_cmake_targets) set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) - if(NOT ${_vfct_CONFIG_PATH} STREQUAL "") + if(_vfct_CONFIG_PATH) set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) @@ -34,26 +34,26 @@ function(vcpkg_fixup_cmake_targets) get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) - if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake") + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") file(REMOVE_RECURSE ${DEBUG_CONFIG}) else() get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) - if(${DEBUG_CONFIG_DIR_NAME} STREQUAL "cmake") + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) endif() endif() get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG} NAME) string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) - if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake") + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake") file(REMOVE_RECURSE ${RELEASE_CONFIG}) else() get_filename_component(RELEASE_CONFIG_PARENT_DIR ${RELEASE_CONFIG} DIRECTORY) get_filename_component(RELEASE_CONFIG_DIR_NAME ${RELEASE_CONFIG_PARENT_DIR} NAME) string(TOLOWER "${RELEASE_CONFIG_DIR_NAME}" RELEASE_CONFIG_DIR_NAME) - if(${RELEASE_CONFIG_DIR_NAME} STREQUAL "cmake") + if(RELEASE_CONFIG_DIR_NAME STREQUAL "cmake") file(REMOVE_RECURSE ${RELEASE_CONFIG_PARENT_DIR}) endif() endif() @@ -63,10 +63,18 @@ function(vcpkg_fixup_cmake_targets) message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") endif() - file(GLOB UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake" "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake") + file(GLOB UNUSED_FILES + "${DEBUG_SHARE}/*[Tt]argets.cmake" + "${DEBUG_SHARE}/*[Cc]onfig.cmake" + "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" + "${DEBUG_SHARE}/*[Cc]onfig-version.cmake" + ) file(REMOVE ${UNUSED_FILES}) - file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake") + file(GLOB RELEASE_TARGETS + "${RELEASE_SHARE}/*[Tt]argets-release.cmake" + "${RELEASE_SHARE}/*[Cc]onfig-release.cmake" + ) foreach(RELEASE_TARGET ${RELEASE_TARGETS}) get_filename_component(RELEASE_TARGET_NAME ${RELEASE_TARGET} NAME) @@ -75,7 +83,10 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${RELEASE_TARGET} "${_contents}") endforeach() - file(GLOB DEBUG_TARGETS "${DEBUG_SHARE}/*[Tt]argets-debug.cmake") + file(GLOB DEBUG_TARGETS + "${DEBUG_SHARE}/*[Tt]argets-debug.cmake" + "${DEBUG_SHARE}/*[Cc]onfig-debug.cmake" + ) foreach(DEBUG_TARGET ${DEBUG_TARGETS}) get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) -- cgit v1.2.3 From 932f0f0657767c26687dcad81311d4badc56348b Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Mon, 22 May 2017 23:57:37 +0300 Subject: scripts/fetchDependency.ps1: fix vcpkg boostrapping with Powershell Core --- scripts/fetchDependency.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 98144bffa..bbc027861 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -9,7 +9,9 @@ $downloadPromptOverride_NO_OVERRIDE= 0 $downloadPromptOverride_DO_NOT_PROMPT = 1 $downloadPromptOverride_ALWAYS_PROMPT = 2 -Import-Module BitsTransfer -Verbose:$false +if ($PSVersionTable.PSEdition -eq "Desktop") { + Import-Module BitsTransfer -Verbose:$false +} Write-Verbose "Fetching dependency: $Dependency" @@ -80,7 +82,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType directory -Path $downloadDir | Out-Null } - if ($Dependency -ne "git") # git fails with BITS + if (($PSVersionTable.PSEdition -eq "Desktop") -and ($Dependency -ne "git")) # git fails with BITS { try { $WC = New-Object System.Net.WebClient @@ -195,11 +197,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") - $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) - $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) - $downloadedFileHash = -Join ($hashByteArray | ForEach {"{0:x2}" -f $_}) - + $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash + if ($expectedDownloadedFileHash -ne $downloadedFileHash) { throw [System.IO.FileNotFoundException] ("Mismatching hash of the downloaded " + $Dependency) -- cgit v1.2.3 From 70429b207dbdf8b2f0c9b71372d3d121acd9ba51 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 22 May 2017 22:00:02 -0700 Subject: [vcpkg] Enable VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT --- scripts/ports.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 9558ac2dc..1d699a966 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -85,6 +85,9 @@ if(CMD MATCHES "^BUILD$") if (DEFINED VCPKG_POLICY_ONLY_RELEASE_CRT) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyOnlyReleaseCRT: ${VCPKG_POLICY_ONLY_RELEASE_CRT}\n") endif() + if (DEFINED VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT) + file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyAllowObsoleteMsvcrt: ${VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT}\n") + endif() if (DEFINED VCPKG_POLICY_EMPTY_INCLUDE_FOLDER) file(APPEND ${BUILD_INFO_FILE_PATH} "PolicyEmptyIncludeFolder: ${VCPKG_POLICY_EMPTY_INCLUDE_FOLDER}\n") endif() -- cgit v1.2.3 From 5ba2f0d81cf9ad13d544606608f314230a0db283 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 23 May 2017 11:53:20 -0700 Subject: scripts/fetchDependency.ps1: Retain previous code for hashing to support Win7 --- scripts/fetchDependency.ps1 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index bbc027861..6c2e85b60 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -10,7 +10,7 @@ $downloadPromptOverride_DO_NOT_PROMPT = 1 $downloadPromptOverride_ALWAYS_PROMPT = 2 if ($PSVersionTable.PSEdition -eq "Desktop") { - Import-Module BitsTransfer -Verbose:$false + Import-Module BitsTransfer -Verbose:$false } Write-Verbose "Fetching dependency: $Dependency" @@ -197,8 +197,18 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash - $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash - + if ($PSVersionTable.PSEdition -eq "Desktop") + { + $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") + $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) + $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) + $downloadedFileHash = -Join ($hashByteArray | ForEach {"{0:x2}" -f $_}) + } + else + { + $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash + } + if ($expectedDownloadedFileHash -ne $downloadedFileHash) { throw [System.IO.FileNotFoundException] ("Mismatching hash of the downloaded " + $Dependency) -- cgit v1.2.3 From 2b944c21e84a38af5628c849141fe959eb1c65e1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 24 May 2017 03:33:20 -0700 Subject: [vcpkg] Fix regression on Windows 7/8 introduced with Powershell Core support --- scripts/fetchDependency.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6c2e85b60..b6144d581 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -9,7 +9,7 @@ $downloadPromptOverride_NO_OVERRIDE= 0 $downloadPromptOverride_DO_NOT_PROMPT = 1 $downloadPromptOverride_ALWAYS_PROMPT = 2 -if ($PSVersionTable.PSEdition -eq "Desktop") { +if ($PSVersionTable.PSEdition -ne "Core") { Import-Module BitsTransfer -Verbose:$false } @@ -82,7 +82,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType directory -Path $downloadDir | Out-Null } - if (($PSVersionTable.PSEdition -eq "Desktop") -and ($Dependency -ne "git")) # git fails with BITS + if (($PSVersionTable.PSEdition -ne "Core") -and ($Dependency -ne "git")) # git fails with BITS { try { $WC = New-Object System.Net.WebClient @@ -197,7 +197,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash - if ($PSVersionTable.PSEdition -eq "Desktop") + if ($PSVersionTable.PSEdition -ne "Core") { $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) -- cgit v1.2.3 From f1bf4276955ef2b1d93b6181bdd89b5af836712f Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Thu, 25 May 2017 08:42:01 -0700 Subject: Added Flex and Bison to vcpkg_find_acquire_program --- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 5c8a00ad2..7edfb4628 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -84,6 +84,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/mesonbuild/meson/archive/0.40.1.zip") set(ARCHIVE "meson-0.40.1.zip") set(HASH 4c1d07f32d527859f762c34de74d31d569573fc833335ab9652ed38d1f9e64b49869e826527c28a6a07cb8e594fd5c647b34aa95e626236a2707f75df0a2d435) + elseif(VAR MATCHES "WINFLEXBISON") + set(PROGNAME winflexbison) + set(PATHS ${DOWNLOADS}/tools/winflexbison) + set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") + set(ARCHIVE "win_flex_bison-2.5.9.zip") + set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 985e787b751891c4923a281644b40b4a20f3da90 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 25 May 2017 15:55:46 -0700 Subject: [vcpkg-ci] Add uwebsockets to internal CI --- scripts/internalCI.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 151b664b8..66744976d 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -15,7 +15,7 @@ if (-not $?) { throw $? } ./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp if (-not $?) { throw $? } -./vcpkg.exe install bond chakracore cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows +./vcpkg.exe install bond chakracore cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static if (-not $?) { throw $? } ./vcpkg.exe install opencv:x86-uwp boost:x86-uwp -- cgit v1.2.3 From 9884310dbea5177f697ccee4d722af5fec9a2f63 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Thu, 25 May 2017 18:04:02 -0700 Subject: Remove unintuitive naming in vcpkg_find_acquire_program --- scripts/cmake/vcpkg_find_acquire_program.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 7edfb4628..127982842 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -84,8 +84,14 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/mesonbuild/meson/archive/0.40.1.zip") set(ARCHIVE "meson-0.40.1.zip") set(HASH 4c1d07f32d527859f762c34de74d31d569573fc833335ab9652ed38d1f9e64b49869e826527c28a6a07cb8e594fd5c647b34aa95e626236a2707f75df0a2d435) - elseif(VAR MATCHES "WINFLEXBISON") - set(PROGNAME winflexbison) + elseif(VAR MATCHES "FLEX") + set(PROGNAME win_flex) + set(PATHS ${DOWNLOADS}/tools/winflexbison) + set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") + set(ARCHIVE "win_flex_bison-2.5.9.zip") + set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) + elseif(VAR MATCHES "BISON") + set(PROGNAME win_bison) set(PATHS ${DOWNLOADS}/tools/winflexbison) set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") set(ARCHIVE "win_flex_bison-2.5.9.zip") -- cgit v1.2.3 From e288a87b9f048b53ecf20bebc429ab1ab732220a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 25 May 2017 18:15:05 -0700 Subject: [vcpkg-ci] Do not delete log files --- scripts/internalCI.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 66744976d..68c917f7a 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -6,7 +6,7 @@ New-Item -type file downloads\AlwaysAllowDownloads -errorAction SilentlyContinue if (-not $?) { throw $? } # Clear out any intermediate files from the previous build -Get-ChildItem buildtrees/*/* | ? Name -ne "src" | Remove-Item -Recurse -Force +Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" -and $_.Extension -ne ".log"} | Remove-Item -Recurse -Force # Purge any outdated packages ./vcpkg remove --outdated --recurse -- cgit v1.2.3 From 334a35e4251eb3076594951550930aa9c46cec06 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 28 May 2017 13:07:20 -0700 Subject: [vcpkg-toolchain] Compare CMAKE_SYSTEM_NAME, not WINDOWS_STORE. Fixes #1179. --- scripts/buildsystems/vcpkg.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 26fa020db..d3e1e814a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,3 +1,6 @@ +# Mark variables as used so cmake doesn't complain about them +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) + if(NOT VCPKG_TOOLCHAIN) if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -32,7 +35,7 @@ if(NOT VCPKG_TOOLCHAIN) endif() endif() - if(WINDOWS_STORE OR WINDOWS_PHONE) + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) -- cgit v1.2.3 From 49cd3995862c0bed0701f84535812e1d0690896f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 24 May 2017 23:33:16 -0700 Subject: [vcpkg-docs] Rework documentation for compatibility with readthedocs.io and MkDocs. --- scripts/cmake/vcpkg_acquire_msys.cmake | 45 ++++++++++ scripts/cmake/vcpkg_apply_patches.cmake | 52 +++++++----- scripts/cmake/vcpkg_build_msbuild.cmake | 99 ++++++++++++---------- scripts/cmake/vcpkg_configure_cmake.cmake | 46 ++++++++++ scripts/cmake/vcpkg_copy_pdbs.cmake | 16 ++++ scripts/cmake/vcpkg_copy_tool_dependencies.cmake | 20 ++++- scripts/cmake/vcpkg_download_distfile.cmake | 37 +++++++- scripts/cmake/vcpkg_execute_required_process.cmake | 31 ++++++- scripts/cmake/vcpkg_extract_source_archive.cmake | 29 +++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 34 ++++++++ scripts/cmake/vcpkg_from_github.cmake | 60 ++++++++++--- scripts/cmake/vcpkg_install_cmake.cmake | 22 +++++ 12 files changed, 413 insertions(+), 78 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index ee526529b..b63700877 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -1,3 +1,48 @@ +## # vcpkg_acquire_msys +## +## Download and prepare an MSYS2 instance. +## +## ## Usage +## ```cmake +## vcpkg_acquire_msys() +## ``` +## +## ## Parameters +## ### MSYS_ROOT_VAR +## An out-variable that will be set to the path to MSYS2. +## +## ## Notes +## A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: +## ```cmake +## vcpkg_acquire_msys(MSYS_ROOT) +## set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) +## +## vcpkg_execute_required_process( +## COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" +## WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel +## LOGNAME build-${TARGET_TRIPLET}-rel +## ) +## ``` +## To ensure a package is available: +## ```cmake +## vcpkg_acquire_msys(MSYS_ROOT) +## set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) +## +## message(STATUS "Installing MSYS Packages") +## vcpkg_execute_required_process( +## COMMAND +## ${BASH} --noprofile --norc -c +## "pacman -Sy --noconfirm --needed make" +## WORKING_DIRECTORY ${MSYS_ROOT} +## LOGNAME pacman-${TARGET_TRIPLET}) +## ``` +## +## ## Examples +## +## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +## * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake) +## * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) + function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(TOOLPATH ${DOWNLOADS}/tools/msys2) diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index 1ef138a1e..ac6e5cc93 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -1,23 +1,35 @@ -#.rst: -# .. command:: vcpkg_apply_patches -# -# Apply a set of patches to a source tree. -# -# :: -# vcpkg_apply_patches(SOURCE_PATH -# PATCHES patch1 [patch ...] -# ) -# -# ``SOURCE_PATH`` -# The source path in which apply the patches. -# ``PATCHES`` -# A list of patches that are applied to the source tree -# ``QUIET`` -# If this option is passed, the warning message when applyng -# a patch fails is not printed. This is convenient for patches -# that are known to fail even on a clean source tree, and for -# which the standard warning message would be confusing for the user. -# +## # vcpkg_apply_patches +## +## Apply a set of patches to a source tree. +## +## ## Usage +## ```cmake +## vcpkg_apply_patches( +## SOURCE_PATH <${SOURCE_PATH}> +## [QUIET] +## PATCHES ... +## ) +## ``` +## +## ## Parameters +## ### SOURCE_PATH +## The source path in which apply the patches. By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +## +## ### PATCHES +## A list of patches that are applied to the source tree. +## +## Generally, these take the form of `${CMAKE_CURRENT_LIST_DIR}/some.patch` to select patches in the `port\\` directory. +## +## ### QUIET +## Disables the warning message upon failure. +## +## This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. +## +## ## Examples +## +## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) +## * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake) +## * [libpng](https://github.com/Microsoft/vcpkg/blob/master/ports/libpng/portfile.cmake) function(vcpkg_apply_patches) cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN}) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 6fe3f5aa0..1e3c85ba2 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -1,46 +1,59 @@ -#.rst: -# .. command:: vcpkg_build_msbuild -# -# Build a msbuild-based project. -# -# :: -# vcpkg_build_msbuild(PROJECT_PATH -# [RELEASE_CONFIGURATION ] # (default = "Release") -# [DEBUG_CONFIGURATION ] @ (default = "Debug") -# [TARGET_PLATFORM_VERSION ] -# [PLATFORM ] # (default = "${TRIPLET_SYSTEM_ARCH}") -# [PLATFORM_TOOLSET ] # (default = "${VCPKG_PLATFORM_TOOLSET}") -# [OPTIONS arg1 [arg2 ...]] -# [OPTIONS_RELEASE arg1 [arg2 ...]] -# [OPTIONS_DEBUG arg1 [arg2 ...]] -# ) -# -# ``PROJECT_PATH`` -# The path to the *.sln msbuild project file. -# ``RELEASE_CONFIGURATION`` -# The configuration (``/p:Configuration`` msbuild parameter) -# used for Release builds. -# ``DEBUG_CONFIGURATION`` -# The configuration (``/p:Configuration`` msbuild parameter) -# used for Debug builds. -# ``TARGET_PLATFORM_VERSION`` -# The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) -# ``TARGET`` -# The MSBuild target to build. (``/t:``) -# ``PLATFORM`` -# The platform (``/p:Platform`` msbuild parameter) -# used for the build. -# ``PLATFORM_TOOLSET`` -# The platform toolset (``/p:PlatformToolset`` msbuild parameter) -# used for the build. -# ``OPTIONS`` -# The options passed to msbuild for all builds. -# ``OPTIONS_RELEASE`` -# The options passed to msbuild for Release builds. -# ``OPTIONS_DEBUG`` -# The options passed to msbuild for Debug builds. -# - +## # vcpkg_build_msbuild +## +## Build an msbuild-based project. +## +## ## Usage +## ```cmake +## vcpkg_build_msbuild( +## PROJECT_PATH <${SOURCE_PATH}/port.sln> +## [RELEASE_CONFIGURATION ] +## [DEBUG_CONFIGURATION ] +## [TARGET ] +## [TARGET_PLATFORM_VERSION <10.0.15063.0>] +## [PLATFORM <${TRIPLET_SYSTEM_ARCH}>] +## [PLATFORM_TOOLSET <${VCPKG_PLATFORM_TOOLSET}>] +## [OPTIONS ...] +## [OPTIONS_RELEASE ...] +## [OPTIONS_DEBUG ...] +## ) +## ``` +## +## ## Parameters +## ### PROJECT_PATH +## The path to the solution (`.sln`) or project (`.vcxproj`) file. +## +## ### RELEASE_CONFIGURATION +## The configuration (``/p:Configuration`` msbuild parameter) used for Release builds. +## +## ### DEBUG_CONFIGURATION +## The configuration (``/p:Configuration`` msbuild parameter) +## used for Debug builds. +## +## ### TARGET_PLATFORM_VERSION +## The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter) +## +## ### TARGET +## The MSBuild target to build. (``/t:``) +## +## ### PLATFORM +## The platform (``/p:Platform`` msbuild parameter) used for the build. +## +## ### PLATFORM_TOOLSET +## The platform toolset (``/p:PlatformToolset`` msbuild parameter) used for the build. +## +## ### OPTIONS +## Additional options passed to msbuild for all builds. +## +## ### OPTIONS_RELEASE +## Additional options passed to msbuild for Release builds. These are in addition to `OPTIONS`. +## +## ### OPTIONS_DEBUG +## Additional options passed to msbuild for Debug builds. These are in addition to `OPTIONS`. +## +## ## Examples +## +## * [libuv](https://github.com/Microsoft/vcpkg/blob/master/ports/libuv/portfile.cmake) +## * [zeromq](https://github.com/Microsoft/vcpkg/blob/master/ports/zeromq/portfile.cmake) function(vcpkg_build_msbuild) cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index cd979be1b..7d43336de 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -1,3 +1,49 @@ +## # vcpkg_configure_cmake +## +## Configure CMake for Debug and Release builds of a project. +## +## ## Usage +## ```cmake +## vcpkg_configure_cmake( +## SOURCE_PATH <${SOURCE_PATH}> +## [PREFER_NINJA] +## [GENERATOR <"NMake Makefiles">] +## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...] +## [OPTIONS_RELEASE <-DOPTIMIZE=1>...] +## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...] +## ) +## ``` +## +## ## Parameters +## ### SOURCE_PATH +## Specifies the directory containing the `CMakeLists.txt`. By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. +## +## ### PREFER_NINJA +## Indicates that, when available, Vcpkg should use Ninja to perform the build. This should be specified unless the port is known to not work under Ninja. +## +## ### GENERATOR +## Specifies the precise generator to use. +## +## This is useful if some project-specific buildsystem has been wrapped in a cmake script that won't perform an actual build. If used for this purpose, it should be set to "NMake Makefiles". +## +## ### OPTIONS +## Additional options passed to CMake during the configuration. +## +## ### OPTIONS_RELEASE +## Additional options passed to CMake during the Release configuration. These are in addition to `OPTIONS`. +## +## ### OPTIONS_DEBUG +## Additional options passed to CMake during the Debug configuration. These are in addition to `OPTIONS`. +## +## ## Notes +## This command supplies many common arguments to CMake. To see the full list, examine the source. +## +## ## Examples +## +## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_configure_cmake) cmake_parse_arguments(_csc "PREFER_NINJA" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) diff --git a/scripts/cmake/vcpkg_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index 61ad97728..ca55eb015 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -1,3 +1,19 @@ +## # vcpkg_copy_pdbs +## +## Automatically locate pdbs in the build tree and copy them adjacent to all DLLs. +## +## ## Usage +## ```cmake +## vcpkg_copy_pdbs() +## ``` +## +## ## Notes +## This command should always be called by portfiles after they have finished rearranging the binary output. +## +## ## Examples +## +## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) function(vcpkg_copy_pdbs) function(merge_filelist OUTVAR INVAR) diff --git a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake index f8af19230..165f19ed1 100644 --- a/scripts/cmake/vcpkg_copy_tool_dependencies.cmake +++ b/scripts/cmake/vcpkg_copy_tool_dependencies.cmake @@ -1,5 +1,21 @@ -# Copy dlls for all tools in TOOL_DIR - +## # vcpkg_copy_tool_dependencies +## +## Copy all DLL dependencies of built tools into the tool folder. +## +## ## Usage +## ```cmake +## vcpkg_copy_tool_dependencies(<${CURRENT_PACKAGES_DIR}/tools/${PORT}>) +## ``` +## ## Parameters +## The path to the directory containing the tools. +## +## ## Notes +## This command should always be called by portfiles after they have finished rearranging the binary output, if they have any tools. +## +## ## Examples +## +## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake) +## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) function(vcpkg_copy_tool_dependencies TOOL_DIR) macro(search_for_dependencies PATH_TO_SEARCH) file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll) diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index d086f9d23..006570195 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -1,4 +1,39 @@ -# Usage: vcpkg_download_distfile( URLS FILENAME SHA512 <5981de...>) +## # vcpkg_download_distfile +## +## Download and cache a file needed for this port. +## +## ## Usage +## ```cmake +## vcpkg_download_distfile( +## +## URLS ... +## FILENAME +## SHA512 <5981de...> +## ) +## ``` +## ## Parameters +## ### OUT_VARIABLE +## This variable will be set to the full path to the downloaded file. This can then immediately be passed in to [`vcpkg_extract_source_archive`](vcpkg_extract_source_archive.md) for sources. +## +## ### URLS +## A list of URLs to be consulted. They will be tried in order until one of the downloaded files successfully matches the SHA512 given. +## +## ### FILENAME +## The local name for the file. Files are shared between ports, so the file may need to be renamed to make it clearly attributed to this port and avoid conflicts. +## +## ### SHA512 +## The expected hash for the file. +## +## If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch. +## +## ## Notes +## The command [`vcpkg_from_github`](vcpkg_from_github.md) should be used instead of this for downloading the main archive for GitHub projects. +## +## ## Examples +## +## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) +## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake) +## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) function(vcpkg_download_distfile VAR) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS) diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 7feff08b2..173bca6e9 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -1,4 +1,33 @@ -# Usage: vcpkg_execute_required_process(COMMAND [...] WORKING_DIRECTORY LOGNAME ) +## # vcpkg_execute_required_process +## +## Execute a process with logging and fail the build if the command fails. +## +## ## Usage +## ```cmake +## vcpkg_execute_required_process( +## COMMAND <${PERL}> [...] +## WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg> +## LOGNAME +## ) +## ``` +## ## Parameters +## ### COMMAND +## The command to be executed, along with its arguments. +## +## ### WORKING_DIRECTORY +## The directory to execute the command in. +## +## ### LOGNAME +## The prefix to use for the log files. +## +## This should be a unique name for different triplets so that the logs don't conflict when building multiple at once. +## +## ## Examples +## +## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) +## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) +## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) function(vcpkg_execute_required_process) cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) #debug_message("vcpkg_execute_required_process(${vcpkg_execute_required_process_COMMAND})") diff --git a/scripts/cmake/vcpkg_extract_source_archive.cmake b/scripts/cmake/vcpkg_extract_source_archive.cmake index 71654b452..5c16616c6 100644 --- a/scripts/cmake/vcpkg_extract_source_archive.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive.cmake @@ -1,3 +1,32 @@ +## # vcpkg_extract_source_archive +## +## Extract an archive into the source directory. +## +## ## Usage +## ```cmake +## vcpkg_extract_source_archive( +## <${ARCHIVE}> [<${TARGET_DIRECTORY}>] +## ) +## ``` +## ## Parameters +## ### ARCHIVE +## The full path to the archive to be extracted. +## +## This is usually obtained from calling [`vcpkg_download_distfile`](vcpkg_download_distfile.md). +## +## ### TARGET_DIRECTORY +## If specified, the archive will be extracted into the target directory instead of `${CURRENT_BUILDTREES_DIR}\src\`. +## +## This can be used to mimic git submodules, by extracting into a subdirectory of another archive. +## +## ## Notes +## This command will also create a tracking file named .extracted in the TARGET_DIRECTORY. This file, when present, will suppress the extraction of the archive. +## +## ## Examples +## +## * [libraw](https://github.com/Microsoft/vcpkg/blob/master/ports/libraw/portfile.cmake) +## * [protobuf](https://github.com/Microsoft/vcpkg/blob/master/ports/protobuf/portfile.cmake) +## * [msgpack](https://github.com/Microsoft/vcpkg/blob/master/ports/msgpack/portfile.cmake) include(vcpkg_execute_required_process) function(vcpkg_extract_source_archive_ex) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 127982842..e7e33c692 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -1,3 +1,37 @@ +## # vcpkg_find_acquire_program +## +## Download or find a well-known tool. +## +## ## Usage +## ```cmake +## vcpkg_find_acquire_program() +## ``` +## ## Parameters +## ### VAR +## This variable specifies both the program to be acquired as well as the out parameter that will be set to the path of the program executable. +## +## ## Notes +## The current list of programs includes: +## +## - 7Z +## - BISON +## - FLEX +## - PERL +## - PYTHON2 +## - PYTHON3 +## - JOM +## - MESON +## - NASM +## - NINJA +## - YASM +## +## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). +## +## ## Examples +## +## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) +## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) +## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) function(vcpkg_find_acquire_program VAR) if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND") return() diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index f0f8dba8b..0ce485954 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -1,14 +1,52 @@ -# Usage: -# vcpkg_from_github( -# OUT_SOURCE_PATH -# REPO -# REF -# SHA512 -# HEAD_REF -# ) -# -# Notes: -# This will export VCPKG_HEAD_VERSION variable during head builds. +## # vcpkg_from_github +## +## Download and extract a project from GitHub. Enables support for `install --head`. +## +## ## Usage: +## ```cmake +## vcpkg_from_github( +## OUT_SOURCE_PATH +## REPO +## [REF ] +## [SHA512 <45d0d7f8cc350...>] +## [HEAD_REF ] +## ) +## ``` +## +## ## Parameters: +## ### OUT_SOURCE_PATH +## Specifies the out-variable that will contain the extracted location. +## +## This should be set to `SOURCE_PATH` by convention. +## +## ### REPO +## The organization or user and repository on GitHub. +## +## ### REF +## A stable git commit-ish (ideally a tag) that will not change contents. +## +## If `REF` is specified, `SHA512` must also be specified. +## +## ### SHA512 +## The SHA512 hash that should match the archive (https://github.com/${REPO}/archive/${REF}.tar.gz). +## +## This is most easily determined by first setting it to `1`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile. +## +## ### HEAD_REF +## The unstable git commit-ish (ideally a branch) to pull for `--head` builds. +## +## For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. +## +## ## Notes: +## At least one of `REF` and `HEAD_REF` must be specified. +## +## This exports the `VCPKG_HEAD_VERSION` variable during head builds. +## +## ## Examples: +## +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [ms-gsl](https://github.com/Microsoft/vcpkg/blob/master/ports/ms-gsl/portfile.cmake) +## * [beast](https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake) function(vcpkg_from_github) set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF) set(multipleValuesArgs) diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index 0ebff6961..f778007ef 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -1,3 +1,25 @@ +## # vcpkg_install_cmake +## +## Build and install a cmake project. +## +## ## Usage: +## ```cmake +## vcpkg_install_cmake([MSVC_64_TOOLSET]) +## ``` +## +## ## Parameters: +## ### MSVC_64_TOOLSET +## This adds the `/p:PreferredToolArchitecture=x64` switch if the underlying buildsystem is MSBuild. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## +## ## Notes: +## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +## +## ## Examples: +## +## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_install_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) -- cgit v1.2.3 From 71726ac000d3dce275289e0807f6bee3e50fe85c Mon Sep 17 00:00:00 2001 From: Bagong Date: Mon, 29 May 2017 09:05:52 +0200 Subject: Correct path bison/flex add ruby 2.4.1 and gperf 3.0.1 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index e7e33c692..f6814c37f 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -90,6 +90,12 @@ function(vcpkg_find_acquire_program VAR) " https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi\n" ) endif() + elseif(VAR MATCHES "RUBY") + set(PROGNAME "ruby") + set(PATHS ${DOWNLOADS}/tools/ruby/rubyinstaller-2.4.1-1-x86/bin) + set(URL https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-1/rubyinstaller-2.4.1-1-x86.7z) + set(ARCHIVE rubyinstaller-2.4.1-1-x86.7z) + set(HASH b51112e9b58cfcbe8cec0607e8a16fff6a943d9b4e31b2a7fbf5df5f83f050bf0a4812d3dd6000ff21a3d5fd219cd0a309c58ac1c1db950a9b0072405e4b70f5) elseif(VAR MATCHES "JOM") set(PROGNAME jom) set(SUBDIR "jom-1.1.2") @@ -118,18 +124,24 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/mesonbuild/meson/archive/0.40.1.zip") set(ARCHIVE "meson-0.40.1.zip") set(HASH 4c1d07f32d527859f762c34de74d31d569573fc833335ab9652ed38d1f9e64b49869e826527c28a6a07cb8e594fd5c647b34aa95e626236a2707f75df0a2d435) - elseif(VAR MATCHES "FLEX") - set(PROGNAME win_flex) - set(PATHS ${DOWNLOADS}/tools/winflexbison) - set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") - set(ARCHIVE "win_flex_bison-2.5.9.zip") - set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) + elseif(VAR MATCHES "FLEX") + set(PROGNAME win_flex) + set(PATHS ${DOWNLOADS}/tools/win_flex) + set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") + set(ARCHIVE "win_flex_bison-2.5.9.zip") + set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) elseif(VAR MATCHES "BISON") - set(PROGNAME win_bison) - set(PATHS ${DOWNLOADS}/tools/winflexbison) - set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") - set(ARCHIVE "win_flex_bison-2.5.9.zip") - set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) + set(PROGNAME win_bison) + set(PATHS ${DOWNLOADS}/tools/win_bison) + set(URL "https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.9.zip/download") + set(ARCHIVE "win_flex_bison-2.5.9.zip") + set(HASH 9580f0e46893670a011645947c1becda69909a41a38bb4197fe33bd1ab7719da6b80e1be316f269e1a4759286870d49a9b07ef83afc4bac33232bd348e0bc814) + elseif(VAR MATCHES "GPERF") + set(PROGNAME gperf) + set(PATHS ${DOWNLOADS}/tools/gperf/bin) + set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/gperf-3.0.1-bin.zip/download") + set(ARCHIVE "gperf-3.0.1-bin.zip") + set(HASH 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From dc43c4271b85a2cc74e0847113af4bbf64140163 Mon Sep 17 00:00:00 2001 From: Bagong Date: Mon, 29 May 2017 20:32:06 +0200 Subject: Add default path of 64-bit python as installed by MSVS2017 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index f6814c37f..03216058c 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -70,7 +70,7 @@ function(vcpkg_find_acquire_program VAR) set(ARCHIVE "python-3.5.3-embed-win32.zip") set(HASH c8cfdc09d052dc27e4380e8e4bf0d32a4c0def7e03896c1fa6cabc26dde78bb74dbb04e3673cc36e3e307d65a1ef284d69174f0cc80008c83bc6178f192ac5cf) elseif(VAR MATCHES "PYTHON2") - find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON) + find_program(PYTHON2 NAMES python2 python PATHS C:/python27 c:/Python27amd64 ENV PYTHON) if(NOT PYTHON2 MATCHES "NOTFOUND") execute_process( COMMAND ${PYTHON2} --version -- cgit v1.2.3 From eb3b2accbcef7eb7f322bc18d46b0abfa24da0a9 Mon Sep 17 00:00:00 2001 From: Daniel Shaw Date: Tue, 30 May 2017 12:24:21 -0700 Subject: Add support for compiler flags --- scripts/cmake/vcpkg_configure_cmake.cmake | 45 ++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 7d43336de..cbbacae3f 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -109,11 +109,29 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() + if((NOT DEFINED VCPKG_CXX_FLAGS_DEBUG AND NOT DEFINED VCPKG_C_FLAGS_DEBUG) OR + (DEFINED VCPKG_CXX_FLAGS_DEBUG AND DEFINED VCPKG_C_FLAGS_DEBUG)) + message(STATUS "Variables for VCPKG_CXX_FLAGS_DEBUG and VCPKG_C_FLAGS_DEBUG are set correctly") + else() + message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS_DEBUG and VCPKG_C_FLAGS_DEBUG") + endif() + if((NOT DEFINED VCPKG_CXX_FLAGS_RELEASE AND NOT DEFINED VCPKG_C_FLAGS_RELEASE) OR + (DEFINED VCPKG_CXX_FLAGS_RELEASE AND DEFINED VCPKG_C_FLAGS_RELEASE)) + message(STATUS "Variables for VCPKG_CXX_FLAGS_RELEASE and VCPKG_C_FLAGS_RELEASE are set correctly") + else() + message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS_RELEASE and VCPKG_C_FLAGS_RELEASE") + endif() + if((NOT DEFINED VCPKG_CXX_FLAGS AND NOT DEFINED VCPKG_C_FLAGS) OR + (DEFINED VCPKG_CXX_FLAGS AND DEFINED VCPKG_C_FLAGS)) + message(STATUS "Variables for VCPKG_CXX_FLAGS and VCPKG_C_FLAGS are set correctly") + else() + message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS and VCPKG_C_FLAGS") + endif() list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" - "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP" - "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP" + "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" + "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" @@ -123,28 +141,31 @@ function(vcpkg_configure_cmake) "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" ) + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" ) list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_C_FLAGS_RELEASE}" ) + elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" ) list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" - "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_C_FLAGS_RELEASE}" ) endif() + list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" - "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" + "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" + "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" ) message(STATUS "Configuring ${TARGET_TRIPLET}-rel") -- cgit v1.2.3 From 4b6c1f291c5e9812926b49bbf97dadee285aa0e2 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 2 Jun 2017 13:33:45 -0700 Subject: Acquire chromium depot tools --- scripts/cmake/vcpkg_acquire_depot_tools.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/cmake/vcpkg_acquire_depot_tools.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake new file mode 100644 index 000000000..3b206e271 --- /dev/null +++ b/scripts/cmake/vcpkg_acquire_depot_tools.cmake @@ -0,0 +1,20 @@ +function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT) + set(TOOLPATH ${DOWNLOADS}/tools/depot_tools) + set(URL "https://storage.googleapis.com/chrome-infra/depot_tools.zip") + set(ARCHIVE "depot_tools.zip") + set(STAMP "initialized-depot-tools.stamp") + + if(NOT EXISTS "${TOOLPATH}/${STAMP}") + message(STATUS "Acquiring Depot Tools...") + file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE}) + file(REMOVE_RECURSE ${TOOLPATH}) + file(MAKE_DIRECTORY ${TOOLPATH}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${TOOLPATH} + ) + file(WRITE "${TOOLPATH}/${STAMP}" "0") + message(STATUS "Acquiring Depot Tools... OK") + endif() + set(${PATH_TO_ROOT_OUT} ${TOOLPATH} PARENT_SCOPE) +endfunction() -- cgit v1.2.3 From e3c90826317d4ba6a01afc3d6cfbfcc898f546e4 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 2 Jun 2017 13:36:32 -0700 Subject: Include it in common tools --- scripts/cmake/vcpkg_common_functions.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index a0e9633c3..29f0f8dff 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -19,4 +19,5 @@ include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) -include(vcpkg_get_windows_sdk) \ No newline at end of file +include(vcpkg_get_windows_sdk) +include(vcpkg_acquire_depot_tools) -- cgit v1.2.3 From 566172b3b6831eb6468d20894ebd995db544e6af Mon Sep 17 00:00:00 2001 From: Daniel Shaw Date: Mon, 5 Jun 2017 17:01:20 -0700 Subject: remove debug statements --- scripts/cmake/vcpkg_configure_cmake.cmake | 3 --- 1 file changed, 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index cbbacae3f..07acfc8ea 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -111,19 +111,16 @@ function(vcpkg_configure_cmake) if((NOT DEFINED VCPKG_CXX_FLAGS_DEBUG AND NOT DEFINED VCPKG_C_FLAGS_DEBUG) OR (DEFINED VCPKG_CXX_FLAGS_DEBUG AND DEFINED VCPKG_C_FLAGS_DEBUG)) - message(STATUS "Variables for VCPKG_CXX_FLAGS_DEBUG and VCPKG_C_FLAGS_DEBUG are set correctly") else() message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS_DEBUG and VCPKG_C_FLAGS_DEBUG") endif() if((NOT DEFINED VCPKG_CXX_FLAGS_RELEASE AND NOT DEFINED VCPKG_C_FLAGS_RELEASE) OR (DEFINED VCPKG_CXX_FLAGS_RELEASE AND DEFINED VCPKG_C_FLAGS_RELEASE)) - message(STATUS "Variables for VCPKG_CXX_FLAGS_RELEASE and VCPKG_C_FLAGS_RELEASE are set correctly") else() message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS_RELEASE and VCPKG_C_FLAGS_RELEASE") endif() if((NOT DEFINED VCPKG_CXX_FLAGS AND NOT DEFINED VCPKG_C_FLAGS) OR (DEFINED VCPKG_CXX_FLAGS AND DEFINED VCPKG_C_FLAGS)) - message(STATUS "Variables for VCPKG_CXX_FLAGS and VCPKG_C_FLAGS are set correctly") else() message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS and VCPKG_C_FLAGS") endif() -- cgit v1.2.3 From 3ee46a4bb6fa2efca575ec8dee79c239c802f62a Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Tue, 6 Jun 2017 10:37:21 -0700 Subject: stop cmake build on a failed download --- scripts/cmake/vcpkg_acquire_depot_tools.cmake | 48 +++++++++++++++++++++------ 1 file changed, 38 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake index 3b206e271..1cc375725 100644 --- a/scripts/cmake/vcpkg_acquire_depot_tools.cmake +++ b/scripts/cmake/vcpkg_acquire_depot_tools.cmake @@ -3,18 +3,46 @@ function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT) set(URL "https://storage.googleapis.com/chrome-infra/depot_tools.zip") set(ARCHIVE "depot_tools.zip") set(STAMP "initialized-depot-tools.stamp") + set(downloaded_file_path ${DOWNLOADS}/${ARCHIVE}) if(NOT EXISTS "${TOOLPATH}/${STAMP}") - message(STATUS "Acquiring Depot Tools...") - file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE}) - file(REMOVE_RECURSE ${TOOLPATH}) - file(MAKE_DIRECTORY ${TOOLPATH}) - execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${TOOLPATH} - ) - file(WRITE "${TOOLPATH}/${STAMP}" "0") - message(STATUS "Acquiring Depot Tools... OK") + + message(STATUS "Acquiring Depot Tools...") + + if(EXISTS ${downloaded_file_path}) + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(_VCPKG_NO_DOWNLOADS) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${URL}... Failed. Status: ${download_status}") + file(REMOVE ${downloaded_file_path}) + set(download_success 0) + else() + message(STATUS "Downloading ${URL}... OK") + set(download_success 1) + endif() + + if (NOT ${download_success}) + message(FATAL_ERROR + "\n" + " Failed to download file.\n" + " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + endif() + endif() + + + file(REMOVE_RECURSE ${TOOLPATH}) + file(MAKE_DIRECTORY ${TOOLPATH}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + WORKING_DIRECTORY ${TOOLPATH} + ) + file(WRITE "${TOOLPATH}/${STAMP}" "0") + message(STATUS "Acquiring Depot Tools... OK") endif() set(${PATH_TO_ROOT_OUT} ${TOOLPATH} PARENT_SCOPE) endfunction() -- cgit v1.2.3 From 13b29588ba5c1b89969a3bf2a5cc61a97e9c83a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Jun 2017 22:38:17 -0700 Subject: [vcpkg-cmake] Add tools subdirectories to the find programs path. Improves #1143. --- scripts/buildsystems/vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d3e1e814a..513c33ecb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,5 @@ # Mark variables as used so cmake doesn't complain about them set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) - if(NOT VCPKG_TOOLCHAIN) if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -55,7 +54,6 @@ if(NOT VCPKG_TOOLCHAIN) endif() endwhile() set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) - set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) @@ -103,6 +101,12 @@ if(NOT VCPKG_TOOLCHAIN) ) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) + file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) + foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) + if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + endif() + endforeach() option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) function(add_executable name) -- cgit v1.2.3 From e24f83aed10aca9014c75e203f99695eda8d3610 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Thu, 15 Jun 2017 08:30:22 +0900 Subject: Fix typo of template Fix typo of portfile template. --- scripts/templates/portfile.in.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index 2ea430453..bc5f5fe07 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -1,7 +1,7 @@ # Common Ambient Variables: # CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} # CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} +# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT} # PORT = current port name (zlib, etc) # TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc) # VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic) -- cgit v1.2.3 From 8085cd34f2f5eef533aaeac6232cde4f073a4bf0 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Sat, 17 Jun 2017 11:30:03 -0700 Subject: Adding support for FFmpeg in UWP. Adding support to download gas-preprocessor as an acquire_program. Update all packages for msys2 Download perl and gcc for ARM assembly in ffmpeg. --- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index b63700877..d87ec3e7c 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -84,6 +84,10 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) + execute_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman -Syu --noconfirm" + WORKING_DIRECTORY ${TOOLPATH} + ) file(WRITE "${TOOLPATH}/${STAMP}" "0") message(STATUS "Acquiring MSYS2... OK") endif() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 03216058c..fef62da53 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -16,6 +16,7 @@ ## - 7Z ## - BISON ## - FLEX +## - GASPREPROCESSOR ## - PERL ## - PYTHON2 ## - PYTHON3 @@ -142,6 +143,15 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://sourceforge.net/projects/gnuwin32/files/gperf/3.0.1/gperf-3.0.1-bin.zip/download") set(ARCHIVE "gperf-3.0.1-bin.zip") set(HASH 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9) + elseif(VAR MATCHES "GASPREPROCESSOR") + set(NOEXTRACT true) + set(PROGNAME gas-preprocessor) + set(REQUIRED_INTERPRETER PERL) + set(SCRIPTNAME "gas-preprocessor.pl") + set(PATHS ${DOWNLOADS}/tools/gas-preprocessor) + set(URL "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/36bacb4cba27003c572e5bf7a9c4dfe3c9a8d40d/gas-preprocessor.pl") + set(ARCHIVE "gas-preprocessor.pl") + set(HASH a25caadccd1457a0fd2abb5a0da9aca1713b2c351d76daf87a4141e52021f51aa09e95a62942c6f0764f79cc1fa65bf71584955b09e62ee7da067b5c82baf6b3) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() @@ -151,8 +161,8 @@ function(vcpkg_find_acquire_program VAR) find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) - find_file(SCIRPT ${SCRIPTNAME} PATHS ${PATHS}) - set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCIRPT}) + find_file(SCRIPT ${SCRIPTNAME} PATHS ${PATHS}) + set(${VAR} ${${REQUIRED_INTERPRETER}} ${SCRIPT}) endif() endmacro() -- cgit v1.2.3 From 338f8614e3e0e8bd96b80c88fce825f02c2e0721 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 20 Jun 2017 15:20:23 -0700 Subject: [vcpkg-fixup-cmake-targets][glm] Upgrade GLM. Move cmake fixup logic into helper script. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 3b0c794d9..f65337544 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -76,8 +76,6 @@ function(vcpkg_fixup_cmake_targets) "${RELEASE_SHARE}/*[Cc]onfig-release.cmake" ) foreach(RELEASE_TARGET ${RELEASE_TARGETS}) - get_filename_component(RELEASE_TARGET_NAME ${RELEASE_TARGET} NAME) - file(READ ${RELEASE_TARGET} _contents) string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") file(WRITE ${RELEASE_TARGET} "${_contents}") @@ -99,6 +97,26 @@ function(vcpkg_fixup_cmake_targets) file(REMOVE ${DEBUG_TARGET}) endforeach() + file(GLOB MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") + foreach(MAIN_TARGET ${MAIN_TARGETS}) + file(READ ${MAIN_TARGET} _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}") + file(WRITE ${MAIN_TARGET} "${_contents}") + endforeach() + + file(GLOB MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") + foreach(MAIN_CONFIG ${MAIN_CONFIGS}) + file(READ ${MAIN_CONFIG} _contents) + 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}") + endforeach() + # Remove /debug/share// if it's empty. file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*") if(NOT REMAINING_FILES) -- cgit v1.2.3 From 833c38c6307e8e34bcf578fc7e24b29228f35928 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 20 Jun 2017 16:19:36 -0700 Subject: [jansson] Enable cmake scripts --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 3b0c794d9..5f96c4b26 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -16,6 +16,10 @@ function(vcpkg_fixup_cmake_targets) cmake_parse_arguments(_vfct "" "CONFIG_PATH" "" ${ARGN}) + if(_vfct_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") + endif() + set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) -- cgit v1.2.3 From e8f819e04e6aed6327537f954a9eda02fca49d1a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 27 Jun 2017 11:24:31 -0700 Subject: [vcpkg-fixup-cmake-targets] Fix bug when port has no unused cmake config files. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index c56b96ccc..6fa096cbd 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -73,7 +73,9 @@ function(vcpkg_fixup_cmake_targets) "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" "${DEBUG_SHARE}/*[Cc]onfig-version.cmake" ) - file(REMOVE ${UNUSED_FILES}) + if(UNUSED_FILES) + file(REMOVE ${UNUSED_FILES}) + endif() file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake" -- cgit v1.2.3 From c21a2fe38ab9523974a80194d6cea5dae6fcb76a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 30 Jun 2017 17:33:48 -0700 Subject: [angle] Add preliminary UWP support --- scripts/buildsystems/vcpkg.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 513c33ecb..41bdb3e60 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -140,3 +140,10 @@ if(NOT VCPKG_TOOLCHAIN) set(VCPKG_TOOLCHAIN ON) endif() + +set(_UNUSED ${CMAKE_TOOLCHAIN_FILE}) +set(_UNUSED ${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}) +set(_UNUSED ${CMAKE_EXPORT_NO_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY}) +set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) -- cgit v1.2.3 From d222302b2f4bd2d857949fde71b927385d703acd Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Fri, 30 Jun 2017 20:49:54 +0300 Subject: [cereal] Portfile fix --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 6fa096cbd..eaf3bb966 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -116,6 +116,10 @@ function(vcpkg_fixup_cmake_targets) file(GLOB MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") foreach(MAIN_CONFIG ${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 "get_filename_component\\(PACKAGE_PREFIX_DIR \"\\\${CMAKE_CURRENT_LIST_DIR}/\\.\\./(\\.\\./)*\" ABSOLUTE\\)" "get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/../../\" ABSOLUTE)" -- cgit v1.2.3 From 5498864711a2c7b1224e2ebfeff0269d591a2136 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 11 Jul 2017 14:09:56 -0700 Subject: [vcpkg-toolchain] Add INPUT_FILE NUL. Fixes #1431. --- scripts/cmake/vcpkg_get_windows_sdk.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_get_windows_sdk.cmake b/scripts/cmake/vcpkg_get_windows_sdk.cmake index ca58ab10a..64d8838e7 100644 --- a/scripts/cmake/vcpkg_get_windows_sdk.cmake +++ b/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -2,6 +2,7 @@ function(vcpkg_get_windows_sdk ret) execute_process( COMMAND powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& {& '${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1'}" 2>&1 + INPUT_FILE NUL OUTPUT_VARIABLE WINDOWS_SDK RESULT_VARIABLE error_code) -- cgit v1.2.3 From 6950aeb6378adb47ff467a79d58ae8d4b5abe9cb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 13 Jul 2017 17:47:20 -0700 Subject: [vcpkg-applocal] Recurse into other binaries. Fixes #1435. --- scripts/buildsystems/msbuild/applocal.ps1 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 932ba11cd..08a6d9a8f 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -50,6 +50,9 @@ function resolve([string]$targetBinary) { deployBinary $targetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } resolve "$targetBinaryDir\$_" + } elseif (Test-Path "$targetBinaryDir\$_") { + Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" + resolve "$targetBinaryDir\$_" } else { Write-Verbose " ${_}: $installedDir\$_ not found" } -- cgit v1.2.3 From 2807fce1ab3e77e8a59ab18adf0c11a610e24fc5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 18 Jul 2017 12:26:55 -0700 Subject: [vcpkg-from-github] Improve documentation (#1457) --- scripts/cmake/vcpkg_from_github.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 0ce485954..645690353 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -23,7 +23,9 @@ ## The organization or user and repository on GitHub. ## ## ### REF -## A stable git commit-ish (ideally a tag) that will not change contents. +## A stable git commit-ish (ideally a tag) that will not change contents. **This should not be a branch.** +## +## For repositories without official releases, this can be set to the full commit id of the current latest master. ## ## If `REF` is specified, `SHA512` must also be specified. ## @@ -38,7 +40,7 @@ ## For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. ## ## ## Notes: -## At least one of `REF` and `HEAD_REF` must be specified. +## At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present. ## ## This exports the `VCPKG_HEAD_VERSION` variable during head builds. ## -- cgit v1.2.3 From 5d86005aa7a25f192d6a3023423e2977bcef7367 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Tue, 25 Jul 2017 04:07:08 +0300 Subject: cmake: update to 3.9 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b6144d581..eecd7fe5a 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -151,12 +151,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.8.0" - $downloadVersion = "3.8.0" - $url = "https://cmake.org/files/v3.8/cmake-3.8.0-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.8.0-win32-x86.zip" - $expectedDownloadedFileHash = "857fca00974ad6ac12fa042373d85ad1288770d4f09fbd99753c822df76b1c6c" - $executableFromDownload = "$downloadsDir\cmake-3.8.0-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.0" + $downloadVersion = "3.9.0" + $url = "https://cmake.org/files/v3.9/cmake-3.9.0-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.0-win32-x86.zip" + $expectedDownloadedFileHash = "9d593839f64b94718a1b75b8519b56ecb959e4d37d406bf2a087e2c1f7a6b89c" + $executableFromDownload = "$downloadsDir\cmake-3.9.0-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 509b59b7aea7611d8f2203ebd7b6357ba772afb7 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Tue, 25 Jul 2017 12:42:59 +0300 Subject: scipts/getWindowsSDK: use registry for SDK detection --- scripts/getWindowsSDK.ps1 | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 7902707cb..3aa23cc56 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -17,19 +17,14 @@ $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $validInstances = New-Object System.Collections.ArrayList -$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) -Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" - # Windows 10 SDK -Write-Verbose "`n" -Write-Verbose "Looking for Windows 10 SDK" -foreach ($ProgramFiles in $CandidateProgramFiles) +function CheckWindows10SDK($path) { - $folder = "$ProgramFiles\Windows Kits\10\Include" + $folder = "$path\Include" if (!(Test-Path $folder)) { Write-Verbose "$folder - Not Found" - continue + return } Write-Verbose "$folder - Found" @@ -42,7 +37,7 @@ foreach ($ProgramFiles in $CandidateProgramFiles) if (!(Test-Path $windowsheader)) { Write-Verbose "$windowsheader - Not Found" - continue + return } Write-Verbose "$windowsheader - Found" @@ -50,7 +45,7 @@ foreach ($ProgramFiles in $CandidateProgramFiles) if (!(Test-Path $ddkheader)) { Write-Verbose "$ddkheader - Not Found" - continue + return } Write-Verbose "$ddkheader - Found" @@ -60,16 +55,20 @@ foreach ($ProgramFiles in $CandidateProgramFiles) } } -# Windows 8.1 SDK Write-Verbose "`n" -Write-Verbose "Looking for Windows 8.1 SDK" -foreach ($ProgramFiles in $CandidateProgramFiles) +Write-Verbose "Looking for Windows 10 SDK" +CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) +CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) + + +# Windows 8.1 SDK +function CheckWindows81SDK($path) { - $folder = "$ProgramFiles\Windows Kits\8.1\Include" + $folder = "$path\Include" if (!(Test-Path $folder)) { Write-Verbose "$folder - Not Found" - continue + return } Write-Verbose "$folder - Found" @@ -78,6 +77,11 @@ foreach ($ProgramFiles in $CandidateProgramFiles) $validInstances.Add($win81sdkVersionString) > $null } +Write-Verbose "`n" +Write-Verbose "Looking for Windows 8.1 SDK" +CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) +CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) + Write-Verbose "`n`n`n" Write-Verbose "The following Windows SDKs were found:" foreach ($instance in $validInstances) -- cgit v1.2.3 From 78266bd041db09034e2f9236b4979b7eeb7e38c8 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Thu, 27 Jul 2017 20:21:15 -0700 Subject: [vcpkg] shorten license instruction in portfile.in.cmake --- scripts/templates/portfile.in.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake index bc5f5fe07..e89ad4640 100644 --- a/scripts/templates/portfile.in.cmake +++ b/scripts/templates/portfile.in.cmake @@ -30,5 +30,4 @@ vcpkg_configure_cmake( vcpkg_install_cmake() # Handle copyright -#file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/@PORT@) -#file(RENAME ${CURRENT_PACKAGES_DIR}/share/@PORT@/LICENSE ${CURRENT_PACKAGES_DIR}/share/@PORT@/copyright) \ No newline at end of file +# file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/@PORT@ RENAME copyright) -- cgit v1.2.3 From 4a5ce3165dcd0769c55a53151c145a3d3df9d9ef Mon Sep 17 00:00:00 2001 From: paercebal Date: Fri, 28 Jul 2017 12:57:05 +0200 Subject: fix the TRIPLET_SYSTEM_ARCH initialization --- scripts/ports.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 1d699a966..8b4d17d80 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -32,8 +32,6 @@ endif() if(CMD MATCHES "^BUILD$") - string(REGEX REPLACE "([^-]*)-([^-]*)" "\\1" TRIPLET_SYSTEM_ARCH ${TARGET_TRIPLET}) - set(CMAKE_TRIPLET_FILE ${VCPKG_ROOT_DIR}/triplets/${TARGET_TRIPLET}.cmake) if(NOT EXISTS ${CMAKE_TRIPLET_FILE}) message(FATAL_ERROR "Unsupported target triplet. Triplet file does not exist: ${CMAKE_TRIPLET_FILE}") @@ -70,6 +68,7 @@ if(CMD MATCHES "^BUILD$") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR} ${CURRENT_PACKAGES_DIR}) include(${CMAKE_TRIPLET_FILE}) + set(TRIPLET_SYSTEM_ARCH ${VCPKG_TARGET_ARCHITECTURE}) include(${CURRENT_PORT_DIR}/portfile.cmake) set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO) -- cgit v1.2.3 From 63454f618996baefef3f60f90767cd4c02d7590d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Jul 2017 11:44:54 -0700 Subject: [vcpkg-cmake] Always search for dynamic boost libraries --- scripts/buildsystems/vcpkg.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 41bdb3e60..8fd08ffb6 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -138,6 +138,13 @@ if(NOT VCPKG_TOOLCHAIN) endif() endfunction() + function(find_package name) + if(name STREQUAL "Boost") + unset(Boost_USE_STATIC_LIBS) + endif() + _find_package(${ARGV}) + endfunction() + set(VCPKG_TOOLCHAIN ON) endif() -- cgit v1.2.3 From 4735040f66155c1b8f94d339bedb6afd4905e47c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Jul 2017 16:46:57 -0700 Subject: [vcpkg] Hotfix for 63454f6189. --- scripts/buildsystems/vcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8fd08ffb6..d8c7ee6b8 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -138,12 +138,12 @@ if(NOT VCPKG_TOOLCHAIN) endif() endfunction() - function(find_package name) + macro(find_package name) if(name STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) endif() _find_package(${ARGV}) - endfunction() + endmacro() set(VCPKG_TOOLCHAIN ON) endif() -- cgit v1.2.3 From 7c6c706160528c9234a91161b834529d4e13d761 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 28 Jul 2017 17:05:38 -0700 Subject: [vcpkg-getWindowsSDK] Also look in the paths, just in case. --- scripts/getWindowsSDK.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 3aa23cc56..9aebae8e3 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -59,7 +59,8 @@ Write-Verbose "`n" Write-Verbose "Looking for Windows 10 SDK" CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) - +CheckWindows10SDK("$env:ProgramFiles\Windows Kits\10") +CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") # Windows 8.1 SDK function CheckWindows81SDK($path) @@ -81,6 +82,8 @@ Write-Verbose "`n" Write-Verbose "Looking for Windows 8.1 SDK" CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) +CheckWindows81SDK("$env:ProgramFiles\Windows Kits\8.1") +CheckWindows81SDK("${env:ProgramFiles(x86)}\Windows Kits\8.1") Write-Verbose "`n`n`n" Write-Verbose "The following Windows SDKs were found:" -- cgit v1.2.3 From c22ab980bcab362134ef3e5db329a81c1767c2c9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 31 Jul 2017 11:27:22 -0700 Subject: [openssl] Switch to msys2 as a perl provider due to strawberryperl being down. --- scripts/cmake/vcpkg_acquire_msys.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index d87ec3e7c..905952eab 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -32,7 +32,7 @@ ## vcpkg_execute_required_process( ## COMMAND ## ${BASH} --noprofile --norc -c -## "pacman -Sy --noconfirm --needed make" +## "PATH=/usr/bin:\$PATH;pacman -Sy --noconfirm --needed make" ## WORKING_DIRECTORY ${MSYS_ROOT} ## LOGNAME pacman-${TARGET_TRIPLET}) ## ``` -- cgit v1.2.3 From 9a87ee9c9dc655dccb4e7b927279c9094f960448 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 1 Aug 2017 16:03:40 -0700 Subject: [openssl] Fix error in msys call to perform the perl installation. --- scripts/cmake/vcpkg_acquire_msys.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 905952eab..87c34c274 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -32,7 +32,7 @@ ## vcpkg_execute_required_process( ## COMMAND ## ${BASH} --noprofile --norc -c -## "PATH=/usr/bin:\$PATH;pacman -Sy --noconfirm --needed make" +## 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed make' ## WORKING_DIRECTORY ${MSYS_ROOT} ## LOGNAME pacman-${TARGET_TRIPLET}) ## ``` -- cgit v1.2.3 From ebc875df58a9441e30fab54e7ba84418e6bf8238 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 1 Aug 2017 17:12:59 -0700 Subject: [openssl][vcpkg_find_acquire_program] Use msys to provide perl for vcpkg_find_acquire_program. Revert openssl to use this instead of msys directly. --- scripts/cmake/vcpkg_find_acquire_program.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index fef62da53..4efe756ee 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -33,6 +33,7 @@ ## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) +include(vcpkg_acquire_msys) function(vcpkg_find_acquire_program VAR) if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND") return() @@ -46,11 +47,14 @@ function(vcpkg_find_acquire_program VAR) vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) if(VAR MATCHES "PERL") - set(PROGNAME perl) - set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) - set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") - set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") - set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) + vcpkg_acquire_msys(MSYS_ROOT) + vcpkg_execute_required_process( + COMMAND ${MSYS_ROOT}/usr/bin/bash.exe --noprofile --norc -c 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed perl' + WORKING_DIRECTORY ${MSYS_ROOT} + LOGNAME acquire-perl-${TARGET_TRIPLET} + ) + set(PERL "${MSYS_ROOT}/usr/bin/perl.exe" PARENT_SCOPE) + return() elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) -- cgit v1.2.3 From 6f112cf9611cabbe5641cc6ce0bd13d0144f50be Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 2 Aug 2017 14:36:02 -0700 Subject: [vcpkg-find-acquire-program] Restore strawberry perl to satisfy openssl:x64-windows --- scripts/cmake/vcpkg_find_acquire_program.cmake | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 4efe756ee..fef62da53 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -33,7 +33,6 @@ ## * [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake) ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) -include(vcpkg_acquire_msys) function(vcpkg_find_acquire_program VAR) if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND") return() @@ -47,14 +46,11 @@ function(vcpkg_find_acquire_program VAR) vcpkg_get_program_files_32_bit(PROGRAM_FILES_32_BIT) if(VAR MATCHES "PERL") - vcpkg_acquire_msys(MSYS_ROOT) - vcpkg_execute_required_process( - COMMAND ${MSYS_ROOT}/usr/bin/bash.exe --noprofile --norc -c 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed perl' - WORKING_DIRECTORY ${MSYS_ROOT} - LOGNAME acquire-perl-${TARGET_TRIPLET} - ) - set(PERL "${MSYS_ROOT}/usr/bin/perl.exe" PARENT_SCOPE) - return() + set(PROGNAME perl) + set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) + set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") + set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") + set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) -- cgit v1.2.3 From cebc7acf025e888f70e84f56941d267b2fbda70a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Aug 2017 12:26:30 -0700 Subject: Updated version of nuget to 4.1.0 --- scripts/fetchDependency.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index eecd7fe5a..13799cc73 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -162,11 +162,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "3.3.0" - $downloadVersion = "3.5.0" - $url = "https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget-3.5.0\nuget.exe" - $expectedDownloadedFileHash = "399ec24c26ed54d6887cde61994bb3d1cada7956c1b19ff880f06f060c039918" + $requiredVersion = "4.1.0" + $downloadVersion = "4.1.0" + $url = "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" + $downloadPath = "$downloadsDir\nuget-4.1.0\nuget.exe" + $expectedDownloadedFileHash = "4c1de9b026e0c4ab087302ff75240885742c0faa62bd2554f913bbe1f6cb63a0" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From 8b09cb2efed9323133e54429a84be39c8c6c850f Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 11 Aug 2017 09:02:36 -0700 Subject: update make to 3.9.1 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 13799cc73..6941ed21e 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -151,12 +151,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.0" - $downloadVersion = "3.9.0" - $url = "https://cmake.org/files/v3.9/cmake-3.9.0-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.0-win32-x86.zip" - $expectedDownloadedFileHash = "9d593839f64b94718a1b75b8519b56ecb959e4d37d406bf2a087e2c1f7a6b89c" - $executableFromDownload = "$downloadsDir\cmake-3.9.0-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.1" + $downloadVersion = "3.9.1" + $url = "https://cmake.org/files/v3.9/cmake-3.9.1-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.1-win32-x86.zip" + $expectedDownloadedFileHash = "e0d9501bd34e3100e925dcb2e07f5f0ce8980bdbe5fce0ae950b21368d54c1a1" + $executableFromDownload = "$downloadsDir\cmake-3.9.1-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 8a0a99b62a61b8efffd8a5e375900c4b572f5d3f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 11 Aug 2017 15:40:06 -0700 Subject: Update required/downloaded git to 2.14.1 --- scripts/fetchDependency.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6941ed21e..d142f57fe 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -172,16 +172,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "git") { - $requiredVersion = "2.0.0" - $downloadVersion = "2.11.1" - $url = "https://github.com/git-for-windows/git/releases/download/v2.11.1.windows.1/MinGit-2.11.1-32-bit.zip" # We choose the 32-bit version - $downloadPath = "$downloadsDir\MinGit-2.11.1-32-bit.zip" - $expectedDownloadedFileHash = "6ca79af09015625f350ef4ad74a75cfb001b340aec095b6963be9d45becb3bba" + $requiredVersion = "2.14.1" + $downloadVersion = "2.14.1" + $url = "https://github.com/git-for-windows/git/releases/download/v2.14.1.windows.1/MinGit-2.14.1-32-bit.zip" # We choose the 32-bit version + $downloadPath = "$downloadsDir\MinGit-2.14.1-32-bit.zip" + $expectedDownloadedFileHash = "77b468e0ead1e7da4cb3a1cf35dabab5210bf10457b4142f5e9430318217cdef" # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.11.1-32-bit\cmd\git.exe" + $executableFromDownload = "$downloadsDir\MinGit-2.14.1-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = "$downloadsDir\MinGit-2.11.1-32-bit" + $extractionFolder = "$downloadsDir\MinGit-2.14.1-32-bit" } else { -- cgit v1.2.3 From f1c6b5cd4b581ec8d3a1b86fe01c4444e3906b2d Mon Sep 17 00:00:00 2001 From: paercebal Date: Sat, 12 Aug 2017 10:57:56 +0200 Subject: Enable tolerance for similar configurations --- scripts/buildsystems/msbuild/vcpkg.targets | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 5c24d755a..1cb338237 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -41,10 +41,10 @@ - %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib - %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link - %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link + %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib + %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link + %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link %(AdditionalIncludeDirectories);$(VcpkgRoot)include @@ -63,11 +63,11 @@ - - -- cgit v1.2.3 From f4d11d7c9ea98007af88684db12de351b83bd976 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Aug 2017 14:41:23 -0700 Subject: Remove download prompts for cmake/git The prompts were causing a lot of issues for users and especially CI builds --- scripts/fetchDependency.ps1 | 53 ++--------------------- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- scripts/internalCI.ps1 | 1 - 3 files changed, 4 insertions(+), 52 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index d142f57fe..5eb0cc0db 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -1,14 +1,8 @@ [CmdletBinding()] param( - [string]$Dependency, - [ValidateNotNullOrEmpty()] - [string]$downloadPromptOverride = "0" + [string]$Dependency ) -$downloadPromptOverride_NO_OVERRIDE= 0 -$downloadPromptOverride_DO_NOT_PROMPT = 1 -$downloadPromptOverride_ALWAYS_PROMPT = 2 - if ($PSVersionTable.PSEdition -ne "Core") { Import-Module BitsTransfer -Verbose:$false } @@ -22,38 +16,6 @@ $downloadsDir = "$vcpkgRootDir\downloads" function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { - function promptForDownload([string]$title, [string]$message, [string]$yesDescription, [string]$noDescription, [string]$downloadPromptOverride) - { - $do_not_prompt = ($downloadPromptOverride -eq $downloadPromptOverride_DO_NOT_PROMPT) -Or - (Test-Path "$downloadsDir\AlwaysAllowEverything") -Or - (Test-Path "$downloadsDir\AlwaysAllowDownloads") - - if (($downloadPromptOverride -ne $downloadPromptOverride_ALWAYS_PROMPT) -And $do_not_prompt) - { - return $true - } - - $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", $yesDescription - $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", $noDescription - $AlwaysAllowDownloads = New-Object System.Management.Automation.Host.ChoiceDescription "&Always Allow Downloads", ($yesDescription + "(Future download prompts will not be displayed)") - - $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $AlwaysAllowDownloads) - $result = $host.ui.PromptForChoice($title, $message, $options, 0) - - switch ($result) - { - 0 {return $true} - 1 {return $false} - 2 { - New-Item "$downloadsDir\AlwaysAllowDownloads" -type file -force | Out-Null - return $true - } - } - - throw "Unexpected result" - } - - function performDownload( [Parameter(Mandatory=$true)][string]$Dependency, [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$downloadDir, @@ -66,16 +28,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) return } - $title = "Download " + $Dependency - $message = ("No suitable version of " + $Dependency + " was found (requires $requiredVersion or higher). Download portable version?") - $yesDescription = "Downloads " + $Dependency + " v" + $downloadVersion +" app-locally." - $noDescription = "Does not download " + $Dependency + "." - - $userAllowedDownload = promptForDownload $title $message $yesDescription $noDescription $downloadPromptOverride - if (!$userAllowedDownload) - { - throw [System.IO.FileNotFoundException] ("Could not detect suitable version of " + $Dependency + " and download not allowed") - } + Write-Host "A suitable version of $Dependency was not found (required v$requiredVersion). Downloading portable $Dependency v$downloadVersion..." if (!(Test-Path $downloadDir)) { @@ -202,7 +155,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) - $downloadedFileHash = -Join ($hashByteArray | ForEach {"{0:x2}" -f $_}) + $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) } else { diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 14bfc244b..ca807980c 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -8,7 +8,7 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" 1 +$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" $nugetPackageDir = "$downloadsDir\nuget-packages" $SetupAPIVersion = "1.8.24" diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 68c917f7a..67871acc1 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -1,7 +1,6 @@ $ErrorActionPreference = "Stop" New-Item -type directory downloads -errorAction SilentlyContinue | Out-Null -New-Item -type file downloads\AlwaysAllowDownloads -errorAction SilentlyContinue | Out-Null ./scripts/bootstrap.ps1 if (-not $?) { throw $? } -- cgit v1.2.3 From 400010c667fb899d5ddf953b4081b89141717bf1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Aug 2017 19:29:03 -0700 Subject: fetchDependency.ps1: Don't print the Downloading message... --- scripts/fetchDependency.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 5eb0cc0db..01d7441c8 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -28,7 +28,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) return } - Write-Host "A suitable version of $Dependency was not found (required v$requiredVersion). Downloading portable $Dependency v$downloadVersion..." + # Write-Host "A suitable version of $Dependency was not found (required v$requiredVersion). Downloading portable $Dependency v$downloadVersion..." if (!(Test-Path $downloadDir)) { -- cgit v1.2.3 From bd7cd7f56d5d9fdfeb1f57810a2ea77bf4d7e31a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 Aug 2017 13:11:50 -0700 Subject: Add explanation for not printing in fetchDependency.ps1 --- scripts/fetchDependency.ps1 | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 01d7441c8..c9aeb0f77 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -28,6 +28,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) return } + # Can't print because vcpkg captures the output and expects only the path that is returned at the end of this script file # Write-Host "A suitable version of $Dependency was not found (required v$requiredVersion). Downloading portable $Dependency v$downloadVersion..." if (!(Test-Path $downloadDir)) -- cgit v1.2.3 From e4eee15ef96ee4a06f40256da8901b28833bf22c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 22 Aug 2017 13:41:32 -0700 Subject: Fix vcpkg_acquire_msys --- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 87c34c274..830022906 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -58,13 +58,13 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(URL "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20161025.tar.xz/download") set(ARCHIVE "msys2-base-x86_64-20161025.tar.xz") set(HASH 6c4c18ec59db80b8269698d074866438a624f1ce735ee5005a01b148b02e8f2e966ae381aa1cb4c50f6226c3b7feb271e36907cf26580df084d695b3c9f5c0eb) - set(STAMP "initialized-msys2.stamp") + set(STAMP "initialized-msys2_64.stamp") else() set(TOOLSUBPATH msys32) set(URL "https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20161025.tar.xz/download") set(ARCHIVE "msys2-base-i686-20161025.tar.xz") set(HASH c9260a38e0c6bf963adeaea098c4e376449c1dd0afe07480741d6583a1ac4c138951ccb0c5388bd148e04255a5c1a23bf5ee2d58dcd6607c14f1eaa5639a7c85) - set(STAMP "initialized-msys2_x64.stamp") + set(STAMP "initialized-msys2_32.stamp") endif() set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH}) -- cgit v1.2.3 From 3f88832110a780de991752323cf39b8f68b34c39 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Aug 2017 23:20:57 -0700 Subject: [vcpkg] Add commit date to vcpkg version --- scripts/bootstrap.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b7bc5afab..569bdbbc7 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -6,15 +6,21 @@ param( $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root +Write-Verbose("vcpkg Path " + $vcpkgRootDir) + +$env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd" $gitHash = "unknownhash" if (Get-Command "git" -ErrorAction SilentlyContinue) { - $gitHash = git rev-parse HEAD + $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short + if ($LASTEXITCODE -ne 0) + { + $gitHash = "unknownhash" + } } -Write-Verbose("Git hash is " + $gitHash) +Write-Verbose("Git repo version string is " + $gitHash) $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" -Write-Verbose("vcpkg Path " + $vcpkgSourcesPath) if (!(Test-Path $vcpkgSourcesPath)) { -- cgit v1.2.3 From 7a2a237e13da457bc672e27c03c492e128bdd11d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Aug 2017 23:25:41 -0700 Subject: [vcpkg] Don't leak changes to the path in bootstrap --- scripts/bootstrap.ps1 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 569bdbbc7..2dd6813a4 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -8,17 +8,25 @@ $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root Write-Verbose("vcpkg Path " + $vcpkgRootDir) -$env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd" $gitHash = "unknownhash" -if (Get-Command "git" -ErrorAction SilentlyContinue) +$oldpath = $env:path +try { - $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short - if ($LASTEXITCODE -ne 0) + $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd" + if (Get-Command "git" -ListImported -ErrorAction SilentlyContinue) { - $gitHash = "unknownhash" + $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short + if ($LASTEXITCODE -ne 0) + { + $gitHash = "unknownhash" + } } } +finally +{ + $env:path = $oldpath +} Write-Verbose("Git repo version string is " + $gitHash) $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" @@ -27,7 +35,8 @@ if (!(Test-Path $vcpkgSourcesPath)) New-Item -ItemType directory -Path $vcpkgSourcesPath -force | Out-Null } -try{ +try +{ pushd $vcpkgSourcesPath $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $msbuildExe = $msbuildExeWithPlatformToolset[0] @@ -40,6 +49,7 @@ try{ Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null } -finally{ +finally +{ popd } -- cgit v1.2.3 From b21bc7c11ae2e34efe2ef87c10dd41213bbd208b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 28 Aug 2017 17:33:03 -0700 Subject: [vcpkg] Don't use -ListImported in bootstrap. Fixes #1711 --- scripts/bootstrap.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 2dd6813a4..b874afd8c 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -14,7 +14,7 @@ $oldpath = $env:path try { $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd" - if (Get-Command "git" -ListImported -ErrorAction SilentlyContinue) + if (Get-Command "git" -ErrorAction SilentlyContinue) { $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short if ($LASTEXITCODE -ne 0) -- cgit v1.2.3 From 97b04a0b959badbecdb7604ba1fd3058a23f8b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Wed, 30 Aug 2017 00:12:23 +0200 Subject: Add CMake function vcpkg_from_bitbucket --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_from_bitbucket.cmake | 190 +++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 scripts/cmake/vcpkg_from_bitbucket.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 29f0f8dff..81e8e5813 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -6,6 +6,7 @@ include(vcpkg_execute_required_process_repeat) include(vcpkg_find_acquire_program) include(vcpkg_fixup_cmake_targets) include(vcpkg_from_github) +include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) diff --git a/scripts/cmake/vcpkg_from_bitbucket.cmake b/scripts/cmake/vcpkg_from_bitbucket.cmake new file mode 100644 index 000000000..227de5141 --- /dev/null +++ b/scripts/cmake/vcpkg_from_bitbucket.cmake @@ -0,0 +1,190 @@ +## # vcpkg_from_bitbucket +## +## Download and extract a project from Bitbucket. +## Enables support for installing HEAD `vcpkg.exe install --head `. +## +## ## Usage: +## ```cmake +## vcpkg_from_bitbucket( +## OUT_SOURCE_PATH +## REPO +## [REF ] +## [SHA512 <45d0d7f8cc350...>] +## [HEAD_REF ] +## ) +## ``` +## +## ## Parameters: +## ### OUT_SOURCE_PATH +## Specifies the out-variable that will contain the extracted location. +## +## This should be set to `SOURCE_PATH` by convention. +## +## ### REPO +## The organization or user and repository on GitHub. +## +## ### REF +## A stable git commit-ish (ideally a tag) that will not change contents. **This should not be a branch.** +## +## For repositories without official releases, this can be set to the full commit id of the current latest master. +## +## If `REF` is specified, `SHA512` must also be specified. +## +## ### SHA512 +## The SHA512 hash that should match the archive (https://bitbucket.com/${REPO}/get/${REF}.tar.gz). +## +## This is most easily determined by first setting it to `1`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile. +## +## ### HEAD_REF +## The unstable git commit-ish (ideally a branch) to pull for `--head` builds. +## +## For most projects, this should be `master`. The chosen branch should be one that is expected to be always buildable on all supported platforms. +## +## ## Notes: +## At least one of `REF` and `HEAD_REF` must be specified, however it is preferable for both to be present. +## +## This exports the `VCPKG_HEAD_VERSION` variable during head builds. +## +## ## Examples: +## +## * [blaze](https://github.com/Microsoft/vcpkg/blob/master/ports/blaze/portfile.cmake) +function(vcpkg_from_bitbucket) + set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF) + set(multipleValuesArgs) + cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + + if(NOT _vdud_OUT_SOURCE_PATH) + message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") + endif() + + if((_vdud_REF AND NOT _vdud_SHA512) OR (NOT _vdud_REF AND _vdud_SHA512)) + message(FATAL_ERROR "SHA512 must be specified if REF is specified.") + endif() + + if(NOT _vdud_REPO) + message(FATAL_ERROR "The Bitbucket repository must be specified.") + endif() + + if(NOT _vdud_REF AND NOT _vdud_HEAD_REF) + message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.") + endif() + + string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) + string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) + + macro(set_SOURCE_PATH BASE BASEREF) + set(SOURCE_PATH "${BASE}/${ORG_NAME}-${REPO_NAME}-${BASEREF}") + if(EXISTS ${SOURCE_PATH}) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + else() + # Sometimes GitHub strips a leading 'v' off the REF. + string(REGEX REPLACE "^v" "" REF ${BASEREF}) + set(SOURCE_PATH "${BASE}/${ORG_NAME}-${REPO_NAME}-${REF}") + if(EXISTS ${SOURCE_PATH}) + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + else() + message(FATAL_ERROR "Could not determine source path: '${BASE}/${ORG_NAME}-${REPO_NAME}-${BASEREF}' does not exist") + endif() + endif() + endmacro() + + if(VCPKG_USE_HEAD_VERSION AND NOT _vdud_HEAD_REF) + message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") + set(VCPKG_USE_HEAD_VERSION OFF) + endif() + + # Handle --no-head scenarios + if(NOT VCPKG_USE_HEAD_VERSION) + if(NOT _vdud_REF) + message(FATAL_ERROR "Package does not specify REF. It must built using --head.") + endif() + + set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz") + + file(DOWNLOAD "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/tags/${_vdud_REF}" + ${downloaded_file_path}.version + STATUS download_status + ) + list(GET download_status 0 status_code) + if ("${status_code}" STREQUAL "0") + # Parse the github refs response with regex. + # TODO: use some JSON swiss-army-knife utility instead. + file(READ "${downloaded_file_path}.version" _contents) + string(REGEX MATCH "\"hash\": \"[a-f0-9]+\"" x "${_contents}") + string(REGEX REPLACE "\"hash\": \"([a-f0-9]+)\"" "\\1" _version ${x}) + string(SUBSTRING ${_version} 0 12 _version) # Get the 12 first numbers from commit hash + else() + set(_version ${_vdud_REF}) + endif() + + vcpkg_download_distfile(ARCHIVE + URLS "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz" + SHA512 "${_vdud_SHA512}" + FILENAME "${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz" + ) + vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}") + set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${_version}) + return() + endif() + + # The following is for --head scenarios + set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + + if(_VCPKG_NO_DOWNLOADS) + if(NOT EXISTS ${downloaded_file_path} OR NOT EXISTS ${downloaded_file_path}.version) + message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") + endif() + message(STATUS "Using cached ${downloaded_file_path}") + else() + if(EXISTS ${downloaded_file_path}) + message(STATUS "Purging cached ${downloaded_file_path} to fetch latest (use --no-downloads to suppress)") + file(REMOVE ${downloaded_file_path}) + endif() + if(EXISTS ${downloaded_file_path}.version) + file(REMOVE ${downloaded_file_path}.version) + endif() + if(EXISTS ${CURRENT_BUILDTREES_DIR}/src/head) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src/head) + endif() + + # Try to download the file and version information from bitbucket. + message(STATUS "Downloading ${URL}...") + file(DOWNLOAD "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/branches/${_vdud_HEAD_REF}" + ${downloaded_file_path}.version + STATUS download_status + ) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + file(REMOVE ${downloaded_file_path}.version) + message(FATAL_ERROR "Downloading version info for ${URL}... Failed. Status: ${download_status}") + endif() + + file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + file(REMOVE ${downloaded_file_path}) + message(FATAL_ERROR "Downloading ${URL}... Failed. Status: ${download_status}") + else() + message(STATUS "Downloading ${URL}... OK") + endif() + endif() + + vcpkg_extract_source_archive_ex( + ARCHIVE "${downloaded_file_path}" + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/head" + ) + + # Parse the github refs response with regex. + # TODO: use some JSON swiss-army-knife utility instead. + file(READ "${downloaded_file_path}.version" _contents) + string(REGEX MATCH "\"hash\": \"[a-f0-9]+\"" x "${_contents}") + string(REGEX REPLACE "\"hash\": \"([a-f0-9]+)\"" "\\1" _version ${x}) + string(SUBSTRING ${_version} 0 12 _vdud_HEAD_REF) # Get the 12 first numbers from commit hash + + # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. + set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) + + set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${_vdud_HEAD_REF}) +endfunction() -- cgit v1.2.3 From c167c70c272a417779e601fffcbdb72278da1848 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sat, 2 Sep 2017 16:48:29 +0200 Subject: - Added support for VS2013 build chain tools. --- scripts/cmake/vcpkg_configure_cmake.cmake | 8 +++++ scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 39 +++++++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 07acfc8ea..e43075961 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -61,6 +61,14 @@ function(vcpkg_configure_cmake) set(GENERATOR ${_csc_GENERATOR}) elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT _csc_HOST_ARCHITECTURE STREQUAL "x86") set(GENERATOR "Ninja") + + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(GENERATOR "Visual Studio 12 2013") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(GENERATOR "Visual Studio 12 2013 Win64") + elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(GENERATOR "Visual Studio 12 2013 ARM") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index f72491e5d..82d9f7c16 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -4,12 +4,15 @@ param( [switch]$DisableVS2017 = $False, [Parameter(Mandatory=$False)] - [switch]$DisableVS2015 = $False + [switch]$DisableVS2015 = $False, + + [Parameter(Mandatory=$False)] + [switch]$DisableVS2013 = $False ) -if ($DisableVS2017 -and $DisableVS2015) +if ($DisableVS2017 -and $DisableVS2015 -and $DisableVS2013) { - throw "Both VS2015 and VS2017 were disabled." + throw "VS013, VS2015 and VS2017 were disabled." } function New-MSBuildInstance() @@ -23,7 +26,7 @@ function New-MSBuildInstance() return $instance } -Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015" +Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015, DisableVS2013=$DisableVS2013" $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $validInstances = New-Object System.Collections.ArrayList @@ -139,6 +142,27 @@ foreach ($pair in $registryPairs) $validInstances.Add($instance) > $null } +# VS2013 - in Program Files +Write-Verbose "`n`n" +Write-Verbose "Checking for MSBuild from VS2013 in Program Files..." +$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) +Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" +foreach ($ProgramFiles in $CandidateProgramFiles) +{ + $clExe= "$ProgramFiles\Microsoft Visual Studio 12.0\VC\bin\cl.exe" + + if (!(Test-Path $clExe)) + { + Write-Verbose "$clExe - Not Found" + continue + } + + Write-Verbose "$clExe - Found" + $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\12.0\Bin\MSBuild.exe" "v120" + Write-Verbose "Found $instance" + $validInstances.Add($instance) > $null +} + Write-Verbose "`n`n`n" Write-Verbose "The following MSBuild instances were found:" foreach ($instance in $validInstances) @@ -158,7 +182,12 @@ foreach ($instance in $validInstances) { return $instance.msbuildExePath, $instance.toolsetVersion } + + if (!$DisableVS2013 -and $instance.toolsetVersion -eq "v120") + { + return $instance.msbuildExePath, $instance.toolsetVersion + } } -throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file +throw "Could not find MSBuild version with C++ support. VS2013, VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file -- cgit v1.2.3 From 26516fe485b0e9048dd4809256a7e4526957c6e9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 9 Sep 2017 00:12:54 -0700 Subject: vcpkg_configure_cmake (and _meson) now embed debug symbols within static libs (/Z7) --- scripts/cmake/vcpkg_configure_cmake.cmake | 16 ++++++++-------- scripts/cmake/vcpkg_configure_meson.cmake | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 07acfc8ea..fecea8f1c 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -141,22 +141,22 @@ function(vcpkg_configure_cmake) if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" ) list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_C_FLAGS_RELEASE}" + "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" ) elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" ) list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi ${VCPKG_C_FLAGS_RELEASE}" + "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" ) endif() diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 277f91e11..143bb74de 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -9,17 +9,17 @@ function(vcpkg_configure_meson) set(MESON_COMMON_CXXFLAGS "${MESON_COMMON_CXXFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc") if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) - set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") - set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1") - set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") - set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Z7") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Oi /Gy /DNDEBUG /Z7") elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") - set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1") + set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1") - set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") - set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Zi") + set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Z7") + set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MT /O2 /Oi /Gy /DNDEBUG /Z7") endif() set(MESON_COMMON_LDFLAGS "${MESON_COMMON_LDFLAGS} /DEBUG") -- cgit v1.2.3 From e915ab0466956bb16985402ef51a6dace2897420 Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Tue, 12 Sep 2017 20:13:34 -0400 Subject: Update to latest python 3.5 patch --- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index fef62da53..e718fc7da 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -67,9 +67,9 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "PYTHON3") set(PROGNAME python) set(PATHS ${DOWNLOADS}/tools/python) - set(URL "https://www.python.org/ftp/python/3.5.3/python-3.5.3-embed-win32.zip") - set(ARCHIVE "python-3.5.3-embed-win32.zip") - set(HASH c8cfdc09d052dc27e4380e8e4bf0d32a4c0def7e03896c1fa6cabc26dde78bb74dbb04e3673cc36e3e307d65a1ef284d69174f0cc80008c83bc6178f192ac5cf) + set(URL "https://www.python.org/ftp/python/3.5.4/python-3.5.4-embed-win32.zip") + set(ARCHIVE "python-3.5.4-embed-win32.zip") + set(HASH b5240fdc95088c2d7f65d2dd598650f8dd106b49589d94156bd4a078b108c6cabbe7a38ef73e2b2cf00e8312a93d2e587eac2c54ce85540d3c7a26cc60013156) elseif(VAR MATCHES "PYTHON2") find_program(PYTHON2 NAMES python2 python PATHS C:/python27 c:/Python27amd64 ENV PYTHON) if(NOT PYTHON2 MATCHES "NOTFOUND") -- cgit v1.2.3 From cbc3050b44a14bdd252d174072911d1dadcd8eff Mon Sep 17 00:00:00 2001 From: glachancecmaisonneuve Date: Sun, 17 Sep 2017 02:33:41 -0400 Subject: find_acquire_program fix for python2 python2 version bump --- scripts/cmake/vcpkg_find_acquire_program.cmake | 30 ++++++++------------------ 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index e718fc7da..47fbc7801 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -66,31 +66,19 @@ function(vcpkg_find_acquire_program VAR) set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) elseif(VAR MATCHES "PYTHON3") set(PROGNAME python) - set(PATHS ${DOWNLOADS}/tools/python) + set(SUBDIR "python3") + set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) set(URL "https://www.python.org/ftp/python/3.5.4/python-3.5.4-embed-win32.zip") set(ARCHIVE "python-3.5.4-embed-win32.zip") set(HASH b5240fdc95088c2d7f65d2dd598650f8dd106b49589d94156bd4a078b108c6cabbe7a38ef73e2b2cf00e8312a93d2e587eac2c54ce85540d3c7a26cc60013156) elseif(VAR MATCHES "PYTHON2") - find_program(PYTHON2 NAMES python2 python PATHS C:/python27 c:/Python27amd64 ENV PYTHON) - if(NOT PYTHON2 MATCHES "NOTFOUND") - execute_process( - COMMAND ${PYTHON2} --version - OUTPUT_VARIABLE PYTHON_VER_CHECK_OUT - ERROR_VARIABLE PYTHON_VER_CHECK_ERR - ) - set(PYTHON_VER_CHECK "${PYTHON_VER_CHECK_OUT}${PYTHON_VER_CHECK_ERR}") - debug_message("PYTHON_VER_CHECK=${PYTHON_VER_CHECK}") - if(NOT PYTHON_VER_CHECK MATCHES "Python 2.7") - set(PYTHON2 PYTHON2-NOTFOUND) - find_program(PYTHON2 NAMES python2 python PATHS C:/python27 ENV PYTHON NO_SYSTEM_ENVIRONMENT_PATH) - endif() - endif() - if(PYTHON2 MATCHES "NOTFOUND") - message(FATAL_ERROR "Python 2.7 was not found in the path or by searching inside C:\\Python27.\n" - "There is no portable redistributable for Python 2.7, so you will need to install the MSI located at:\n" - " https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi\n" - ) - endif() + set(PROGNAME python) + set(SUBDIR "python2") + set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) + file(TO_NATIVE_PATH "${PATHS}" DESTINATION_NATIVE_PATH) + set(URL "https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi") + set(ARCHIVE "python2.msi") + set(HASH 8c3ad6e527742d99ba96dcfd1098861b14e7207b80d51a54e9b410ab2f36e44e05561ea1527d8e92b3e10808311536260bd9e82db0da3b513fb1be18e108510e) elseif(VAR MATCHES "RUBY") set(PROGNAME "ruby") set(PATHS ${DOWNLOADS}/tools/ruby/rubyinstaller-2.4.1-1-x86/bin) -- cgit v1.2.3 From 39a96fc2f4a7d471ab3fa16c480fc0d9965605b1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 15 Sep 2017 16:47:07 -0700 Subject: Bump required version of CMake to 3.9.2 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index c9aeb0f77..4aca0c811 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -105,12 +105,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.1" - $downloadVersion = "3.9.1" - $url = "https://cmake.org/files/v3.9/cmake-3.9.1-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.1-win32-x86.zip" - $expectedDownloadedFileHash = "e0d9501bd34e3100e925dcb2e07f5f0ce8980bdbe5fce0ae950b21368d54c1a1" - $executableFromDownload = "$downloadsDir\cmake-3.9.1-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.2" + $downloadVersion = "3.9.2" + $url = "https://cmake.org/files/v3.9/cmake-3.9.2-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.2-win32-x86.zip" + $expectedDownloadedFileHash = "9fe68d50f065666cb2861f53751390f15c6363c440e86a07677689378bb8329f" + $executableFromDownload = "$downloadsDir\cmake-3.9.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 548b7f69197fad294f44b6e3ae5f587116220fae Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 22 Sep 2017 14:20:27 -0700 Subject: Bump required version of CMake to 3.9.3 3.9.3 contains this interesting change: FindBoost: Add support for Boost 1.65.0 and 1.65.1 to CMake 3.9 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 4aca0c811..2a23002a4 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -105,12 +105,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.2" - $downloadVersion = "3.9.2" - $url = "https://cmake.org/files/v3.9/cmake-3.9.2-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.2-win32-x86.zip" - $expectedDownloadedFileHash = "9fe68d50f065666cb2861f53751390f15c6363c440e86a07677689378bb8329f" - $executableFromDownload = "$downloadsDir\cmake-3.9.2-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.3" + $downloadVersion = "3.9.3" + $url = "https://cmake.org/files/v3.9/cmake-3.9.3-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.3-win32-x86.zip" + $expectedDownloadedFileHash = "47870e3d4c9a5aa019e71020cd85cc60b6f2d2569fb239eaec204cd991e512f1" + $executableFromDownload = "$downloadsDir\cmake-3.9.3-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 06798b6528b777ba2e2a9af59774309db5cf5e52 Mon Sep 17 00:00:00 2001 From: glachancecmaisonneuve Date: Mon, 25 Sep 2017 13:05:32 -0400 Subject: Fix for BUILD_ARGS being always added in non ninja build --- scripts/cmake/vcpkg_build_cmake.cmake | 30 +++++++++++++++++++++++++++++- scripts/cmake/vcpkg_install_cmake.cmake | 6 ++++-- 2 files changed, 33 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 18e2a8b00..546071a36 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -1,3 +1,29 @@ +## # vcpkg_build_cmake +## +## Build a cmake project. +## +## ## Usage: +## ```cmake +## vcpkg_build_cmake([MSVC_64_TOOLSET] [DISABLE_PARALLEL]) +## ``` +## +## ## Parameters: +## ### MSVC_64_TOOLSET +## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## +## ### DISABLE_PARALLEL +## The /m parameter will not be added to the underlying buildsystem parameters +## +## ## Notes: +## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +## Use [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the "install" target +## +## ## Examples: +## +## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) +## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) +## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) +## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_build_cmake) cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) @@ -19,7 +45,9 @@ function(vcpkg_build_cmake) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) set(BUILD_ARGS -v) # verbose output - else() + endif() + + if(_bc_MSVC_64_TOOLSET) set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) endif() diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index f778007ef..34ac15fe6 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -9,7 +9,7 @@ ## ## ## Parameters: ## ### MSVC_64_TOOLSET -## This adds the `/p:PreferredToolArchitecture=x64` switch if the underlying buildsystem is MSBuild. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. ## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). @@ -41,7 +41,9 @@ function(vcpkg_install_cmake) if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) set(BUILD_ARGS -v) # verbose output - else() + endif() + + if(_bc_MSVC_64_TOOLSET) set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) endif() -- cgit v1.2.3 From c6149fae2f9f33d9ed363650aee6aea642574b0a Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Wed, 27 Sep 2017 02:57:51 +0300 Subject: [vcpkg-export-ifw] Usage QtIFW tools Download and use tools to make repository and installer --- scripts/fetchDependency.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 2a23002a4..25447c19b 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -137,6 +137,17 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $extractionType = $ExtractionType_ZIP $extractionFolder = "$downloadsDir\MinGit-2.14.1-32-bit" } + elseif($Dependency -eq "installerbase") + { + $requiredVersion = "3.1.81" + $downloadVersion = "3.1.81" + $url = "https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip" + $downloadPath = "$downloadsDir\QtInstallerFramework-win-x86.zip" + $expectedDownloadedFileHash = "f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8" + $executableFromDownload = "$downloadsDir\QtInstallerFramework-win-x86\bin\installerbase.exe" + $extractionType = $ExtractionType_ZIP + $extractionFolder = $downloadsDir + } else { throw "Unknown program requested" -- cgit v1.2.3 From 58418e73736d267bb921d6b4568e39710fcfdacb Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Tue, 3 Oct 2017 00:55:54 +0900 Subject: Add Dark support Add Dark support to vcpkg_find_acquire_program(). --- scripts/cmake/vcpkg_find_acquire_program.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index e718fc7da..69e439001 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -152,6 +152,13 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/36bacb4cba27003c572e5bf7a9c4dfe3c9a8d40d/gas-preprocessor.pl") set(ARCHIVE "gas-preprocessor.pl") set(HASH a25caadccd1457a0fd2abb5a0da9aca1713b2c351d76daf87a4141e52021f51aa09e95a62942c6f0764f79cc1fa65bf71584955b09e62ee7da067b5c82baf6b3) + elseif(VAR MATCHES "DARK") + set(PROGNAME dark) + set(SUBDIR "wix311-binaries") + set(PATHS ${DOWNLOADS}/tools/dark/${SUBDIR}) + set(URL "https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip") + set(ARCHIVE "wix311-binaries.zip") + set(HASH 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 433c505e32ec38b8a3395e1f0fe3fca0e9c12cad Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 3 Oct 2017 15:58:10 -0700 Subject: [vcpkg] Revert attempt to build vcpkg.exe with VS2013 --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 39 +++--------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 82d9f7c16..f72491e5d 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -4,15 +4,12 @@ param( [switch]$DisableVS2017 = $False, [Parameter(Mandatory=$False)] - [switch]$DisableVS2015 = $False, - - [Parameter(Mandatory=$False)] - [switch]$DisableVS2013 = $False + [switch]$DisableVS2015 = $False ) -if ($DisableVS2017 -and $DisableVS2015 -and $DisableVS2013) +if ($DisableVS2017 -and $DisableVS2015) { - throw "VS013, VS2015 and VS2017 were disabled." + throw "Both VS2015 and VS2017 were disabled." } function New-MSBuildInstance() @@ -26,7 +23,7 @@ function New-MSBuildInstance() return $instance } -Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015, DisableVS2013=$DisableVS2013" +Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015" $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $validInstances = New-Object System.Collections.ArrayList @@ -142,27 +139,6 @@ foreach ($pair in $registryPairs) $validInstances.Add($instance) > $null } -# VS2013 - in Program Files -Write-Verbose "`n`n" -Write-Verbose "Checking for MSBuild from VS2013 in Program Files..." -$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) -Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" -foreach ($ProgramFiles in $CandidateProgramFiles) -{ - $clExe= "$ProgramFiles\Microsoft Visual Studio 12.0\VC\bin\cl.exe" - - if (!(Test-Path $clExe)) - { - Write-Verbose "$clExe - Not Found" - continue - } - - Write-Verbose "$clExe - Found" - $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\12.0\Bin\MSBuild.exe" "v120" - Write-Verbose "Found $instance" - $validInstances.Add($instance) > $null -} - Write-Verbose "`n`n`n" Write-Verbose "The following MSBuild instances were found:" foreach ($instance in $validInstances) @@ -182,12 +158,7 @@ foreach ($instance in $validInstances) { return $instance.msbuildExePath, $instance.toolsetVersion } - - if (!$DisableVS2013 -and $instance.toolsetVersion -eq "v120") - { - return $instance.msbuildExePath, $instance.toolsetVersion - } } -throw "Could not find MSBuild version with C++ support. VS2013, VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file +throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file -- cgit v1.2.3 From 0ba3c166d76a4484fd4d378dc7367f2794577a20 Mon Sep 17 00:00:00 2001 From: Jens Frederich Date: Wed, 4 Oct 2017 08:19:57 +0200 Subject: Get proxy credentials behind web proxy --- scripts/bootstrap.ps1 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b7bc5afab..fa51de404 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -4,6 +4,10 @@ param( [string]$disableMetrics = "0" ) +$webclient=New-Object System.Net.WebClient +$creds=Get-Credential +$webclient.Proxy.Credentials=$creds + $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root -- cgit v1.2.3 From 6f763c5ca830c9e461e106c63959a60d33eb5e5b Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Thu, 5 Oct 2017 21:24:32 +0300 Subject: [vcpkg-export-ifw] Maintenance Tool Install maintenance tool and create Start menu shortcuts to manage, update and uninstall packages. --- scripts/ifw/maintenance.qs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 scripts/ifw/maintenance.qs (limited to 'scripts') diff --git a/scripts/ifw/maintenance.qs b/scripts/ifw/maintenance.qs new file mode 100644 index 000000000..5cdad7225 --- /dev/null +++ b/scripts/ifw/maintenance.qs @@ -0,0 +1,46 @@ +// constructor +function Component() +{ + installer.installationStarted.connect(this, Component.prototype.onInstallationStarted); +} + +Component.prototype.onInstallationStarted = function() +{ + if (component.updateRequested() || component.installationRequested()) { + if (installer.value("os") == "win") + component.installerbaseBinaryPath = "@TargetDir@/tempmaintenancetool.exe"; + installer.setInstallerBaseBinary(component.installerbaseBinaryPath); + } +} + +Component.prototype.createOperations = function() +{ + // call the base createOperations + component.createOperations(); + + // only for windows online installer + if ( installer.value("os") == "win" && !installer.isOfflineOnly() ) + { + // shortcut to add or remove packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Manage vcpkg.lnk", + " --manage-packages"); + // shortcut to update packages + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Update vcpkg.lnk", + " --updater"); + } + + // create uninstall link only for windows + if (installer.value("os") == "win") + { + // shortcut to uninstaller + component.addOperation( "CreateShortcut", + "@TargetDir@/maintenancetool.exe", + "@StartMenuDir@/Uninstall vcpkg.lnk", + " --uninstall"); + } +} + -- cgit v1.2.3 From 2c9ee072da34a925f0faf22596e532d378930582 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 5 Oct 2017 17:49:28 -0700 Subject: [vcpkg_build_cmake] Refactor _build_ and _install_ into a single cmake script. Regenerate documentation. Remove MSVC_64_TOOLSET option because it's obsolete. --- scripts/cmake/vcpkg_build_cmake.cmake | 65 +++++++++++++++++-------------- scripts/cmake/vcpkg_configure_cmake.cmake | 2 + scripts/cmake/vcpkg_install_cmake.cmake | 50 +++--------------------- 3 files changed, 43 insertions(+), 74 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 546071a36..5dc81ec09 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -4,19 +4,21 @@ ## ## ## Usage: ## ```cmake -## vcpkg_build_cmake([MSVC_64_TOOLSET] [DISABLE_PARALLEL]) +## vcpkg_build_cmake([DISABLE_PARALLEL] [TARGET ]) ## ``` ## ## ## Parameters: -## ### MSVC_64_TOOLSET -## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. -## ## ### DISABLE_PARALLEL -## The /m parameter will not be added to the underlying buildsystem parameters +## The underlying buildsystem will be instructed to not parallelize +## +## ### TARGET +## The target passed to the cmake build command (`cmake --build . --target `). If not specified, no target will +## be passed. ## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). -## Use [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the "install" target +## You can use the alias [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the +## "install" target ## ## ## Examples: ## @@ -25,45 +27,50 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_build_cmake) - cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - - set(MSVC_EXTRA_ARGS - "/p:VCPkgLocalAppDataDisabled=true" - "/p:UseIntelMKL=No" - ) + cmake_parse_arguments(_bc "DISABLE_PARALLEL" "TARGET;LOGFILE_ROOT" "" ${ARGN}) - # Specifies the architecture of the toolset, NOT the architecture of the produced binary - # This can help libraries that cause the linker to run out of memory. - # https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory - if (_bc_MSVC_64_TOOLSET) - list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") + if(NOT _bc_LOGFILE_ROOT) + set(_bc_LOGFILE_ROOT "build") endif() - if (NOT _bc_DISABLE_PARALLEL) - list(APPEND MSVC_EXTRA_ARGS "/m") + if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja") + set(BUILD_ARGS "-v") # verbose output + if (_bc_DISABLE_PARALLEL) + list(APPEND BUILD_ARGS "-j1") + endif() + elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio") + set(BUILD_ARGS + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) + if (NOT _bc_DISABLE_PARALLEL) + list(APPEND BUILD_ARGS "/m") + endif() + elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake") + # No options are currently added for nmake builds + else() + message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles") endif() - if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) - set(BUILD_ARGS -v) # verbose output - endif() - - if(_bc_MSVC_64_TOOLSET) - set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) + if(_bc_TARGET) + set(TARGET_PARAM "--target" ${_bc_TARGET}) + else() + set(TARGET_PARAM) endif() message(STATUS "Build ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${BUILD_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel + LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-rel ) message(STATUS "Build ${TARGET_TRIPLET}-rel done") message(STATUS "Build ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug -- ${BUILD_ARGS} + COMMAND ${CMAKE_COMMAND} --build . --config Debug ${TARGET_PARAM} -- ${BUILD_ARGS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg + LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-dbg ) message(STATUS "Build ${TARGET_TRIPLET}-dbg done") endfunction() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index fecea8f1c..fe8c97c52 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -188,4 +188,6 @@ function(vcpkg_configure_cmake) LOGNAME config-${TARGET_TRIPLET}-dbg ) message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + + set(_VCPKG_CMAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_install_cmake.cmake b/scripts/cmake/vcpkg_install_cmake.cmake index 34ac15fe6..ab72d054e 100644 --- a/scripts/cmake/vcpkg_install_cmake.cmake +++ b/scripts/cmake/vcpkg_install_cmake.cmake @@ -4,15 +4,15 @@ ## ## ## Usage: ## ```cmake -## vcpkg_install_cmake([MSVC_64_TOOLSET]) +## vcpkg_install_cmake(...) ## ``` ## ## ## Parameters: -## ### MSVC_64_TOOLSET -## This adds the `/p:PreferredToolArchitecture=x64` switch to the underlying buildsystem parameters. Some large projects can run out of memory when linking if they use the 32-bit hosted tools. +## See [`vcpkg_build_cmake()`](vcpkg_build_cmake.md). ## ## ## Notes: -## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). +## This command transparently forwards to [`vcpkg_build_cmake()`](vcpkg_build_cmake.md), adding a `TARGET install` +## parameter. ## ## ## Examples: ## @@ -21,45 +21,5 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_install_cmake) - cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN}) - - set(MSVC_EXTRA_ARGS - "/p:VCPkgLocalAppDataDisabled=true" - "/p:UseIntelMKL=No" - ) - - # Specifies the architecture of the toolset, NOT the architecture of the produced binary - # This can help libraries that cause the linker to run out of memory. - # https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory - if (_bc_MSVC_64_TOOLSET) - list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64") - endif() - - if (NOT _bc_DISABLE_PARALLEL) - list(APPEND MSVC_EXTRA_ARGS "/m") - endif() - - if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja) - set(BUILD_ARGS -v) # verbose output - endif() - - if(_bc_MSVC_64_TOOLSET) - set(BUILD_ARGS ${MSVC_EXTRA_ARGS}) - endif() - - message(STATUS "Package ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME package-${TARGET_TRIPLET}-rel - ) - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + vcpkg_build_cmake(LOGFILE_ROOT install TARGET install ${ARGN}) endfunction() -- cgit v1.2.3 From 9a963f7eff1981d4e894ea8b297d092cda60b764 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Oct 2017 13:51:28 -0700 Subject: Overhaul VS selection. Add triplet option to specify VS instance --- scripts/get_triplet_environment.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index 69e06bf97..b32f840d2 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -5,4 +5,5 @@ message("c35112b6-d1ba-415b-aa5d-81de856ef8eb") message("VCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}") message("VCPKG_CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") message("VCPKG_CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") -message("VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}") \ No newline at end of file +message("VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}") +message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") \ No newline at end of file -- cgit v1.2.3 From eca5a8b8d48d24c1a50fac58797af45dc5e83110 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Oct 2017 14:27:36 -0700 Subject: Add vswhere in fetchDependency.ps1 --- scripts/fetchDependency.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 25447c19b..80d6d2abb 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -119,11 +119,21 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $requiredVersion = "4.1.0" $downloadVersion = "4.1.0" $url = "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget-4.1.0\nuget.exe" + $downloadPath = "$downloadsDir\nuget-$downloadVersion\nuget.exe" $expectedDownloadedFileHash = "4c1de9b026e0c4ab087302ff75240885742c0faa62bd2554f913bbe1f6cb63a0" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } + elseif($Dependency -eq "vswhere") + { + $requiredVersion = "2.1.4" + $downloadVersion = "2.1.4" + $url = "https://github.com/Microsoft/vswhere/releases/download/2.1.4/vswhere.exe" + $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" + $expectedDownloadedFileHash = "548fb9dfeed59bc4ddcce739a5729e9c8dd5932cd60ff6f74727ee069e7da458" + $executableFromDownload = $downloadPath + $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED + } elseif($Dependency -eq "git") { $requiredVersion = "2.14.1" -- cgit v1.2.3 From f0c23aeb6b238ee0ba2dc272ee4c193f2f777460 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Oct 2017 18:25:34 -0700 Subject: Completely rework Visual Studio detection - Now using vswhere.exe to detect all VS instance (2015 + 2017) - Default version preference order is now: stable, prerelease, legacy - Within each preference weight, the latest one is chosen - findVisualStudioInstallationInstances.ps1 now has a parameter to choose VS instance --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 172 ++++------------------ scripts/findVisualStudioInstallationInstances.ps1 | 49 +++--- 2 files changed, 55 insertions(+), 166 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index f72491e5d..632cc2cdf 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -1,164 +1,50 @@ [CmdletBinding()] param( [Parameter(Mandatory=$False)] - [switch]$DisableVS2017 = $False, - - [Parameter(Mandatory=$False)] - [switch]$DisableVS2015 = $False + [string]$explicitlyRequestedVSPath = "" ) -if ($DisableVS2017 -and $DisableVS2015) -{ - throw "Both VS2015 and VS2017 were disabled." -} - -function New-MSBuildInstance() -{ - param ($msbuildExePath, $toolsetVersion) - - $instance = new-object PSObject - $instance | add-member -type NoteProperty -Name msbuildExePath -Value $msbuildExePath - $instance | add-member -type NoteProperty -Name toolsetVersion -Value $toolsetVersion +$explicitlyRequestedVSPath = $explicitlyRequestedVSPath -replace "\\$" # Remove potential trailing backslash - return $instance -} - -Write-Verbose "Executing $($MyInvocation.MyCommand.Name) with DisableVS2017=$DisableVS2017, DisableVS2015=$DisableVS2015" $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition - -$validInstances = New-Object System.Collections.ArrayList - -# VS2017 -Write-Verbose "`n`n" -Write-Verbose "Checking for MSBuild from VS2017 instances..." -$VisualStudio2017InstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 -Write-Verbose "VS2017 Candidates: $([system.String]::Join(',', $VisualStudio2017InstallationInstances))" -foreach ($instanceCandidate in $VisualStudio2017InstallationInstances) -{ - $VCFolder= "$instanceCandidate\VC\Tools\MSVC\" - - if (Test-Path $VCFolder) - { - $instance = New-MSBuildInstance "$instanceCandidate\MSBuild\15.0\Bin\MSBuild.exe" "v141" - Write-Verbose "Found $instance" - $validInstances.Add($instance) > $null - } -} - -# VS2015 - in Program Files -Write-Verbose "`n`n" -Write-Verbose "Checking for MSBuild from VS2015 in Program Files..." -$CandidateProgramFiles = $(& $scriptsDir\getProgramFiles32bit.ps1), $(& $scriptsDir\getProgramFilesPlatformBitness.ps1) -Write-Verbose "Program Files Candidate locations: $([system.String]::Join(',', $CandidateProgramFiles))" -foreach ($ProgramFiles in $CandidateProgramFiles) -{ - $clExe= "$ProgramFiles\Microsoft Visual Studio 14.0\VC\bin\cl.exe" - - if (!(Test-Path $clExe)) - { - Write-Verbose "$clExe - Not Found" - continue - } - - Write-Verbose "$clExe - Found" - $instance = New-MSBuildInstance "$ProgramFiles\MSBuild\14.0\Bin\MSBuild.exe" "v140" - Write-Verbose "Found $instance" - $validInstances.Add($instance) > $null -} - -# VS2015 - through the registry -function NewCppRegistryPair() -{ - param ($visualStudioEntry, $msBuildEntry) - - $instance = new-object PSObject - $instance | add-member -type NoteProperty -Name visualStudioEntry -Value $visualStudioEntry - $instance | add-member -type NoteProperty -Name msBuildEntry -Value $msBuildEntry - - return $instance -} - -Write-Verbose "`n`n" -Write-Verbose "Checking for MSBuild from VS2015 through the registry..." - -$registryPairs = -$(NewCppRegistryPair "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\visualstudio\14.0" "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\msbuild\toolsversions\14.0"), -$(NewCppRegistryPair "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\visualstudio\14.0" "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\msbuild\toolsversions\14.0") - -foreach ($pair in $registryPairs) +$VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 +Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))" +foreach ($instanceCandidate in $VisualStudioInstallationInstances) { - $vsEntry = $pair.visualStudioEntry - try - { - $VS14InstallDir = $(gp $vsEntry InstallDir -erroraction Stop | % { $_.InstallDir }) - Write-Verbose "$vsEntry\InstallDir - Found" - } - catch - { - Write-Verbose "$vsEntry\InstallDir - Not Found" - continue - } - - Write-Verbose "$VS14InstallDir - Obtained from registry" - # We want "${VS14InstallDir}..\..\VC\bin\cl.exe" - # Doing Split-path to avoid the ..\.. from appearing in the output - $clExePath = Split-path $VS14InstallDir -Parent - $clExePath = Split-path $clExePath -Parent - $clExePath = "$clExePath\VC\bin\cl.exe" - - if (!(Test-Path $clExePath)) - { - Write-Verbose "$clExePath - Not Found" - continue - } + Write-Verbose "Inspecting: $instanceCandidate" + $split = $instanceCandidate -split "::" + # $preferenceWeight = $split[0] + # $releaseType = $split[1] + $version = $split[2] + $path = $split[3] - Write-Verbose "$clExePath - Found" - - $msbuildEntry = $pair.msBuildEntry - try - { - $MSBuild14 = $(gp $msbuildEntry MSBuildToolsPath -erroraction Stop | % { $_.MSBuildToolsPath }) - Write-Verbose "$msbuildEntry\MSBuildToolsPath - Found" - } - catch - { - Write-Verbose "$msbuildEntry\MSBuildToolsPath - Not Found" - continue - } - - Write-Verbose "${MSBuild14} - Obtained from registry" - $msbuildPath = "${MSBuild14}MSBuild.exe" - if (!(Test-Path $msbuildPath)) + if ($explicitlyRequestedVSPath -ne "" -and $explicitlyRequestedVSPath -ne $path) { - Write-Verbose "$msbuildPath - Not Found" + Write-Verbose "Skipping: $instanceCandidate" continue } - $instance = New-MSBuildInstance $msbuildPath "v140" - Write-Verbose "Found $instance" - $validInstances.Add($instance) > $null -} - -Write-Verbose "`n`n`n" -Write-Verbose "The following MSBuild instances were found:" -foreach ($instance in $validInstances) -{ - Write-Verbose $instance -} - -# Selecting -foreach ($instance in $validInstances) -{ - if (!$DisableVS2017 -and $instance.toolsetVersion -eq "v141") + $majorVersion = $version.Substring(0,2); + if ($majorVersion -eq "15") { - return $instance.msbuildExePath, $instance.toolsetVersion + $VCFolder= "$path\VC\Tools\MSVC\" + if (Test-Path $VCFolder) + { + Write-Verbose "Picking: $instanceCandidate" + return "$path\MSBuild\15.0\Bin\MSBuild.exe", "v141" + } } - if (!$DisableVS2015 -and $instance.toolsetVersion -eq "v140") + if ($majorVersion -eq "14") { - return $instance.msbuildExePath, $instance.toolsetVersion + $clExe= "$path\VC\bin\cl.exe" + if (Test-Path $clExe) + { + Write-Verbose "Picking: $instanceCandidate" + $programFilesPath = split-path -parent $path + return "$programFilesPath\MSBuild\14.0\Bin\MSBuild.exe", "v140" + } } } - throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index ca807980c..8c67ef6d6 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -4,32 +4,35 @@ param( ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root +$vswhereExe = & $scriptsDir\fetchDependency.ps1 "vswhere" -$downloadsDir = "$vcpkgRootDir\downloads" +$output = & $vswhereExe -prerelease -legacy -format xml +[xml]$asXml = $output -$nugetexe = & $scriptsDir\fetchDependency.ps1 "nuget" -$nugetPackageDir = "$downloadsDir\nuget-packages" - -$SetupAPIVersion = "1.8.24" -Write-Verbose "Fetching Microsoft.VisualStudio.Setup.Configuration.Native@$SetupAPIVersion from NuGet." -$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Version $SetupAPIVersion -OutputDirectory $nugetPackageDir -Source "https://api.nuget.org/v3/index.json" -nocache 2>&1 -Write-Verbose "Fetching Microsoft.VisualStudio.Setup.Configuration.Native@$SetupAPIVersion from NuGet. Done." - -$SetupConsoleExe = "$nugetPackageDir\Microsoft.VisualStudio.Setup.Configuration.Native.$SetupAPIVersion\tools\x86\Microsoft.VisualStudio.Setup.Configuration.Console.exe" - -if (!(Test-Path $SetupConsoleExe)) +$results = New-Object System.Collections.ArrayList +foreach ($instance in $asXml.instances.instance) { - throw $nugetOutput + $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash + $installationVersion = $instance.InstallationVersion + $isPrerelease = $instance.IsPrerelease + if ($isPrerelease -eq 0) + { + $releaseType = "PreferenceWeight3::StableRelease" + } + elseif ($isPrerelease -eq 1) + { + $releaseType = "PreferenceWeight2::PreRelease" + } + else + { + $releaseType = "PreferenceWeight1::Legacy" + } + + # Placed like that for easy sorting according to preference + $results.Add("${releaseType}::${installationVersion}::${installationPath}") > $null } -$instances = & $SetupConsoleExe -nologo -value InstallationPath 2>&1 -$instanceCount = $instances.Length - -# The last item can be empty -if ($instanceCount -gt 0 -and $instances[$instanceCount - 1] -eq "") -{ - $instances = $instances[0..($instanceCount - 2)] -} +$results.Sort() +$results.Reverse() -return $instances +return $results \ No newline at end of file -- cgit v1.2.3 From 0643bd6581182a537b23c885b1c6b27e33e61dc4 Mon Sep 17 00:00:00 2001 From: Daniel Strommen Date: Thu, 5 Oct 2017 19:47:41 -0700 Subject: Fix Win10SDK detection during Bootstrap When multiple Win10 SDK's are installed, like Insider previews, depending on the SDK installation, it may not contain the um headers. There is already a loop for trying to find the newest Win10 SDK that has full headers, but it's returning at the first failure, rather than continuing the loop to the next iteration. Also, use Join-Path instead of manual path appending, to normalize the extra \ at the end of the sdk root value. In some cases paths with double backslashes can be interpreted as a fallback syntax for UNC paths. Join-Path normalizes the path appropriately. --- scripts/getWindowsSDK.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 9aebae8e3..f4537ddc3 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -20,7 +20,7 @@ $validInstances = New-Object System.Collections.ArrayList # Windows 10 SDK function CheckWindows10SDK($path) { - $folder = "$path\Include" + $folder = (Join-Path $path "Include") if (!(Test-Path $folder)) { Write-Verbose "$folder - Not Found" @@ -37,7 +37,7 @@ function CheckWindows10SDK($path) if (!(Test-Path $windowsheader)) { Write-Verbose "$windowsheader - Not Found" - return + continue } Write-Verbose "$windowsheader - Found" @@ -45,7 +45,7 @@ function CheckWindows10SDK($path) if (!(Test-Path $ddkheader)) { Write-Verbose "$ddkheader - Not Found" - return + continue } Write-Verbose "$ddkheader - Found" @@ -106,4 +106,4 @@ foreach ($instance in $validInstances) } } -throw "Could not detect a Windows SDK / TargetPlatformVersion" \ No newline at end of file +throw "Could not detect a Windows SDK / TargetPlatformVersion" -- cgit v1.2.3 From e3527b23ea291489fae1363528ecde07c9191f95 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Oct 2017 22:44:49 -0700 Subject: Don't assume VS2015 is in C:\Program Files (x86)\ --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 632cc2cdf..e9fb60cb2 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -41,7 +41,7 @@ foreach ($instanceCandidate in $VisualStudioInstallationInstances) if (Test-Path $clExe) { Write-Verbose "Picking: $instanceCandidate" - $programFilesPath = split-path -parent $path + $programFilesPath = & $scriptsDir\getProgramFiles32bit.ps1 return "$programFilesPath\MSBuild\14.0\Bin\MSBuild.exe", "v140" } } -- cgit v1.2.3 From cf7762a82ea044b33ddadd6b1d01a4035af3bf9d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 6 Oct 2017 00:49:41 -0700 Subject: [vcpkg-internal-ci] Remove chakracore due to dependency on cor.h --- scripts/internalCI.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 67871acc1..887eb7bea 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -14,7 +14,7 @@ if (-not $?) { throw $? } ./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp if (-not $?) { throw $? } -./vcpkg.exe install bond chakracore cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static +./vcpkg.exe install bond cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static if (-not $?) { throw $? } ./vcpkg.exe install opencv:x86-uwp boost:x86-uwp -- cgit v1.2.3 From f0f25b1cb714e07766b998bb205314498f891416 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Oct 2017 02:04:04 -0700 Subject: Remove unused variable --- scripts/getWindowsSDK.ps1 | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index f4537ddc3..8ef26a436 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -13,7 +13,6 @@ if ($DisableWin10SDK -and $DisableWin81SDK) } Write-Verbose "Executing $($MyInvocation.MyCommand.Name)" -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $validInstances = New-Object System.Collections.ArrayList -- cgit v1.2.3 From cd4142d3cac144c6f4e558cdfe8403e1987ff833 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Oct 2017 14:06:02 -0700 Subject: Bump version of nuget to 4.3.0 (was 4.1.0) --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 80d6d2abb..665376baf 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -116,11 +116,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "4.1.0" - $downloadVersion = "4.1.0" - $url = "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" + $requiredVersion = "4.3.0" + $downloadVersion = "4.3.0" + $url = "https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe" $downloadPath = "$downloadsDir\nuget-$downloadVersion\nuget.exe" - $expectedDownloadedFileHash = "4c1de9b026e0c4ab087302ff75240885742c0faa62bd2554f913bbe1f6cb63a0" + $expectedDownloadedFileHash = "386da77a8cf2b63d1260b7020feeedabfe3b65ab31d20e6a313a530865972f3a" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From ab7a1abc93473dc1b7fcb341a4d104e3a77afd87 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 9 Oct 2017 16:38:21 -0700 Subject: [VS detection] Add -products * flag to vswhere. This includes Express and BuildTools SKUs --- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 8c67ef6d6..b2f186478 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -6,7 +6,7 @@ param( $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vswhereExe = & $scriptsDir\fetchDependency.ps1 "vswhere" -$output = & $vswhereExe -prerelease -legacy -format xml +$output = & $vswhereExe -prerelease -legacy -products * -format xml [xml]$asXml = $output $results = New-Object System.Collections.ArrayList -- cgit v1.2.3 From b6512bace19d6c28cce71a0c2e8e28ab77d3ef56 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 9 Oct 2017 16:40:13 -0700 Subject: [vswhere.exe] Update to vesrion 2.2.3 (was 2.1.4) --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 665376baf..bc58f4436 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -126,11 +126,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "vswhere") { - $requiredVersion = "2.1.4" - $downloadVersion = "2.1.4" - $url = "https://github.com/Microsoft/vswhere/releases/download/2.1.4/vswhere.exe" + $requiredVersion = "2.2.3" + $downloadVersion = "2.2.3" + $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.3/vswhere.exe" $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" - $expectedDownloadedFileHash = "548fb9dfeed59bc4ddcce739a5729e9c8dd5932cd60ff6f74727ee069e7da458" + $expectedDownloadedFileHash = "5f19066ac91635ad17d33fe0f79fc63c672a46f98c0358589a90163bcb2733e8" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From 00d89dbd66a658174233920d6be2a85f282ef29f Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sun, 24 Sep 2017 16:01:37 +0300 Subject: vcpkg: initial ARM64 support --- scripts/cmake/vcpkg_configure_cmake.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index fe8c97c52..bfb6a19fd 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -78,14 +78,20 @@ function(vcpkg_configure_cmake) set(GENERATOR "Visual Studio 15 2017") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + set(ARCH "ARM64") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 Win64") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(TRIPLET_SYSTEM_ARCH STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 ARM") + elseif(TRIPLET_SYSTEM_ARCH STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + set(GENERATOR "Visual Studio 15 2017") + set(ARCH "ARM64") endif() # If we use Ninja, make sure it's on PATH @@ -139,6 +145,12 @@ function(vcpkg_configure_cmake) "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" ) + if(DEFINED ARCH) + list(APPEND _csc_OPTIONS + "-A${ARCH}" + ) + endif() + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS_DEBUG "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" -- cgit v1.2.3 From 5c66f301b9d7aa27a11059cee970e579f039c66c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Oct 2017 08:22:50 -0700 Subject: [vcpkg-scripts] Remove double expansions --- scripts/cmake/vcpkg_acquire_depot_tools.cmake | 2 +- scripts/cmake/vcpkg_download_distfile.cmake | 2 +- scripts/cmake/vcpkg_find_acquire_program.cmake | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake index 1cc375725..009ba40f1 100644 --- a/scripts/cmake/vcpkg_acquire_depot_tools.cmake +++ b/scripts/cmake/vcpkg_acquire_depot_tools.cmake @@ -26,7 +26,7 @@ function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT) set(download_success 1) endif() - if (NOT ${download_success}) + if (NOT download_success) message(FATAL_ERROR "\n" " Failed to download file.\n" diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 006570195..b8acfc823 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -78,7 +78,7 @@ function(vcpkg_download_distfile VAR) endif() endforeach(url) - if (NOT ${download_success}) + if (NOT download_success) message(FATAL_ERROR "\n" " Failed to download file.\n" diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 3c6dfae08..8d167e1c2 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -34,7 +34,8 @@ ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) function(vcpkg_find_acquire_program VAR) - if(${VAR} AND NOT ${VAR} MATCHES "-NOTFOUND") + set(EXPANDED_VAR ${${VAR}}) + if(EXPANDED_VAR) return() endif() @@ -153,7 +154,8 @@ function(vcpkg_find_acquire_program VAR) macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) - find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) + find_program(FOUND_PROG ${PROGNAME} PATHS ${PATHS}) + set(${VAR} ${FOUND_PROG}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) find_file(SCRIPT ${SCRIPTNAME} PATHS ${PATHS}) @@ -162,7 +164,8 @@ function(vcpkg_find_acquire_program VAR) endmacro() do_find() - if(${VAR} MATCHES "-NOTFOUND") + set(FOUND_PROG ${${VAR}}) + if(FOUND_PROG MATCHES "-NOTFOUND") file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} EXPECTED_HASH SHA512=${HASH} SHOW_PROGRESS @@ -173,7 +176,7 @@ function(vcpkg_find_acquire_program VAR) else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) - if(${ARCHIVE_EXTENSION} STREQUAL ".msi") + if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( -- cgit v1.2.3 From 9ddc98988fb8d7c886963fa7568395ecd5785eaa Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Oct 2017 10:52:00 -0700 Subject: [vcpkg-scripts] Detect and prompt for proxy in more cases --- scripts/bootstrap.ps1 | 4 ---- scripts/fetchDependency.ps1 | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index fa51de404..b7bc5afab 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -4,10 +4,6 @@ param( [string]$disableMetrics = "0" ) -$webclient=New-Object System.Net.WebClient -$creds=Get-Credential -$webclient.Proxy.Credentials=$creds - $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b6144d581..2ee87bcff 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -82,17 +82,19 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType directory -Path $downloadDir | Out-Null } + $WC = New-Object System.Net.WebClient + $ProxyAuth = !$WC.Proxy.IsBypassed($url) + if ($ProxyAuth) + { + $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred) + $WC.Proxy.Credentials=$ProxyCred + } + if (($PSVersionTable.PSEdition -ne "Core") -and ($Dependency -ne "git")) # git fails with BITS { try { - $WC = New-Object System.Net.WebClient - $ProxyAuth = !$WC.Proxy.IsBypassed($url) - If($ProxyAuth){ - $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred) - } - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop } catch [System.Exception] { @@ -106,7 +108,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if (!(Test-Path $downloadPath)) { Write-Verbose("Downloading $Dependency...") - (New-Object System.Net.WebClient).DownloadFile($url, $downloadPath) + $WC.DownloadFile($url, $downloadPath) } } -- cgit v1.2.3 From 53ad1402514481c581a7b3bd1b0ffbcea9aaa902 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 12 Oct 2017 11:54:47 -0700 Subject: [vcpkg-scripts] Hotpatch revert changes to vcpkg_find_acquire_program.cmake. --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 8d167e1c2..51e394bf1 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -154,8 +154,7 @@ function(vcpkg_find_acquire_program VAR) macro(do_find) if(NOT DEFINED REQUIRED_INTERPRETER) - find_program(FOUND_PROG ${PROGNAME} PATHS ${PATHS}) - set(${VAR} ${FOUND_PROG}) + find_program(${VAR} ${PROGNAME} PATHS ${PATHS}) else() vcpkg_find_acquire_program(${REQUIRED_INTERPRETER}) find_file(SCRIPT ${SCRIPTNAME} PATHS ${PATHS}) @@ -164,8 +163,7 @@ function(vcpkg_find_acquire_program VAR) endmacro() do_find() - set(FOUND_PROG ${${VAR}}) - if(FOUND_PROG MATCHES "-NOTFOUND") + if("${${VAR}}" MATCHES "-NOTFOUND") file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} EXPECTED_HASH SHA512=${HASH} SHOW_PROGRESS @@ -194,5 +192,5 @@ function(vcpkg_find_acquire_program VAR) do_find() endif() - set(${VAR} ${${VAR}} PARENT_SCOPE) + set(${VAR} "${${VAR}}" PARENT_SCOPE) endfunction() -- cgit v1.2.3 From 4ce8f0aa31da63f84fc81dfd895faaeb03d5c7b1 Mon Sep 17 00:00:00 2001 From: jasjuang Date: Fri, 13 Oct 2017 21:25:18 -0700 Subject: new port: cgal --- scripts/cmake/vcpkg_from_github.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 645690353..d14077410 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -80,6 +80,7 @@ function(vcpkg_from_github) else() # Sometimes GitHub strips a leading 'v' off the REF. string(REGEX REPLACE "^v" "" REF ${BASEREF}) + string(REPLACE "/" "-" REF ${REF}) set(SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") if(EXISTS ${SOURCE_PATH}) set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) -- cgit v1.2.3 From fc1a24ad8bb3187d17341c967353c3cc9742317a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 14 Oct 2017 01:45:28 -0700 Subject: [vcpkg] Initial commit of powershell integration --- scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 | 31 +++++++++++++++++++++++++ scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 create mode 100644 scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 (limited to 'scripts') diff --git a/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 b/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 new file mode 100644 index 000000000..3fb94fe7d --- /dev/null +++ b/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psd1 @@ -0,0 +1,31 @@ +@{ + +# Script module or binary module file associated with this manifest. +ModuleToProcess = 'posh-vcpkg.psm1' + +# Version number of this module. +ModuleVersion = '0.0.1' + +# ID used to uniquely identify this module +GUID = '948f02ab-fc99-4a53-8335-b6556eef129b' + +# Minimum version of the Windows PowerShell engine required by this module +PowerShellVersion = '5.0' + +FunctionsToExport = @('TabExpansion') +CmdletsToExport = @() +VariablesToExport = @() +AliasesToExport = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. +# This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = +@{ + PSData = + @{ + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @('vcpkg', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion') + } +} + +} diff --git a/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 b/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 new file mode 100644 index 000000000..25ef99609 --- /dev/null +++ b/scripts/posh-vcpkg/0.0.1/posh-vcpkg.psm1 @@ -0,0 +1,39 @@ +param() + +if (Get-Module posh-vcpkg) { return } + +if ($PSVersionTable.PSVersion.Major -lt 5) { + Write-Warning ("posh-vcpkg does not support PowerShell versions before 5.0.") + return +} + +if (Test-Path Function:\TabExpansion) { + Rename-Item Function:\TabExpansion VcpkgTabExpansionBackup +} + +function TabExpansion($line, $lastWord) { + $lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart() + + switch -regex ($lastBlock) { + "^(?(\./|\.\\|)vcpkg(\.exe|)) (?.*)$" + { + & $matches['vcpkgexe'] autocomplete $matches['remaining'] + return + } + + # Fall back on existing tab expansion + default { + if (Test-Path Function:\VcpkgTabExpansionBackup) { + VcpkgTabExpansionBackup $line $lastWord + } + } + } +} + +$exportModuleMemberParams = @{ + Function = @( + 'TabExpansion' + ) +} + +Export-ModuleMember @exportModuleMemberParams -- cgit v1.2.3 From 459ac9f2e17340e10e3cb8a66f956c59541d5fdd Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 00:40:25 +1100 Subject: qt5tools package --- scripts/cmake/vcpkg_build_qmake.cmake | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 1c6358654..bee5da7c9 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,18 +15,17 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_LIB_BACKUP ENV{LIB}) - set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;$ENV{LIB}") + set(ENV_PATH_BACKUP ENV{PATH}) + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}") - vcpkg_execute_required_process_repeat( - COUNT 2 + vcpkg_execute_required_process( COMMAND ${JOM} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} LOGNAME package-${TARGET_TRIPLET} ) message(STATUS "Package ${TARGET_TRIPLET} done") - # Restore the original value of ENV{LIB} - set(ENV{LIB} ENV_LIB_BACKUP) + # Restore the original value of ENV{PATH} + set(ENV{PATH} ENV_PATH_BACKUP) endfunction() -- cgit v1.2.3 From 3ba22c17540fc761c4fb3410ccd75cecb0f1f8b5 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:04:16 +1100 Subject: working qt tools build --- scripts/cmake/vcpkg_build_qmake.cmake | 4 +-- scripts/cmake/vcpkg_build_qmake_debug.cmake | 29 +++++++++++++++ scripts/cmake/vcpkg_build_qmake_release.cmake | 29 +++++++++++++++ scripts/cmake/vcpkg_common_functions.cmake | 4 +++ scripts/cmake/vcpkg_configure_qmake_debug.cmake | 41 +++++++++++++++++++++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 43 +++++++++++++++++++++++ 6 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake create mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index bee5da7c9..693f7841e 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -15,7 +15,7 @@ function(vcpkg_build_qmake) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP ENV{PATH}) + set(ENV_PATH_BACKUP "$ENV{PATH}") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}") @@ -27,5 +27,5 @@ function(vcpkg_build_qmake) message(STATUS "Package ${TARGET_TRIPLET} done") # Restore the original value of ENV{PATH} - set(ENV{PATH} ENV_PATH_BACKUP) + set(ENV{PATH} "${ENV_PATH_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake new file mode 100644 index 000000000..7e5625850 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -0,0 +1,29 @@ +#.rst: +# .. command:: vcpkg_build_qmake_debug +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake_debug. +# +# :: +# vcpkg_build_qmake_debug() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake_debug) + vcpkg_find_acquire_program(JOM) + + # Make sure that the linker finds the libraries used + set(ENV_PATH_BACKUP "$ENV{PATH}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/debug/tools/qt5;$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME package-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Package ${TARGET_TRIPLET}-dbg done") + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") +endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake new file mode 100644 index 000000000..6cfbcdc91 --- /dev/null +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -0,0 +1,29 @@ +#.rst: +# .. command:: vcpkg_build_qmake_release +# +# Build a qmake-based project, previously configured using vcpkg_configure_qmake_release. +# +# :: +# vcpkg_build_qmake_release() +# +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_build_qmake_release) + vcpkg_find_acquire_program(JOM) + + # Make sure that the linker finds the libraries used + set(ENV_PATH_BACKUP "$ENV{PATH}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") + + message(STATUS "Package ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${JOM} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME package-${TARGET_TRIPLET}-rel + ) + message(STATUS "Package ${TARGET_TRIPLET}-rel done") + + # Restore the original value of ENV{PATH} + set(ENV{PATH} "${ENV_PATH_BACKUP}") +endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 81e8e5813..5dabd446e 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,11 +10,15 @@ include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) +include(vcpkg_build_qmake_debug) +include(vcpkg_build_qmake_release) include(vcpkg_install_cmake) include(vcpkg_install_meson) include(vcpkg_configure_cmake) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) +include(vcpkg_configure_qmake_debug) +include(vcpkg_configure_qmake_release) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake new file mode 100644 index 000000000..0166973d2 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -0,0 +1,41 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_debug +# +# Configure a qmake-based project. +# This sets the config variable to debug and outputs to +# a debug triplet directory. +# +# :: +# vcpkg_configure_qmake_debug(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_configure_qmake_debug) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/debug/tools/qt5) + + if(NOT QMAKE_COMMAND) + message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") +endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake new file mode 100644 index 000000000..67bdbdfb0 --- /dev/null +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -0,0 +1,43 @@ +#.rst: +# .. command:: vcpkg_configure_qmake_release +# +# Configure a qmake-based project. +# This sets the config variable to release and outputs to +# a release triplet directory. +# +# :: +# vcpkg_configure_qmake_release(SOURCE_PATH +# [OPTIONS arg1 [arg2 ...]] +# ) +# +# ``SOURCE_PATH`` +# The path to the *.pro qmake project file. +# ``OPTIONS`` +# The options passed to qmake. +# +# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html + +function(vcpkg_configure_qmake_release) + cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) + + # Find qmake exectuable + find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) + + if(NOT QMAKE_COMMAND) + message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") + endif() + + # Cleanup build directories + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) +endfunction() \ No newline at end of file -- cgit v1.2.3 From d28de4a13edca249086e3ccf8d34e92ecb10006d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 16 Oct 2017 23:56:47 +1100 Subject: qt5winextras --- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 3 +++ scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 + 2 files changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index 0166973d2..e3dfb0777 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -38,4 +38,7 @@ function(vcpkg_configure_qmake_debug) LOGNAME config-${TARGET_TRIPLET}-dbg ) message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + unset(QMAKE_COMMAND) + unset(QMAKE_COMMAND PARENT_SCOPE) + unset(QMAKE_COMMAND CACHE) endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index 67bdbdfb0..8ab5340e9 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -38,6 +38,7 @@ function(vcpkg_configure_qmake_release) LOGNAME config-${TARGET_TRIPLET}-rel ) message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + unset(QMAKE_COMMAND) unset(QMAKE_COMMAND PARENT_SCOPE) unset(QMAKE_COMMAND CACHE) endfunction() \ No newline at end of file -- cgit v1.2.3 From c147fc78c919d6084e5f98a574484346d590f00d Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 03:15:30 +1100 Subject: further fixes --- scripts/cmake/vcpkg_build_qmake_debug.cmake | 3 ++- scripts/cmake/vcpkg_build_qmake_release.cmake | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake index 7e5625850..a734e63cf 100644 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_build_qmake_debug.cmake @@ -10,6 +10,7 @@ # [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake_debug) + cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used @@ -18,7 +19,7 @@ function(vcpkg_build_qmake_debug) message(STATUS "Package ${TARGET_TRIPLET}-dbg") vcpkg_execute_required_process( - COMMAND ${JOM} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME package-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake index 6cfbcdc91..3daf9201b 100644 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ b/scripts/cmake/vcpkg_build_qmake_release.cmake @@ -10,15 +10,16 @@ # [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake_release) + cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) - + # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") message(STATUS "Package ${TARGET_TRIPLET}-rel") vcpkg_execute_required_process( - COMMAND ${JOM} + COMMAND ${JOM} ${_csc_TARGETS} WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME package-${TARGET_TRIPLET}-rel ) -- cgit v1.2.3 From 81613fa0ff506852fbb90757fc27f87ffe591fee Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 16 Oct 2017 11:22:21 -0700 Subject: [vcpkg-toolchain] Improvements; add VCPKG_CHAINLOAD_TOOLCHAIN_FILE --- scripts/buildsystems/vcpkg.cmake | 267 ++++++++++++++++-------------- scripts/cmake/vcpkg_configure_cmake.cmake | 106 +++++++----- 2 files changed, 203 insertions(+), 170 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d8c7ee6b8..19fc99af7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,156 +1,175 @@ # Mark variables as used so cmake doesn't complain about them -set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) -if(NOT VCPKG_TOOLCHAIN) - if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") +mark_as_advanced(CMAKE_TOOLCHAIN_FILE) + +if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") +endif() + +if(VCPKG_TOOLCHAIN) + return() +endif() + +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if( _CMAKE_IN_TRY_COMPILE ) + include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) +endif() + +if(VCPKG_TARGET_TRIPLET) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) +else() + if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) - elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() - if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") + find_program(_VCPKG_CL cl) + if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 ARM$") + elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015$") - set(_VCPKG_TARGET_TRIPLET_ARCH x86) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") - set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") - set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") 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$") - set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(_VCPKG_CL MATCHES "arm/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH x86) - else() - message(FATAL_ERROR "Unable to determine target architecture.") - endif() + message(FATAL_ERROR "Unable to determine target architecture.") endif() endif() +endif() - if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") - set(_VCPKG_TARGET_TRIPLET_PLAT uwp) - else() - set(_VCPKG_TARGET_TRIPLET_PLAT windows) - endif() +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(_VCPKG_TARGET_TRIPLET_PLAT uwp) +else() + set(_VCPKG_TARGET_TRIPLET_PLAT windows) +endif() - set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") - set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) +set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") +set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) - #Detect .vcpkg-root to figure VCPKG_ROOT_DIR - SET(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) - while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") - get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) - if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive - message(FATAL_ERROR "Could not find .vcpkg-root") - else() - SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) - endif() - endwhile() - set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) - set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) - - if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) - list(APPEND CMAKE_PREFIX_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug - ) - list(APPEND CMAKE_LIBRARY_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link - ) +# Detect .vcpkg-root to figure VCPKG_ROOT_DIR +set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) +while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") + get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) + if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive + message(FATAL_ERROR "Could not find .vcpkg-root") + else() + SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) endif() +endwhile() +set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) +set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) + +if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_PREFIX_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug ) list(APPEND CMAKE_LIBRARY_PATH - ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) +endif() +list(APPEND CMAKE_PREFIX_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) +list(APPEND CMAKE_LIBRARY_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link +) - set(Boost_COMPILER "-vc140") +set(Boost_COMPILER "-vc140") - if (NOT DEFINED CMAKE_SYSTEM_VERSION) - include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) - # This is used as an implicit parameter for vcpkg_get_windows_sdk - set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) - vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) - unset(VCPKG_ROOT_DIR) - set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION}) - endif() +if (NOT DEFINED CMAKE_SYSTEM_VERSION) + include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) + # This is used as an implicit parameter for vcpkg_get_windows_sdk + set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) + vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) + unset(VCPKG_ROOT_DIR) + set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version") +endif() - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) - set(CMAKE_SYSTEM_IGNORE_PATH - "${_programfiles}/OpenSSL" - "${_programfiles}/OpenSSL-Win32" - "${_programfiles}/OpenSSL-Win64" - "${_programfiles}/OpenSSL-Win32/lib/VC" - "${_programfiles}/OpenSSL-Win64/lib/VC" - "${_programfiles}/OpenSSL-Win32/lib/VC/static" - "${_programfiles}/OpenSSL-Win64/lib/VC/static" - "C:/OpenSSL/" - "C:/OpenSSL-Win32/" - "C:/OpenSSL-Win64/" - "C:/OpenSSL-Win32/lib/VC" - "C:/OpenSSL-Win64/lib/VC" - "C:/OpenSSL-Win32/lib/VC/static" - "C:/OpenSSL-Win64/lib/VC/static" - ) +file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) +set(CMAKE_SYSTEM_IGNORE_PATH + "${_programfiles}/OpenSSL" + "${_programfiles}/OpenSSL-Win32" + "${_programfiles}/OpenSSL-Win64" + "${_programfiles}/OpenSSL-Win32/lib/VC" + "${_programfiles}/OpenSSL-Win64/lib/VC" + "${_programfiles}/OpenSSL-Win32/lib/VC/static" + "${_programfiles}/OpenSSL-Win64/lib/VC/static" + "C:/OpenSSL/" + "C:/OpenSSL-Win32/" + "C:/OpenSSL-Win64/" + "C:/OpenSSL-Win32/lib/VC" + "C:/OpenSSL-Win64/lib/VC" + "C:/OpenSSL-Win32/lib/VC/static" + "C:/OpenSSL-Win64/lib/VC/static" +) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) - file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) - foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) - if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) - endif() - endforeach() - - option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) - function(add_executable name) - _add_executable(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - list(FIND ARGV "ALIAS" ALIAS_IDX) - if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - if(VCPKG_APPLOCAL_DEPS) - add_custom_command(TARGET ${name} POST_BUILD - COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 - -targetBinary $ - -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" - -OutVariable out - ) - endif() - set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) - set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) - endif() - endfunction() - - function(add_library name) - _add_library(${ARGV}) - list(FIND ARGV "IMPORTED" IMPORTED_IDX) - list(FIND ARGV "INTERFACE" INTERFACE_IDX) - list(FIND ARGV "ALIAS" ALIAS_IDX) - if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) - set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) - endif() - endfunction() +set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) +file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) +foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) + if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + endif() +endforeach() - macro(find_package name) - if(name STREQUAL "Boost") - unset(Boost_USE_STATIC_LIBS) +option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) +function(add_executable name) + _add_executable(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + if(VCPKG_APPLOCAL_DEPS) + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) endif() - _find_package(${ARGV}) - endmacro() + set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() - set(VCPKG_TOOLCHAIN ON) -endif() +function(add_library name) + _add_library(${ARGV}) + list(FIND ARGV "IMPORTED" IMPORTED_IDX) + list(FIND ARGV "INTERFACE" INTERFACE_IDX) + list(FIND ARGV "ALIAS" ALIAS_IDX) + if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) + set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) + endif() +endfunction() + +macro(find_package name) + if(name STREQUAL "Boost") + unset(Boost_USE_STATIC_LIBS) + endif() + _find_package(${ARGV}) +endmacro() -set(_UNUSED ${CMAKE_TOOLCHAIN_FILE}) +set(VCPKG_TOOLCHAIN ON) set(_UNUSED ${CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION}) set(_UNUSED ${CMAKE_EXPORT_NO_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY}) set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) + +if(NOT _CMAKE_IN_TRY_COMPILE) + file(TO_CMAKE_PATH "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" _chainload_file) + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" + "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" + "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" + "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n") +endif() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index bfb6a19fd..b979245aa 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -61,37 +61,39 @@ function(vcpkg_configure_cmake) set(GENERATOR ${_csc_GENERATOR}) elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT _csc_HOST_ARCHITECTURE STREQUAL "x86") set(GENERATOR "Ninja") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 ARM") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND TRIPLET_SYSTEM_ARCH STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") set(ARCH "ARM64") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") - elseif(TRIPLET_SYSTEM_ARCH MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 Win64") - elseif(TRIPLET_SYSTEM_ARCH STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017 ARM") - elseif(TRIPLET_SYSTEM_ARCH STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") set(ARCH "ARM64") + else() + message(FATAL_ERROR "Unable to determine appropriate generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") endif() # If we use Ninja, make sure it's on PATH @@ -104,15 +106,18 @@ function(vcpkg_configure_cmake) file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) - list(APPEND _csc_OPTIONS -DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}) + list(APPEND _csc_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") endif() if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - list(APPEND _csc_OPTIONS -DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}) + list(APPEND _csc_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") endif() - if(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=ON) - elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) + else() + message(FATAL_ERROR "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". It must be \"static\" or \"dynamic\"") endif() if((NOT DEFINED VCPKG_CXX_FLAGS_DEBUG AND NOT DEFINED VCPKG_C_FLAGS_DEBUG) OR @@ -131,10 +136,45 @@ function(vcpkg_configure_cmake) message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS and VCPKG_C_FLAGS") endif() + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") + else() + set(VCPKG_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}") + set(VCPKG_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}") + if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" + ) + elseif(VCPKG_CRT_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" + "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" + "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" + ) + else() + message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") + endif() + + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" + "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" + ) + list(APPEND _csc_OPTIONS + "-DCMAKE_CXX_FLAGS=${VCPKG_CXX_FLAGS}" + "-DCMAKE_C_FLAGS=${VCPKG_C_FLAGS}" + ) + endif() + list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" - "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" - "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" @@ -151,32 +191,6 @@ function(vcpkg_configure_cmake) ) endif() - if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) - list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" - ) - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" - ) - - elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) - list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" - ) - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" - ) - endif() - - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" - "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( -- cgit v1.2.3 From 374253cb1b12a60925693130132f1a6ab6c3a83a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 16 Oct 2017 15:39:41 -0700 Subject: [ninja] Update to 1.8.2 --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 51e394bf1..b81675c13 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -101,11 +101,11 @@ function(vcpkg_find_acquire_program VAR) set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) - set(SUBDIR "ninja-1.7.2") + set(SUBDIR "ninja-1.8.2") set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) - set(URL "https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip") - set(ARCHIVE "ninja-win.zip") - set(HASH cccab9281b274c564f9ad77a2115be1f19be67d7b2ee14a55d1db1b27f3b68db8e76076e4f804b61eb8e573e26a8ecc9985675a8dcf03fd7a77b7f57234f1393) + 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 "MESON") set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) -- cgit v1.2.3 From e8f64049cf5d4b2f1b76bab49d5134bdd0dff1ea Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 16 Oct 2017 17:02:59 -0700 Subject: Fix getWindowsSDK.ps1 error when $path is $null --- scripts/getWindowsSDK.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index 8ef26a436..ed2fd11c7 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -19,6 +19,11 @@ $validInstances = New-Object System.Collections.ArrayList # Windows 10 SDK function CheckWindows10SDK($path) { + if ($path -eq $null) + { + return + } + $folder = (Join-Path $path "Include") if (!(Test-Path $folder)) { @@ -64,6 +69,11 @@ CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") # Windows 8.1 SDK function CheckWindows81SDK($path) { + if ($path -eq $null) + { + return + } + $folder = "$path\Include" if (!(Test-Path $folder)) { -- cgit v1.2.3 From 0051e7477be15c9746e9fb2babe15aaec47a7eef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 16 Oct 2017 17:04:55 -0700 Subject: [findVS] Add detection for VS2015 Build Tools --- scripts/findVisualStudioInstallationInstances.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index b2f186478..8a2adca10 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -32,6 +32,21 @@ foreach ($instance in $asXml.instances.instance) $results.Add("${releaseType}::${installationVersion}::${installationPath}") > $null } +# If nothing is found, attempt to find VS2015 Build Tools (not detected by vswhere.exe) +if ($results.Count -eq 0) +{ + $programFiles = & $scriptsDir\getProgramFiles32bit.ps1 + $installationPath = "$programFiles\Microsoft Visual Studio 14.0" + $clExe = "$installationPath\VC\bin\cl.exe" + $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + + if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) + { + return "PreferenceWeight1::Legacy::14.0::$installationPath" + } +} + + $results.Sort() $results.Reverse() -- cgit v1.2.3 From 62b62d9f35cfb1e81971f56d4f33f369ed9af53c Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Tue, 17 Oct 2017 20:02:26 +1100 Subject: minor clean up and configuration --- scripts/cmake/vcpkg_configure_qmake_release.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index 8ab5340e9..cf9eacbd5 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,7 +22,6 @@ function(vcpkg_configure_qmake_release) # Find qmake exectuable find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) - if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() -- cgit v1.2.3 From 87296823ac9cc939c233caf7c02585b5fe6d3df7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 12:41:34 -0700 Subject: [cmake] Update to 3.9.4 (was 3.9.3) --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 773ebeac4..b43fd0cb5 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -107,12 +107,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.3" - $downloadVersion = "3.9.3" - $url = "https://cmake.org/files/v3.9/cmake-3.9.3-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.3-win32-x86.zip" - $expectedDownloadedFileHash = "47870e3d4c9a5aa019e71020cd85cc60b6f2d2569fb239eaec204cd991e512f1" - $executableFromDownload = "$downloadsDir\cmake-3.9.3-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.4" + $downloadVersion = "3.9.4" + $url = "https://cmake.org/files/v3.9/cmake-3.9.4-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.4-win32-x86.zip" + $expectedDownloadedFileHash = "8214df1ff51f9a6a1f0e27f9bd18f402b1749c5b645fbf6e401bcb00047171cd" + $executableFromDownload = "$downloadsDir\cmake-3.9.4-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From edb718e21b56ab62a6544a26c1bba450d952b32d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:19:14 -0700 Subject: [fetchDependency] Introduce Test-Command function --- scripts/fetchDependency.ps1 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b43fd0cb5..ac4ab5f46 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -14,6 +14,11 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" +function Test-Command($commandName) +{ + return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) +} + function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { function performDownload( [Parameter(Mandatory=$true)][string]$Dependency, -- cgit v1.2.3 From 147cde8bfda4e7283e4d47cd8a55c5bd0c689081 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:19:42 -0700 Subject: [fetchDependency] Use Expand-Archive if it exists, otherwise fallback to cmd --- scripts/fetchDependency.ps1 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index ac4ab5f46..6024895ae 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -101,12 +101,19 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType Directory -Path $destination | Out-Null } - $shell = new-object -com shell.application - $zip = $shell.NameSpace($file) - foreach($item in $zip.items()) + if (Test-Command -commandName 'Expand-Archive') { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destination).copyhere($item) | Out-Null + Expand-Archive -path $file -destinationpath $destination + } + else + { + $shell = new-object -com shell.application + $zip = $shell.NameSpace($file) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destination).copyhere($item) | Out-Null + } } } -- cgit v1.2.3 From 7fac8a06c091c7d6a0a9dd059166d4320cd86267 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:40:01 -0700 Subject: [fetchDependency] Add Test-Module function --- scripts/fetchDependency.ps1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6024895ae..2ba98ab23 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -3,6 +3,16 @@ param( [string]$Dependency ) +function Test-Command($commandName) +{ + return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) +} + +function Test-Module($moduleName) +{ + return [bool](Get-Module -ListAvailable -Name $moduleName) +} + if ($PSVersionTable.PSEdition -ne "Core") { Import-Module BitsTransfer -Verbose:$false } @@ -14,11 +24,6 @@ $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -function Test-Command($commandName) -{ - return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) -} - function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { function performDownload( [Parameter(Mandatory=$true)][string]$Dependency, -- cgit v1.2.3 From 451c1c96be2407da0e590344c655a8df838d3f99 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:42:58 -0700 Subject: [fetchDependency] Use Test-Module for BitsTransfer module check --- scripts/fetchDependency.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 2ba98ab23..58f64b626 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -13,7 +13,8 @@ function Test-Module($moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } -if ($PSVersionTable.PSEdition -ne "Core") { +if (Test-Module -moduleName 'BitsTransfer') +{ Import-Module BitsTransfer -Verbose:$false } -- cgit v1.2.3 From d6d5540cc54c5d3dcbb43bdc6d0fd5b2d6271d21 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:45:41 -0700 Subject: [fetchDependency] Call Start-BitsTransfer if available, otherwise fallback --- scripts/fetchDependency.ps1 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 58f64b626..d2e2b89fd 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -57,12 +57,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $WC.Proxy.Credentials=$ProxyCred } - if (($PSVersionTable.PSEdition -ne "Core") -and ($Dependency -ne "git")) # git fails with BITS + # git and installerbase fail with Start-BitsTransfer + if ((Test-Command -commandName 'Start-BitsTransfer') -and ($Dependency -ne "git")-and ($Dependency -ne "installerbase")) { - try { + try + { Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + return } - catch [System.Exception] { + catch [System.Exception] + { # If BITS fails for any reason, delete any potentially partially downloaded files and continue if (Test-Path $downloadPath) { @@ -70,11 +74,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } } } - if (!(Test-Path $downloadPath)) - { - Write-Verbose("Downloading $Dependency...") - $WC.DownloadFile($url, $downloadPath) - } + + Write-Verbose("Downloading $Dependency...") + $WC.DownloadFile($url, $downloadPath) } # Enums (without resorting to C#) are only available on powershell 5+. -- cgit v1.2.3 From ffd91c0c1d071378d383ad94ba915e2c10dff06b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 13:58:36 -0700 Subject: [fetchDependency] Call Get-FileHash if available, otherwise fallback --- scripts/fetchDependency.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index d2e2b89fd..e8c66c84d 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -194,17 +194,17 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion #calculating the hash - if ($PSVersionTable.PSEdition -ne "Core") + if (Test-Command -commandName 'Get-FileHash') + { + $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash + } + else { $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) } - else - { - $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash - } if ($expectedDownloadedFileHash -ne $downloadedFileHash) { -- cgit v1.2.3 From fa4e54a37356ad0200ce6387541ef78997b8a87e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 14:05:55 -0700 Subject: [git] Update to 2.14.2.3 (was 2.14.1) --- scripts/fetchDependency.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index e8c66c84d..86bf103a8 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -158,16 +158,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "git") { - $requiredVersion = "2.14.1" - $downloadVersion = "2.14.1" - $url = "https://github.com/git-for-windows/git/releases/download/v2.14.1.windows.1/MinGit-2.14.1-32-bit.zip" # We choose the 32-bit version - $downloadPath = "$downloadsDir\MinGit-2.14.1-32-bit.zip" - $expectedDownloadedFileHash = "77b468e0ead1e7da4cb3a1cf35dabab5210bf10457b4142f5e9430318217cdef" + $requiredVersion = "2.14.2" + $downloadVersion = "2.14.2" + $url = "https://github.com/git-for-windows/git/releases/download/v2.14.2.windows.3/MinGit-2.14.2.3-32-bit.zip" # We choose the 32-bit version + $downloadPath = "$downloadsDir\MinGit-2.14.2.3-32-bit.zip" + $expectedDownloadedFileHash = "7cc1f27e1cfe79381e1a504a5fc7bc33951ac9031cd14c3bf478769d21a26cce" # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.14.1-32-bit\cmd\git.exe" + $executableFromDownload = "$downloadsDir\MinGit-2.14.2.3-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = "$downloadsDir\MinGit-2.14.1-32-bit" + $extractionFolder = "$downloadsDir\MinGit-2.14.2.3-32-bit" } elseif($Dependency -eq "installerbase") { -- cgit v1.2.3 From 508c21a6f8dece3c2793b302a926d1e663eb8526 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 14:08:30 -0700 Subject: [vswhere] Update to 2.2.7 (was 2.2.3) --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 86bf103a8..1677cb869 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -148,11 +148,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "vswhere") { - $requiredVersion = "2.2.3" - $downloadVersion = "2.2.3" - $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.3/vswhere.exe" + $requiredVersion = "2.2.7" + $downloadVersion = "2.2.7" + $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.7/vswhere.exe" $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" - $expectedDownloadedFileHash = "5f19066ac91635ad17d33fe0f79fc63c672a46f98c0358589a90163bcb2733e8" + $expectedDownloadedFileHash = "f50303881da706132516d9decfd5314d524a0044daf49c0cfd21dc39c1261ec3" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From e9ba8b0ecbe5c49cda2710acaae0983dfe2552f9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Oct 2017 14:19:48 -0700 Subject: [nuget] Update to 4.4.0 (was 4.3.0) --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 1677cb869..df03878eb 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -138,11 +138,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "nuget") { - $requiredVersion = "4.3.0" - $downloadVersion = "4.3.0" - $url = "https://dist.nuget.org/win-x86-commandline/v4.3.0/nuget.exe" + $requiredVersion = "4.4.0" + $downloadVersion = "4.4.0" + $url = "https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe" $downloadPath = "$downloadsDir\nuget-$downloadVersion\nuget.exe" - $expectedDownloadedFileHash = "386da77a8cf2b63d1260b7020feeedabfe3b65ab31d20e6a313a530865972f3a" + $expectedDownloadedFileHash = "2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From 11fdd415dd21f85292260a64fa9d52d872697e7c Mon Sep 17 00:00:00 2001 From: bahaki386 Date: Wed, 18 Oct 2017 19:38:25 +0900 Subject: Update Meson to 0.43.0 Upedate Meson to 0.43.0. It will fix Issue #2006. --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b81675c13..fdee0cb1f 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -110,10 +110,10 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME meson) set(REQUIRED_INTERPRETER PYTHON3) set(SCRIPTNAME meson.py) - set(PATHS ${DOWNLOADS}/tools/meson/meson-0.40.1) - set(URL "https://github.com/mesonbuild/meson/archive/0.40.1.zip") - set(ARCHIVE "meson-0.40.1.zip") - set(HASH 4c1d07f32d527859f762c34de74d31d569573fc833335ab9652ed38d1f9e64b49869e826527c28a6a07cb8e594fd5c647b34aa95e626236a2707f75df0a2d435) + set(PATHS ${DOWNLOADS}/tools/meson/meson-0.43.0) + set(URL "https://github.com/mesonbuild/meson/archive/0.43.0.zip") + set(ARCHIVE "meson-0.43.0.zip") + set(HASH dde4de72eff37046731224f32aa5f4618d45bdf148cec2d1af6e25e7522ebc2b04aedc9eceed483dfa93823a0ea7ea472d0c0c9380061bf3ee2f16b87dd1425e) elseif(VAR MATCHES "FLEX") set(PROGNAME win_flex) set(PATHS ${DOWNLOADS}/tools/win_flex) -- cgit v1.2.3 From f527812e9e7f6436aa11c9f01b7f70e4c4893270 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Oct 2017 08:53:59 -0700 Subject: [grpc] Fix absolute paths in installed cmake files. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index eaf3bb966..40ed0225f 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -83,6 +83,7 @@ function(vcpkg_fixup_cmake_targets) ) foreach(RELEASE_TARGET ${RELEASE_TARGETS}) file(READ ${RELEASE_TARGET} _contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") file(WRITE ${RELEASE_TARGET} "${_contents}") endforeach() @@ -95,6 +96,7 @@ function(vcpkg_fixup_cmake_targets) get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) file(READ ${DEBUG_TARGET} _contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") -- cgit v1.2.3 From 50ae9eec872a0802d2450b4ae2d640475d0d7889 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 19 Oct 2017 19:50:23 -0700 Subject: Do not depend on newlines when getting output from powershell --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 3 ++- scripts/findVisualStudioInstallationInstances.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index e9fb60cb2..3269562dc 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -9,8 +9,9 @@ $explicitlyRequestedVSPath = $explicitlyRequestedVSPath -replace "\\$" # Remove $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))" -foreach ($instanceCandidate in $VisualStudioInstallationInstances) +foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances) { + $instanceCandidate = $instanceCandidateWithEOL -replace "::" Write-Verbose "Inspecting: $instanceCandidate" $split = $instanceCandidate -split "::" # $preferenceWeight = $split[0] diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 8a2adca10..566560cdb 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -29,7 +29,7 @@ foreach ($instance in $asXml.instances.instance) } # Placed like that for easy sorting according to preference - $results.Add("${releaseType}::${installationVersion}::${installationPath}") > $null + $results.Add("${releaseType}::${installationVersion}::${installationPath}::") > $null } # If nothing is found, attempt to find VS2015 Build Tools (not detected by vswhere.exe) @@ -42,7 +42,7 @@ if ($results.Count -eq 0) if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) { - return "PreferenceWeight1::Legacy::14.0::$installationPath" + return "PreferenceWeight1::Legacy::14.0::$installationPath::" } } -- cgit v1.2.3 From 2a617103266e8cc391197126fa16c29f65f13ca5 Mon Sep 17 00:00:00 2001 From: Sean Warren Date: Mon, 23 Oct 2017 11:01:40 +1100 Subject: Remove non-numeric characters from Windows SDK version string See issue #1836, #2019 --- scripts/cmake/vcpkg_get_windows_sdk.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_get_windows_sdk.cmake b/scripts/cmake/vcpkg_get_windows_sdk.cmake index 64d8838e7..a8aad64a9 100644 --- a/scripts/cmake/vcpkg_get_windows_sdk.cmake +++ b/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -10,7 +10,7 @@ function(vcpkg_get_windows_sdk ret) message(FATAL_ERROR "Could not find Windows SDK") endif() - # Remove trailing newline - string(REGEX REPLACE "\n$" "" WINDOWS_SDK "${WINDOWS_SDK}") + # Remove trailing newline and non-numeric characters + string(REGEX REPLACE "[^0-9.]" "" WINDOWS_SDK "${WINDOWS_SDK}") set(${ret} ${WINDOWS_SDK} PARENT_SCOPE) endfunction() \ No newline at end of file -- cgit v1.2.3 From aec9215800a42e7e4ec28aad756695a8ced8876c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Oct 2017 17:08:24 -0700 Subject: [InternalCI.ps1] Fix error when buildtrees/ does not exist --- scripts/internalCI.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 887eb7bea..16ce4fc7a 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -5,7 +5,10 @@ New-Item -type directory downloads -errorAction SilentlyContinue | Out-Null if (-not $?) { throw $? } # Clear out any intermediate files from the previous build -Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" -and $_.Extension -ne ".log"} | Remove-Item -Recurse -Force +if (Test-Path buildtrees) +{ + Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" -and $_.Extension -ne ".log"} | Remove-Item -Recurse -Force +} # Purge any outdated packages ./vcpkg remove --outdated --recurse -- cgit v1.2.3 From 4b66571c9d12cf718e3175203a867d5014208fdb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 26 Oct 2017 22:34:54 -0700 Subject: [blaze] Add dependencies and install *-config.cmake files. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 40ed0225f..069672b71 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -23,7 +23,7 @@ function(vcpkg_fixup_cmake_targets) set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) - if(_vfct_CONFIG_PATH) + if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}") set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) @@ -31,10 +31,14 @@ function(vcpkg_fixup_cmake_targets) message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") endif() - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/share) - file(RENAME ${DEBUG_CONFIG} ${DEBUG_SHARE}) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share) - file(RENAME ${RELEASE_CONFIG} ${RELEASE_SHARE}) + file(MAKE_DIRECTORY ${DEBUG_SHARE}) + file(GLOB FILES ${DEBUG_CONFIG}/*) + file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + + file(GLOB FILES ${RELEASE_CONFIG}/*) + file(COPY ${FILES} DESTINATION ${RELEASE_SHARE}) + file(REMOVE_RECURSE ${RELEASE_CONFIG}) get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) -- cgit v1.2.3 From 83c29df043ce91d37a0c463ed854e78caba53984 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Oct 2017 14:45:08 -0700 Subject: [fetchDependency] Fix compat with Powershell 2 --- scripts/fetchDependency.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index df03878eb..90de17717 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -8,6 +8,11 @@ function Test-Command($commandName) return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) } +function Test-CommandParameter($commandName, $parameterName) +{ + return (Get-Command $commandName).Parameters.Keys -contains $parameterName +} + function Test-Module($moduleName) { return [bool](Get-Module -ListAvailable -Name $moduleName) @@ -51,7 +56,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $ProxyAuth = !$WC.Proxy.IsBypassed($url) if ($ProxyAuth) { - $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" + if (Test-CommandParameter -commandName 'Get-Credential' -parameterName 'Message') + { + $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" + } + else + { + "Enter credentials for Proxy Authentication" + $ProxyCred = Get-Credential + } + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred) $WC.Proxy.Credentials=$ProxyCred -- cgit v1.2.3 From 0796a9df0e4d171ef2c7ab4d0c16ef4dc496ee5c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Oct 2017 18:53:36 -0700 Subject: [git] Update to 2.14.3 (was 2.14.2.3) --- scripts/bootstrap.ps1 | 2 +- scripts/fetchDependency.ps1 | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b874afd8c..4488d9b95 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -13,7 +13,7 @@ $gitHash = "unknownhash" $oldpath = $env:path try { - $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.1-32-bit\cmd" + $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.3-32-bit\cmd" if (Get-Command "git" -ErrorAction SilentlyContinue) { $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 90de17717..89e37c428 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -172,16 +172,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "git") { - $requiredVersion = "2.14.2" - $downloadVersion = "2.14.2" - $url = "https://github.com/git-for-windows/git/releases/download/v2.14.2.windows.3/MinGit-2.14.2.3-32-bit.zip" # We choose the 32-bit version - $downloadPath = "$downloadsDir\MinGit-2.14.2.3-32-bit.zip" - $expectedDownloadedFileHash = "7cc1f27e1cfe79381e1a504a5fc7bc33951ac9031cd14c3bf478769d21a26cce" + $requiredVersion = "2.14.3" + $downloadVersion = "2.14.3" + $url = "https://github.com/git-for-windows/git/releases/download/v2.14.3.windows.1/MinGit-2.14.3-32-bit.zip" + $downloadPath = "$downloadsDir\MinGit-2.14.3-32-bit.zip" + $expectedDownloadedFileHash = "a91385acb1da220612790807c41d0f304b41093c474b9d7342230ec194a3398e" # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.14.2.3-32-bit\cmd\git.exe" + $executableFromDownload = "$downloadsDir\MinGit-2.14.3-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = "$downloadsDir\MinGit-2.14.2.3-32-bit" + $extractionFolder = "$downloadsDir\MinGit-2.14.3-32-bit" } elseif($Dependency -eq "installerbase") { -- cgit v1.2.3 From eb7e1e481bbebc13d277d6a89f0a270767962286 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Oct 2017 18:51:55 -0700 Subject: Fix proxy usage in Win7 (powershell 2.0) --- scripts/fetchDependency.ps1 | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 89e37c428..6cd28ad8e 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -18,6 +18,19 @@ function Test-Module($moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } +function Get-Credential-Backwards-Compatible() +{ + if (Test-CommandParameter -commandName 'Get-Credential' -parameterName 'Message') + { + return Get-Credential -Message "Enter credentials for Proxy Authentication" + } + else + { + Write-Host "Enter credentials for Proxy Authentication" + return Get-Credential + } +} + if (Test-Module -moduleName 'BitsTransfer') { Import-Module BitsTransfer -Verbose:$false @@ -54,28 +67,18 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $WC = New-Object System.Net.WebClient $ProxyAuth = !$WC.Proxy.IsBypassed($url) - if ($ProxyAuth) - { - if (Test-CommandParameter -commandName 'Get-Credential' -parameterName 'Message') - { - $ProxyCred = Get-Credential -Message "Enter credentials for Proxy Authentication" - } - else - { - "Enter credentials for Proxy Authentication" - $ProxyCred = Get-Credential - } - - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential",$ProxyCred) - $WC.Proxy.Credentials=$ProxyCred - } # git and installerbase fail with Start-BitsTransfer if ((Test-Command -commandName 'Start-BitsTransfer') -and ($Dependency -ne "git")-and ($Dependency -ne "installerbase")) { try { + if ($ProxyAuth) + { + $ProxyCred = Get-Credential-Backwards-Compatible + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $ProxyCred) + } Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop return } @@ -89,6 +92,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } } + if ($ProxyAuth) + { + $WC.Proxy.Credentials = Get-Credential-Backwards-Compatible + } + Write-Verbose("Downloading $Dependency...") $WC.DownloadFile($url, $downloadPath) } -- cgit v1.2.3 From 7d0bcceaf028f28b0bc5ae666689f26d8de743a9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Oct 2017 17:06:07 -0700 Subject: [findVSInstances] Data lines are now placed within tags. Text outside these tags is ignored This means we can print text in powershell now and it won't break vcpkg. --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 2 +- scripts/findVisualStudioInstallationInstances.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 3269562dc..d9ffbd32a 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -11,7 +11,7 @@ $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationI Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))" foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances) { - $instanceCandidate = $instanceCandidateWithEOL -replace "::" + $instanceCandidate = $instanceCandidateWithEOL -replace "::" -replace "::" Write-Verbose "Inspecting: $instanceCandidate" $split = $instanceCandidate -split "::" # $preferenceWeight = $split[0] diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 566560cdb..5470b57c0 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -29,7 +29,7 @@ foreach ($instance in $asXml.instances.instance) } # Placed like that for easy sorting according to preference - $results.Add("${releaseType}::${installationVersion}::${installationPath}::") > $null + $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null } # If nothing is found, attempt to find VS2015 Build Tools (not detected by vswhere.exe) @@ -42,7 +42,7 @@ if ($results.Count -eq 0) if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) { - return "PreferenceWeight1::Legacy::14.0::$installationPath::" + return "::PreferenceWeight1::Legacy::14.0::$installationPath::" } } -- cgit v1.2.3 From 47bf4b6b5caf44adeaf582e5137377fb9d2cc5c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Oct 2017 17:23:09 -0700 Subject: [fetchDependency] Now also returns output in the form data --- scripts/fetchDependency.ps1 | 4 ++-- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6cd28ad8e..aec05457a 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -265,6 +265,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) return $executableFromDownload } -SelectProgram $Dependency - +$path = SelectProgram $Dependency Write-Verbose "Fetching dependency: $Dependency. Done." +return "::$path::" diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 5470b57c0..e3bc67ff6 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -4,7 +4,7 @@ param( ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -$vswhereExe = & $scriptsDir\fetchDependency.ps1 "vswhere" +$vswhereExe = (& $scriptsDir\fetchDependency.ps1 "vswhere") -replace "::" -replace "::" $output = & $vswhereExe -prerelease -legacy -products * -format xml [xml]$asXml = $output -- cgit v1.2.3 From a5b54588eca1d57366f7052ee9ab30da4ba68066 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Oct 2017 17:30:29 -0700 Subject: [git] Update to 2.15.0 (was 2.14.3) --- scripts/bootstrap.ps1 | 2 +- scripts/fetchDependency.ps1 | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 4488d9b95..f44a7dea1 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -13,7 +13,7 @@ $gitHash = "unknownhash" $oldpath = $env:path try { - $env:path += ";$vcpkgRootDir\downloads\MinGit-2.14.3-32-bit\cmd" + $env:path += ";$vcpkgRootDir\downloads\MinGit-2.15.0-32-bit\cmd" if (Get-Command "git" -ErrorAction SilentlyContinue) { $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index aec05457a..4ef3a1f17 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -180,16 +180,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "git") { - $requiredVersion = "2.14.3" - $downloadVersion = "2.14.3" - $url = "https://github.com/git-for-windows/git/releases/download/v2.14.3.windows.1/MinGit-2.14.3-32-bit.zip" - $downloadPath = "$downloadsDir\MinGit-2.14.3-32-bit.zip" - $expectedDownloadedFileHash = "a91385acb1da220612790807c41d0f304b41093c474b9d7342230ec194a3398e" + $requiredVersion = "2.15.0" + $downloadVersion = "2.15.0" + $url = "https://github.com/git-for-windows/git/releases/download/v2.15.0.windows.1/MinGit-2.15.0-32-bit.zip" + $downloadPath = "$downloadsDir\MinGit-2.15.0-32-bit.zip" + $expectedDownloadedFileHash = "69c035ab7b75c42ce5dd99e8927d2624ab618fab73c5ad84c9412bd74c343537" # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.14.3-32-bit\cmd\git.exe" + $executableFromDownload = "$downloadsDir\MinGit-2.15.0-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = "$downloadsDir\MinGit-2.14.3-32-bit" + $extractionFolder = "$downloadsDir\MinGit-2.15.0-32-bit" } elseif($Dependency -eq "installerbase") { -- cgit v1.2.3 From 516c42bdc4a5443e0f78fae559c187823e6326d1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 31 Oct 2017 23:41:24 -0700 Subject: [bootstrap-vcpkg] Added better diagnostics in case of MSBuild failure. --- scripts/bootstrap.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index f44a7dea1..b14dbbe4a 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -32,7 +32,8 @@ $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" if (!(Test-Path $vcpkgSourcesPath)) { - New-Item -ItemType directory -Path $vcpkgSourcesPath -force | Out-Null + Write-Error "Unable to determine vcpkg sources directory. '$vcpkgSourcesPath' does not exist." + return } try @@ -43,6 +44,11 @@ try $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj + if ($LASTEXITCODE -ne 0) + { + Write-Error "Building vcpkg.exe failed. Please ensure you have installed the Desktop C++ workload and the Windows SDK for Desktop C++." + return + } Write-Verbose("Placing vcpkg.exe in the correct location") -- cgit v1.2.3 From 4ff90ec4309df1d5937d62c52683e1147066445a Mon Sep 17 00:00:00 2001 From: James Chang Date: Wed, 1 Nov 2017 16:27:12 +0800 Subject: [poco] build with MySQL support (#2088) * [poco] build with MySQL support Set proper variables to enable MySQL support if libmysql port is installed * [poco] Move Mysql support to a feature. Enable CMake config files. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 069672b71..ca228b2a4 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -116,6 +116,9 @@ function(vcpkg_fixup_cmake_targets) "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 "_INVALID_ROOT_/[^\";]*;" "" _contents "${_contents}") file(WRITE ${MAIN_TARGET} "${_contents}") endforeach() -- cgit v1.2.3 From b54f4f26ae6c2b0944590d0de5c7fbf0d9ed38d7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 1 Nov 2017 11:41:51 -0700 Subject: [blaze] Fix remaining stray _INVALID_ROOT_ --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index ca228b2a4..22c2245c8 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -119,6 +119,7 @@ function(vcpkg_fixup_cmake_targets) string(REPLACE "${CURRENT_INSTALLED_DIR}" "_INVALID_ROOT_" _contents "${_contents}") string(REGEX REPLACE ";_INVALID_ROOT_/[^\";]*" "" _contents "${_contents}") string(REGEX REPLACE "_INVALID_ROOT_/[^\";]*;" "" _contents "${_contents}") + string(REGEX REPLACE "\"_INVALID_ROOT_/[^\";]*\"" "\"\"" _contents "${_contents}") file(WRITE ${MAIN_TARGET} "${_contents}") endforeach() -- cgit v1.2.3 From 24c3f87bf45838aeeb74c513d40ac175994d0b7f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Nov 2017 18:54:10 -0700 Subject: [vcpkg_download_distfile] Now downloads in a temp dir and rename to the target location --- scripts/cmake/vcpkg_download_distfile.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index b8acfc823..ff32f1aed 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -38,7 +38,12 @@ function(vcpkg_download_distfile VAR) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS) cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) + set(download_file_path_part "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}") + + file(REMOVE_RECURSE "${DOWNLOADS}/temp") + file(MAKE_DIRECTORY "${DOWNLOADS}/temp") function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE) message(STATUS "Testing integrity of ${FILE_KIND}...") @@ -65,13 +70,13 @@ function(vcpkg_download_distfile VAR) # Tries to download the file. foreach(url IN LISTS vcpkg_download_distfile_URLS) message(STATUS "Downloading ${url}...") - file(DOWNLOAD ${url} ${downloaded_file_path} STATUS download_status) + file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status SHOW_PROGRESS) list(GET download_status 0 status_code) if (NOT "${status_code}" STREQUAL "0") message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") - file(REMOVE ${downloaded_file_path}) set(download_success 0) else() + file(RENAME ${download_file_path_part} ${downloaded_file_path}) message(STATUS "Downloading ${url}... OK") set(download_success 1) break() -- cgit v1.2.3 From 9150cb8a906c99ff1881fe0d88811ad967658cde Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Nov 2017 18:54:34 -0700 Subject: [vcpkg_find_acquire_program] Use vcpkg_download_distfile() --- scripts/cmake/vcpkg_find_acquire_program.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index fdee0cb1f..e6a37e328 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -164,18 +164,20 @@ function(vcpkg_find_acquire_program VAR) do_find() if("${${VAR}}" MATCHES "-NOTFOUND") - file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} - EXPECTED_HASH SHA512=${HASH} - SHOW_PROGRESS + vcpkg_download_distfile(ARCHIVE_PATH + URLS ${URL} + SHA512 ${HASH} + FILENAME ${ARCHIVE} ) + file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) if(DEFINED NOEXTRACT) - file(COPY ${DOWNLOADS}/${ARCHIVE} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) if(ARCHIVE_EXTENSION STREQUAL ".msi") - file(TO_NATIVE_PATH "${DOWNLOADS}/${ARCHIVE}" ARCHIVE_NATIVE_PATH) + file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} @@ -183,7 +185,7 @@ function(vcpkg_find_acquire_program VAR) ) else() execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} ) endif() -- cgit v1.2.3 From ebb52b8cb19e049cf998bd6742cb9f6a07e947cd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Nov 2017 19:08:13 -0700 Subject: Remove vcpkg_acquire_depot_tools --- scripts/cmake/vcpkg_acquire_depot_tools.cmake | 48 --------------------------- scripts/cmake/vcpkg_common_functions.cmake | 1 - 2 files changed, 49 deletions(-) delete mode 100644 scripts/cmake/vcpkg_acquire_depot_tools.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_depot_tools.cmake b/scripts/cmake/vcpkg_acquire_depot_tools.cmake deleted file mode 100644 index 009ba40f1..000000000 --- a/scripts/cmake/vcpkg_acquire_depot_tools.cmake +++ /dev/null @@ -1,48 +0,0 @@ -function(vcpkg_acquire_depot_tools PATH_TO_ROOT_OUT) - set(TOOLPATH ${DOWNLOADS}/tools/depot_tools) - set(URL "https://storage.googleapis.com/chrome-infra/depot_tools.zip") - set(ARCHIVE "depot_tools.zip") - set(STAMP "initialized-depot-tools.stamp") - set(downloaded_file_path ${DOWNLOADS}/${ARCHIVE}) - - if(NOT EXISTS "${TOOLPATH}/${STAMP}") - - message(STATUS "Acquiring Depot Tools...") - - if(EXISTS ${downloaded_file_path}) - message(STATUS "Using cached ${downloaded_file_path}") - else() - if(_VCPKG_NO_DOWNLOADS) - message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") - endif() - file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - message(STATUS "Downloading ${URL}... Failed. Status: ${download_status}") - file(REMOVE ${downloaded_file_path}) - set(download_success 0) - else() - message(STATUS "Downloading ${URL}... OK") - set(download_success 1) - endif() - - if (NOT download_success) - message(FATAL_ERROR - "\n" - " Failed to download file.\n" - " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") - endif() - endif() - - - file(REMOVE_RECURSE ${TOOLPATH}) - file(MAKE_DIRECTORY ${TOOLPATH}) - execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} - WORKING_DIRECTORY ${TOOLPATH} - ) - file(WRITE "${TOOLPATH}/${STAMP}" "0") - message(STATUS "Acquiring Depot Tools... OK") - endif() - set(${PATH_TO_ROOT_OUT} ${TOOLPATH} PARENT_SCOPE) -endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 81e8e5813..7ef87f2ea 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -21,4 +21,3 @@ include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) -include(vcpkg_acquire_depot_tools) -- cgit v1.2.3 From dc7db2571399a97d6dacc4f12f81ee1fa204987d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Nov 2017 19:08:53 -0700 Subject: [downloads] Don't show progress by default --- scripts/cmake/vcpkg_download_distfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index ff32f1aed..0141e9811 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -70,7 +70,7 @@ function(vcpkg_download_distfile VAR) # Tries to download the file. foreach(url IN LISTS vcpkg_download_distfile_URLS) message(STATUS "Downloading ${url}...") - file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status SHOW_PROGRESS) + file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) list(GET download_status 0 status_code) if (NOT "${status_code}" STREQUAL "0") message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") -- cgit v1.2.3 From 76d4666f12cbce4a52123cc41d489dfa4ce4bbba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 2 Nov 2017 19:14:10 -0700 Subject: [vcpkg_acquire_msys] Use vcpkg_download_distfile() --- scripts/cmake/vcpkg_acquire_msys.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 830022906..80a30bf2b 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -70,14 +70,18 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(PATH_TO_ROOT ${TOOLPATH}/${TOOLSUBPATH}) if(NOT EXISTS "${TOOLPATH}/${STAMP}") + message(STATUS "Acquiring MSYS2...") - file(DOWNLOAD ${URL} ${DOWNLOADS}/${ARCHIVE} - EXPECTED_HASH SHA512=${HASH} + vcpkg_download_distfile(ARCHIVE_PATH + URLS ${URL} + FILENAME ${ARCHIVE} + SHA512 ${HASH} ) + file(REMOVE_RECURSE ${TOOLPATH}/${TOOLSUBPATH}) file(MAKE_DIRECTORY ${TOOLPATH}) execute_process( - COMMAND ${CMAKE_COMMAND} -E tar xzf ${DOWNLOADS}/${ARCHIVE} + COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} WORKING_DIRECTORY ${TOOLPATH} ) execute_process( -- cgit v1.2.3 From 8bbd043beac822c20c54e6f2ee686777c9a20ac9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 14:34:08 -0700 Subject: vcpkg_from_github] Use vcpkg_download_distfile() --- scripts/cmake/vcpkg_download_distfile.cmake | 4 ++++ scripts/cmake/vcpkg_from_github.cmake | 33 ++++++++++++----------------- 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 0141e9811..b22d82a16 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -46,6 +46,10 @@ function(vcpkg_download_distfile VAR) file(MAKE_DIRECTORY "${DOWNLOADS}/temp") function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE) + if (_VCPKG_INTERNAL_NO_HASH_CHECK) + return() + endif() + message(STATUS "Testing integrity of ${FILE_KIND}...") file(SHA512 ${downloaded_file_path} FILE_HASH) if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index d14077410..1ede43fd8 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -113,7 +113,8 @@ function(vcpkg_from_github) # The following is for --head scenarios set(URL "https://github.com/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_HEAD_REF}.tar.gz") - set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") if(_VCPKG_NO_DOWNLOADS) if(NOT EXISTS ${downloaded_file_path} OR NOT EXISTS ${downloaded_file_path}.version) @@ -133,35 +134,27 @@ function(vcpkg_from_github) endif() # Try to download the file and version information from github. - message(STATUS "Downloading ${URL}...") - file(DOWNLOAD "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}" - ${downloaded_file_path}.version - STATUS download_status + set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") + vcpkg_download_distfile(ARCHIVE_VERSION + URLS "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}" + FILENAME ${downloaded_file_name}.version ) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - file(REMOVE ${downloaded_file_path}.version) - message(FATAL_ERROR "Downloading version info for ${URL}... Failed. Status: ${download_status}") - endif() - file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - file(REMOVE ${downloaded_file_path}) - message(FATAL_ERROR "Downloading ${URL}... Failed. Status: ${download_status}") - else() - message(STATUS "Downloading ${URL}... OK") - endif() + vcpkg_download_distfile(ARCHIVE + URLS ${URL} + FILENAME ${downloaded_file_name} + ) + set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() vcpkg_extract_source_archive_ex( - ARCHIVE "${downloaded_file_path}" + ARCHIVE "${ARCHIVE}" WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/head" ) # Parse the github refs response with regex. # TODO: use some JSON swiss-army-knife utility instead. - file(READ "${downloaded_file_path}.version" _contents) + file(READ "${ARCHIVE_VERSION}" _contents) string(REGEX MATCH "\"sha\": \"[a-f0-9]+\"" x "${_contents}") string(REGEX REPLACE "\"sha\": \"([a-f0-9]+)\"" "\\1" _version ${x}) -- cgit v1.2.3 From a523aacff8a642d4380e5f53b87404118b5d2a03 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 14:50:16 -0700 Subject: [vcpkg_from_bitbucket] Use vcpkg_download_distfile() --- scripts/cmake/vcpkg_from_bitbucket.cmake | 38 +++++++++++++------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_bitbucket.cmake b/scripts/cmake/vcpkg_from_bitbucket.cmake index 227de5141..26600f013 100644 --- a/scripts/cmake/vcpkg_from_bitbucket.cmake +++ b/scripts/cmake/vcpkg_from_bitbucket.cmake @@ -92,13 +92,13 @@ function(vcpkg_from_bitbucket) message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") set(VCPKG_USE_HEAD_VERSION OFF) endif() - + # Handle --no-head scenarios if(NOT VCPKG_USE_HEAD_VERSION) if(NOT _vdud_REF) message(FATAL_ERROR "Package does not specify REF. It must built using --head.") endif() - + set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz") set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz") @@ -117,7 +117,7 @@ function(vcpkg_from_bitbucket) else() set(_version ${_vdud_REF}) endif() - + vcpkg_download_distfile(ARCHIVE URLS "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_REF}.tar.gz" SHA512 "${_vdud_SHA512}" @@ -150,39 +150,31 @@ function(vcpkg_from_bitbucket) endif() # Try to download the file and version information from bitbucket. - message(STATUS "Downloading ${URL}...") - file(DOWNLOAD "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/branches/${_vdud_HEAD_REF}" - ${downloaded_file_path}.version - STATUS download_status + set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") + vcpkg_download_distfile(ARCHIVE_VERSION + URLS "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/branches/${_vdud_HEAD_REF}" + FILENAME ${downloaded_file_name}.version ) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - file(REMOVE ${downloaded_file_path}.version) - message(FATAL_ERROR "Downloading version info for ${URL}... Failed. Status: ${download_status}") - endif() - file(DOWNLOAD ${URL} ${downloaded_file_path} STATUS download_status) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - file(REMOVE ${downloaded_file_path}) - message(FATAL_ERROR "Downloading ${URL}... Failed. Status: ${download_status}") - else() - message(STATUS "Downloading ${URL}... OK") - endif() + vcpkg_download_distfile(ARCHIVE + URLS ${URL} + FILENAME ${downloaded_file_name} + ) + set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() vcpkg_extract_source_archive_ex( - ARCHIVE "${downloaded_file_path}" + ARCHIVE "${ARCHIVE}" WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/head" ) # Parse the github refs response with regex. # TODO: use some JSON swiss-army-knife utility instead. - file(READ "${downloaded_file_path}.version" _contents) + file(READ "${ARCHIVE_VERSION}" _contents) string(REGEX MATCH "\"hash\": \"[a-f0-9]+\"" x "${_contents}") string(REGEX REPLACE "\"hash\": \"([a-f0-9]+)\"" "\\1" _version ${x}) string(SUBSTRING ${_version} 0 12 _vdud_HEAD_REF) # Get the 12 first numbers from commit hash - + # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) -- cgit v1.2.3 From 0fb0191f3cb9ba4ea0f0e0675f929e1e599e1461 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 14:52:02 -0700 Subject: [ports.cmake] Use vcpkg_download_distfile() --- scripts/ports.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 8b4d17d80..ef06a4d65 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -108,10 +108,12 @@ elseif(CMD MATCHES "^CREATE$") message(STATUS "If this is not desired, delete the file and ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}") else() include(vcpkg_download_distfile) - file(DOWNLOAD ${URL} ${DOWNLOADS}/${FILENAME} STATUS error_code) - if(NOT error_code MATCHES "0;") - message(FATAL_ERROR "Error downloading file: ${error_code}") - endif() + set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") + vcpkg_download_distfile(ARCHIVE + URLS ${URL} + FILENAME ${FILENAME} + ) + set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() file(SHA512 ${DOWNLOADS}/${FILENAME} SHA512) -- cgit v1.2.3 From 82ce87cfd0854907a270ef2f8de80670bd8428b3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 15:48:21 -0700 Subject: Use download-at-temp-and-rename pattern in powershell too --- scripts/fetchDependency.ps1 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 4ef3a1f17..9d3f76386 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -65,6 +65,18 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType directory -Path $downloadDir | Out-Null } + $downloadsTemp = "$downloadDir/temp" + if (Test-Path $downloadsTemp) # Delete temp dir if it exists + { + Remove-Item $downloadsTemp -Recurse -Force + } + if (!(Test-Path $downloadsTemp)) # Recreate temp dir. It may still be there the dir was in use + { + New-Item -ItemType directory -Path $downloadsTemp | Out-Null + } + + $tempDownloadName = "$downloadsTemp/$Dependency-$downloadVersion.temp" + $WC = New-Object System.Net.WebClient $ProxyAuth = !$WC.Proxy.IsBypassed($url) @@ -79,15 +91,16 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $ProxyCred) } - Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop + Start-BitsTransfer -Source $url -Destination $tempDownloadName -ErrorAction Stop + Move-Item -Path $tempDownloadName -Destination $downloadPath return } catch [System.Exception] { # If BITS fails for any reason, delete any potentially partially downloaded files and continue - if (Test-Path $downloadPath) + if (Test-Path $tempDownloadName) { - Remove-Item $downloadPath + Remove-Item $tempDownloadName } } } @@ -98,7 +111,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } Write-Verbose("Downloading $Dependency...") - $WC.DownloadFile($url, $downloadPath) + $WC.DownloadFile($url, $tempDownloadName) + Move-Item -Path $tempDownloadName -Destination $downloadPath } # Enums (without resorting to C#) are only available on powershell 5+. -- cgit v1.2.3 From 9dc02f48b65618ab7f89c5a004a3d81fc882af32 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 16:35:15 -0700 Subject: [fetchDependendy.ps1] Remove obsolete comment --- scripts/fetchDependency.ps1 | 3 --- 1 file changed, 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 9d3f76386..6788b5e7e 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -57,9 +57,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) return } - # Can't print because vcpkg captures the output and expects only the path that is returned at the end of this script file - # Write-Host "A suitable version of $Dependency was not found (required v$requiredVersion). Downloading portable $Dependency v$downloadVersion..." - if (!(Test-Path $downloadDir)) { New-Item -ItemType directory -Path $downloadDir | Out-Null -- cgit v1.2.3 From a4dc2d2ef29654df9587d60f586c2eea16dedaaf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 16:39:43 -0700 Subject: [fetchDependency.ps1] Improve error message on hash mismatch --- scripts/fetchDependency.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6788b5e7e..593cba2a6 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -239,9 +239,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) } + $downloadedFileHash = $downloadedFileHash.ToLower() if ($expectedDownloadedFileHash -ne $downloadedFileHash) { - throw [System.IO.FileNotFoundException] ("Mismatching hash of the downloaded " + $Dependency) + Write-Host ("`nFile does not have expected hash:`n" + + " File path: [ $downloadPath ]`n" + + " Expected hash: [ $expectedDownloadedFileHash ]`n" + + " Actual hash: [ $downloadedFileHash ]`n") + throw "Invalid Hash" } if ($extractionType -eq $ExtractionType_NO_EXTRACTION_REQUIRED) @@ -270,7 +275,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if (-not (Test-Path $executableFromDownload)) { - throw [System.IO.FileNotFoundException] ("Could not detect or download " + $Dependency) + throw ("Could not detect or download " + $Dependency) } return $executableFromDownload -- cgit v1.2.3 From ad884fc2966c0d8fdff6835d481fd301bfc438ad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 16:40:28 -0700 Subject: [vswhere] Update to 2.2.11 (was 2.2.7) --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 593cba2a6..f78d159d0 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -181,11 +181,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "vswhere") { - $requiredVersion = "2.2.7" - $downloadVersion = "2.2.7" - $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.7/vswhere.exe" + $requiredVersion = "2.2.11" + $downloadVersion = "2.2.11" + $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.11/vswhere.exe" $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" - $expectedDownloadedFileHash = "f50303881da706132516d9decfd5314d524a0044daf49c0cfd21dc39c1261ec3" + $expectedDownloadedFileHash = "0235c2cb6341978abdf32e27fcf1d7af5cb5514c035e529c4cd9283e6f1a261f" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From 3b90bc07ce6fb8639fbb0a142bdbbd458e85462a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 3 Nov 2017 18:25:54 -0700 Subject: [cmake] Update to 3.9.5 (was 3.9.4) --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index f78d159d0..16ba984e6 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -160,12 +160,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.4" - $downloadVersion = "3.9.4" - $url = "https://cmake.org/files/v3.9/cmake-3.9.4-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.4-win32-x86.zip" - $expectedDownloadedFileHash = "8214df1ff51f9a6a1f0e27f9bd18f402b1749c5b645fbf6e401bcb00047171cd" - $executableFromDownload = "$downloadsDir\cmake-3.9.4-win32-x86\bin\cmake.exe" + $requiredVersion = "3.9.5" + $downloadVersion = "3.9.5" + $url = "https://cmake.org/files/v3.9/cmake-3.9.5-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.9.5-win32-x86.zip" + $expectedDownloadedFileHash = "dd3e183254c12f7c338d3edfa642f1ac84a763b8b9a2feabb4ad5fccece5dff9" + $executableFromDownload = "$downloadsDir\cmake-3.9.5-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP $extractionFolder = $downloadsDir } -- cgit v1.2.3 From 330b8d8bab6a3d07165bf7c05fea09a8e0d56348 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 4 Nov 2017 20:48:06 -0700 Subject: [vcpkg-msbuild-integration] Output warning when configuration is not determinable. Add special cases for RelWithDebInfo and MinSizeRel. --- scripts/buildsystems/msbuild/vcpkg.targets | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 1cb338237..ad1dde89b 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -36,15 +36,17 @@ $(Configuration) + Debug + Release $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), .vcpkg-root))\installed\$(VcpkgTriplet)\ - %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib - %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link - %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link + %(AdditionalDependencies);$(VcpkgRoot)debug\lib\*.lib + %(AdditionalDependencies);$(VcpkgRoot)lib\*.lib + %(AdditionalLibraryDirectories);$(VcpkgRoot)lib;$(VcpkgRoot)lib\manual-link + %(AdditionalLibraryDirectories);$(VcpkgRoot)debug\lib;$(VcpkgRoot)debug\lib\manual-link %(AdditionalIncludeDirectories);$(VcpkgRoot)include @@ -57,6 +59,7 @@ + -- cgit v1.2.3 From 9bb4817e32a14647093876cabaf62bbd2be63fc6 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:24:29 +1100 Subject: use install target in Makefiles; make all portfile uniform --- scripts/cmake/vcpkg_common_functions.cmake | 1 + scripts/cmake/vcpkg_replace_string.cmake | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 scripts/cmake/vcpkg_replace_string.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 5dabd446e..e48b5e442 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -26,3 +26,4 @@ include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) include(vcpkg_acquire_depot_tools) +include(vcpkg_replace_string) diff --git a/scripts/cmake/vcpkg_replace_string.cmake b/scripts/cmake/vcpkg_replace_string.cmake new file mode 100644 index 000000000..3eb18d0bf --- /dev/null +++ b/scripts/cmake/vcpkg_replace_string.cmake @@ -0,0 +1,14 @@ +#.rst: +# .. command:: vcpkg_replace_string +# +# Replace a string in a file. +# +# :: +# vcpkg_replace_string(filename match_string replace_string) +# +# +function(vcpkg_replace_string filename match_string replace_string) + file(READ ${filename} _contents) + string(REPLACE "${match_string}" "${replace_string}" _contents "${_contents}") + file(WRITE ${filename} "${_contents}") +endfunction() -- cgit v1.2.3 From 3a5b383bbec74dbaf0f1056e1a5d315e43d79375 Mon Sep 17 00:00:00 2001 From: Barath Kannan Date: Mon, 6 Nov 2017 00:31:24 +1100 Subject: resolve conflict on non-existant vcpkg_acquire_depot_tools --- scripts/cmake/vcpkg_common_functions.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index e48b5e442..40111542d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -25,5 +25,4 @@ include(vcpkg_copy_tool_dependencies) include(vcpkg_get_program_files_32_bit) include(vcpkg_get_program_files_platform_bitness) include(vcpkg_get_windows_sdk) -include(vcpkg_acquire_depot_tools) include(vcpkg_replace_string) -- cgit v1.2.3 From 07e4e674f09e435ba2a444296bbc12814cc8428e Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Mon, 6 Nov 2017 04:33:35 +0900 Subject: Reset settings to find boost libraries Reset the settings to find the boost libraries that installed by vcpkg. vcpkg will always rename to Boost libraries name that able to be find with default settings of FindBoost.cmake. --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 19fc99af7..68e29b87c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -155,6 +155,8 @@ endfunction() macro(find_package name) if(name STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) + unset(Boost_USE_MULTITHREADED) + unset(Boost_USE_STATIC_RUNTIME) endif() _find_package(${ARGV}) endmacro() -- cgit v1.2.3 From 524adf93aac0b7ed7c9c0f06d0e578803336bbb7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 5 Nov 2017 17:58:47 -0800 Subject: [Expand-Archive] Use namespaces to distringuish Powershell 5's and PSCX's --- scripts/fetchDependency.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 16ba984e6..4f629dfc9 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -142,12 +142,19 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) New-Item -ItemType Directory -Path $destination | Out-Null } - if (Test-Command -commandName 'Expand-Archive') + if (Test-Command -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { - Expand-Archive -path $file -destinationpath $destination + Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") + Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destination + } + elseif (Test-Command -commandName 'Pscx\Expand-Archive') + { + Write-Verbose("Extracting with Pscx\Expand-Archive") + Pscx\Expand-Archive -path $file -OutputPath $destination } else { + Write-Verbose("Extracting via shell") $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) @@ -257,7 +264,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) # consider renaming the extraction folder to make sure the extraction finished { - # Expand-Archive $downloadPath -dest "$extractionFolder" -Force # Requires powershell 5+ Expand-ZIPFile -File $downloadPath -Destination $extractionFolder } } -- cgit v1.2.3 From 4bd9ad6969485417e1c8243eeba4cef4608e6ec9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 5 Nov 2017 18:10:48 -0800 Subject: [Get-(File)Hash] Use namespaces and add Pscx check --- scripts/fetchDependency.ps1 | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 4f629dfc9..b884f3da8 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -31,6 +31,30 @@ function Get-Credential-Backwards-Compatible() } } +function Get-Hash-SHA265() +{ + if (Test-Command -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') + { + Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") + $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash + } + elseif(Test-Command -commandName 'Pscx\Get-Hash') + { + Write-Verbose("Hashing with Pscx\Get-Hash") + $downloadedFileHash = (Get-Hash -Path $downloadPath -Algorithm SHA256).HashString + } + else + { + Write-Verbose("Hashing with .NET") + $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") + $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) + $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) + $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) + } + + return $downloadedFileHash.ToLower() +} + if (Test-Module -moduleName 'BitsTransfer') { Import-Module BitsTransfer -Verbose:$false @@ -233,20 +257,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion - #calculating the hash - if (Test-Command -commandName 'Get-FileHash') - { - $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash - } - else - { - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") - $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) - $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) - $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) - } - - $downloadedFileHash = $downloadedFileHash.ToLower() + $downloadedFileHash = Get-Hash-SHA265 $downloadPath if ($expectedDownloadedFileHash -ne $downloadedFileHash) { Write-Host ("`nFile does not have expected hash:`n" + -- cgit v1.2.3 From d43676658ac120cb9a0ce3df6a62e9ee0c3c4843 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Nov 2017 09:06:54 -0800 Subject: [vcpkg_from_github] Handle '/' in REFs. Fixes #2141. --- scripts/cmake/vcpkg_from_github.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 1ede43fd8..5730ce39a 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -101,19 +101,22 @@ function(vcpkg_from_github) message(FATAL_ERROR "Package does not specify REF. It must built using --head.") endif() + string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}") + vcpkg_download_distfile(ARCHIVE URLS "https://github.com/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_REF}.tar.gz" SHA512 "${_vdud_SHA512}" - FILENAME "${ORG_NAME}-${REPO_NAME}-${_vdud_REF}.tar.gz" + FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}") - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${_vdud_REF}) + set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${SANITIZED_REF}) return() endif() # The following is for --head scenarios set(URL "https://github.com/${ORG_NAME}/${REPO_NAME}/archive/${_vdud_HEAD_REF}.tar.gz") - set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + string(REPLACE "/" "-" SANITIZED_HEAD_REF "${_vdud_HEAD_REF}") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${SANITIZED_HEAD_REF}.tar.gz") set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") if(_VCPKG_NO_DOWNLOADS) @@ -161,5 +164,5 @@ function(vcpkg_from_github) # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${_vdud_HEAD_REF}) + set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) endfunction() -- cgit v1.2.3 From 2ece3186ff5cc8b687a22d1a242537a0a6da7420 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 8 Nov 2017 10:41:03 -0800 Subject: [vcpkg-build-msbuild] Update examples. --- scripts/cmake/vcpkg_build_msbuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 1e3c85ba2..81f442ef7 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -52,8 +52,8 @@ ## ## ## Examples ## -## * [libuv](https://github.com/Microsoft/vcpkg/blob/master/ports/libuv/portfile.cmake) -## * [zeromq](https://github.com/Microsoft/vcpkg/blob/master/ports/zeromq/portfile.cmake) +## * [chakracore](https://github.com/Microsoft/vcpkg/blob/master/ports/chakracore/portfile.cmake) +## * [cppunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cppunit/portfile.cmake) function(vcpkg_build_msbuild) cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) -- cgit v1.2.3 From 138bce34f27f2cb2cdeb50056b414d1cd80e73ec Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Nov 2017 17:51:15 -0800 Subject: Fix SHA-256 name --- scripts/fetchDependency.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b884f3da8..f90a51290 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -31,7 +31,7 @@ function Get-Credential-Backwards-Compatible() } } -function Get-Hash-SHA265() +function Get-Hash-SHA256() { if (Test-Command -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') { @@ -257,7 +257,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion - $downloadedFileHash = Get-Hash-SHA265 $downloadPath + $downloadedFileHash = Get-Hash-SHA256 $downloadPath if ($expectedDownloadedFileHash -ne $downloadedFileHash) { Write-Host ("`nFile does not have expected hash:`n" + -- cgit v1.2.3 From eabacf0d14b288f8d8a530cbefce09f7e26aa981 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Nov 2017 17:52:04 -0800 Subject: Make parameter mandatory --- scripts/fetchDependency.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index f90a51290..b185336f5 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -145,9 +145,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) # Using this to wait for the execution to finish function Invoke-Command() { - param ( [string]$program = $(throw "Please specify a program" ), - [string]$argumentString = "", - [switch]$waitForExit ) + param ( [Parameter(Mandatory=$true)][string]$program, + [string]$argumentString = "", + [switch]$waitForExit = $false ) $psi = new-object "Diagnostics.ProcessStartInfo" $psi.FileName = $program -- cgit v1.2.3 From 615f7e112f38cf82dd1cec9d519501938f755324 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Nov 2017 20:09:04 -0800 Subject: [bootstrap.ps1] Add option to specify VS path --- scripts/bootstrap.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b14dbbe4a..f8e6dcaa0 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( - [ValidateNotNullOrEmpty()] - [string]$disableMetrics = "0" + [ValidateNotNullOrEmpty()][string]$disableMetrics = "0", + [Parameter(Mandatory=$False)][string]$explicitlyRequestedVSPath = "" ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition @@ -39,7 +39,7 @@ if (!(Test-Path $vcpkgSourcesPath)) try { pushd $vcpkgSourcesPath - $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 + $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $explicitlyRequestedVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 -- cgit v1.2.3 From 7eb0095094f62719d9f28c694d2bd6b3d003f090 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Nov 2017 21:41:16 -0800 Subject: Rename $explicitlyRequestedVSPath to $withVSPath --- scripts/bootstrap.ps1 | 4 ++-- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index f8e6dcaa0..f349dbecd 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -1,7 +1,7 @@ [CmdletBinding()] param( [ValidateNotNullOrEmpty()][string]$disableMetrics = "0", - [Parameter(Mandatory=$False)][string]$explicitlyRequestedVSPath = "" + [Parameter(Mandatory=$False)][string]$withVSPath = "" ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition @@ -39,7 +39,7 @@ if (!(Test-Path $vcpkgSourcesPath)) try { pushd $vcpkgSourcesPath - $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $explicitlyRequestedVSPath + $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index d9ffbd32a..e58b58c04 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -1,10 +1,10 @@ [CmdletBinding()] param( [Parameter(Mandatory=$False)] - [string]$explicitlyRequestedVSPath = "" + [string]$withVSPath = "" ) -$explicitlyRequestedVSPath = $explicitlyRequestedVSPath -replace "\\$" # Remove potential trailing backslash +$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 @@ -19,7 +19,7 @@ foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances) $version = $split[2] $path = $split[3] - if ($explicitlyRequestedVSPath -ne "" -and $explicitlyRequestedVSPath -ne $path) + if ($withVSPath -ne "" -and $withVSPath -ne $path) { Write-Verbose "Skipping: $instanceCandidate" continue -- cgit v1.2.3 From cd41cfe468d453a9c5d9ceb601f0e5aba988113a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 9 Nov 2017 21:42:36 -0800 Subject: Use Push-Location/Pop-Location instead of pushd/popd --- scripts/bootstrap.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index f349dbecd..ca7b1a0ce 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -38,7 +38,7 @@ if (!(Test-Path $vcpkgSourcesPath)) try { - pushd $vcpkgSourcesPath + Push-Location $vcpkgSourcesPath $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] @@ -57,5 +57,5 @@ try } finally { - popd + Pop-Location } -- cgit v1.2.3 From 50f6bc4e8f103c695f8754962dde0be03e32cbc5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 10 Nov 2017 17:34:00 -0800 Subject: [vcpkg-toolchain] Fix find_package detection of Boost. Fixes #2130. --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 68e29b87c..e3aa46b64 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -153,7 +153,7 @@ function(add_library name) endfunction() macro(find_package name) - if(name STREQUAL "Boost") + if("${name}" STREQUAL "Boost") unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) -- cgit v1.2.3 From 415789b42e5fd43ac984902cd72848f6ef6b450a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 13 Nov 2017 21:36:29 -0800 Subject: [vcpkg-metrics] Replace SQM with MAC hash. --- scripts/SHA256Hash.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/SHA256Hash.ps1 (limited to 'scripts') diff --git a/scripts/SHA256Hash.ps1 b/scripts/SHA256Hash.ps1 new file mode 100644 index 000000000..348d461b7 --- /dev/null +++ b/scripts/SHA256Hash.ps1 @@ -0,0 +1,9 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$True)] + [String]$Value +) + +$sha256 = New-Object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider +$utf8 = New-Object -TypeName System.Text.UTF8Encoding +[System.BitConverter]::ToString($sha256.ComputeHash($utf8.GetBytes($Value))) -- cgit v1.2.3 From 24283ec1ee019df3e43dbb9c9bf2f1d9d1263911 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Nov 2017 18:56:44 -0800 Subject: [leptonica][tiff] Add LZMA to tiff's dependent libraries. Leptonica should use TIFF_LIBRARIES. --- scripts/buildsystems/vcpkg.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index e3aa46b64..66dd50169 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -159,6 +159,16 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) endif() _find_package(${ARGV}) + + if("${name}" STREQUAL "TIFF") + find_package(LibLZMA) + if(TARGET TIFF::TIFF) + set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + if(TIFF_LIBRARIES) + list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + endif() endmacro() set(VCPKG_TOOLCHAIN ON) -- cgit v1.2.3 From 4228e1e389f31b70eb7078aed99b21ad465d8aa0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Nov 2017 21:15:37 -0800 Subject: [llvm] Install debug targets for cmake --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 22c2245c8..5bf1b2cdb 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -81,9 +81,11 @@ function(vcpkg_fixup_cmake_targets) file(REMOVE ${UNUSED_FILES}) endif() + # LLVM uses "LLVMExports-release.cmake" file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake" "${RELEASE_SHARE}/*[Cc]onfig-release.cmake" + "${RELEASE_SHARE}/*[Ee]xports-release.cmake" ) foreach(RELEASE_TARGET ${RELEASE_TARGETS}) file(READ ${RELEASE_TARGET} _contents) @@ -95,7 +97,8 @@ function(vcpkg_fixup_cmake_targets) file(GLOB DEBUG_TARGETS "${DEBUG_SHARE}/*[Tt]argets-debug.cmake" "${DEBUG_SHARE}/*[Cc]onfig-debug.cmake" - ) + "${DEBUG_SHARE}/*[Ee]xports-debug.cmake" + ) foreach(DEBUG_TARGET ${DEBUG_TARGETS}) get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) -- cgit v1.2.3 From 7e3dcc4f096925f152593e3c8cd33e5dbf0b4e6f Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Nov 2017 21:58:26 -0800 Subject: [tesseract] Fix static linking. [icu][tiff] Add patches in toolchain to fix static linking. --- scripts/buildsystems/vcpkg.cmake | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 66dd50169..ff89439cc 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -157,10 +157,20 @@ macro(find_package name) unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) - endif() - _find_package(${ARGV}) - - if("${name}" STREQUAL "TIFF") + _find_package(${ARGV}) + elseif("${name}" STREQUAL "ICU") + function(_vcpkg_find_in_list) + list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) + set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE) + endfunction() + _vcpkg_find_in_list(${ARGV}) + if(NOT COMPONENTS_IDX EQUAL -1) + _find_package(${ARGV} COMPONENTS data) + else() + _find_package(${ARGV}) + endif() + elseif("${name}" STREQUAL "TIFF") + _find_package(${ARGV}) find_package(LibLZMA) if(TARGET TIFF::TIFF) set_property(TARGET TIFF::TIFF APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) @@ -168,6 +178,8 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + else() + _find_package(${ARGV}) endif() endmacro() -- cgit v1.2.3 From 2abdcc1eec62fa7bd6af7abe0d7884966bd65b59 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 15 Nov 2017 18:07:50 -0800 Subject: Introduce VcpkgPowershellUtils --- scripts/VcpkgPowershellUtils.ps1 | 185 ++++++++++++++++++++++++++++++++++++ scripts/fetchDependency.ps1 | 198 ++------------------------------------- 2 files changed, 192 insertions(+), 191 deletions(-) create mode 100644 scripts/VcpkgPowershellUtils.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 new file mode 100644 index 000000000..c7447b383 --- /dev/null +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -0,0 +1,185 @@ +function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) +{ + return [bool](Get-Module -ListAvailable -Name $moduleName) +} + +function vcpkgCreateDirectory([Parameter(Mandatory=$true)][string]$dirPath) +{ + if (!(Test-Path $dirPath)) + { + New-Item -ItemType Directory -Path $dirPath | Out-Null + } +} + +function vcpkgRemoveDirectory([Parameter(Mandatory=$true)][string]$dirPath) +{ + if (Test-Path $dirPath) + { + Remove-Item $dirPath -Recurse -Force + } +} + +function vcpkgRemoveFile([Parameter(Mandatory=$true)][string]$filePath) +{ + if (Test-Path $filePath) + { + Remove-Item $filePath -Force + } +} + +function vcpkgHasCommand([Parameter(Mandatory=$true)][string]$commandName) +{ + return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) +} + +function vcpkgHasCommandParameter([Parameter(Mandatory=$true)][string]$commandName, [Parameter(Mandatory=$true)][string]$parameterName) +{ + return (Get-Command $commandName).Parameters.Keys -contains $parameterName +} + +function vcpkgGetCredentials() +{ + if (vcpkgHasCommandParameter -commandName 'Get-Credential' -parameterName 'Message') + { + return Get-Credential -Message "Enter credentials for Proxy Authentication" + } + else + { + Write-Host "Enter credentials for Proxy Authentication" + return Get-Credential + } +} + +function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath) +{ + if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') + { + Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") + $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA256).Hash + } + elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') + { + Write-Verbose("Hashing with Pscx\Get-Hash") + $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA256).HashString + } + else + { + Write-Verbose("Hashing with .NET") + $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") + $fileAsByteArray = [io.File]::ReadAllBytes($filePath) + $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) + $hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) + } + + return $hash.ToLower() +} + +function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath, + [Parameter(Mandatory=$true)][string]$expectedHash, + [Parameter(Mandatory=$true)][string]$actualHash ) +{ + if ($expectedDownloadedFileHash -ne $downloadedFileHash) + { + Write-Host ("`nFile does not have expected hash:`n" + + " File path: [ $filePath ]`n" + + " Expected hash: [ $expectedHash ]`n" + + " Actual hash: [ $actualHash ]`n") + throw "Invalid Hash for file $filePath" + } +} + +if (vcpkgHasModule -moduleName 'BitsTransfer') +{ + Import-Module BitsTransfer -Verbose:$false +} + +function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, + [Parameter(Mandatory=$true)][string]$downloadPath) +{ + if (Test-Path $downloadPath) + { + return + } + + $downloadDir = split-path -parent $downloadPath + vcpkgCreateDirectory $downloadDir + + $downloadPartPath = "$downloadPath.part" + vcpkgRemoveFile $downloadPartPath + + $wc = New-Object System.Net.WebClient + $proxyAuth = !$wc.Proxy.IsBypassed($url) + if ($proxyAuth) + { + $wc.Proxy.Credentials = vcpkgGetCredentials + } + + # Some download (e.g. git from github)fail with Start-BitsTransfer + if (vcpkgHasCommand -commandName 'Start-BitsTransfer') + { + try + { + if ($proxyAuth) + { + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") + $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $wc.Proxy.Credentials) + } + Start-BitsTransfer -Source $url -Destination $downloadPartPath -ErrorAction Stop + Move-Item -Path $downloadPartPath -Destination $downloadPath + return + } + catch [System.Exception] + { + # If BITS fails for any reason, delete any potentially partially downloaded files and continue + vcpkgRemoveFile $downloadPartPath + } + } + + Write-Verbose("Downloading $Dependency...") + $wc.DownloadFile($url, $downloadPartPath) + Move-Item -Path $downloadPartPath -Destination $downloadPath +} + +function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, + [Parameter(Mandatory=$true)][string]$destination) +{ + vcpkgCreateDirectory $destination + + if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') + { + Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") + Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destination + } + elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') + { + Write-Verbose("Extracting with Pscx\Expand-Archive") + Pscx\Expand-Archive -path $file -OutputPath $destination + } + else + { + Write-Verbose("Extracting via shell") + $shell = new-object -com shell.application + $zip = $shell.NameSpace($file) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destination).copyhere($item) | Out-Null + } + } +} + +function vcpkgInvokeCommand() +{ + param ( [Parameter(Mandatory=$true)][string]$executable, + [string]$arguments = "", + [switch]$wait) + + Write-Verbose "Executing: ${executable} ${arguments}" + $process = Start-Process -FilePath $executable -ArgumentList $arguments -PassThru + if ($wait) + { + Wait-Process -InputObject $process + $ec = $process.ExitCode + Write-Verbose "Execution terminated with exit code $ec." + } +} \ No newline at end of file diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index b185336f5..8ea69e488 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -3,192 +3,21 @@ param( [string]$Dependency ) -function Test-Command($commandName) -{ - return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) -} - -function Test-CommandParameter($commandName, $parameterName) -{ - return (Get-Command $commandName).Parameters.Keys -contains $parameterName -} - -function Test-Module($moduleName) -{ - return [bool](Get-Module -ListAvailable -Name $moduleName) -} - -function Get-Credential-Backwards-Compatible() -{ - if (Test-CommandParameter -commandName 'Get-Credential' -parameterName 'Message') - { - return Get-Credential -Message "Enter credentials for Proxy Authentication" - } - else - { - Write-Host "Enter credentials for Proxy Authentication" - return Get-Credential - } -} - -function Get-Hash-SHA256() -{ - if (Test-Command -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') - { - Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $downloadedFileHash = (Get-FileHash -Path $downloadPath -Algorithm SHA256).Hash - } - elseif(Test-Command -commandName 'Pscx\Get-Hash') - { - Write-Verbose("Hashing with Pscx\Get-Hash") - $downloadedFileHash = (Get-Hash -Path $downloadPath -Algorithm SHA256).HashString - } - else - { - Write-Verbose("Hashing with .NET") - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") - $fileAsByteArray = [io.File]::ReadAllBytes($downloadPath) - $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) - $downloadedFileHash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) - } - - return $downloadedFileHash.ToLower() -} - -if (Test-Module -moduleName 'BitsTransfer') -{ - Import-Module BitsTransfer -Verbose:$false -} +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" Write-Verbose "Fetching dependency: $Dependency" - -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { - function performDownload( [Parameter(Mandatory=$true)][string]$Dependency, - [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadDir, - [Parameter(Mandatory=$true)][string]$downloadPath, - [Parameter(Mandatory=$true)][string]$downloadVersion, - [Parameter(Mandatory=$true)][string]$requiredVersion) - { - if (Test-Path $downloadPath) - { - return - } - - if (!(Test-Path $downloadDir)) - { - New-Item -ItemType directory -Path $downloadDir | Out-Null - } - - $downloadsTemp = "$downloadDir/temp" - if (Test-Path $downloadsTemp) # Delete temp dir if it exists - { - Remove-Item $downloadsTemp -Recurse -Force - } - if (!(Test-Path $downloadsTemp)) # Recreate temp dir. It may still be there the dir was in use - { - New-Item -ItemType directory -Path $downloadsTemp | Out-Null - } - - $tempDownloadName = "$downloadsTemp/$Dependency-$downloadVersion.temp" - - $WC = New-Object System.Net.WebClient - $ProxyAuth = !$WC.Proxy.IsBypassed($url) - - # git and installerbase fail with Start-BitsTransfer - if ((Test-Command -commandName 'Start-BitsTransfer') -and ($Dependency -ne "git")-and ($Dependency -ne "installerbase")) - { - try - { - if ($ProxyAuth) - { - $ProxyCred = Get-Credential-Backwards-Compatible - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $ProxyCred) - } - Start-BitsTransfer -Source $url -Destination $tempDownloadName -ErrorAction Stop - Move-Item -Path $tempDownloadName -Destination $downloadPath - return - } - catch [System.Exception] - { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - if (Test-Path $tempDownloadName) - { - Remove-Item $tempDownloadName - } - } - } - - if ($ProxyAuth) - { - $WC.Proxy.Credentials = Get-Credential-Backwards-Compatible - } - - Write-Verbose("Downloading $Dependency...") - $WC.DownloadFile($url, $tempDownloadName) - Move-Item -Path $tempDownloadName -Destination $downloadPath - } - # Enums (without resorting to C#) are only available on powershell 5+. $ExtractionType_NO_EXTRACTION_REQUIRED = 0 $ExtractionType_ZIP = 1 $ExtractionType_SELF_EXTRACTING_7Z = 2 - - # Using this to wait for the execution to finish - function Invoke-Command() - { - param ( [Parameter(Mandatory=$true)][string]$program, - [string]$argumentString = "", - [switch]$waitForExit = $false ) - - $psi = new-object "Diagnostics.ProcessStartInfo" - $psi.FileName = $program - $psi.Arguments = $argumentString - $proc = [Diagnostics.Process]::Start($psi) - if ( $waitForExit ) - { - $proc.WaitForExit(); - } - } - - function Expand-ZIPFile($file, $destination) - { - if (!(Test-Path $destination)) - { - New-Item -ItemType Directory -Path $destination | Out-Null - } - - if (Test-Command -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') - { - Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destination - } - elseif (Test-Command -commandName 'Pscx\Expand-Archive') - { - Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $file -OutputPath $destination - } - else - { - Write-Verbose("Extracting via shell") - $shell = new-object -com shell.application - $zip = $shell.NameSpace($file) - foreach($item in $zip.items()) - { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destination).copyhere($item) | Out-Null - } - } - } - if($Dependency -eq "cmake") { $requiredVersion = "3.9.5" @@ -249,23 +78,10 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } - $downloadSubdir = Split-path $downloadPath -Parent - if (!(Test-Path $downloadSubdir)) - { - New-Item -ItemType Directory -Path $downloadSubdir | Out-Null - } - - performDownload $Dependency $url $downloadsDir $downloadPath $downloadVersion $requiredVersion + vcpkgDownloadFile $url $downloadPath - $downloadedFileHash = Get-Hash-SHA256 $downloadPath - if ($expectedDownloadedFileHash -ne $downloadedFileHash) - { - Write-Host ("`nFile does not have expected hash:`n" + - " File path: [ $downloadPath ]`n" + - " Expected hash: [ $expectedDownloadedFileHash ]`n" + - " Actual hash: [ $downloadedFileHash ]`n") - throw "Invalid Hash" - } + $downloadedFileHash = vcpkgGetSHA256 $downloadPath + vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash if ($extractionType -eq $ExtractionType_NO_EXTRACTION_REQUIRED) { @@ -275,14 +91,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) # consider renaming the extraction folder to make sure the extraction finished { - Expand-ZIPFile -File $downloadPath -Destination $extractionFolder + vcpkgExtractFile -File $downloadPath -Destination $extractionFolder } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) { if (-not (Test-Path $executableFromDownload)) { - Invoke-Command $downloadPath "-y" -waitForExit:$true + vcpkgInvokeCommand $downloadPath "-y" -wait:$true } } else -- cgit v1.2.3 From b2e1dc3e5a4224bd06f1aaa52c87f5c8939787ae Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 16 Nov 2017 02:01:50 -0800 Subject: Use temp-and-rename pattern for extracting --- scripts/VcpkgPowershellUtils.ps1 | 13 ++++++++++--- scripts/fetchDependency.ps1 | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index c7447b383..12eacec96 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -144,16 +144,20 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$destination) { vcpkgCreateDirectory $destination + $baseName = (Get-ChildItem .\downloads\cmake-3.9.5-win32-x86.zip).BaseName + $destinationPartial = "$destination\$baseName-partially_extracted" + vcpkgRemoveDirectory $destinationPartial + vcpkgCreateDirectory $destinationPartial if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destination + Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destinationPartial } elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') { Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $file -OutputPath $destination + Pscx\Expand-Archive -path $file -OutputPath $destinationPartial } else { @@ -163,9 +167,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, foreach($item in $zip.items()) { # Piping to Out-Null is used to block until finished - $shell.Namespace($destination).copyhere($item) | Out-Null + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null } } + + Move-Item -Path "$destinationPartial\*" -Destination $destination + vcpkgRemoveDirectory $destinationPartial } function vcpkgInvokeCommand() diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 8ea69e488..2cc782feb 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -89,7 +89,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($extractionType -eq $ExtractionType_ZIP) { - if (-not (Test-Path $executableFromDownload)) # consider renaming the extraction folder to make sure the extraction finished + if (-not (Test-Path $executableFromDownload)) { vcpkgExtractFile -File $downloadPath -Destination $extractionFolder } -- cgit v1.2.3 From 6290155eaaff1bd70ec9a893b090adea473effa8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 17 Nov 2017 01:23:14 -0800 Subject: [vcpkgExtractFile] Fix partial dir name. Special case 1-item zips - If the zip contains a single item, pull that up a directory - If the zip contains multiple items, place that in a directory on of the same name as the zip --- scripts/VcpkgPowershellUtils.ps1 | 23 +++++++++++++++++------ scripts/fetchDependency.ps1 | 5 +---- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 12eacec96..0b1a35262 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -141,11 +141,13 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, - [Parameter(Mandatory=$true)][string]$destination) + [Parameter(Mandatory=$true)][string]$destinationDir) { - vcpkgCreateDirectory $destination - $baseName = (Get-ChildItem .\downloads\cmake-3.9.5-win32-x86.zip).BaseName - $destinationPartial = "$destination\$baseName-partially_extracted" + $parentPath = split-path -parent $destinationDir + vcpkgCreateDirectory $parentPath + $baseName = (Get-ChildItem $file).BaseName + $destinationPartial = "$destinationDir\$baseName-partially_extracted" + vcpkgRemoveDirectory $destinationPartial vcpkgCreateDirectory $destinationPartial @@ -171,8 +173,17 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, } } - Move-Item -Path "$destinationPartial\*" -Destination $destination - vcpkgRemoveDirectory $destinationPartial + $hasASingleItem = (Get-ChildItem $destinationPartial | Measure-Object).Count -eq 1; + + if ($hasASingleItem) + { + Move-Item -Path "$destinationPartial\*" -Destination $destinationDir + vcpkgRemoveDirectory $destinationPartial + } + else + { + Rename-Item -Path $destinationPartial -NewName $baseName + } } function vcpkgInvokeCommand() diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 2cc782feb..596845acb 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -27,7 +27,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $expectedDownloadedFileHash = "dd3e183254c12f7c338d3edfa642f1ac84a763b8b9a2feabb4ad5fccece5dff9" $executableFromDownload = "$downloadsDir\cmake-3.9.5-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = $downloadsDir } elseif($Dependency -eq "nuget") { @@ -60,7 +59,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) # Therefore, choosing the cmd dir here as well. $executableFromDownload = "$downloadsDir\MinGit-2.15.0-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = "$downloadsDir\MinGit-2.15.0-32-bit" } elseif($Dependency -eq "installerbase") { @@ -71,7 +69,6 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) $expectedDownloadedFileHash = "f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8" $executableFromDownload = "$downloadsDir\QtInstallerFramework-win-x86\bin\installerbase.exe" $extractionType = $ExtractionType_ZIP - $extractionFolder = $downloadsDir } else { @@ -91,7 +88,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) { - vcpkgExtractFile -File $downloadPath -Destination $extractionFolder + vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) -- cgit v1.2.3 From 7fc2d7dbdf81b05905f4121fd52aa68234024c43 Mon Sep 17 00:00:00 2001 From: Frank Quinn Date: Sun, 19 Nov 2017 11:42:52 +0000 Subject: Added SCONS to vcpkg_find_acquire_program See: http://scons.org I have a port I would like to submit which uses scons (which in turn uses the python interpreter already provided). This change makes SCONS usable for vcpkg_execute_required_process. --- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index e6a37e328..066126e6c 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -148,6 +148,14 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip") set(ARCHIVE "wix311-binaries.zip") set(HASH 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516) + elseif(VAR MATCHES "SCONS") + set(PROGNAME scons) + set(REQUIRED_INTERPRETER PYTHON2) + set(SCRIPTNAME "scons.py") + set(PATHS ${DOWNLOADS}/tools/scons) + set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") + set(ARCHIVE "scons-local-3.0.1.zip") + set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From eec26f68fc0f380118b2de7670c98f7a639d9d4b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 20 Nov 2017 17:07:03 -0800 Subject: [qt5] Reduce duplication in modular build by extracting qt5modularscripts --- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 6 ++++-- scripts/cmake/vcpkg_configure_qmake_release.cmake | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake index e3dfb0777..3eeb42cb3 100644 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_debug.cmake @@ -21,7 +21,7 @@ function(vcpkg_configure_qmake_debug) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) # Find qmake exectuable - find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/debug/tools/qt5) + find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") @@ -30,10 +30,12 @@ function(vcpkg_configure_qmake_debug) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg ) diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake index cf9eacbd5..60750060b 100644 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ b/scripts/cmake/vcpkg_configure_qmake_release.cmake @@ -22,6 +22,7 @@ function(vcpkg_configure_qmake_release) # Find qmake exectuable find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) + if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() @@ -29,10 +30,12 @@ function(vcpkg_configure_qmake_release) # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) -- cgit v1.2.3 From 141f10801c2fae8ab844e94fe5338d055892c0ac Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 11:49:15 -0800 Subject: [vcpkg] Improve external toolchain handling. --- scripts/buildsystems/vcpkg.cmake | 16 +++++++++++----- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- scripts/cmake/vcpkg_execute_required_process.cmake | 7 ++++--- scripts/get_triplet_environment.cmake | 3 ++- 4 files changed, 19 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ff89439cc..4d82c43b7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,11 @@ # Mark variables as used so cmake doesn't complain about them mark_as_advanced(CMAKE_TOOLCHAIN_FILE) +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if( _CMAKE_IN_TRY_COMPILE ) + include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) +endif() + if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") endif() @@ -9,11 +14,6 @@ if(VCPKG_TOOLCHAIN) return() endif() -get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) -if( _CMAKE_IN_TRY_COMPILE ) - include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) -endif() - if(VCPKG_TARGET_TRIPLET) elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -77,10 +77,16 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/manual-link ) + list(APPEND CMAKE_FIND_ROOT_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug + ) endif() list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} ) +list(APPEND CMAKE_FIND_ROOT_PATH + ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} +) list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 54616122c..d40550f06 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -61,14 +61,14 @@ function(vcpkg_configure_cmake) set(GENERATOR ${_csc_GENERATOR}) elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT _csc_HOST_ARCHITECTURE STREQUAL "x86") set(GENERATOR "Ninja") - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013 Win64") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013 ARM") - + elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + set(GENERATOR "Ninja") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 173bca6e9..7c4907016 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -38,13 +38,14 @@ function(vcpkg_execute_required_process) RESULT_VARIABLE error_code WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY}) #debug_message("error_code=${error_code}") - file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR) if(error_code) + file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log" NATIVE_LOG_OUT) + file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log" NATIVE_LOG_ERR) message(FATAL_ERROR " Command failed: ${vcpkg_execute_required_process_COMMAND}\n" " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" " See logs for more information:\n" - " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_LOGNAME}-out.log\n" - " ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_LOGNAME}-err.log\n") + " ${NATIVE_LOG_OUT}\n" + " ${NATIVE_LOG_ERR}\n") endif() endfunction() diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index b32f840d2..d498edf4a 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -6,4 +6,5 @@ message("VCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}") message("VCPKG_CMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") message("VCPKG_CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") message("VCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}") -message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") \ No newline at end of file +message("VCPKG_VISUAL_STUDIO_PATH=${VCPKG_VISUAL_STUDIO_PATH}") +message("VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") -- cgit v1.2.3 From 89983fe102520c7a063ff349ac824995b1832a97 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 12:47:49 -0800 Subject: [vcpkg-from-github] Improve argument handling --- scripts/cmake/vcpkg_from_github.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 5730ce39a..b71ab3838 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -54,19 +54,19 @@ function(vcpkg_from_github) set(multipleValuesArgs) cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) - if(NOT _vdud_OUT_SOURCE_PATH) + if(NOT DEFINED _vdud_OUT_SOURCE_PATH) message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") endif() - if((_vdud_REF AND NOT _vdud_SHA512) OR (NOT _vdud_REF AND _vdud_SHA512)) + if((DEFINED _vdud_REF AND NOT DEFINED _vdud_SHA512) OR (NOT DEFINED _vdud_REF AND DEFINED _vdud_SHA512)) message(FATAL_ERROR "SHA512 must be specified if REF is specified.") endif() - if(NOT _vdud_REPO) + if(NOT DEFINED _vdud_REPO) message(FATAL_ERROR "The GitHub repository must be specified.") endif() - if(NOT _vdud_REF AND NOT _vdud_HEAD_REF) + if(NOT DEFINED _vdud_REF AND NOT DEFINED _vdud_HEAD_REF) message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.") endif() @@ -90,7 +90,7 @@ function(vcpkg_from_github) endif() endmacro() - if(VCPKG_USE_HEAD_VERSION AND NOT _vdud_HEAD_REF) + if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF) message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") set(VCPKG_USE_HEAD_VERSION OFF) endif() -- cgit v1.2.3 From 5335d17f53d491d83d98e80ab0e750ec0f6f430b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 15:25:18 -0800 Subject: [vcpkg] Initial experimental support for VCPKG_BUILD_TYPE release --- scripts/cmake/vcpkg_build_cmake.cmake | 32 ++++++----- scripts/cmake/vcpkg_build_msbuild.cmake | 44 +++++++++------- scripts/cmake/vcpkg_configure_cmake.cmake | 48 +++++++++-------- scripts/cmake/vcpkg_configure_meson.cmake | 56 +++++++++++--------- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 76 +++++++++++++++------------ scripts/get_triplet_environment.cmake | 1 + 6 files changed, 141 insertions(+), 116 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 5dc81ec09..0b4bbd211 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -58,19 +58,23 @@ function(vcpkg_build_cmake) set(TARGET_PARAM) endif() - message(STATUS "Build ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-rel - ) - message(STATUS "Build ${TARGET_TRIPLET}-rel done") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Build ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-rel + ) + message(STATUS "Build ${TARGET_TRIPLET}-rel done") + endif() - message(STATUS "Build ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug ${TARGET_PARAM} -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Build ${TARGET_TRIPLET}-dbg done") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Build ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${CMAKE_COMMAND} --build . --config Debug ${TARGET_PARAM} -- ${BUILD_ARGS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Build ${TARGET_TRIPLET}-dbg done") + endif() endfunction() diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 81f442ef7..b8403d277 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -87,25 +87,29 @@ function(vcpkg_build_msbuild) /m ) - message(STATUS "Building ${_csc_PROJECT_PATH} for Release") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND msbuild ${_csc_PROJECT_PATH} - /p:Configuration=${_csc_RELEASE_CONFIGURATION} - ${_csc_OPTIONS} - ${_csc_OPTIONS_RELEASE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel - ) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Building ${_csc_PROJECT_PATH} for Release") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND msbuild ${_csc_PROJECT_PATH} + /p:Configuration=${_csc_RELEASE_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_RELEASE} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) + endif() - message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND msbuild ${_csc_PROJECT_PATH} - /p:Configuration=${_csc_DEBUG_CONFIGURATION} - ${_csc_OPTIONS} - ${_csc_OPTIONS_DEBUG} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg - ) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND msbuild ${_csc_PROJECT_PATH} + /p:Configuration=${_csc_DEBUG_CONFIGURATION} + ${_csc_OPTIONS} + ${_csc_OPTIONS_DEBUG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) + endif() endfunction() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index d40550f06..4bcf3d2c9 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -199,29 +199,33 @@ function(vcpkg_configure_cmake) ) endif() - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} - -G ${GENERATOR} - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + endif() - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} - -G ${GENERATOR} - -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Debug + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endif() set(_VCPKG_CMAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 143bb74de..9b87261d5 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -42,31 +42,35 @@ function(vcpkg_configure_meson) set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") # configure release - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}") - set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}") - set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}") - set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_RELEASE_CPPFLAGS}") - vcpkg_execute_required_process( - COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - - # configure debug - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}") - set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}") - set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}") - set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_DEBUG_CPPFLAGS}") - vcpkg_execute_required_process( - COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_RELEASE_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_RELEASE_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_RELEASE_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_RELEASE_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_RELEASE} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # configure debug + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(ENV{CFLAGS} "${MESON_COMMON_CFLAGS} ${MESON_DEBUG_CFLAGS}") + set(ENV{CXXFLAGS} "${MESON_COMMON_CXXFLAGS} ${MESON_DEBUG_CXXFLAGS}") + set(ENV{LDFLAGS} "${MESON_COMMON_LDFLAGS} ${MESON_DEBUG_LDFLAGS}") + set(ENV{CPPFLAGS} "${MESON_COMMON_CPPFLAGS} ${MESON_DEBUG_CPPFLAGS}") + vcpkg_execute_required_process( + COMMAND ${MESON} ${_vcm_OPTIONS} ${_vcm_OPTIONS_DEBUG} ${_vcm_SOURCE_PATH} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endif() endfunction() diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 5bf1b2cdb..f86ad0661 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -27,29 +27,33 @@ function(vcpkg_fixup_cmake_targets) set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) - if(NOT EXISTS ${DEBUG_CONFIG}) - message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") - endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS ${DEBUG_CONFIG}) + message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") + endif() - file(MAKE_DIRECTORY ${DEBUG_SHARE}) - file(GLOB FILES ${DEBUG_CONFIG}/*) - file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) - file(REMOVE_RECURSE ${DEBUG_CONFIG}) + file(MAKE_DIRECTORY ${DEBUG_SHARE}) + file(GLOB FILES ${DEBUG_CONFIG}/*) + file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + endif() file(GLOB FILES ${RELEASE_CONFIG}/*) file(COPY ${FILES} DESTINATION ${RELEASE_SHARE}) file(REMOVE_RECURSE ${RELEASE_CONFIG}) - get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) - string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) - if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") - file(REMOVE_RECURSE ${DEBUG_CONFIG}) - else() - get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) - get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG} NAME) string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") - file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) + file(REMOVE_RECURSE ${DEBUG_CONFIG}) + else() + get_filename_component(DEBUG_CONFIG_PARENT_DIR ${DEBUG_CONFIG} DIRECTORY) + get_filename_component(DEBUG_CONFIG_DIR_NAME ${DEBUG_CONFIG_PARENT_DIR} NAME) + string(TOLOWER "${DEBUG_CONFIG_DIR_NAME}" DEBUG_CONFIG_DIR_NAME) + if(DEBUG_CONFIG_DIR_NAME STREQUAL "cmake") + file(REMOVE_RECURSE ${DEBUG_CONFIG_PARENT_DIR}) + endif() endif() endif() @@ -67,8 +71,10 @@ function(vcpkg_fixup_cmake_targets) endif() endif() - if(NOT EXISTS ${DEBUG_SHARE}) - message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS ${DEBUG_SHARE}) + message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") + endif() endif() file(GLOB UNUSED_FILES @@ -94,23 +100,25 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${RELEASE_TARGET} "${_contents}") endforeach() - file(GLOB DEBUG_TARGETS - "${DEBUG_SHARE}/*[Tt]argets-debug.cmake" - "${DEBUG_SHARE}/*[Cc]onfig-debug.cmake" - "${DEBUG_SHARE}/*[Ee]xports-debug.cmake" - ) - foreach(DEBUG_TARGET ${DEBUG_TARGETS}) - get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) - - file(READ ${DEBUG_TARGET} _contents) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") - string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") - string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") - string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}") - - file(REMOVE ${DEBUG_TARGET}) - endforeach() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB DEBUG_TARGETS + "${DEBUG_SHARE}/*[Tt]argets-debug.cmake" + "${DEBUG_SHARE}/*[Cc]onfig-debug.cmake" + "${DEBUG_SHARE}/*[Ee]xports-debug.cmake" + ) + foreach(DEBUG_TARGET ${DEBUG_TARGETS}) + get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) + + file(READ ${DEBUG_TARGET} _contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") + string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") + string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") + file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}") + + file(REMOVE ${DEBUG_TARGET}) + endforeach() + endif() file(GLOB MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") foreach(MAIN_TARGET ${MAIN_TARGETS}) diff --git a/scripts/get_triplet_environment.cmake b/scripts/get_triplet_environment.cmake index d498edf4a..bc79b16ce 100644 --- a/scripts/get_triplet_environment.cmake +++ b/scripts/get_triplet_environment.cmake @@ -8,3 +8,4 @@ message("VCPKG_CMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") 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}") -- cgit v1.2.3 From 14cbe496bcc136aac590f10d79848ec224088e85 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 25 Nov 2017 15:53:32 -0800 Subject: [vcpkg] Allow compilation inside WSL --- scripts/buildsystems/vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4d82c43b7..8edc2830c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -42,6 +42,8 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) else() message(FATAL_ERROR "Unable to determine target architecture.") endif() @@ -50,6 +52,8 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(_VCPKG_TARGET_TRIPLET_PLAT linux) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() @@ -93,7 +97,7 @@ list(APPEND CMAKE_LIBRARY_PATH set(Boost_COMPILER "-vc140") -if (NOT DEFINED CMAKE_SYSTEM_VERSION) +if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) # This is used as an implicit parameter for vcpkg_get_windows_sdk set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) @@ -134,7 +138,7 @@ function(add_executable name) list(FIND ARGV "IMPORTED" IMPORTED_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - if(VCPKG_APPLOCAL_DEPS) + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -- cgit v1.2.3 From 8883e40aaadbba91610342fda42d304a4cad0e68 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 26 Nov 2017 01:31:58 -0800 Subject: vcpkgCreateDirectory->vcpkgCreateDirectoryIfNotExists --- scripts/VcpkgPowershellUtils.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 0b1a35262..d32c3ae6b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,7 +3,7 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } -function vcpkgCreateDirectory([Parameter(Mandatory=$true)][string]$dirPath) +function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$dirPath) { if (!(Test-Path $dirPath)) { @@ -102,7 +102,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $downloadDir = split-path -parent $downloadPath - vcpkgCreateDirectory $downloadDir + vcpkgCreateDirectoryIfNotExists $downloadDir $downloadPartPath = "$downloadPath.part" vcpkgRemoveFile $downloadPartPath @@ -144,12 +144,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$destinationDir) { $parentPath = split-path -parent $destinationDir - vcpkgCreateDirectory $parentPath + vcpkgCreateDirectoryIfNotExists $parentPath $baseName = (Get-ChildItem $file).BaseName $destinationPartial = "$destinationDir\$baseName-partially_extracted" vcpkgRemoveDirectory $destinationPartial - vcpkgCreateDirectory $destinationPartial + vcpkgCreateDirectoryIfNotExists $destinationPartial if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { -- cgit v1.2.3 From 92872439b9e76ec881edae187d5fb137f02ce39b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 26 Nov 2017 01:32:09 -0800 Subject: [fetchDependency[ Make parameter mandatory --- scripts/fetchDependency.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 596845acb..6e022928f 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -1,6 +1,6 @@ [CmdletBinding()] param( - [string]$Dependency + [Parameter(Mandatory=$true)][string]$Dependency ) $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -- cgit v1.2.3 From e009618ba0850ef54e837e8fb76910245d99b456 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sun, 26 Nov 2017 14:18:35 +0300 Subject: [cmake] update to 3.10.0 (#2236) --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6e022928f..744439bb7 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -20,12 +20,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.9.5" - $downloadVersion = "3.9.5" - $url = "https://cmake.org/files/v3.9/cmake-3.9.5-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.9.5-win32-x86.zip" - $expectedDownloadedFileHash = "dd3e183254c12f7c338d3edfa642f1ac84a763b8b9a2feabb4ad5fccece5dff9" - $executableFromDownload = "$downloadsDir\cmake-3.9.5-win32-x86\bin\cmake.exe" + $requiredVersion = "3.10.0" + $downloadVersion = "3.10.0" + $url = "https://cmake.org/files/v3.10/cmake-3.10.0-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.10.0-win32-x86.zip" + $expectedDownloadedFileHash = "dce666e897f95a88d3eed6cddd1faa3f44179d519b33ca6065b385bbc7072419" + $executableFromDownload = "$downloadsDir\cmake-3.10.0-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "nuget") -- cgit v1.2.3 From c4c079f86eac8215040173d6707900d8983ea7fc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Nov 2017 00:25:29 -0800 Subject: [VcpkgPowershellUtils] Minor tweaks --- scripts/VcpkgPowershellUtils.ps1 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d32c3ae6b..d431c3b45 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -11,6 +11,20 @@ function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$di } } +function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$path) +{ + $parentDir = split-path -parent $path + if ([string]::IsNullOrEmpty($parentDir)) + { + return + } + + if (!(Test-Path $dirPath)) + { + New-Item -ItemType Directory -Path $parentDir | Out-Null + } +} + function vcpkgRemoveDirectory([Parameter(Mandatory=$true)][string]$dirPath) { if (Test-Path $dirPath) @@ -101,8 +115,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, return } - $downloadDir = split-path -parent $downloadPath - vcpkgCreateDirectoryIfNotExists $downloadDir + vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" vcpkgRemoveFile $downloadPartPath @@ -143,10 +156,10 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$destinationDir) { - $parentPath = split-path -parent $destinationDir - vcpkgCreateDirectoryIfNotExists $parentPath + vcpkgCreateParentDirectoryIfNotExists $destinationDir $baseName = (Get-ChildItem $file).BaseName - $destinationPartial = "$destinationDir\$baseName-partially_extracted" + $destination = "$destinationDir\$baseName" + $destinationPartial = "$destination-partially_extracted" vcpkgRemoveDirectory $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial @@ -179,10 +192,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, { Move-Item -Path "$destinationPartial\*" -Destination $destinationDir vcpkgRemoveDirectory $destinationPartial + return $destination } else { Rename-Item -Path $destinationPartial -NewName $baseName + return $destination } } -- cgit v1.2.3 From 2c914ff05af3b2209eb11b6ba61b43eb46033cb3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Nov 2017 00:42:21 -0800 Subject: Rework vcpkgExtractFile (powershell) --- scripts/VcpkgPowershellUtils.ps1 | 12 +++++------- scripts/fetchDependency.ps1 | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d431c3b45..0e53ff620 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -19,7 +19,7 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri return } - if (!(Test-Path $dirPath)) + if (!(Test-Path $parentDir)) { New-Item -ItemType Directory -Path $parentDir | Out-Null } @@ -157,9 +157,7 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$destinationDir) { vcpkgCreateParentDirectoryIfNotExists $destinationDir - $baseName = (Get-ChildItem $file).BaseName - $destination = "$destinationDir\$baseName" - $destinationPartial = "$destination-partially_extracted" + $destinationPartial = "$destinationDir-partially_extracted" vcpkgRemoveDirectory $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial @@ -192,12 +190,12 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, { Move-Item -Path "$destinationPartial\*" -Destination $destinationDir vcpkgRemoveDirectory $destinationPartial - return $destination + return $destinationDir } else { - Rename-Item -Path $destinationPartial -NewName $baseName - return $destination + Move-Item -Path $destinationPartial -Destination $destinationDir + return $destinationDir } } diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 744439bb7..830ec7064 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -88,7 +88,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) { - vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir + $extractFolderName = (Get-ChildItem $downloadPath).BaseName + vcpkgExtractFile -File $downloadPath -DestinationDir "$downloadsDir\$extractFolderName" } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) -- cgit v1.2.3 From b7c9ef55531cba1c014650dbc5ff33fa1b977b40 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 27 Nov 2017 00:45:00 -0800 Subject: Don't return $destinationDir --- scripts/VcpkgPowershellUtils.ps1 | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 0e53ff620..28e818437 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -190,12 +190,10 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, { Move-Item -Path "$destinationPartial\*" -Destination $destinationDir vcpkgRemoveDirectory $destinationPartial - return $destinationDir } else { Move-Item -Path $destinationPartial -Destination $destinationDir - return $destinationDir } } -- cgit v1.2.3 From b4668e664a4db7b8bc9e9c4c202312e0fb7a8ff9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 28 Nov 2017 13:17:10 -0800 Subject: [vcpkg] Only default target triplet to windows if on windows --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8edc2830c..24f6d855e 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -54,7 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "Wind set(_VCPKG_TARGET_TRIPLET_PLAT uwp) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -else() +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() -- cgit v1.2.3 From d38d4a75408e0e9d0820187b16da2e06ce0ee316 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 29 Nov 2017 23:45:47 -0800 Subject: [vcpkg] Add --x-xunit internal command to print installation results in a VSTS friendly format. --- scripts/internalCI.ps1 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 16ce4fc7a..37f4f35a4 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -1,5 +1,7 @@ $ErrorActionPreference = "Stop" +rm TEST-internal-ci.xml -errorAction SilentlyContinue + New-Item -type directory downloads -errorAction SilentlyContinue | Out-Null ./scripts/bootstrap.ps1 if (-not $?) { throw $? } @@ -7,21 +9,14 @@ if (-not $?) { throw $? } # Clear out any intermediate files from the previous build if (Test-Path buildtrees) { - Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" -and $_.Extension -ne ".log"} | Remove-Item -Recurse -Force + Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" } | Remove-Item -Recurse -Force } # Purge any outdated packages ./vcpkg remove --outdated --recurse if (-not $?) { throw $? } -./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp -if (-not $?) { throw $? } - -./vcpkg.exe install bond cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static +./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp ` +bond cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static ` +opencv:x86-uwp boost:x86-uwp --keep-going "--x-xunit=TEST-internal-ci.xml" if (-not $?) { throw $? } - -./vcpkg.exe install opencv:x86-uwp boost:x86-uwp -if (-not $?) { throw $? } - -# ./vcpkg.exe install folly:x64-windows -# if (-not $?) { throw $? } -- cgit v1.2.3 From fdf7c65aa4ea53e580a85c9b984109c4f4446da5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 30 Nov 2017 16:43:41 -0800 Subject: Exit early if no VS is found --- scripts/bootstrap.ps1 | 2 +- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index ca7b1a0ce..3f40a2ead 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -46,7 +46,7 @@ try & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj if ($LASTEXITCODE -ne 0) { - Write-Error "Building vcpkg.exe failed. Please ensure you have installed the Desktop C++ workload and the Windows SDK for Desktop C++." + Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." return } diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index e58b58c04..46ba767b9 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -8,6 +8,11 @@ $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 +if ($VisualStudioInstallationInstances -eq $null) +{ + throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." +} + Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))" foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances) { -- cgit v1.2.3 From d26a6b067c24e324b111849c320bdc4cf681e713 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 26 Nov 2017 02:51:31 -0800 Subject: Add `vcpkg integrate powershell` for tab completion --- scripts/addPoshVcpkgToPowershellProfile.ps1 | 55 +++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 scripts/addPoshVcpkgToPowershellProfile.ps1 (limited to 'scripts') diff --git a/scripts/addPoshVcpkgToPowershellProfile.ps1 b/scripts/addPoshVcpkgToPowershellProfile.ps1 new file mode 100644 index 000000000..92a7573e4 --- /dev/null +++ b/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -0,0 +1,55 @@ +[CmdletBinding()] +param() + +function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string]$path) +{ + if (!(Test-Path $path)) + { + return $false + } + + $fileContents = Get-Content $path + return $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' +} + +$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + +$profileEntry = "Import-Module '$scriptsDir\posh-vcpkg'" +$profilePath = $PROFILE # Implicit powershell variable +if (!(Test-Path $profilePath)) +{ + $profileDir = Split-Path $profilePath -Parent + vcpkgCreateDirectoryIfNotExists $profileDir +} + +Write-Host "`nAdding the following line to ${profilePath}:" +Write-Host " $profileEntry" + +# @() Needed to force Array in PowerShell 2.0 +[Array]$existingImports = @(findExistingImportModuleDirectives $profilePath) +if ($existingImports.Count -gt 0) +{ + $existingImportsOut = $existingImports -join "`n " + Write-Host "`nposh-vcpkg is already imported to your PowerShell profile. The following entries were found:" + Write-Host " $existingImportsOut" + Write-Host "`nPlease make sure you have started a new Powershell window for the changes to take effect." + return +} + +# Posh-git does the following check, so we should too. +# https://github.com/dahlbyk/posh-git/blob/master/src/Utils.ps1 +# If the profile script exists and is signed, then we should not modify it +if (Test-Path $profilePath) +{ + $sig = Get-AuthenticodeSignature $profilePath + if ($null -ne $sig.SignerCertificate) + { + Write-Warning "Skipping add of posh-vcpkg import to profile; '$profilePath' appears to be signed." + Write-Warning "Please manually add the line '$profileEntry' to your profile and resign it." + return + } +} + +Add-Content $profilePath -Value "`n$profileEntry" -Encoding UTF8 +Write-Host "`nSuccessfully added posh-vcpkg to your PowerShell profile. Please start a new Powershell window for the changes to take effect." -- cgit v1.2.3 From a4f8515c9e6af66bbdcf704c75e5284daa240040 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 4 Dec 2017 17:37:08 -0800 Subject: [vcpkg-msbuild-integration] Address #2299 by using full path to powershell. --- scripts/buildsystems/msbuild/vcpkg.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index ad1dde89b..d6fbcf179 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -67,11 +67,11 @@ File="$(TLogLocation)$(ProjectName).write.1u.tlog" Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/> -- cgit v1.2.3 From e7cbb50f3dd323380928f4cb4e5b9bc0945abac8 Mon Sep 17 00:00:00 2001 From: Ilya Finkelshteyn Date: Tue, 5 Dec 2017 14:31:58 -0800 Subject: Fix path to powershell.exe https://github.com/Microsoft/vcpkg/issues/2299 --- scripts/buildsystems/msbuild/vcpkg.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index d6fbcf179..092e013b5 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -67,11 +67,11 @@ File="$(TLogLocation)$(ProjectName).write.1u.tlog" Lines="^$(TargetPath);$([System.IO.Path]::Combine($(ProjectDir),$(IntDir)))vcpkg.applocal.log" Encoding="Unicode"/> -- cgit v1.2.3 From 1f3013bea303736d216361a47e2f323577ab9c46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 8 Dec 2017 15:16:35 -0800 Subject: Improve vcpkgExtractFile. Also merge vcpkgRemoveDirectory/File --- scripts/VcpkgPowershellUtils.ps1 | 41 ++++++++++++++++++---------------------- scripts/fetchDependency.ps1 | 4 ++-- 2 files changed, 20 insertions(+), 25 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 28e818437..45f52b225 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -25,7 +25,7 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri } } -function vcpkgRemoveDirectory([Parameter(Mandatory=$true)][string]$dirPath) +function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$dirPath) { if (Test-Path $dirPath) { @@ -33,14 +33,6 @@ function vcpkgRemoveDirectory([Parameter(Mandatory=$true)][string]$dirPath) } } -function vcpkgRemoveFile([Parameter(Mandatory=$true)][string]$filePath) -{ - if (Test-Path $filePath) - { - Remove-Item $filePath -Force - } -} - function vcpkgHasCommand([Parameter(Mandatory=$true)][string]$commandName) { return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) @@ -118,7 +110,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" - vcpkgRemoveFile $downloadPartPath + vcpkgRemoveItem $downloadPartPath $wc = New-Object System.Net.WebClient $proxyAuth = !$wc.Proxy.IsBypassed($url) @@ -144,7 +136,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, catch [System.Exception] { # If BITS fails for any reason, delete any potentially partially downloaded files and continue - vcpkgRemoveFile $downloadPartPath + vcpkgRemoveItem $downloadPartPath } } @@ -154,14 +146,21 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, - [Parameter(Mandatory=$true)][string]$destinationDir) + [Parameter(Mandatory=$true)][string]$destinationDir, + [Parameter(Mandatory=$true)][string]$outFilename) { - vcpkgCreateParentDirectoryIfNotExists $destinationDir - $destinationPartial = "$destinationDir-partially_extracted" + vcpkgCreateDirectoryIfNotExists $destinationDir + $output = "$destinationDir/$outFilename" + vcpkgRemoveItem $output + $destinationPartial = "$destinationDir/partially-extracted" - vcpkgRemoveDirectory $destinationPartial + vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial + $shell = new-object -com shell.application + $zip = $shell.NameSpace($file) + $itemCount = $zip.Items().Count + if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") @@ -175,8 +174,6 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, else { Write-Verbose("Extracting via shell") - $shell = new-object -com shell.application - $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { # Piping to Out-Null is used to block until finished @@ -184,16 +181,14 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, } } - $hasASingleItem = (Get-ChildItem $destinationPartial | Measure-Object).Count -eq 1; - - if ($hasASingleItem) + if ($itemCount -eq 1) { - Move-Item -Path "$destinationPartial\*" -Destination $destinationDir - vcpkgRemoveDirectory $destinationPartial + Move-Item -Path "$destinationPartial\*" -Destination $output + vcpkgRemoveItem $destinationPartial } else { - Move-Item -Path $destinationPartial -Destination $destinationDir + Move-Item -Path $destinationPartial -Destination $output } } diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 830ec7064..f62fe450c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -88,8 +88,8 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) { - $extractFolderName = (Get-ChildItem $downloadPath).BaseName - vcpkgExtractFile -File $downloadPath -DestinationDir "$downloadsDir\$extractFolderName" + $outFilename = (Get-ChildItem $downloadPath).BaseName + vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) -- cgit v1.2.3 From 3c2b2cc60719b110de889b62dd13af5f1a4b883c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 8 Dec 2017 22:03:03 -0800 Subject: [vcpkg-cmake-toolchain] Use list(APPEND) instead of set(). Fixes #2336. Fix MPI issue introduced in cmake 3.10. Fixes #2317. Add _VCPKG_ROOT_DIR to persisted variables to reduce disk access during cmake reconfigure. --- scripts/buildsystems/vcpkg.cmake | 50 ++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 24f6d855e..cdef610c1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,7 @@ # Mark variables as used so cmake doesn't complain about them mark_as_advanced(CMAKE_TOOLCHAIN_FILE) +# This is a backport of CMAKE_TRY_COMPILE_PLATFORM_VARIABLES to cmake 3.0 get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) if( _CMAKE_IN_TRY_COMPILE ) include( "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg.config.cmake" OPTIONAL ) @@ -61,17 +62,19 @@ endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") set(_VCPKG_TOOLCHAIN_DIR ${CMAKE_CURRENT_LIST_DIR}) -# Detect .vcpkg-root to figure VCPKG_ROOT_DIR -set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) -while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") - get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) - if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive - message(FATAL_ERROR "Could not find .vcpkg-root") - else() - SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) - endif() -endwhile() -set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) +if(NOT DEFINED _VCPKG_ROOT_DIR) + # Detect .vcpkg-root to figure VCPKG_ROOT_DIR + set(_VCPKG_ROOT_DIR_CANDIDATE ${CMAKE_CURRENT_LIST_DIR}) + while(IS_DIRECTORY ${_VCPKG_ROOT_DIR_CANDIDATE} AND NOT EXISTS "${_VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root") + get_filename_component(_VCPKG_ROOT_DIR_TEMP ${_VCPKG_ROOT_DIR_CANDIDATE} DIRECTORY) + if (_VCPKG_ROOT_DIR_TEMP STREQUAL _VCPKG_ROOT_DIR_CANDIDATE) # If unchanged, we have reached the root of the drive + message(FATAL_ERROR "Could not find .vcpkg-root") + else() + SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) + endif() + endwhile() + set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE STRING "Vcpkg root directory") +endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) @@ -95,8 +98,6 @@ list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -set(Boost_COMPILER "-vc140") - if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) # This is used as an implicit parameter for vcpkg_get_windows_sdk @@ -124,11 +125,11 @@ set(CMAKE_SYSTEM_IGNORE_PATH "C:/OpenSSL-Win64/lib/VC/static" ) -set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) +list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) - set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + list(APPEND CMAKE_PROGRAM_PATH ${_VCPKG_TOOLS_DIR}) endif() endforeach() @@ -167,6 +168,7 @@ macro(find_package name) unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) + set(Boost_COMPILER "-vc140") _find_package(${ARGV}) elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) @@ -188,6 +190,17 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + elseif("${name}" STREQUAL "MPI") + if(MPI_C_LIB_NAMES) + set(MPI_C_WORKS TRUE) + set(MPI_C_WRAPPER_FOUND TRUE) + endif() + if(MPI_CXX_LIB_NAMES) + set(MPI_CXX_WORKS TRUE) + set(MPI_CXX_WRAPPER_FOUND TRUE) + set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE) + endif() + _find_package(${ARGV}) else() _find_package(${ARGV}) endif() @@ -202,8 +215,11 @@ set(_UNUSED ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP}) if(NOT _CMAKE_IN_TRY_COMPILE) file(TO_CMAKE_PATH "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" _chainload_file) + file(TO_CMAKE_PATH "${_VCPKG_ROOT_DIR}" _root_dir) file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/vcpkg.config.cmake" "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")\n" "set(VCPKG_APPLOCAL_DEPS \"${VCPKG_APPLOCAL_DEPS}\" CACHE STRING \"\")\n" - "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n") -endif() \ No newline at end of file + "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${_chainload_file}\" CACHE STRING \"\")\n" + "set(_VCPKG_ROOT_DIR \"${_root_dir}\" CACHE STRING \"\")\n" + ) +endif() -- cgit v1.2.3 From 19860a093370c5a57bd8c622e5e47177193c7c8e Mon Sep 17 00:00:00 2001 From: cDc Date: Sat, 9 Dec 2017 10:24:19 +0200 Subject: [tinyexif] add TinyEXIF library (#2221) --- scripts/buildsystems/vcpkg.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index cdef610c1..22dc5d6b1 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,6 +190,12 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + elseif("${name}" STREQUAL "tinyxml2") + _find_package(${ARGV}) + if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) + add_library(tinyxml2 INTERFACE IMPORTED) + set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") + endif() elseif("${name}" STREQUAL "MPI") if(MPI_C_LIB_NAMES) set(MPI_C_WORKS TRUE) -- cgit v1.2.3 From 4567fa570916b0398ac0a65645e2074a4c8f0fd9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 9 Dec 2017 17:25:12 -0800 Subject: [vcpkg-cmake-toolchain] Mark _VCPKG_ROOT_DIR as INTERNAL --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 22dc5d6b1..71cf4e9b3 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -73,7 +73,7 @@ if(NOT DEFINED _VCPKG_ROOT_DIR) SET(_VCPKG_ROOT_DIR_CANDIDATE ${_VCPKG_ROOT_DIR_TEMP}) endif() endwhile() - set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE STRING "Vcpkg root directory") + set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE} CACHE INTERNAL "Vcpkg root directory") endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) -- cgit v1.2.3 From 1656cf7fa7f8fe7fa3d803c86fbd9ae8a649b719 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 12 Dec 2017 17:52:57 -0800 Subject: [powershell] Use \ instead of / for paths. Resolves #2358. Resolves #2361 --- scripts/VcpkgPowershellUtils.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 45f52b225..e394e540e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -150,9 +150,9 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, [Parameter(Mandatory=$true)][string]$outFilename) { vcpkgCreateDirectoryIfNotExists $destinationDir - $output = "$destinationDir/$outFilename" + $output = "$destinationDir\$outFilename" vcpkgRemoveItem $output - $destinationPartial = "$destinationDir/partially-extracted" + $destinationPartial = "$destinationDir\partially-extracted" vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial -- cgit v1.2.3 From 7e1a737ba4ef1fb0377b75c4a64973f821a561d0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 19 Dec 2017 16:11:20 -0800 Subject: [vcpkg-integrate-powershell] Fix $false bug. Fixes #2397. --- scripts/addPoshVcpkgToPowershellProfile.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/addPoshVcpkgToPowershellProfile.ps1 b/scripts/addPoshVcpkgToPowershellProfile.ps1 index 92a7573e4..7a12e7d34 100644 --- a/scripts/addPoshVcpkgToPowershellProfile.ps1 +++ b/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -5,11 +5,12 @@ function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string] { if (!(Test-Path $path)) { - return $false + return } $fileContents = Get-Content $path - return $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' + $fileContents -match 'Import-Module.+?(?=posh-vcpkg)' + return } $scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition -- cgit v1.2.3 From 6cb6a61aaf5ef2c143f974e9f731778bcd3f5cbe Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Wed, 20 Dec 2017 09:18:13 +0900 Subject: Fix find Boost when can not be found Boost that installed with Vcpkg (#2395) * Fix find Boost when can not be found Boost that installed with Vcpkg Fix find Boost when can not be found Boost that installed with Vcpkg. Re-find package Boost uisng user specified options. * Fix regex of generators Fix regex of generators. Add ending position. * Fix Save and Resore Boost_COMPILER * [vcpkg-cmake-integration] Expand saved boost variables --- scripts/buildsystems/vcpkg.cmake | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 71cf4e9b3..b8d3fbdbb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -31,9 +31,9 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017 ARM$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) - elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017") + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) else() find_program(_VCPKG_CL cl) @@ -165,11 +165,22 @@ endfunction() macro(find_package name) if("${name}" STREQUAL "Boost") + set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS}) + set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}) + set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME}) + set(_Boost_COMPILER ${Boost_COMPILER}) unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) + if(NOT Boost_FOUND) + set(Boost_USE_STATIC_LIBS ${_Boost_USE_STATIC_LIBS}) + set(Boost_USE_MULTITHREADED ${_Boost_USE_MULTITHREADED}) + set(Boost_USE_STATIC_RUNTIME ${_Boost_USE_STATIC_RUNTIME}) + set(Boost_COMPILER ${_Boost_COMPILER}) + _find_package(${ARGV}) + endif() elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3 From 5e5506e68a9657d18bc4fb4380b5b4dfc849c019 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 21 Dec 2017 03:47:02 -0800 Subject: [vcpkg-download-distfile] Add input sanitization --- scripts/cmake/vcpkg_download_distfile.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index b22d82a16..24503338a 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -39,6 +39,16 @@ function(vcpkg_download_distfile VAR) set(multipleValuesArgs URLS) cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + if(NOT DEFINED vcpkg_download_distfile_URLS) + message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.") + endif() + if(NOT DEFINED vcpkg_download_distfile_FILENAME) + message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") + endif() + if(NOT DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.") + endif() + set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) set(download_file_path_part "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}") -- cgit v1.2.3 From a24ccdfc01aba83b833af528b8f1a6ec6db020a4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Oct 2017 17:19:11 -0700 Subject: [vcpkg-build-cmake] Build at IDLE priority. Try to detect out-of-memory issues in the linker, and restart the build once. --- scripts/cmake/vcpkg_build_cmake.cmake | 99 +++++++++++++++++----- scripts/cmake/vcpkg_execute_required_process.cmake | 28 ++++-- 2 files changed, 99 insertions(+), 28 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 0b4bbd211..548e6cf46 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -33,10 +33,13 @@ function(vcpkg_build_cmake) set(_bc_LOGFILE_ROOT "build") endif() + set(PARALLEL_ARG) + set(NO_PARALLEL_ARG) + if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja") set(BUILD_ARGS "-v") # verbose output if (_bc_DISABLE_PARALLEL) - list(APPEND BUILD_ARGS "-j1") + set(NO_PARALLEL_ARG "-j1") endif() elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio") set(BUILD_ARGS @@ -44,7 +47,7 @@ function(vcpkg_build_cmake) "/p:UseIntelMKL=No" ) if (NOT _bc_DISABLE_PARALLEL) - list(APPEND BUILD_ARGS "/m") + set(PARALLEL_ARG "/m") endif() elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake") # No options are currently added for nmake builds @@ -58,23 +61,79 @@ function(vcpkg_build_cmake) set(TARGET_PARAM) endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - message(STATUS "Build ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-rel - ) - message(STATUS "Build ${TARGET_TRIPLET}-rel done") - endif() + foreach(BUILDTYPE "release" "debug") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) + if(BUILDTYPE STREQUAL "debug") + set(SHORT_BUILDTYPE "dbg") + else() + set(SHORT_BUILDTYPE "rel") + endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - message(STATUS "Build ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} --build . --config Debug ${TARGET_PARAM} -- ${BUILD_ARGS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME ${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Build ${TARGET_TRIPLET}-dbg done") - endif() + message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") + set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") + set(LOGS) + + if(BUILDTYPE STREQUAL "release") + set(CONFIG "Release") + else() + set(CONFIG "Debug") + endif() + + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} + OUTPUT_FILE "${LOGPREFIX}-out.log" + ERROR_FILE "${LOGPREFIX}-err.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + if(error_code) + file(READ "${LOGPREFIX}-out.log" out_contents) + file(READ "${LOGPREFIX}-err.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err.log") + endif() + + if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ") + # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + OUTPUT_FILE "${LOGPREFIX}-out-1.log" + ERROR_FILE "${LOGPREFIX}-err-1.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-1.log" out_contents) + file(READ "${LOGPREFIX}-err-1.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-1.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-1.log") + endif() + endif() + endif() + + if(error_code) + set(STRINGIFIED_LOGS) + foreach(LOG ${LOGS}) + file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) + list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") + endforeach() + set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG}) + set(_eb_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + message(FATAL_ERROR + " Command failed: ${_eb_COMMAND}\n" + " Working Directory: ${_eb_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + ${STRINGIFIED_LOGS}) + endif() + endif() + message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} done") + endif() + endforeach() endfunction() diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 7c4907016..5b8922c14 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -30,22 +30,34 @@ ## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) function(vcpkg_execute_required_process) cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN}) - #debug_message("vcpkg_execute_required_process(${vcpkg_execute_required_process_COMMAND})") + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log") execute_process( COMMAND ${vcpkg_execute_required_process_COMMAND} - OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log - ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} RESULT_VARIABLE error_code WORKING_DIRECTORY ${vcpkg_execute_required_process_WORKING_DIRECTORY}) - #debug_message("error_code=${error_code}") if(error_code) - file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log" NATIVE_LOG_OUT) - file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-err.log" NATIVE_LOG_ERR) + set(LOGS) + file(READ "${LOG_OUT}" out_contents) + file(READ "${LOG_ERR}" err_contents) + if(out_contents) + list(APPEND LOGS "${LOG_OUT}") + endif() + if(err_contents) + list(APPEND LOGS "${LOG_ERR}") + endif() + set(STRINGIFIED_LOGS) + foreach(LOG ${LOGS}) + file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) + list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") + endforeach() message(FATAL_ERROR " Command failed: ${vcpkg_execute_required_process_COMMAND}\n" " Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n" " See logs for more information:\n" - " ${NATIVE_LOG_OUT}\n" - " ${NATIVE_LOG_ERR}\n") + ${STRINGIFIED_LOGS} + ) endif() endfunction() -- cgit v1.2.3 From be5e529bb3e8483e5675488232d936e7d7d29ceb Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 3 Jan 2018 10:57:46 +0100 Subject: Update cmake to 3.10.1 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index f62fe450c..168c2359e 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -20,12 +20,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.10.0" - $downloadVersion = "3.10.0" - $url = "https://cmake.org/files/v3.10/cmake-3.10.0-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.10.0-win32-x86.zip" - $expectedDownloadedFileHash = "dce666e897f95a88d3eed6cddd1faa3f44179d519b33ca6065b385bbc7072419" - $executableFromDownload = "$downloadsDir\cmake-3.10.0-win32-x86\bin\cmake.exe" + $requiredVersion = "3.10.1" + $downloadVersion = "3.10.1" + $url = "https://cmake.org/files/v3.10/cmake-3.10.1-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.10.1-win32-x86.zip" + $expectedDownloadedFileHash = "6fe010cce1201d884cd7a9535db8a1f16d98b8965341251fde8f1c5069ee58c0" + $executableFromDownload = "$downloadsDir\cmake-3.10.1-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "nuget") -- cgit v1.2.3 From 43aec468a14993044b9d6fd89d124c1371edba64 Mon Sep 17 00:00:00 2001 From: Albert Ziegenhagel Date: Wed, 3 Jan 2018 10:58:59 +0100 Subject: Remove workaround for a bug in FindMPI.cmake that was introduced in cmake 3.10.0 and fixed in 3.10.1 --- scripts/buildsystems/vcpkg.cmake | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b8d3fbdbb..7ebe695fb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -207,17 +207,6 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "MPI") - if(MPI_C_LIB_NAMES) - set(MPI_C_WORKS TRUE) - set(MPI_C_WRAPPER_FOUND TRUE) - endif() - if(MPI_CXX_LIB_NAMES) - set(MPI_CXX_WORKS TRUE) - set(MPI_CXX_WRAPPER_FOUND TRUE) - set(MPI_CXX_VALIDATE_SKIP_MPICXX TRUE) - endif() - _find_package(${ARGV}) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 7f9ca12c4c66a0e4043c5999b098fe9f721f9d1b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 3 Jan 2018 14:30:30 -0800 Subject: [vcpkg-download-distfile] Fix #2426 --- scripts/cmake/vcpkg_download_distfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 24503338a..2055139f5 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -45,7 +45,7 @@ function(vcpkg_download_distfile VAR) if(NOT DEFINED vcpkg_download_distfile_FILENAME) message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") endif() - if(NOT DEFINED vcpkg_download_distfile_SHA512) + if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK AND NOT DEFINED vcpkg_download_distfile_SHA512) message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.") endif() -- cgit v1.2.3 From a28138eb9ef8d2986227b7cd784be9ffa8492a46 Mon Sep 17 00:00:00 2001 From: Jacek Blaszczynski Date: Thu, 4 Jan 2018 00:19:52 +0100 Subject: Add preliminary support for arm-windows and arm64-windows triplets (#2371) * Add preliminary support for arm-windows and arm64-windows triplets Visual Studio 15.4 shipped with new VC tools targeting arm and arm64 for desktop. This change allows for recognition and usage of new triplets supporting arm and arm64 Windows desktop and server targets. * Remove unnecessary changes * Part 2 * Part 3 * Make detection of Arm64 _VCPKG_TARGET_ARCHITECTURE precise * Enforce usage of Visual Studio CMake generatorfor arm and temporarily arm64 targets * Address code review feedback, clean libjpeg-turbo port.cmake * [libjpeg-turbo][tiff] Reduce changes to existing libraries. * [vcpkg-cmake] Simplify toolchain selection logic and improve comments --- scripts/buildsystems/msbuild/vcpkg.targets | 15 ++++++++++++ scripts/buildsystems/vcpkg.cmake | 5 ++++ scripts/cmake/vcpkg_configure_cmake.cmake | 37 +++++++++++++++--------------- 3 files changed, 38 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 092e013b5..499052e4d 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -24,6 +24,16 @@ x64-windows + + true + arm-windows + + + + true + arm64-windows + + true x64-uwp @@ -34,6 +44,11 @@ arm-uwp + + true + arm64-uwp + + $(Configuration) Debug diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7ebe695fb..f157d3236 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -22,6 +22,8 @@ elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Xx]64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) +elseif(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) else() if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015 Win64$") set(_VCPKG_TARGET_TRIPLET_ARCH x64) @@ -41,6 +43,8 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH x64) elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(_VCPKG_CL MATCHES "arm64/cl.exe$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") @@ -105,6 +109,7 @@ if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "win vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) unset(VCPKG_ROOT_DIR) set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version") + message(STATUS "Found Windows SDK ${WINDOWS_SDK_VERSION}") endif() file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 4bcf3d2c9..6e2ec4ef5 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -57,40 +57,39 @@ function(vcpkg_configure_cmake) set(_csc_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE}) endif() + set(NINJA_CAN_BE_USED ON) + if(_csc_HOST_ARCHITECTURE STREQUAL "x86") + # Prebuilt ninja binaries are only provided for x64 hosts + set(NINJA_CAN_BE_USED OFF) + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + # Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility + set(NINJA_CAN_BE_USED OFF) + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + # Arm64 usage should be allowed once github issue #2375 is resolved + set(NINJA_CAN_BE_USED OFF) + endif() + if(_csc_GENERATOR) set(GENERATOR ${_csc_GENERATOR}) - elseif(_csc_PREFER_NINJA AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT _csc_HOST_ARCHITECTURE STREQUAL "x86") + elseif(_csc_PREFER_NINJA AND NINJA_CAN_BE_USED) + set(GENERATOR "Ninja") + elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) set(GENERATOR "Ninja") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013 Win64") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") set(GENERATOR "Visual Studio 12 2013 ARM") - elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - set(GENERATOR "Ninja") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(GENERATOR "Visual Studio 14 2015") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") - set(GENERATOR "Visual Studio 14 2015 ARM") + elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 Win64") - elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v140") set(GENERATOR "Visual Studio 14 2015 ARM") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(GENERATOR "Visual Studio 15 2017") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(GENERATOR "Visual Studio 15 2017 Win64") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(GENERATOR "Visual Studio 15 2017 ARM") - elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") - set(GENERATOR "Visual Studio 15 2017") - set(ARCH "ARM64") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") set(GENERATOR "Visual Studio 15 2017") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x64" AND VCPKG_PLATFORM_TOOLSET MATCHES "v141") -- cgit v1.2.3 From 0cf5bd657ef401319fa3ef60846189546a5c7a87 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 3 Jan 2018 20:11:35 -0800 Subject: [vcpkg-fixup-cmake-targets] Add TARGET_PATH option --- scripts/cmake/vcpkg_build_cmake.cmake | 12 ++++++------ scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 14 +++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 548e6cf46..66503f4b8 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -38,17 +38,13 @@ function(vcpkg_build_cmake) if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja") set(BUILD_ARGS "-v") # verbose output - if (_bc_DISABLE_PARALLEL) - set(NO_PARALLEL_ARG "-j1") - endif() + set(NO_PARALLEL_ARG "-j1") elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio") set(BUILD_ARGS "/p:VCPkgLocalAppDataDisabled=true" "/p:UseIntelMKL=No" ) - if (NOT _bc_DISABLE_PARALLEL) - set(PARALLEL_ARG "/m") - endif() + set(PARALLEL_ARG "/m") elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake") # No options are currently added for nmake builds else() @@ -61,6 +57,10 @@ function(vcpkg_build_cmake) set(TARGET_PARAM) endif() + if(_bc_DISABLE_PARALLEL) + set(PARALLEL_ARG ${NO_PARALLEL_ARG}) + endif() + foreach(BUILDTYPE "release" "debug") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index f86ad0661..fead64d15 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -14,14 +14,18 @@ # function(vcpkg_fixup_cmake_targets) - cmake_parse_arguments(_vfct "" "CONFIG_PATH" "" ${ARGN}) + cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN}) if(_vfct_UNPARSED_ARGUMENTS) message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") endif() - set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT}) - set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) + if(NOT _vfct_TARGET_PATH) + set(_vfct_TARGET_PATH share/${PORT}) + endif() + + set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH}) + set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}") set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) @@ -114,7 +118,7 @@ function(vcpkg_fixup_cmake_targets) string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}") + file(WRITE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}/${DEBUG_TARGET_NAME} "${_contents}") file(REMOVE ${DEBUG_TARGET}) endforeach() @@ -148,7 +152,7 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${MAIN_CONFIG} "${_contents}") endforeach() - # Remove /debug/share// if it's empty. + # Remove /debug// if it's empty. file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*") if(NOT REMAINING_FILES) file(REMOVE_RECURSE ${DEBUG_SHARE}) -- cgit v1.2.3 From 42c0cfc8705c71c3c9dcc4df4804ab342dc89988 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Sat, 30 Dec 2017 01:21:18 +0300 Subject: [vcpkg] fix --head flag for github-based ports --- scripts/cmake/vcpkg_download_distfile.cmake | 16 ++++++++++++---- scripts/cmake/vcpkg_from_github.cmake | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 2055139f5..2c20cc1b8 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -26,6 +26,9 @@ ## ## If this doesn't match the downloaded version, the build will be terminated with a message describing the mismatch. ## +## ### SKIP_SHA512 +## Skip SHA512 hash check for file. +## ## ## Notes ## The command [`vcpkg_from_github`](vcpkg_from_github.md) should be used instead of this for downloading the main archive for GitHub projects. ## @@ -35,9 +38,10 @@ ## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake) ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) function(vcpkg_download_distfile VAR) + set(options SKIP_SHA512) set(oneValueArgs FILENAME SHA512) set(multipleValuesArgs URLS) - cmake_parse_arguments(vcpkg_download_distfile "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) + cmake_parse_arguments(vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) if(NOT DEFINED vcpkg_download_distfile_URLS) message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.") @@ -45,7 +49,7 @@ function(vcpkg_download_distfile VAR) if(NOT DEFINED vcpkg_download_distfile_FILENAME) message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") endif() - if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK AND NOT DEFINED vcpkg_download_distfile_SHA512) + if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512 AND NOT _VCPKG_INTERNAL_NO_HASH_CHECK AND NOT DEFINED vcpkg_download_distfile_SHA512) message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.") endif() @@ -75,7 +79,9 @@ function(vcpkg_download_distfile VAR) if(EXISTS ${downloaded_file_path}) message(STATUS "Using cached ${downloaded_file_path}") - test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") + if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512) + test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") + endif() else() if(_VCPKG_NO_DOWNLOADS) message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") @@ -103,7 +109,9 @@ function(vcpkg_download_distfile VAR) " Failed to download file.\n" " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") else() - test_hash("downloaded file" "The file may be corrupted.") + if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512) + test_hash("downloaded file" "The file may be corrupted.") + endif() endif() endif() set(${VAR} ${downloaded_file_path} PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index b71ab3838..545be3b4d 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -141,11 +141,13 @@ function(vcpkg_from_github) vcpkg_download_distfile(ARCHIVE_VERSION URLS "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}" FILENAME ${downloaded_file_name}.version + SKIP_SHA512 ) vcpkg_download_distfile(ARCHIVE URLS ${URL} FILENAME ${downloaded_file_name} + SKIP_SHA512 ) set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() -- cgit v1.2.3 From 2b30280c222a6970fa74d05b6f7e106b4776318a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 5 Jan 2018 16:16:08 -0800 Subject: [vcpkg-download-distfile] Regenerate docs and enable SKIP_SHA512 only in unstable (head) mode --- scripts/cmake/vcpkg_download_distfile.cmake | 33 +++++++++++++++++++---------- scripts/cmake/vcpkg_from_github.cmake | 7 +++--- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 2c20cc1b8..7a1c95461 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -2,6 +2,8 @@ ## ## Download and cache a file needed for this port. ## +## This helper should always be used instead of CMake's built-in `file(DOWNLOAD)` command. +## ## ## Usage ## ```cmake ## vcpkg_download_distfile( @@ -29,12 +31,14 @@ ## ### SKIP_SHA512 ## Skip SHA512 hash check for file. ## +## This switch is only valid when building with the `--head` command line flag. +## ## ## Notes -## The command [`vcpkg_from_github`](vcpkg_from_github.md) should be used instead of this for downloading the main archive for GitHub projects. +## The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downloading from GitHub projects. ## ## ## Examples ## -## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake) +## * [apr](https://github.com/Microsoft/vcpkg/blob/master/ports/apr/portfile.cmake) ## * [fontconfig](https://github.com/Microsoft/vcpkg/blob/master/ports/fontconfig/portfile.cmake) ## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake) function(vcpkg_download_distfile VAR) @@ -49,8 +53,14 @@ function(vcpkg_download_distfile VAR) if(NOT DEFINED vcpkg_download_distfile_FILENAME) message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") endif() - if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512 AND NOT _VCPKG_INTERNAL_NO_HASH_CHECK AND NOT DEFINED vcpkg_download_distfile_SHA512) - message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.") + if(vcpkg_download_distfile_SKIP_SHA512 AND NOT VCPKG_USE_HEAD_VERSION) + message(FATAL_ERROR "vcpkg_download_distfile only allows SKIP_SHA512 when building with --head") + endif() + if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") + endif() + if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.") endif() set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) @@ -60,7 +70,12 @@ function(vcpkg_download_distfile VAR) file(MAKE_DIRECTORY "${DOWNLOADS}/temp") function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE) - if (_VCPKG_INTERNAL_NO_HASH_CHECK) + if(_VCPKG_INTERNAL_NO_HASH_CHECK) + # When using the internal hash skip, do not output an explicit message. + return() + endif() + if(vcpkg_download_distfile_SKIP_SHA512) + message(STATUS "Skipping hash check for ${downloaded_file_path}.") return() endif() @@ -79,9 +94,7 @@ function(vcpkg_download_distfile VAR) if(EXISTS ${downloaded_file_path}) message(STATUS "Using cached ${downloaded_file_path}") - if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512) - test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") - endif() + test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") else() if(_VCPKG_NO_DOWNLOADS) message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") @@ -109,9 +122,7 @@ function(vcpkg_download_distfile VAR) " Failed to download file.\n" " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") else() - if(NOT DEFINED vcpkg_download_distfile_SKIP_SHA512) - test_hash("downloaded file" "The file may be corrupted.") - endif() + test_hash("downloaded file" "The file may have been corrupted in transit.") endif() endif() set(${VAR} ${downloaded_file_path} PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 545be3b4d..c6a23cff6 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -137,7 +137,6 @@ function(vcpkg_from_github) endif() # Try to download the file and version information from github. - set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") vcpkg_download_distfile(ARCHIVE_VERSION URLS "https://api.github.com/repos/${ORG_NAME}/${REPO_NAME}/git/refs/heads/${_vdud_HEAD_REF}" FILENAME ${downloaded_file_name}.version @@ -149,7 +148,6 @@ function(vcpkg_from_github) FILENAME ${downloaded_file_name} SKIP_SHA512 ) - set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() vcpkg_extract_source_archive_ex( @@ -164,7 +162,10 @@ function(vcpkg_from_github) string(REGEX REPLACE "\"sha\": \"([a-f0-9]+)\"" "\\1" _version ${x}) # exports VCPKG_HEAD_VERSION to the caller. This will get picked up by ports.cmake after the build. - set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) + # When multiple vcpkg_from_github's are used after each other, only use the version from the first (hopefully the primary one). + if(NOT DEFINED VCPKG_HEAD_VERSION) + set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) + endif() set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) endfunction() -- cgit v1.2.3 From bc70053ab7764d3d59c428c507aa25ccea773458 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Sat, 6 Jan 2018 18:54:59 +0100 Subject: use proper symbol to build correct configuration --- scripts/cmake/vcpkg_build_cmake.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 66503f4b8..8bafee4d4 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -80,7 +80,7 @@ function(vcpkg_build_cmake) endif() execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out.log" ERROR_FILE "${LOGPREFIX}-err.log" RESULT_VARIABLE error_code @@ -99,7 +99,7 @@ function(vcpkg_build_cmake) if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ") # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out-1.log" ERROR_FILE "${LOGPREFIX}-err-1.log" RESULT_VARIABLE error_code @@ -124,7 +124,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 Release ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG}) + set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_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 From 3b3bff1824c09a9c3accc9e737af96e4f89228fd Mon Sep 17 00:00:00 2001 From: Cdec Date: Sun, 14 Jan 2018 12:49:04 +0900 Subject: [vcpkg_download_distfile] Change to refer _VCPKG_INTERNAL_NO_HASH_CHECK in parameter check --- scripts/cmake/vcpkg_download_distfile.cmake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 7a1c95461..28276f47c 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -53,14 +53,16 @@ function(vcpkg_download_distfile VAR) if(NOT DEFINED vcpkg_download_distfile_FILENAME) message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") endif() - if(vcpkg_download_distfile_SKIP_SHA512 AND NOT VCPKG_USE_HEAD_VERSION) - message(FATAL_ERROR "vcpkg_download_distfile only allows SKIP_SHA512 when building with --head") - endif() - if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) - message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") - endif() - if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512) - message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.") + if(NOT _VCPKG_INTERNAL_NO_HASH_CHECK) + if(vcpkg_download_distfile_SKIP_SHA512 AND NOT VCPKG_USE_HEAD_VERSION) + message(FATAL_ERROR "vcpkg_download_distfile only allows SKIP_SHA512 when building with --head") + endif() + if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") + endif() + if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512) + message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.") + endif() endif() set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) -- cgit v1.2.3 From 3390007020921b41e3d4d42ad9b46c671250743a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Jan 2018 17:31:22 -0800 Subject: [powershell] Remove usages of BitsTransfer --- scripts/VcpkgPowershellUtils.ps1 | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index e394e540e..997f603e3 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -94,11 +94,6 @@ function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePat } } -if (vcpkgHasModule -moduleName 'BitsTransfer') -{ - Import-Module BitsTransfer -Verbose:$false -} - function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$downloadPath) { @@ -119,28 +114,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, $wc.Proxy.Credentials = vcpkgGetCredentials } - # Some download (e.g. git from github)fail with Start-BitsTransfer - if (vcpkgHasCommand -commandName 'Start-BitsTransfer') - { - try - { - if ($proxyAuth) - { - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $wc.Proxy.Credentials) - } - Start-BitsTransfer -Source $url -Destination $downloadPartPath -ErrorAction Stop - Move-Item -Path $downloadPartPath -Destination $downloadPath - return - } - catch [System.Exception] - { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - vcpkgRemoveItem $downloadPartPath - } - } - - Write-Verbose("Downloading $Dependency...") $wc.DownloadFile($url, $downloadPartPath) Move-Item -Path $downloadPartPath -Destination $downloadPath } -- cgit v1.2.3 From 81ab439b4884b93f862ebd17da1e65d8d8d9bd70 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Jan 2018 17:33:44 -0800 Subject: [VcpkgPowershelUtils] Inline variable --- scripts/VcpkgPowershellUtils.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 997f603e3..5381523f0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -108,8 +108,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, vcpkgRemoveItem $downloadPartPath $wc = New-Object System.Net.WebClient - $proxyAuth = !$wc.Proxy.IsBypassed($url) - if ($proxyAuth) + if (!$wc.Proxy.IsBypassed($url)) { $wc.Proxy.Credentials = vcpkgGetCredentials } -- cgit v1.2.3 From c7296cf1f21104b15d9cfe931416245768b484e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Jan 2018 17:34:09 -0800 Subject: [FetchDependency] Print out text when downloading/extracting --- scripts/fetchDependency.ps1 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 168c2359e..e4cab124c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -75,7 +75,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } + Write-Host "Downloading $Dependency..." vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $Dependency has completed successfully." $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash @@ -89,7 +91,9 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if (-not (Test-Path $executableFromDownload)) { $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $Dependency..." vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $Dependency has completed successfully." } } elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) -- cgit v1.2.3 From c1ba4eacc34a814ce2f9f0b35bf055750c94f8c2 Mon Sep 17 00:00:00 2001 From: Sean Warren Date: Thu, 18 Jan 2018 20:28:56 +1100 Subject: Generalise vcpkg_fixup_cmake_targets.cmake file to correctly detect dlib debug files (#2574) --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index fead64d15..4bd4d135f 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -91,11 +91,8 @@ function(vcpkg_fixup_cmake_targets) file(REMOVE ${UNUSED_FILES}) endif() - # LLVM uses "LLVMExports-release.cmake" file(GLOB RELEASE_TARGETS - "${RELEASE_SHARE}/*[Tt]argets-release.cmake" - "${RELEASE_SHARE}/*[Cc]onfig-release.cmake" - "${RELEASE_SHARE}/*[Ee]xports-release.cmake" + "${RELEASE_SHARE}/*-release.cmake" ) foreach(RELEASE_TARGET ${RELEASE_TARGETS}) file(READ ${RELEASE_TARGET} _contents) @@ -106,9 +103,7 @@ function(vcpkg_fixup_cmake_targets) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") file(GLOB DEBUG_TARGETS - "${DEBUG_SHARE}/*[Tt]argets-debug.cmake" - "${DEBUG_SHARE}/*[Cc]onfig-debug.cmake" - "${DEBUG_SHARE}/*[Ee]xports-debug.cmake" + "${DEBUG_SHARE}/*-debug.cmake" ) foreach(DEBUG_TARGET ${DEBUG_TARGETS}) get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) -- cgit v1.2.3 From b47b4346f8c5b09cfb9826a083fc2d034a2ea9b4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 07:36:07 -0800 Subject: [vcpkg-build-qmake][vcpkg-configure-qmake] Collapse config-specific versions. --- scripts/cmake/vcpkg_build_qmake.cmake | 76 +++++++++++++++++++---- scripts/cmake/vcpkg_build_qmake_debug.cmake | 30 --------- scripts/cmake/vcpkg_build_qmake_release.cmake | 30 --------- scripts/cmake/vcpkg_common_functions.cmake | 4 -- scripts/cmake/vcpkg_configure_qmake.cmake | 41 +++++++----- scripts/cmake/vcpkg_configure_qmake_debug.cmake | 46 -------------- scripts/cmake/vcpkg_configure_qmake_release.cmake | 46 -------------- 7 files changed, 89 insertions(+), 184 deletions(-) delete mode 100644 scripts/cmake/vcpkg_build_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_build_qmake_release.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_debug.cmake delete mode 100644 scripts/cmake/vcpkg_configure_qmake_release.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 693f7841e..194ab8206 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -1,31 +1,81 @@ #.rst: # .. command:: vcpkg_build_qmake # -# Build a qmake-based project, previously configured using vcpkg_configure_qmake . -# As the CONFIG qmake option is assumed to be "debug_and_release" (the default value on Windows, see [1]), -# both the debug and release libraries are build in the same build tree. +# Build a qmake-based project, previously configured using vcpkg_configure_qmake. # # :: # vcpkg_build_qmake() # -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_build_qmake) + cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS" ${ARGN}) vcpkg_find_acquire_program(JOM) # Make sure that the linker finds the libraries used set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") - message(STATUS "Package ${TARGET_TRIPLET}") - vcpkg_execute_required_process( - COMMAND ${JOM} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME package-${TARGET_TRIPLET} - ) - message(STATUS "Package ${TARGET_TRIPLET} done") + set(DEBUG_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + set(RELEASE_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR) + + list(APPEND _csc_RELEASE_TARGETS ${_csc_TARGETS}) + list(APPEND _csc_DEBUG_TARGETS ${_csc_TARGETS}) + + if(NOT _csc_BUILD_LOGNAME) + set(_csc_BUILD_LOGNAME build) + endif() + + function(run_jom TARGETS LOG_PREFIX LOG_SUFFIX) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX}") + vcpkg_execute_required_process( + COMMAND ${JOM} ${TARGETS} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${LOG_SUFFIX} + LOGNAME package-${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} + ) + message(STATUS "Package ${LOG_PREFIX}-${TARGET_TRIPLET}-${LOG_SUFFIX} done") + endfunction() + + # This fixes issues on machines with default codepages that are not ASCII compatible, such as some CJK encodings + set(ENV_CL_BACKUP "$ENV{_CL_}") + set(ENV{_CL_} "/utf-8") + + #First generate the makefiles so we can modify them + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles dbg) + + #Store debug makefiles path + file(GLOB_RECURSE DEBUG_MAKEFILES ${DEBUG_DIR}/*Makefile*) + + foreach(DEBUG_MAKEFILE ${DEBUG_MAKEFILES}) + file(READ "${DEBUG_MAKEFILE}" _contents) + string(REPLACE "zlib.lib" "zlibd.lib" _contents "${_contents}") + string(REPLACE "installed\\${TARGET_TRIPLET}\\lib" "installed\\${TARGET_TRIPLET}\\debug\\lib" _contents "${_contents}") + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib qtmaind.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link qtmaind.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" _contents "${_contents}") + file(WRITE "${DEBUG_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_DEBUG_TARGETS}" ${_csc_BUILD_LOGNAME} dbg) + + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + if(NOT _csc_SKIP_MAKEFILES) + run_jom(qmake_all makefiles rel) + + #Store release makefile path + file(GLOB_RECURSE RELEASE_MAKEFILES ${RELEASE_DIR}/*Makefile*) + + foreach(RELEASE_MAKEFILE ${RELEASE_MAKEFILES}) + file(READ "${RELEASE_MAKEFILE}" _contents) + string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib qtmain.lib" "shell32.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link qtmain.lib /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" _contents "${_contents}") + file(WRITE "${RELEASE_MAKEFILE}" "${_contents}") + endforeach() + endif() + + run_jom("${_csc_RELEASE_TARGETS}" ${_csc_BUILD_LOGNAME} rel) # Restore the original value of ENV{PATH} set(ENV{PATH} "${ENV_PATH_BACKUP}") + set(ENV{_CL_} "${ENV_CL_BACKUP}") endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_debug.cmake b/scripts/cmake/vcpkg_build_qmake_debug.cmake deleted file mode 100644 index a734e63cf..000000000 --- a/scripts/cmake/vcpkg_build_qmake_debug.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.rst: -# .. command:: vcpkg_build_qmake_debug -# -# Build a qmake-based project, previously configured using vcpkg_configure_qmake_debug. -# -# :: -# vcpkg_build_qmake_debug() -# -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_build_qmake_debug) - cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) - vcpkg_find_acquire_program(JOM) - - # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/debug/tools/qt5;$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-dbg") - vcpkg_execute_required_process( - COMMAND ${JOM} ${_csc_TARGETS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME package-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Package ${TARGET_TRIPLET}-dbg done") - - # Restore the original value of ENV{PATH} - set(ENV{PATH} "${ENV_PATH_BACKUP}") -endfunction() diff --git a/scripts/cmake/vcpkg_build_qmake_release.cmake b/scripts/cmake/vcpkg_build_qmake_release.cmake deleted file mode 100644 index 3daf9201b..000000000 --- a/scripts/cmake/vcpkg_build_qmake_release.cmake +++ /dev/null @@ -1,30 +0,0 @@ -#.rst: -# .. command:: vcpkg_build_qmake_release -# -# Build a qmake-based project, previously configured using vcpkg_configure_qmake_release. -# -# :: -# vcpkg_build_qmake_release() -# -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_build_qmake_release) - cmake_parse_arguments(_csc "" "" "TARGETS" ${ARGN}) - vcpkg_find_acquire_program(JOM) - - # Make sure that the linker finds the libraries used - set(ENV_PATH_BACKUP "$ENV{PATH}") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;$ENV{PATH}") - - message(STATUS "Package ${TARGET_TRIPLET}-rel") - vcpkg_execute_required_process( - COMMAND ${JOM} ${_csc_TARGETS} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME package-${TARGET_TRIPLET}-rel - ) - message(STATUS "Package ${TARGET_TRIPLET}-rel done") - - # Restore the original value of ENV{PATH} - set(ENV{PATH} "${ENV_PATH_BACKUP}") -endfunction() diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index 258b8f64a..27dd0732d 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -10,15 +10,11 @@ include(vcpkg_from_bitbucket) include(vcpkg_build_cmake) include(vcpkg_build_msbuild) include(vcpkg_build_qmake) -include(vcpkg_build_qmake_debug) -include(vcpkg_build_qmake_release) include(vcpkg_install_cmake) include(vcpkg_install_meson) include(vcpkg_configure_cmake) include(vcpkg_configure_meson) include(vcpkg_configure_qmake) -include(vcpkg_configure_qmake_debug) -include(vcpkg_configure_qmake_release) include(vcpkg_apply_patches) include(vcpkg_copy_pdbs) include(vcpkg_copy_tool_dependencies) diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index 037197e48..4cc7bc9f7 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -2,11 +2,6 @@ # .. command:: vcpkg_configure_qmake # # Configure a qmake-based project. -# It is assume that the qmake project CONFIG variable is -# "debug_and_release" (the default value on Windows, see [1]). -# Using this option, only one Makefile for building both Release and Debug -# libraries is generated, that then can be run using the vcpkg_build_qmake -# command. # # :: # vcpkg_configure_qmake(SOURCE_PATH @@ -17,28 +12,44 @@ # The path to the *.pro qmake project file. # ``OPTIONS`` # The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html function(vcpkg_configure_qmake) cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - # Find qmake exectuable + # Find qmake executable find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + list(APPEND _csc_OPTIONS CONFIG+=staticlib) + endif() + # Cleanup build directories - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - message(STATUS "Configuring ${TARGET_TRIPLET}") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}) + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} - LOGNAME config-${TARGET_TRIPLET} + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel ) - message(STATUS "Configuring ${TARGET_TRIPLET} done") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + + configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf) + + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_debug.cmake b/scripts/cmake/vcpkg_configure_qmake_debug.cmake deleted file mode 100644 index 3eeb42cb3..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_debug.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.rst: -# .. command:: vcpkg_configure_qmake_debug -# -# Configure a qmake-based project. -# This sets the config variable to debug and outputs to -# a debug triplet directory. -# -# :: -# vcpkg_configure_qmake_debug(SOURCE_PATH -# [OPTIONS arg1 [arg2 ...]] -# ) -# -# ``SOURCE_PATH`` -# The path to the *.pro qmake project file. -# ``OPTIONS`` -# The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_configure_qmake_debug) - cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - - # Find qmake exectuable - find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) - - if(NOT QMAKE_COMMAND) - message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") - endif() - - # Cleanup build directories - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - - configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_debug.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) - - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) - vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") - unset(QMAKE_COMMAND) - unset(QMAKE_COMMAND PARENT_SCOPE) - unset(QMAKE_COMMAND CACHE) -endfunction() \ No newline at end of file diff --git a/scripts/cmake/vcpkg_configure_qmake_release.cmake b/scripts/cmake/vcpkg_configure_qmake_release.cmake deleted file mode 100644 index 60750060b..000000000 --- a/scripts/cmake/vcpkg_configure_qmake_release.cmake +++ /dev/null @@ -1,46 +0,0 @@ -#.rst: -# .. command:: vcpkg_configure_qmake_release -# -# Configure a qmake-based project. -# This sets the config variable to release and outputs to -# a release triplet directory. -# -# :: -# vcpkg_configure_qmake_release(SOURCE_PATH -# [OPTIONS arg1 [arg2 ...]] -# ) -# -# ``SOURCE_PATH`` -# The path to the *.pro qmake project file. -# ``OPTIONS`` -# The options passed to qmake. -# -# [1] : http://doc.qt.io/qt-5/qmake-variable-reference.html - -function(vcpkg_configure_qmake_release) - cmake_parse_arguments(_csc "" "SOURCE_PATH" "OPTIONS" ${ARGN}) - - # Find qmake exectuable - find_program(QMAKE_COMMAND NAMES qmake.exe PATHS ${CURRENT_INSTALLED_DIR}/tools/qt5) - - if(NOT QMAKE_COMMAND) - message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") - endif() - - # Cleanup build directories - file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - - configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) - - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - unset(QMAKE_COMMAND) - unset(QMAKE_COMMAND PARENT_SCOPE) - unset(QMAKE_COMMAND CACHE) -endfunction() \ No newline at end of file -- cgit v1.2.3 From 353d635b97df5c80f270ec200d16a6664c4d6ab6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 18 Jan 2018 10:45:34 -0800 Subject: [freetype][harfbuzz] Fix static freetype dependency. --- scripts/buildsystems/vcpkg.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index f157d3236..8ee21d411 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -206,6 +206,17 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() + elseif("${name}" STREQUAL "Freetype") + _find_package(${ARGV}) + find_package(ZLIB) + find_package(PNG) + find_package(BZip2) + if(TARGET Freetype::Freetype) + set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB) + endif() + if(FREETYPE_LIBRARIES) + list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) + endif() elseif("${name}" STREQUAL "tinyxml2") _find_package(${ARGV}) if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) -- cgit v1.2.3 From 64203615a6d593fafbea36ce4cd01583deb0ad01 Mon Sep 17 00:00:00 2001 From: Tsukasa Sugiura Date: Wed, 24 Jan 2018 01:45:23 +0900 Subject: Fix OpenNI2 deploy (#2627) * Fix OpenNI2 deploy Fix to deploy initialization file and drivers. * [openni2] Adjusting deployopenni2.ps1 paths * Fix Create Directory of OpenNI2 Drivers Fix create directory of OpenNI2 drivers. * Fix Deploy Script Path Fix deploy script path. --- scripts/buildsystems/msbuild/applocal.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 08a6d9a8f..0b56356a0 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -49,6 +49,7 @@ function resolve([string]$targetBinary) { if (Test-Path "$installedDir\$_") { deployBinary $targetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } + if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } resolve "$targetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" @@ -66,5 +67,10 @@ if (Test-Path "$g_install_root\plugins\qtdeploy.ps1") { . "$g_install_root\plugins\qtdeploy.ps1" } +# Note: This is a hack to make OpenNI2 work. +if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { + . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" +} + resolve($targetBinary) Write-Verbose $($g_searched | out-string) \ No newline at end of file -- cgit v1.2.3 From 2890ffa31c409e1384bdd562f6f5b9fc827a4c14 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 18 Jan 2018 18:12:14 -0800 Subject: Don't print "downloading..." if file is already downloaded --- scripts/fetchDependency.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index e4cab124c..1ff44c211 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -75,9 +75,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) throw "Unknown program requested" } - Write-Host "Downloading $Dependency..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $Dependency has completed successfully." + if (!(Test-Path $downloadPath)) + { + Write-Host "Downloading $Dependency..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $Dependency has completed successfully." + } $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash -- cgit v1.2.3 From 3332326c655714fe2e1f740b5635a29c86581228 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 19 Jan 2018 15:12:21 -0800 Subject: Update CMake to 3.10.2 --- scripts/fetchDependency.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 1ff44c211..7629a0c2c 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -20,12 +20,12 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) if($Dependency -eq "cmake") { - $requiredVersion = "3.10.1" - $downloadVersion = "3.10.1" - $url = "https://cmake.org/files/v3.10/cmake-3.10.1-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.10.1-win32-x86.zip" - $expectedDownloadedFileHash = "6fe010cce1201d884cd7a9535db8a1f16d98b8965341251fde8f1c5069ee58c0" - $executableFromDownload = "$downloadsDir\cmake-3.10.1-win32-x86\bin\cmake.exe" + $requiredVersion = "3.10.2" + $downloadVersion = "3.10.2" + $url = "https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip" + $downloadPath = "$downloadsDir\cmake-3.10.2-win32-x86.zip" + $expectedDownloadedFileHash = "f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6" + $executableFromDownload = "$downloadsDir\cmake-3.10.2-win32-x86\bin\cmake.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "nuget") -- cgit v1.2.3 From ae582e0d4f05c210b82046b1a5cb63f395242219 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 19 Jan 2018 15:19:18 -0800 Subject: [bootstrap] Extract arguments in variable --- scripts/bootstrap.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 3f40a2ead..b4749bdd6 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -43,7 +43,18 @@ try $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 - & $msbuildExe "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=$platformToolset /p:TargetPlatformVersion=$windowsSDK /m dirs.proj + + $arguments = ( + "`"/p:VCPKG_VERSION=-$gitHash`"", + "`"/p:DISABLE_METRICS=$disableMetrics`"", + "/p:Configuration=Release", + "/p:Platform=x86", + "/p:PlatformToolset=$platformToolset", + "/p:TargetPlatformVersion=$windowsSDK", + "/m", + "dirs.proj") + + & $msbuildExe $arguments if ($LASTEXITCODE -ne 0) { Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." -- cgit v1.2.3 From 62c8626f4d28344c3cc4b488ffeac51bddb8bbcd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 19 Jan 2018 15:19:40 -0800 Subject: vcpkgInvokeCommand(): Add -NoNewWindows flag --- scripts/VcpkgPowershellUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 5381523f0..7a6a67c2c 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -171,7 +171,7 @@ function vcpkgInvokeCommand() [switch]$wait) Write-Verbose "Executing: ${executable} ${arguments}" - $process = Start-Process -FilePath $executable -ArgumentList $arguments -PassThru + $process = Start-Process -FilePath $executable -ArgumentList $arguments -PassThru -NoNewWindow if ($wait) { Wait-Process -InputObject $process -- cgit v1.2.3 From a5fe308ea3c29c5f8715b8f0c78571759541c9b5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 22 Jan 2018 18:18:53 -0800 Subject: $script:MyInvocation.MyCommand.Definition It works also in cases where scripts/functions are calling each other. Without the $script prefix, it would instead give you the calling function OR the path if there was no parent function. With the prefix, it always yields the directory of the script --- scripts/addPoshVcpkgToPowershellProfile.ps1 | 2 +- scripts/bootstrap.ps1 | 2 +- scripts/fetchDependency.ps1 | 2 +- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 2 +- scripts/findVisualStudioInstallationInstances.ps1 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/addPoshVcpkgToPowershellProfile.ps1 b/scripts/addPoshVcpkgToPowershellProfile.ps1 index 7a12e7d34..dcbd2e0be 100644 --- a/scripts/addPoshVcpkgToPowershellProfile.ps1 +++ b/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -13,7 +13,7 @@ function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string] return } -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" $profileEntry = "Import-Module '$scriptsDir\posh-vcpkg'" diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index b4749bdd6..2c05f1adb 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -4,7 +4,7 @@ param( [Parameter(Mandatory=$False)][string]$withVSPath = "" ) -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root Write-Verbose("vcpkg Path " + $vcpkgRootDir) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 7629a0c2c..6bb87fec4 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -3,7 +3,7 @@ param( [Parameter(Mandatory=$true)][string]$Dependency ) -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" Write-Verbose "Fetching dependency: $Dependency" diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 46ba767b9..570ebdf44 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -6,7 +6,7 @@ param( $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 if ($VisualStudioInstallationInstances -eq $null) { diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index e3bc67ff6..359da9caa 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -3,7 +3,7 @@ param( ) -$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $vswhereExe = (& $scriptsDir\fetchDependency.ps1 "vswhere") -replace "::" -replace "::" $output = & $vswhereExe -prerelease -legacy -products * -format xml -- cgit v1.2.3 From 0df743d6252efda732c00daa48cef28acbf3f078 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 22 Jan 2018 18:19:30 -0800 Subject: [bootstrap] Build vcpkg in a clean environment --- scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 | 52 +++++++++++++++++++++++ scripts/VcpkgPowershellUtils.ps1 | 27 +++++++++++- scripts/bootstrap.ps1 | 7 ++- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 b/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 new file mode 100644 index 000000000..5c922572b --- /dev/null +++ b/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 @@ -0,0 +1,52 @@ +# Capture environment variables for the System and User. Also add some special/built-in variables. +# These will be used to synthesize a clean environment +$specialEnvironmentMap = @{ "SystemDrive"=$env:SystemDrive; "SystemRoot"=$env:SystemRoot; "UserProfile"=$env:UserProfile } # These are built-in and not set in the registry +$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_CURRENT_USER\Environment +$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment + +# Identify the keySet of environment variable names +$nameSet = ($specialEnvironmentMap.Keys + $machineEnvironmentMap.Keys + $userEnvironmentMap.Keys) | Sort-Object | Select-Object -Unique + +# Any environment variable in the $nameSet should be restored to its original value +foreach ($name in $nameSet) +{ + if ($specialEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $specialEnvironmentMap[$name], 'Process') + continue; + } + + # PATH needs to be concatenated as it has values in both machine and user environment. Any other values should be set. + if ($name -match 'path') + { + $pathValuePartial = @() + # Machine values before user values + $pathValuePartial += $machineEnvironmentMap[$name] -split ';' + $pathValuePartial += $userEnvironmentMap[$name] -split ';' + $pathValue = $pathValuePartial -join ';' + [Environment]::SetEnvironmentVariable($name, $pathValue, 'Process') + continue; + } + + if ($userEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $userEnvironmentMap[$name], 'Process') + continue; + } + + if ($machineEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $machineEnvironmentMap[$name], 'Process') + continue; + } + + throw "Unreachable: Unknown variable $name" +} + +# Any environment variable NOT in the $nameSet should be removed +$processEnvironmentMap = [Environment]::GetEnvironmentVariables('Process') +$variablesForRemoval = $processEnvironmentMap.Keys | Where-Object {$nameSet -notcontains $_} +foreach ($name in $variablesForRemoval) +{ + [Environment]::SetEnvironmentVariable($name, $null, 'Process') +} diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 7a6a67c2c..ec1e8b92b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -168,10 +168,33 @@ function vcpkgInvokeCommand() { param ( [Parameter(Mandatory=$true)][string]$executable, [string]$arguments = "", - [switch]$wait) + [Parameter(Mandatory=$true)][switch]$wait) Write-Verbose "Executing: ${executable} ${arguments}" - $process = Start-Process -FilePath $executable -ArgumentList $arguments -PassThru -NoNewWindow + $process = Start-Process -FilePath "`"$executable`"" -ArgumentList $arguments -PassThru -NoNewWindow + if ($wait) + { + Wait-Process -InputObject $process + $ec = $process.ExitCode + Write-Verbose "Execution terminated with exit code $ec." + } +} + +function vcpkgInvokeCommandClean() +{ + param ( [Parameter(Mandatory=$true)][string]$executable, + [string]$arguments = "", + [Parameter(Mandatory=$true)][switch]$wait) + + Write-Verbose "Clean-Executing: ${executable} ${arguments}" + $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition + $cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1" + $command = "& `"$cleanEnvScript`"; & `"$executable`" $arguments" + $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) + $encodedCommand = [Convert]::ToBase64String($bytes) + $arg = "-encodedCommand $encodedCommand" + + $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow if ($wait) { Wait-Process -InputObject $process diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 2c05f1adb..bf1dcba8e 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,6 +5,7 @@ param( ) $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" $vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root Write-Verbose("vcpkg Path " + $vcpkgRootDir) @@ -52,9 +53,11 @@ try "/p:PlatformToolset=$platformToolset", "/p:TargetPlatformVersion=$windowsSDK", "/m", - "dirs.proj") + "dirs.proj") -join " " + + # vcpkgInvokeCommandClean cmd "/c echo %PATH%" -wait:$true + vcpkgInvokeCommandClean $msbuildExe $arguments -wait:$true - & $msbuildExe $arguments if ($LASTEXITCODE -ne 0) { Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." -- cgit v1.2.3 From e5b0de35d37b0df531fbcc7567fe849aef0b2b85 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 23 Jan 2018 15:08:52 -0800 Subject: [vswhere] Update to 2.3.2 --- scripts/fetchDependency.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 6bb87fec4..463b6f243 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -40,11 +40,11 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "vswhere") { - $requiredVersion = "2.2.11" - $downloadVersion = "2.2.11" - $url = "https://github.com/Microsoft/vswhere/releases/download/2.2.11/vswhere.exe" + $requiredVersion = "2.3.2" + $downloadVersion = "2.3.2" + $url = "https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe" $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" - $expectedDownloadedFileHash = "0235c2cb6341978abdf32e27fcf1d7af5cb5514c035e529c4cd9283e6f1a261f" + $expectedDownloadedFileHash = "103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04" $executableFromDownload = $downloadPath $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED } -- cgit v1.2.3 From fd2f9816cc7aaecd52d335591d46efa3c9ea2f00 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 24 Jan 2018 15:22:41 -0800 Subject: Don't expand variable --- scripts/cmake/vcpkg_apply_patches.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index ac6e5cc93..1894d6e9a 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -47,7 +47,7 @@ function(vcpkg_apply_patches) RESULT_VARIABLE error_code ) - if(error_code AND NOT ${_ap_QUIET}) + if(error_code AND NOT _ap_QUIET) message(STATUS "Applying patch failed. This is expected if this patch was previously applied.") endif() -- cgit v1.2.3 From a8a20f1a1338ecc5ebb0575135b820b06479ae15 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 14:46:00 -0800 Subject: VcpkgInvokeCommand: remove paramter $wait --- scripts/VcpkgPowershellUtils.ps1 | 24 ++++++++---------------- scripts/bootstrap.ps1 | 4 ++-- scripts/fetchDependency.ps1 | 2 +- 3 files changed, 11 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index ec1e8b92b..3ca540874 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -167,24 +167,19 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, function vcpkgInvokeCommand() { param ( [Parameter(Mandatory=$true)][string]$executable, - [string]$arguments = "", - [Parameter(Mandatory=$true)][switch]$wait) + [string]$arguments = "") Write-Verbose "Executing: ${executable} ${arguments}" $process = Start-Process -FilePath "`"$executable`"" -ArgumentList $arguments -PassThru -NoNewWindow - if ($wait) - { - Wait-Process -InputObject $process - $ec = $process.ExitCode - Write-Verbose "Execution terminated with exit code $ec." - } + Wait-Process -InputObject $process + $ec = $process.ExitCode + Write-Verbose "Execution terminated with exit code $ec." } function vcpkgInvokeCommandClean() { param ( [Parameter(Mandatory=$true)][string]$executable, - [string]$arguments = "", - [Parameter(Mandatory=$true)][switch]$wait) + [string]$arguments = "") Write-Verbose "Clean-Executing: ${executable} ${arguments}" $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition @@ -195,10 +190,7 @@ function vcpkgInvokeCommandClean() $arg = "-encodedCommand $encodedCommand" $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow - if ($wait) - { - Wait-Process -InputObject $process - $ec = $process.ExitCode - Write-Verbose "Execution terminated with exit code $ec." - } + Wait-Process -InputObject $process + $ec = $process.ExitCode + Write-Verbose "Execution terminated with exit code $ec." } \ No newline at end of file diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index bf1dcba8e..a50d0dde1 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -55,8 +55,8 @@ try "/m", "dirs.proj") -join " " - # vcpkgInvokeCommandClean cmd "/c echo %PATH%" -wait:$true - vcpkgInvokeCommandClean $msbuildExe $arguments -wait:$true + # vcpkgInvokeCommandClean cmd "/c echo %PATH%" + vcpkgInvokeCommandClean $msbuildExe $arguments if ($LASTEXITCODE -ne 0) { diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index 463b6f243..ad0b774d4 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -103,7 +103,7 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) { if (-not (Test-Path $executableFromDownload)) { - vcpkgInvokeCommand $downloadPath "-y" -wait:$true + vcpkgInvokeCommand $downloadPath "-y" } } else -- cgit v1.2.3 From 89addaa7a52e46014a3c6996ca3a093e9f5fd4d0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 14:57:26 -0800 Subject: VcpkgInvokeCommand: return the error code --- scripts/VcpkgPowershellUtils.ps1 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 3ca540874..06fc458f7 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -174,6 +174,7 @@ function vcpkgInvokeCommand() Wait-Process -InputObject $process $ec = $process.ExitCode Write-Verbose "Execution terminated with exit code $ec." + return $ec } function vcpkgInvokeCommandClean() @@ -193,4 +194,5 @@ function vcpkgInvokeCommandClean() Wait-Process -InputObject $process $ec = $process.ExitCode Write-Verbose "Execution terminated with exit code $ec." + return $ec } \ No newline at end of file -- cgit v1.2.3 From edcc8e2c364b2030e4f542faf05b4d36220083e9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 14:57:53 -0800 Subject: [bootstrap] Exit fast(er) if msbuild fails --- scripts/bootstrap.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a50d0dde1..3e886b26a 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -56,9 +56,9 @@ try "dirs.proj") -join " " # vcpkgInvokeCommandClean cmd "/c echo %PATH%" - vcpkgInvokeCommandClean $msbuildExe $arguments + $ec = vcpkgInvokeCommandClean $msbuildExe $arguments - if ($LASTEXITCODE -ne 0) + if ($ec -ne 0) { Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." return -- cgit v1.2.3 From 6e07cbeff467a027b14870f57a8b8a18357b243e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 16:48:32 -0800 Subject: [bootstrap] Specify full path for dirs.proj --- scripts/bootstrap.ps1 | 54 ++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 3e886b26a..ab7838127 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -37,39 +37,31 @@ if (!(Test-Path $vcpkgSourcesPath)) return } -try -{ - Push-Location $vcpkgSourcesPath - $msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath - $msbuildExe = $msbuildExeWithPlatformToolset[0] - $platformToolset = $msbuildExeWithPlatformToolset[1] - $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 - - $arguments = ( - "`"/p:VCPKG_VERSION=-$gitHash`"", - "`"/p:DISABLE_METRICS=$disableMetrics`"", - "/p:Configuration=Release", - "/p:Platform=x86", - "/p:PlatformToolset=$platformToolset", - "/p:TargetPlatformVersion=$windowsSDK", - "/m", - "dirs.proj") -join " " +$msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath +$msbuildExe = $msbuildExeWithPlatformToolset[0] +$platformToolset = $msbuildExeWithPlatformToolset[1] +$windowsSDK = & $scriptsDir\getWindowsSDK.ps1 - # vcpkgInvokeCommandClean cmd "/c echo %PATH%" - $ec = vcpkgInvokeCommandClean $msbuildExe $arguments - - if ($ec -ne 0) - { - Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." - return - } +$arguments = ( +"`"/p:VCPKG_VERSION=-$gitHash`"", +"`"/p:DISABLE_METRICS=$disableMetrics`"", +"/p:Configuration=Release", +"/p:Platform=x86", +"/p:PlatformToolset=$platformToolset", +"/p:TargetPlatformVersion=$windowsSDK", +"/m", +"$vcpkgSourcesPath\dirs.proj") -join " " - Write-Verbose("Placing vcpkg.exe in the correct location") +# vcpkgInvokeCommandClean cmd "/c echo %PATH%" +$ec = vcpkgInvokeCommandClean $msbuildExe $arguments - Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null - Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null -} -finally +if ($ec -ne 0) { - Pop-Location + Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." + return } + +Write-Verbose("Placing vcpkg.exe in the correct location") + +Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRootDir\vcpkg.exe | Out-Null +Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRootDir\scripts\vcpkgmetricsuploader.exe | Out-Null -- cgit v1.2.3 From 186a2cf88baa88be7385dd3381748e80432e5261 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 17:03:37 -0800 Subject: [bootstrap] Fix whitespace issue --- scripts/bootstrap.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index ab7838127..03f05d50b 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -50,7 +50,7 @@ $arguments = ( "/p:PlatformToolset=$platformToolset", "/p:TargetPlatformVersion=$windowsSDK", "/m", -"$vcpkgSourcesPath\dirs.proj") -join " " +"`"$vcpkgSourcesPath\dirs.proj`"") -join " " # vcpkgInvokeCommandClean cmd "/c echo %PATH%" $ec = vcpkgInvokeCommandClean $msbuildExe $arguments -- cgit v1.2.3 From e9b0de9d689560bfde4ebb73a6d76a0c3440a9ef Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 25 Jan 2018 17:27:43 -0800 Subject: Add -NoProfile and -ExecutionPolicy Bypass in powershell call --- scripts/VcpkgPowershellUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 06fc458f7..63da1a508 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -188,7 +188,7 @@ function vcpkgInvokeCommandClean() $command = "& `"$cleanEnvScript`"; & `"$executable`" $arguments" $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) $encodedCommand = [Convert]::ToBase64String($bytes) - $arg = "-encodedCommand $encodedCommand" + $arg = "-NoProfile -ExecutionPolicy Bypass -encodedCommand $encodedCommand" $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow Wait-Process -InputObject $process -- cgit v1.2.3 From 6c0f3a8859718b87b017ee9458cf0e4adacdd2dd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 27 Jan 2018 22:08:07 -0800 Subject: [ClearEnvironment] Fix registry comments --- scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 b/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 index 5c922572b..0a133f5f8 100644 --- a/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 +++ b/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 @@ -1,8 +1,8 @@ # Capture environment variables for the System and User. Also add some special/built-in variables. # These will be used to synthesize a clean environment $specialEnvironmentMap = @{ "SystemDrive"=$env:SystemDrive; "SystemRoot"=$env:SystemRoot; "UserProfile"=$env:UserProfile } # These are built-in and not set in the registry -$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_CURRENT_USER\Environment -$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment +$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment +$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_CURRENT_USER\Environment # Identify the keySet of environment variable names $nameSet = ($specialEnvironmentMap.Keys + $machineEnvironmentMap.Keys + $userEnvironmentMap.Keys) | Sort-Object | Select-Object -Unique -- cgit v1.2.3 From 2bc105cd95a457caf44623a742ddf4040bee4d20 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 30 Jan 2018 14:42:33 -0800 Subject: Add vcpkgFormatElapsedTime in powershell side --- scripts/VcpkgPowershellUtils.ps1 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 63da1a508..722d337ca 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -195,4 +195,29 @@ function vcpkgInvokeCommandClean() $ec = $process.ExitCode Write-Verbose "Execution terminated with exit code $ec." return $ec +} + +function vcpkgFormatElapsedTime([TimeSpan]$ts) +{ + if ($ts.TotalHours -ge 1) + { + return [string]::Format( "{0:N2} h", $ts.TotalHours); + } + + if ($ts.TotalMinutes -ge 1) + { + return [string]::Format( "{0:N2} min", $ts.TotalMinutes); + } + + if ($ts.TotalSeconds -ge 1) + { + return [string]::Format( "{0:N2} s", $ts.TotalSeconds); + } + + if ($ts.TotalMilliseconds -ge 1) + { + return [string]::Format( "{0:N2} ms", $ts.TotalMilliseconds); + } + + throw $ts } \ No newline at end of file -- cgit v1.2.3 From 1f6f27a5480a02434614cc48aed5178a9e69bb4e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 31 Jan 2018 11:50:32 -0800 Subject: [vcpkg-from-bitbucket] Fix HEAD builds. Fixes #2696. --- scripts/cmake/vcpkg_from_bitbucket.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_bitbucket.cmake b/scripts/cmake/vcpkg_from_bitbucket.cmake index 26600f013..a12d86b43 100644 --- a/scripts/cmake/vcpkg_from_bitbucket.cmake +++ b/scripts/cmake/vcpkg_from_bitbucket.cmake @@ -130,7 +130,8 @@ function(vcpkg_from_bitbucket) # The following is for --head scenarios set(URL "https://bitbucket.com/${ORG_NAME}/${REPO_NAME}/get/${_vdud_HEAD_REF}.tar.gz") - set(downloaded_file_path "${DOWNLOADS}/${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_name "${ORG_NAME}-${REPO_NAME}-${_vdud_HEAD_REF}.tar.gz") + set(downloaded_file_path "${DOWNLOADS}/${downloaded_file_name}") if(_VCPKG_NO_DOWNLOADS) if(NOT EXISTS ${downloaded_file_path} OR NOT EXISTS ${downloaded_file_path}.version) @@ -150,17 +151,17 @@ function(vcpkg_from_bitbucket) endif() # Try to download the file and version information from bitbucket. - set(_VCPKG_INTERNAL_NO_HASH_CHECK "TRUE") vcpkg_download_distfile(ARCHIVE_VERSION URLS "https://api.bitbucket.com/2.0/repositories/${ORG_NAME}/${REPO_NAME}/refs/branches/${_vdud_HEAD_REF}" - FILENAME ${downloaded_file_name}.version + FILENAME "${downloaded_file_name}.version" + SKIP_SHA512 ) vcpkg_download_distfile(ARCHIVE - URLS ${URL} - FILENAME ${downloaded_file_name} + URLS "${URL}" + FILENAME "${downloaded_file_name}" + SKIP_SHA512 ) - set(_VCPKG_INTERNAL_NO_HASH_CHECK "FALSE") endif() vcpkg_extract_source_archive_ex( -- cgit v1.2.3 From d385e296a6929bcf7e86eda925376e0cabce6fd4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 5 Feb 2018 17:50:16 -0800 Subject: [hdf5] Always use config mode for HDF5 --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 8ee21d411..76d77a0b5 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -223,6 +223,8 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() + elseif("${name}" STREQUAL "HDF5") + _find_package(${ARGV} CONFIG) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From f136732dcd308037d6adee7bfb404e1154f78369 Mon Sep 17 00:00:00 2001 From: Neil McNeight Date: Tue, 6 Feb 2018 15:26:06 -0600 Subject: Fix for Issue #2729 Allows PowerShell to change the name of the downloaded directory correctly. --- scripts/VcpkgPowershellUtils.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 722d337ca..4aaad3479 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -160,7 +160,7 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, } else { - Move-Item -Path $destinationPartial -Destination $output + Move-Item -Path "$destinationPartial" -Destination $output } } @@ -220,4 +220,4 @@ function vcpkgFormatElapsedTime([TimeSpan]$ts) } throw $ts -} \ No newline at end of file +} -- cgit v1.2.3 From c9d434dfbc985be918295cabe7b37fae7732b9c8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Feb 2018 17:36:59 -0800 Subject: vcpkgRemoveItem: nullcheck --- scripts/VcpkgPowershellUtils.ps1 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 4aaad3479..07270dd22 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -27,6 +27,11 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$dirPath) { + if ([string]::IsNullOrEmpty($dirPath)) + { + return + } + if (Test-Path $dirPath) { Remove-Item $dirPath -Recurse -Force -- cgit v1.2.3 From 71025694e9c3fe1c1843bbb8f41bfecc19d4a931 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 16:57:47 -0800 Subject: [vcpkg-configure-cmake] Use ninja to configure in parallel (#2712) --- scripts/cmake/vcpkg_configure_cmake.cmake | 88 +++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 22 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 6e2ec4ef5..bc1d73f07 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -198,32 +198,76 @@ function(vcpkg_configure_cmake) ) endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} - -G ${GENERATOR} - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel + set(rel_command + ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}) + set(dbg_command + ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + -G ${GENERATOR} + -DCMAKE_BUILD_TYPE=Debug + -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) + + if(NINJA_CAN_BE_USED AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + + vcpkg_find_acquire_program(NINJA) + get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) + set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + + #parallelize the configure step + set(_contents + "rule CreateProcess\n command = $process\n\n" ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + set(rel_line "build ../CMakeCache.txt: CreateProcess\n process = cmd /c \"cd .. &&") + foreach(arg ${rel_command}) + set(rel_line "${rel_line} \"${arg}\"") + endforeach() + set(_contents "${_contents}${rel_line}\"\n\n") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + set(dbg_line "build ../../${TARGET_TRIPLET}-dbg/CMakeCache.txt: CreateProcess\n process = cmd /c \"cd ../../${TARGET_TRIPLET}-dbg &&") + foreach(arg ${dbg_command}) + set(dbg_line "${dbg_line} \"${arg}\"") + endforeach() + set(_contents "${_contents}${dbg_line}\"\n\n") + endif() + + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure) + file(WRITE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure/build.ninja "${_contents}") + + message(STATUS "Configuring ${TARGET_TRIPLET}") vcpkg_execute_required_process( - COMMAND ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} - -G ${GENERATOR} - -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME config-${TARGET_TRIPLET}-dbg + COMMAND ninja -v + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/vcpkg-parallel-configure + LOGNAME config-${TARGET_TRIPLET} ) - message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + message(STATUS "Configuring ${TARGET_TRIPLET} done") + else() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${rel_command} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${dbg_command} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME config-${TARGET_TRIPLET}-dbg + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") + endif() endif() set(_VCPKG_CMAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) -- cgit v1.2.3 From 676c861ae65569058014ac5367447464f1fb0877 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 17:02:47 -0800 Subject: [curl] Add nghttp2.lib to dependencies of curl --- scripts/buildsystems/vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 76d77a0b5..9fbc24ad7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -225,6 +225,15 @@ macro(find_package name) endif() elseif("${name}" STREQUAL "HDF5") _find_package(${ARGV} CONFIG) + elseif("${name}" STREQUAL "CURL") + _find_package(${ARGV}) + if(CURL_FOUND) + if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + list(APPEND CURL_LIBRARIES + "debug" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/nghttp2.lib" + "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") + endif() + endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 116914e110e06183eaa8626accf1403637b6b681 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 17:10:43 -0800 Subject: [vtk] Fix breaking change in find_package(HDF5) --- scripts/buildsystems/vcpkg.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 9fbc24ad7..0cb311555 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -223,7 +223,8 @@ macro(find_package name) add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "HDF5") + elseif("${name}" STREQUAL "HDF5" AND NOT PROJECT_NAME STREQUAL "VTK") + # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) -- cgit v1.2.3 From 815e3caf5573d1149e1f826b359beb9039293307 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 6 Feb 2018 15:44:59 -0800 Subject: Merge findFileRecursivelyUp into VcpkgPowershellUtils --- scripts/VcpkgPowershellUtils.ps1 | 20 ++++++++++++++++++++ scripts/bootstrap.ps1 | 2 +- scripts/fetchDependency.ps1 | 2 +- scripts/findFileRecursivelyUp.ps1 | 18 ------------------ 4 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 scripts/findFileRecursivelyUp.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 07270dd22..4334df2cc 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -226,3 +226,23 @@ function vcpkgFormatElapsedTime([TimeSpan]$ts) throw $ts } + +function vcpkgFindFileRecursivelyUp() +{ + param( + [ValidateNotNullOrEmpty()] + [Parameter(Mandatory=$true)][string]$startingDir, + [ValidateNotNullOrEmpty()] + [Parameter(Mandatory=$true)][string]$filename + ) + + $currentDir = $startingDir + + while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename")) + { + Write-Verbose "Examining $currentDir for $filename" + $currentDir = Split-path $currentDir -Parent + } + Write-Verbose "Examining $currentDir for $filename - Found" + return $currentDir +} diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 03f05d50b..0df2a2a99 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -6,7 +6,7 @@ param( $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" -$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root +$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root Write-Verbose("vcpkg Path " + $vcpkgRootDir) diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index ad0b774d4..bfc0f733a 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -7,7 +7,7 @@ $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" Write-Verbose "Fetching dependency: $Dependency" -$vcpkgRootDir = & $scriptsDir\findFileRecursivelyUp.ps1 $scriptsDir .vcpkg-root +$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" diff --git a/scripts/findFileRecursivelyUp.ps1 b/scripts/findFileRecursivelyUp.ps1 deleted file mode 100644 index 4b6409e8c..000000000 --- a/scripts/findFileRecursivelyUp.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -[CmdletBinding()] -param( - [ValidateNotNullOrEmpty()] - [Parameter(Mandatory=$true)][string]$startingDir, - [ValidateNotNullOrEmpty()] - [Parameter(Mandatory=$true)][string]$filename -) - -$ErrorActionPreference = "Stop" -$currentDir = $startingDir - -while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename")) -{ - Write-Verbose "Examining $currentDir for $filename" - $currentDir = Split-path $currentDir -Parent -} -Write-Verbose "Examining $currentDir for $filename - Found" -return $currentDir \ No newline at end of file -- cgit v1.2.3 From 3aac3957ae9053eb3ffb97bcc49148e7b0a4c050 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 7 Feb 2018 17:31:19 -0800 Subject: [vcpkgInvokeCommandClean] Don't use -encodedCommand. Instead, use -Command with the appropriate number of escaped quotes (which ended up being 3) --- scripts/VcpkgPowershellUtils.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 4334df2cc..bed78b198 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -190,10 +190,10 @@ function vcpkgInvokeCommandClean() Write-Verbose "Clean-Executing: ${executable} ${arguments}" $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1" - $command = "& `"$cleanEnvScript`"; & `"$executable`" $arguments" - $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) - $encodedCommand = [Convert]::ToBase64String($bytes) - $arg = "-NoProfile -ExecutionPolicy Bypass -encodedCommand $encodedCommand" + $tripleQuotes = "`"`"`"" + $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes + $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes" + $arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command" $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow Wait-Process -InputObject $process -- cgit v1.2.3 From 73e45b0ce2b4132a24708a0359c76927ed418e15 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 19:00:11 -0800 Subject: [qt5-base][qtdeploy] Deploy plugin dependencies to the executable's folder. --- scripts/buildsystems/msbuild/applocal.ps1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 0b56356a0..3f0f2ef37 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -24,6 +24,19 @@ function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$tar if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" } } + +Write-Verbose "Resolving base path $targetBinary..." +try +{ + $baseBinaryPath = Resolve-Path $targetBinary -erroraction stop + $baseTargetBinaryDir = Split-Path $baseBinaryPath -parent +} +catch [System.Management.Automation.ItemNotFoundException] +{ + return +} + +# Note: this function signature is depended upon by the qtdeploy.ps1 script function resolve([string]$targetBinary) { Write-Verbose "Resolving $targetBinary..." try @@ -47,10 +60,10 @@ function resolve([string]$targetBinary) { } $g_searched.Set_Item($_, $true) if (Test-Path "$installedDir\$_") { - deployBinary $targetBinaryDir $installedDir "$_" + deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } - resolve "$targetBinaryDir\$_" + resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" resolve "$targetBinaryDir\$_" -- cgit v1.2.3 From d8f3fffd5e12b241d9cc0ef67a46c087d4c63949 Mon Sep 17 00:00:00 2001 From: Jason Juang Date: Tue, 13 Feb 2018 00:00:27 -0800 Subject: change compile order to debug first, fix #2767 (#2785) --- scripts/cmake/vcpkg_build_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 8bafee4d4..bdf192792 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -61,7 +61,7 @@ function(vcpkg_build_cmake) set(PARALLEL_ARG ${NO_PARALLEL_ARG}) endif() - foreach(BUILDTYPE "release" "debug") + foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") set(SHORT_BUILDTYPE "dbg") -- cgit v1.2.3 From 78b1396b88f93f74f9a007599e5998026445f14f Mon Sep 17 00:00:00 2001 From: Bruce Jones Date: Tue, 13 Feb 2018 19:13:27 -0500 Subject: Copy local dependencies for library targets (#2787) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries --- scripts/buildsystems/vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0cb311555..ceb43940b 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -163,6 +163,15 @@ function(add_library name) list(FIND ARGV "INTERFACE" INTERFACE_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + get_target_property(IS_LIBRARY_SHARED ${name} TYPE) + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY") + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) + endif() set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) endif() -- cgit v1.2.3 From f279e9f5e3a569b237dbaca44bbc7225f1d7e27d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Feb 2018 18:04:16 -0800 Subject: [vcpkg-find-acquire-program] Add mirror for NASM. Fixes #2777. --- scripts/cmake/vcpkg_find_acquire_program.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 066126e6c..1e6979bad 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -55,7 +55,10 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) - set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip") + set(URL + "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip" + "http://mirrors.kodi.tv/build-deps/win32/nasm-2.12.02-win32.zip" + ) set(ARCHIVE "nasm-2.12.02-win32.zip") set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) elseif(VAR MATCHES "YASM") -- cgit v1.2.3 From 995ab094093e5cea8b250f69200406bcc59848ae Mon Sep 17 00:00:00 2001 From: Guillaume Lachance Date: Sat, 17 Feb 2018 05:31:49 -0500 Subject: libmupdf version bump (#2730) * Add libgta Libgta is a portable library that implements the Generic Tagged Array (GTA) file format. Signed-off-by: Hiroshi Miura * [libgta] turn off document build and doxygen dependency Signed-off-by: Hiroshi Miura * [libgta] add build-dependency - bzip2, zlib and liblzma Signed-off-by: Hiroshi Miura * [libgta] remove dlls when static build Signed-off-by: Hiroshi Miura * Fix typo * [libgta] update CONTROL add lf at end of file. * libmupdf version bump * [qt5-base] Use system freetype. * [opencv] Fix UWP and ARM * [hdf5] Always use config mode for HDF5 * [opencv] Fixup -- apply patch added in previous commit * [abseil] Add *.inc files. Fixes #2718 * [abseil] Update to 2018-2-5 * Fix for Issue #2729 Allows PowerShell to change the name of the downloaded directory correctly. * vcpkgRemoveItem: nullcheck * [cpprestsdk] Update to 2.10.2 * Adding Torch's TH library (#2737) Adding Torch's TH library * [flatbuffers] Fixes #2735 * sobjectizer updated to v.5.5.21 * [nghttp2] Enable static builds * [nghttp2]: update to 1.30.0 (#2739) * [nghttp2]: update to 1.30.0 * [nghttp2] Enable static builds * Add epsilon library port Signed-off-by: Hiroshi Miura * [vcpkg-configure-cmake] Use ninja to configure in parallel (#2712) * [curl] Add nghttp2.lib to dependencies of curl * [vtk] Fix breaking change in find_package(HDF5) * Merge findFileRecursivelyUp into VcpkgPowershellUtils * [vcpkgInvokeCommandClean] Don't use -encodedCommand. Instead, use -Command with the appropriate number of escaped quotes (which ended up being 3) * [blosc] Update to 1.13.5 static-install-fix.patch no longer required (upstream contains the patched version). Resolves build error with VS 15.6 in static builds * [cgal] Avoid using absolute paths in cmake config file * Update CHANGELOG and bump version to v0.0.104 * [qt5-base][qtdeploy] Deploy plugin dependencies to the executable's folder. * Add libgeotiff port Signed-off-by: Hiroshi Miura * [libgeotiff] fix install directory for cmake configurations Signed-off-by: Hiroshi Miura * fix tiff detection error when static build * [libgeotiff] remove installed dlls when static build * [libgeotiff] update description * [chipmunk] 7.0.2 initial. * [recast] 1.5.1 initial. * [tinydir] 1.2.3 initial. * [mman] git-f5ff813 initial. * Update Catch to 2.1.2 (#2763) * [vcpkg-ci] Delete intermediate build folders even on unsuccesful builds * [folly] Workaround bug for VS 15.6 * [pcre] fix space issue and add mirror (fix #2751) * [realsense2] Update to v2.10.0 Update realsense2 port to librealsense v2.10.0. * [libevent] Fix generated libevent targets files * fixed typo in warning message (#2773) * [blaze] update to Blaze 3.3 * [lmdb] Fix possible whitespace problem * Fix date issue * add qt5-quickcontrols2 * add qt5-quickcontrols port * add qt5-graphicaleffects * change compile order to debug first, fix #2767 (#2785) * [liblzma] Add usage information * [ffmpeg] Allow static builds of ffmpeg (#2783) ffmpeg creates static .a libraries, so change the suffix to .lib * [ffmpeg] Bump version for PR #2783 * [aubio] Update to handle static FFMPEG * Copy local dependencies for library targets (#2787) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries * [uriparser] Update to 0.8.5 * [vcpkg] Implement Default-Features (#2697) * [vcpkg] Add Default-Feature to make_status_pgh utility function Signed-off-by: Squareys * [vcpkg] Parse "Default-Features" as dependencies and add test for parsing Signed-off-by: Squareys * [vcpkg] Document some methods and structures Signed-off-by: Squareys * [vcpkg] Add install_default_features_test Signed-off-by: Squareys * [vcpkg] Change install_default_features_test to not have preinstalled package * [vcpkg] Test install behaviour of default features Signed-off-by: Squareys * [vcpkg] Implement default features Signed-off-by: Squareys * [vcpkg] Test default features upgrade behavior Signed-off-by: Squareys * [vcpkg] Implement upgrade with default features Signed-off-by: Squareys * [vcpkg] Test behaviour of upgrade with default features in dependencies Signed-off-by: Squareys * [vcpkg] Make upgrade install new default features Signed-off-by: Squareys * [vcpkg] Move collecting of packages for which to prevent defaults Further down the line to create_feature_install_plan. Signed-off-by: Squareys * [vcpkg] Fix core missing from default features and potential inf loop Signed-off-by: Squareys * [vcpkg] Rename, fix and move some tests Signed-off-by: Squareys * Updated boost license to 1.66.0 (#2795) I was a bit confused to see a reference to "1.65.1" while I was installing 1.66.0, but it turns out this URL is just not updated. This updates it. * [vcpkg-find-acquire-program] Add mirror for NASM. Fixes #2777. * update cuda requirement to 9.0, fixes #2791 (#2802) * update cuda requirement to 9.0, fixes #2791 * [cuda] Restore sample version blob * [vcpkg] http_proxy and https_proxy should be lowercase (#2815) Pacman of Msys understands only lowercase environment variables http_proxy and https_proxy. * [vcpkg] Add find/find_installed/is_installed for FeatureSpec Signed-off-by: Squareys * [vcpkg] Fix build command for packages that depend of features Signed-off-by: Squareys * [liblo] Initial port (#2821) * [portaudio] Added ASIO support to build * Update libpng to 1.6.34 * [liblo] Initial port * Revert "Update libpng to 1.6.34" This reverts commit ede0bb947b07aea119b7b05e3625c3eec1395af4. * Revert "[liblo] Initial port" This reverts commit bb819eb21841bb8cf4816af5a78e17ef58ec8ce5. * [liblo] Initial port * [liblo] Use vcpkg_from_github() and vcpkg_fixup_cmake_targets() * [liblo] Fix SHA512 * [openvr] update to 1.0.13 (#2809) * [ebml] Initial port. (#2812) * [vcpkg] Fix bug with missing dependencies introduced in #2697 (#2819) When a package dependency was not found (has no source control file), install would exit with "Value was null" when trying to install its default features, as the dependency would be marked erroneously as found in this case. Signed-off-by: Squareys * [vcpkg] Avoid using s::status_known() -- it does not do what you think it does * [jansson] Update to 2.11 (#2820) * [aws-sdk-cpp] update to 1.3.58 (#2810) * [mkl] Add port MKL (#2806) * [corrade,magnum,-plugins,-extras,-integration] Update to latest and support feature packages (#2687) [corrade,magnum,-plugins,-extras,-integration] Update to latest and support feature packages * [jbig2dec][libmupdf] Extract jbig2dec, remove remaining vendored 3rdparty --- scripts/cmake/vcpkg_configure_cmake.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index bc1d73f07..726aab2ec 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -21,6 +21,11 @@ ## ### PREFER_NINJA ## Indicates that, when available, Vcpkg should use Ninja to perform the build. This should be specified unless the port is known to not work under Ninja. ## +## ### DISABLE_PARALLEL_CONFIGURE +## Disables running the CMake configure step in parallel. +## +## This is needed for libraries which write back into their source directory during configure. +## ## ### GENERATOR ## Specifies the precise generator to use. ## @@ -45,7 +50,7 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_configure_cmake) - cmake_parse_arguments(_csc "PREFER_NINJA" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + cmake_parse_arguments(_csc "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) if(NOT VCPKG_PLATFORM_TOOLSET) message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap-vcpkg.bat\n") @@ -209,7 +214,7 @@ function(vcpkg_configure_cmake) -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) - if(NINJA_CAN_BE_USED AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + if(NINJA_CAN_BE_USED AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _csc_DISABLE_PARALLEL_CONFIGURE) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) -- cgit v1.2.3 From 2f6cf768e54a155c282a7b490027ceb7be245fbf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 14 Feb 2018 17:08:52 -0800 Subject: Improve vcpkgRemoveItem --- scripts/VcpkgPowershellUtils.ps1 | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index bed78b198..b73361fd1 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -25,16 +25,29 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri } } -function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$dirPath) +function vcpkgIsDirectory([Parameter(Mandatory=$true)][string]$path) { - if ([string]::IsNullOrEmpty($dirPath)) + return (Get-Item $path) -is [System.IO.DirectoryInfo] +} + +function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$path) +{ + if ([string]::IsNullOrEmpty($path)) { return } - if (Test-Path $dirPath) + if (Test-Path $path) { - Remove-Item $dirPath -Recurse -Force + # Remove-Item -Recurse occasionally fails. This is a workaround + if (vcpkgIsDirectory $path) + { + & cmd.exe /c rd /s /q $path + } + else + { + Remove-Item $path -Force + } } } -- cgit v1.2.3 From 8a4afe16193f274eb4d60357d81b8827ed055fb8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 20 Feb 2018 17:58:21 -0800 Subject: Update git to 2.16.2 --- scripts/bootstrap.ps1 | 2 +- scripts/fetchDependency.ps1 | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 0df2a2a99..eb4513a64 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -14,7 +14,7 @@ $gitHash = "unknownhash" $oldpath = $env:path try { - $env:path += ";$vcpkgRootDir\downloads\MinGit-2.15.0-32-bit\cmd" + $env:path += ";$vcpkgRootDir\downloads\MinGit-2.16.2-32-bit\cmd" if (Get-Command "git" -ErrorAction SilentlyContinue) { $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index bfc0f733a..ec3cdc83a 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -50,14 +50,14 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) } elseif($Dependency -eq "git") { - $requiredVersion = "2.15.0" - $downloadVersion = "2.15.0" - $url = "https://github.com/git-for-windows/git/releases/download/v2.15.0.windows.1/MinGit-2.15.0-32-bit.zip" - $downloadPath = "$downloadsDir\MinGit-2.15.0-32-bit.zip" - $expectedDownloadedFileHash = "69c035ab7b75c42ce5dd99e8927d2624ab618fab73c5ad84c9412bd74c343537" + $requiredVersion = "2.16.2" + $downloadVersion = "2.16.2" + $url = "https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip" + $downloadPath = "$downloadsDir\MinGit-2.16.2-32-bit.zip" + $expectedDownloadedFileHash = "322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da" # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.15.0-32-bit\cmd\git.exe" + $executableFromDownload = "$downloadsDir\MinGit-2.16.2-32-bit\cmd\git.exe" $extractionType = $ExtractionType_ZIP } elseif($Dependency -eq "installerbase") -- cgit v1.2.3 From 97531c32d4867f6bc2d6dab9653eaaee66a74ded Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Feb 2018 14:50:36 -0800 Subject: [configure_qmake] Do not pass -d (too much output) --- scripts/cmake/vcpkg_configure_qmake.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_qmake.cmake b/scripts/cmake/vcpkg_configure_qmake.cmake index 4cc7bc9f7..3aa30e70d 100644 --- a/scripts/cmake/vcpkg_configure_qmake.cmake +++ b/scripts/cmake/vcpkg_configure_qmake.cmake @@ -1,7 +1,7 @@ #.rst: # .. command:: vcpkg_configure_qmake # -# Configure a qmake-based project. +# Configure a qmake-based project. # # :: # vcpkg_configure_qmake(SOURCE_PATH @@ -15,10 +15,10 @@ 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) - + if(NOT QMAKE_COMMAND) message(FATAL_ERROR "vcpkg_configure_qmake: unable to find qmake.") endif() @@ -27,7 +27,7 @@ function(vcpkg_configure_qmake) list(APPEND _csc_OPTIONS CONFIG+=staticlib) endif() - # Cleanup build directories + # Cleanup build directories file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) configure_file(${CURRENT_INSTALLED_DIR}/tools/qt5/qt_release.conf ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf) @@ -35,7 +35,7 @@ function(vcpkg_configure_qmake) message(STATUS "Configuring ${TARGET_TRIPLET}-rel") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" + COMMAND ${QMAKE_COMMAND} CONFIG-=debug CONFIG+=release ${_csc_OPTIONS} ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel LOGNAME config-${TARGET_TRIPLET}-rel ) @@ -46,7 +46,7 @@ function(vcpkg_configure_qmake) message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( - COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} -d ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" + COMMAND ${QMAKE_COMMAND} CONFIG-=release CONFIG+=debug ${_csc_OPTIONS} ${_csc_SOURCE_PATH} -qtconf "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/qt.conf" WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg LOGNAME config-${TARGET_TRIPLET}-dbg ) -- cgit v1.2.3 From 6b48216b8c6112833311bc9aabde4664a036ecd9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 21 Feb 2018 16:44:50 -0800 Subject: [vcpkg-configure-cmake] Improvements to allow list parameters --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 726aab2ec..9bb7d6da3 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -204,12 +204,12 @@ function(vcpkg_configure_cmake) endif() set(rel_command - ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE} + ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} "${_csc_OPTIONS}" "${_csc_OPTIONS_RELEASE}" -G ${GENERATOR} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}) set(dbg_command - ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG} + ${CMAKE_COMMAND} ${_csc_SOURCE_PATH} "${_csc_OPTIONS}" "${_csc_OPTIONS_DEBUG}" -G ${GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) -- cgit v1.2.3 From 099759de63e2d64ffe80f6c9244a2390e47316bc Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 21 Feb 2018 16:45:24 -0800 Subject: [vcpkg-download-distfile] Create target directory on download --- scripts/cmake/vcpkg_download_distfile.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 28276f47c..af4926008 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -111,6 +111,8 @@ function(vcpkg_download_distfile VAR) message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") set(download_success 0) else() + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") file(RENAME ${download_file_path_part} ${downloaded_file_path}) message(STATUS "Downloading ${url}... OK") set(download_success 1) -- cgit v1.2.3 From 59dca1d481113057aebb1bbf76eaf72b018d0ba2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 21 Feb 2018 20:08:25 -0800 Subject: [vcpkg] Handle feature packages in CI --- scripts/internalCI.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 index 37f4f35a4..9529c3766 100644 --- a/scripts/internalCI.ps1 +++ b/scripts/internalCI.ps1 @@ -18,5 +18,5 @@ if (-not $?) { throw $? } ./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp ` bond cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static ` -opencv:x86-uwp boost:x86-uwp --keep-going "--x-xunit=TEST-internal-ci.xml" +opencv:x86-uwp boost:x86-uwp --keep-going "--x-xunit=TEST-internal-ci.xml" --recurse if (-not $?) { throw $? } -- cgit v1.2.3 From b0f2b75a2b22ae62eb2ad2ebd505d6c33520b448 Mon Sep 17 00:00:00 2001 From: Jim McGrath Date: Thu, 22 Feb 2018 15:19:14 -0600 Subject: use TLS 1.2 for downloads --- scripts/VcpkgPowershellUtils.ps1 | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index b73361fd1..0cad383d0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,3 +1,4 @@ +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) { return [bool](Get-Module -ListAvailable -Name $moduleName) -- cgit v1.2.3 From ce53ea00118154f240e7b5cb1856fd85b45dd216 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Feb 2018 17:56:55 -0800 Subject: TLS fix --- scripts/VcpkgPowershellUtils.ps1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 0cad383d0..d4296857e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,4 +1,3 @@ -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) { return [bool](Get-Module -ListAvailable -Name $moduleName) @@ -121,11 +120,26 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, return } + if ($url -match "github") + { + if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12")) + { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + } + else + { + Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" + Write-Warning "Please manually download $url to $downloadPath" + throw "Download failed" + } + } + vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath + $wc = New-Object System.Net.WebClient if (!$wc.Proxy.IsBypassed($url)) { -- cgit v1.2.3 From 0334365f516c5f229ff4fcf038c7d0190979a38a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 23 Feb 2018 16:50:32 -0800 Subject: [vcpkg-cmake-integration] Warn if no packages are installed for the current triplet. --- scripts/buildsystems/vcpkg.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ceb43940b..d5108471f 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -81,6 +81,10 @@ if(NOT DEFINED _VCPKG_ROOT_DIR) endif() set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) +if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_IN_TRY_COMPILE) + message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.") +endif() + if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug -- cgit v1.2.3 From 31b27eaa1b29c856ffc16b0560a44491d27bea01 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Feb 2018 19:48:37 -0800 Subject: Introduce vcpkgDependency.xml instead of hardcoding --- scripts/fetchDependency.ps1 | 110 ++++++++++++------------------------------ scripts/vcpkgDependencies.xml | 48 ++++++++++++++++++ 2 files changed, 79 insertions(+), 79 deletions(-) create mode 100644 scripts/vcpkgDependencies.xml (limited to 'scripts') diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 index ec3cdc83a..5f7902881 100644 --- a/scripts/fetchDependency.ps1 +++ b/scripts/fetchDependency.ps1 @@ -1,124 +1,76 @@ [CmdletBinding()] param( - [Parameter(Mandatory=$true)][string]$Dependency + [Parameter(Mandatory=$true)][string]$dependency ) $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" -Write-Verbose "Fetching dependency: $Dependency" +Write-Verbose "Fetching dependency: $dependency" $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" -function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency) +function fetchDependencyInternal([Parameter(Mandatory=$true)][string]$dependency) { - # Enums (without resorting to C#) are only available on powershell 5+. - $ExtractionType_NO_EXTRACTION_REQUIRED = 0 - $ExtractionType_ZIP = 1 - $ExtractionType_SELF_EXTRACTING_7Z = 2 + $dependency = $dependency.toLower() - if($Dependency -eq "cmake") - { - $requiredVersion = "3.10.2" - $downloadVersion = "3.10.2" - $url = "https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip" - $downloadPath = "$downloadsDir\cmake-3.10.2-win32-x86.zip" - $expectedDownloadedFileHash = "f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6" - $executableFromDownload = "$downloadsDir\cmake-3.10.2-win32-x86\bin\cmake.exe" - $extractionType = $ExtractionType_ZIP - } - elseif($Dependency -eq "nuget") - { - $requiredVersion = "4.4.0" - $downloadVersion = "4.4.0" - $url = "https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe" - $downloadPath = "$downloadsDir\nuget-$downloadVersion\nuget.exe" - $expectedDownloadedFileHash = "2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6" - $executableFromDownload = $downloadPath - $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED - } - elseif($Dependency -eq "vswhere") - { - $requiredVersion = "2.3.2" - $downloadVersion = "2.3.2" - $url = "https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe" - $downloadPath = "$downloadsDir\vswhere-$downloadVersion\vswhere.exe" - $expectedDownloadedFileHash = "103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04" - $executableFromDownload = $downloadPath - $extractionType = $ExtractionType_NO_EXTRACTION_REQUIRED - } - elseif($Dependency -eq "git") - { - $requiredVersion = "2.16.2" - $downloadVersion = "2.16.2" - $url = "https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip" - $downloadPath = "$downloadsDir\MinGit-2.16.2-32-bit.zip" - $expectedDownloadedFileHash = "322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da" - # There is another copy of git.exe in MinGit\bin. However, an installed version of git add the cmd dir to the PATH. - # Therefore, choosing the cmd dir here as well. - $executableFromDownload = "$downloadsDir\MinGit-2.16.2-32-bit\cmd\git.exe" - $extractionType = $ExtractionType_ZIP - } - elseif($Dependency -eq "installerbase") - { - $requiredVersion = "3.1.81" - $downloadVersion = "3.1.81" - $url = "https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip" - $downloadPath = "$downloadsDir\QtInstallerFramework-win-x86.zip" - $expectedDownloadedFileHash = "f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8" - $executableFromDownload = "$downloadsDir\QtInstallerFramework-win-x86\bin\installerbase.exe" - $extractionType = $ExtractionType_ZIP - } - else + [xml]$asXml = Get-Content "$scriptsDir\vcpkgDependencies.xml" + $dependencyData = $asXml.SelectSingleNode("//dependencies/dependency[@name=`"$dependency`"]") # Case-sensitive! + + if ($dependencyData -eq $null) { - throw "Unknown program requested" + throw "Unkown dependency $dependency" } + $requiredVersion = $dependencyData.requiredVersion + $downloadVersion = $dependencyData.downloadVersion + $url = $dependencyData.x86url + $downloadRelativePath = $dependencyData.downloadRelativePath + $downloadPath = "$downloadsDir\$downloadRelativePath" + $expectedDownloadedFileHash = $dependencyData.sha256 + $extension = $dependencyData.extension + if (!(Test-Path $downloadPath)) { - Write-Host "Downloading $Dependency..." + Write-Host "Downloading $dependency..." vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $Dependency has completed successfully." + Write-Host "Downloading $dependency has completed successfully." } $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if ($extractionType -eq $ExtractionType_NO_EXTRACTION_REQUIRED) + + if ($extension -eq "exe") { - # do nothing + $executableFromDownload = $downloadPath } - elseif($extractionType -eq $ExtractionType_ZIP) + elseif ($extension -eq "zip") { + $postExtractionExecutableRelativePath = $dependencyData.postExtractionExecutableRelativePath + $executableFromDownload = "$downloadsDir\$postExtractionExecutableRelativePath" if (-not (Test-Path $executableFromDownload)) { $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $Dependency..." + Write-Host "Extracting $dependency..." vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $Dependency has completed successfully." - } - } - elseif($extractionType -eq $ExtractionType_SELF_EXTRACTING_7Z) - { - if (-not (Test-Path $executableFromDownload)) - { - vcpkgInvokeCommand $downloadPath "-y" + Write-Host "Extracting $dependency has completed successfully." } } else { - throw "Invalid extraction type" + throw "Unexpected file type" } if (-not (Test-Path $executableFromDownload)) { - throw ("Could not detect or download " + $Dependency) + throw ("Could not detect or download " + $dependency) } return $executableFromDownload } -$path = SelectProgram $Dependency -Write-Verbose "Fetching dependency: $Dependency. Done." +$path = fetchDependencyInternal $dependency +Write-Verbose "Fetching dependency: $dependency. Done." return "::$path::" diff --git a/scripts/vcpkgDependencies.xml b/scripts/vcpkgDependencies.xml new file mode 100644 index 000000000..2007b3ca6 --- /dev/null +++ b/scripts/vcpkgDependencies.xml @@ -0,0 +1,48 @@ + + + + 3.10.2 + 3.10.2 + https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip + cmake-3.10.2-win32-x86.zip + f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 + zip + cmake-3.10.2-win32-x86\bin\cmake.exe + + + 2.16.2 + 2.16.2 + https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip + MinGit-2.16.2-32-bit.zip + 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da + zip + + MinGit-2.16.2-32-bit\cmd\git.exe + + + 2.3.2 + 2.3.2 + https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe + vswhere-2.3.2\vswhere.exe + 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 + exe + + + 4.4.0 + 4.4.0 + https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe + nuget-4.4.0\nuget.exe + 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 + exe + + + 3.1.81 + 3.1.81 + https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip + QtInstallerFramework-win-x86.zip + f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 + zip + QtInstallerFramework-win-x86\bin\installerbase.exe + + \ No newline at end of file -- cgit v1.2.3 From f0cee21f7a11c9c2073616e199b412d6fb2a364d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Feb 2018 19:56:08 -0800 Subject: [vcpkgDependencies.xml] Reuse in bootstrap --- scripts/bootstrap.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index eb4513a64..9ee2d1643 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -14,7 +14,13 @@ $gitHash = "unknownhash" $oldpath = $env:path try { - $env:path += ";$vcpkgRootDir\downloads\MinGit-2.16.2-32-bit\cmd" + [xml]$asXml = Get-Content "$scriptsDir\vcpkgDependencies.xml" + $dependencyData = $asXml.SelectSingleNode("//dependencies/dependency[@name=`"git`"]") + $postExtractionExecutableRelativePath = $dependencyData.postExtractionExecutableRelativePath + $gitFromDownload = "$vcpkgRootDir\downloads\$postExtractionExecutableRelativePath" + $gitDir = split-path -parent $gitFromDownload + + $env:path += ";$gitDir" if (Get-Command "git" -ErrorAction SilentlyContinue) { $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short @@ -29,6 +35,7 @@ finally $env:path = $oldpath } Write-Verbose("Git repo version string is " + $gitHash) + $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" if (!(Test-Path $vcpkgSourcesPath)) -- cgit v1.2.3 From 407767858336479eebe759404db689a9b1e16671 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 23 Feb 2018 16:34:31 -0800 Subject: Rename "depenencies" to tools. Rework xml file to reduce fields. --- scripts/bootstrap.ps1 | 6 +- scripts/fetchDependency.ps1 | 76 ----------------------- scripts/fetchTool.ps1 | 73 ++++++++++++++++++++++ scripts/findVisualStudioInstallationInstances.ps1 | 2 +- scripts/vcpkgDependencies.xml | 48 -------------- scripts/vcpkgTools.xml | 36 +++++++++++ 6 files changed, 113 insertions(+), 128 deletions(-) delete mode 100644 scripts/fetchDependency.ps1 create mode 100644 scripts/fetchTool.ps1 delete mode 100644 scripts/vcpkgDependencies.xml create mode 100644 scripts/vcpkgTools.xml (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 9ee2d1643..bc94aecc8 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -14,9 +14,9 @@ $gitHash = "unknownhash" $oldpath = $env:path try { - [xml]$asXml = Get-Content "$scriptsDir\vcpkgDependencies.xml" - $dependencyData = $asXml.SelectSingleNode("//dependencies/dependency[@name=`"git`"]") - $postExtractionExecutableRelativePath = $dependencyData.postExtractionExecutableRelativePath + [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" + $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"git`"]") + $postExtractionExecutableRelativePath = $toolData.postExtractionExecutableRelativePath $gitFromDownload = "$vcpkgRootDir\downloads\$postExtractionExecutableRelativePath" $gitDir = split-path -parent $gitFromDownload diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1 deleted file mode 100644 index 5f7902881..000000000 --- a/scripts/fetchDependency.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$true)][string]$dependency -) - -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -Write-Verbose "Fetching dependency: $dependency" -$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root - -$downloadsDir = "$vcpkgRootDir\downloads" - -function fetchDependencyInternal([Parameter(Mandatory=$true)][string]$dependency) -{ - $dependency = $dependency.toLower() - - [xml]$asXml = Get-Content "$scriptsDir\vcpkgDependencies.xml" - $dependencyData = $asXml.SelectSingleNode("//dependencies/dependency[@name=`"$dependency`"]") # Case-sensitive! - - if ($dependencyData -eq $null) - { - throw "Unkown dependency $dependency" - } - - $requiredVersion = $dependencyData.requiredVersion - $downloadVersion = $dependencyData.downloadVersion - $url = $dependencyData.x86url - $downloadRelativePath = $dependencyData.downloadRelativePath - $downloadPath = "$downloadsDir\$downloadRelativePath" - $expectedDownloadedFileHash = $dependencyData.sha256 - $extension = $dependencyData.extension - - if (!(Test-Path $downloadPath)) - { - Write-Host "Downloading $dependency..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $dependency has completed successfully." - } - - $downloadedFileHash = vcpkgGetSHA256 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - - - if ($extension -eq "exe") - { - $executableFromDownload = $downloadPath - } - elseif ($extension -eq "zip") - { - $postExtractionExecutableRelativePath = $dependencyData.postExtractionExecutableRelativePath - $executableFromDownload = "$downloadsDir\$postExtractionExecutableRelativePath" - if (-not (Test-Path $executableFromDownload)) - { - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $dependency..." - vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $dependency has completed successfully." - } - } - else - { - throw "Unexpected file type" - } - - if (-not (Test-Path $executableFromDownload)) - { - throw ("Could not detect or download " + $dependency) - } - - return $executableFromDownload -} - -$path = fetchDependencyInternal $dependency -Write-Verbose "Fetching dependency: $dependency. Done." -return "::$path::" diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 new file mode 100644 index 000000000..1f72bb39e --- /dev/null +++ b/scripts/fetchTool.ps1 @@ -0,0 +1,73 @@ +[CmdletBinding()] +param( + [Parameter(Mandatory=$true)][string]$tool +) + +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + +Write-Verbose "Fetching tool: $tool" +$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root + +$downloadsDir = "$vcpkgRootDir\downloads" +vcpkgCreateDirectoryIfNotExists $downloadsDir + +function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) +{ + $tool = $tool.toLower() + + [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" + $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! + + if ($toolData -eq $null) + { + throw "Unkown tool $tool" + } + + $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + + if (Test-Path $exePath) + { + return $exePath + } + + if ($toolData.archiveRelativePath) + { + $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + } + else + { + $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + } + + $url = $toolData.url + if (!(Test-Path $downloadPath)) + { + Write-Host "Downloading $tool..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $tool has completed successfully." + } + + $expectedDownloadedFileHash = $toolData.sha256 + $downloadedFileHash = vcpkgGetSHA256 $downloadPath + vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash + + if ($toolData.archiveRelativePath) + { + $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $tool..." + vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool has completed successfully." + } + + if (-not (Test-Path $exePath)) + { + throw ("Could not detect or download " + $tool) + } + + return $exePath +} + +$path = fetchToolInternal $tool +Write-Verbose "Fetching tool: $tool. Done." +return "::$path::" diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index 359da9caa..fba5f447e 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -4,7 +4,7 @@ param( ) $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -$vswhereExe = (& $scriptsDir\fetchDependency.ps1 "vswhere") -replace "::" -replace "::" +$vswhereExe = (& $scriptsDir\fetchTool.ps1 "vswhere") -replace "::" -replace "::" $output = & $vswhereExe -prerelease -legacy -products * -format xml [xml]$asXml = $output diff --git a/scripts/vcpkgDependencies.xml b/scripts/vcpkgDependencies.xml deleted file mode 100644 index 2007b3ca6..000000000 --- a/scripts/vcpkgDependencies.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - 3.10.2 - 3.10.2 - https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip - cmake-3.10.2-win32-x86.zip - f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 - zip - cmake-3.10.2-win32-x86\bin\cmake.exe - - - 2.16.2 - 2.16.2 - https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip - MinGit-2.16.2-32-bit.zip - 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da - zip - - MinGit-2.16.2-32-bit\cmd\git.exe - - - 2.3.2 - 2.3.2 - https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe - vswhere-2.3.2\vswhere.exe - 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 - exe - - - 4.4.0 - 4.4.0 - https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe - nuget-4.4.0\nuget.exe - 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 - exe - - - 3.1.81 - 3.1.81 - https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip - QtInstallerFramework-win-x86.zip - f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 - zip - QtInstallerFramework-win-x86\bin\installerbase.exe - - \ No newline at end of file diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml new file mode 100644 index 000000000..e54d16864 --- /dev/null +++ b/scripts/vcpkgTools.xml @@ -0,0 +1,36 @@ + + + + 3.10.2 + cmake-3.10.2-win32-x86\bin\cmake.exe + https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip + f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 + cmake-3.10.2-win32-x86.zip + + + 2.16.2 + MinGit-2.16.2-32-bit\cmd\git.exe + https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip + 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da + MinGit-2.16.2-32-bit.zip + + + 2.3.2 + vswhere-2.3.2\vswhere.exe + https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe + 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 + + + 4.4.0 + nuget-4.4.0\nuget.exe + https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe + 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 + + + 3.1.81 + QtInstallerFramework-win-x86\bin\installerbase.exe + https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip + f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 + QtInstallerFramework-win-x86.zip + + -- cgit v1.2.3 From 63901137f66ec90f4a51070bd53a2d7433b4b54a Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Sat, 24 Feb 2018 16:00:51 +0800 Subject: Add doxygen and add packages option to vcpkg_require_msys (#2869) * Add doxygen to acquired programs * Add packages option to msys function * Add documentation for PACKAGES in vcpkg_require_msys * [ffmpeg][x264] Update to use `PACKAGES` parameter. Tweak docs. --- scripts/cmake/vcpkg_acquire_msys.cmake | 41 ++++++++++++++++---------- scripts/cmake/vcpkg_find_acquire_program.cmake | 6 ++++ 2 files changed, 31 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 80a30bf2b..ab0f4d047 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -4,13 +4,18 @@ ## ## ## Usage ## ```cmake -## vcpkg_acquire_msys() +## vcpkg_acquire_msys( [PACKAGES ...]) ## ``` ## ## ## Parameters ## ### MSYS_ROOT_VAR ## An out-variable that will be set to the path to MSYS2. ## +## ### PACKAGES +## A list of packages to acquire in msys. +## +## To ensure a package is available: `vcpkg_acquire_msys(MSYS_ROOT PACKAGES make automake1.15)` +## ## ## Notes ## A call to `vcpkg_acquire_msys` will usually be followed by a call to `bash.exe`: ## ```cmake @@ -23,19 +28,6 @@ ## LOGNAME build-${TARGET_TRIPLET}-rel ## ) ## ``` -## To ensure a package is available: -## ```cmake -## vcpkg_acquire_msys(MSYS_ROOT) -## set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) -## -## message(STATUS "Installing MSYS Packages") -## vcpkg_execute_required_process( -## COMMAND -## ${BASH} --noprofile --norc -c -## 'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed make' -## WORKING_DIRECTORY ${MSYS_ROOT} -## LOGNAME pacman-${TARGET_TRIPLET}) -## ``` ## ## ## Examples ## @@ -45,6 +37,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) set(TOOLPATH ${DOWNLOADS}/tools/msys2) + cmake_parse_arguments(_am "" "" "PACKAGES" ${ARGN}) # detect host architecture if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) @@ -85,16 +78,32 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) WORKING_DIRECTORY ${TOOLPATH} ) execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman-key --init;pacman-key --populate" + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman-key --init;pacman-key --populate" WORKING_DIRECTORY ${TOOLPATH} ) execute_process( - COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin:\$PATH;pacman -Syu --noconfirm" + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "PATH=/usr/bin;pacman -Syu --noconfirm" WORKING_DIRECTORY ${TOOLPATH} ) file(WRITE "${TOOLPATH}/${STAMP}" "0") message(STATUS "Acquiring MSYS2... OK") endif() + if(_am_PACKAGES) + message(STATUS "Acquiring MSYS Packages...") + string(REPLACE ";" " " _am_PACKAGES "${_am_PACKAGES}") + + set(_ENV_ORIGINAL $ENV{PATH}) + set(ENV{PATH} ${PATH_TO_ROOT}/usr/bin) + vcpkg_execute_required_process( + COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}" + WORKING_DIRECTORY ${TOOLPATH} + LOGNAME msys-pacman-${TARGET_TRIPLET} + ) + set(ENV{PATH} "${_ENV_ORIGINAL}") + + message(STATUS "Acquiring MSYS Packages... OK") + endif() + set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 1e6979bad..b24345021 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -159,6 +159,12 @@ function(vcpkg_find_acquire_program VAR) set(URL "https://sourceforge.net/projects/scons/files/scons-local-3.0.1.zip/download") set(ARCHIVE "scons-local-3.0.1.zip") set(HASH fe121b67b979a4e9580c7f62cfdbe0c243eba62a05b560d6d513ac7f35816d439b26d92fc2d7b7d7241c9ce2a49ea7949455a17587ef53c04a5f5125ac635727) + elseif(VAR MATCHES "DOXYGEN") + set(PROGNAME doxygen) + set(PATHS ${DOWNLOADS}/tools/doxygen) + set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip") + set(ARCHIVE "doxygen-1.8.14.windows.bin.zip") + set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From e2980c8f91327614f24abec6704a5831d8074a8a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 26 Feb 2018 18:18:43 -0800 Subject: [vcpkg] Add 7zip internal tool --- scripts/vcpkgTools.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index e54d16864..02fd0b996 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -33,4 +33,11 @@ f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 QtInstallerFramework-win-x86.zip + + 18.01.0 + 7za920\7za.exe + http://www.7-zip.org/a/7za920.zip + 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 7za920.zip + -- cgit v1.2.3 From 4642191a099ddd578a46ecbb2c08899233e9e754 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 28 Feb 2018 03:40:10 -0800 Subject: [vcpkg-scripts] The shell zip extractor requires full paths --- scripts/VcpkgPowershellUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d4296857e..80e6fdc1f 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -163,7 +163,7 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, vcpkgCreateDirectoryIfNotExists $destinationPartial $shell = new-object -com shell.application - $zip = $shell.NameSpace($file) + $zip = $shell.NameSpace($(Get-Item $file).fullname) $itemCount = $zip.Items().Count if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') -- cgit v1.2.3 From f3463c4867df66b8f91adc4e2aa795b59997eb9d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 17:48:31 -0800 Subject: [bootstrap] Fix reference to xml file --- scripts/bootstrap.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index bc94aecc8..a3c842dc0 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -16,8 +16,7 @@ try { [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"git`"]") - $postExtractionExecutableRelativePath = $toolData.postExtractionExecutableRelativePath - $gitFromDownload = "$vcpkgRootDir\downloads\$postExtractionExecutableRelativePath" + $gitFromDownload = "$vcpkgRootDir\downloads\$($toolData.exeRelativePath)" $gitDir = split-path -parent $gitFromDownload $env:path += ";$gitDir" -- cgit v1.2.3 From d979d9b491192764729e82c619d28baaf2d21031 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:06:54 -0800 Subject: Fix issue when isPrerelease is not available --- scripts/VcpkgPowershellUtils.ps1 | 5 +++++ scripts/findVisualStudioInstallationInstances.ps1 | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 80e6fdc1f..088519c37 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,6 +3,11 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } +function vcpkgHasProperty([Parameter(Mandatory=$true)]$object, [Parameter(Mandatory=$true)]$propertyName) +{ + return [bool]($object.psobject.Properties | where { $_.Name -eq "$propertyName"}) +} + function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$dirPath) { if (!(Test-Path $dirPath)) diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 index fba5f447e..cb51c345d 100644 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ b/scripts/findVisualStudioInstallationInstances.ps1 @@ -2,8 +2,10 @@ param( ) - +Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + $vswhereExe = (& $scriptsDir\fetchTool.ps1 "vswhere") -replace "::" -replace "::" $output = & $vswhereExe -prerelease -legacy -products * -format xml @@ -14,7 +16,13 @@ foreach ($instance in $asXml.instances.instance) { $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash $installationVersion = $instance.InstallationVersion - $isPrerelease = $instance.IsPrerelease + + $isPrerelease = -7 + if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") + { + $isPrerelease = $instance.isPrerelease + } + if ($isPrerelease -eq 0) { $releaseType = "PreferenceWeight3::StableRelease" -- cgit v1.2.3 From 6e0b74c7846216f1483949270df899415908cdf0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:43:41 -0800 Subject: [vcpkgHasProperty] Return false if property doesn't exist --- scripts/VcpkgPowershellUtils.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 088519c37..2dbf04085 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -3,8 +3,13 @@ function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) return [bool](Get-Module -ListAvailable -Name $moduleName) } -function vcpkgHasProperty([Parameter(Mandatory=$true)]$object, [Parameter(Mandatory=$true)]$propertyName) +function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { + if ($object -eq $null) + { + return $false + } + return [bool]($object.psobject.Properties | where { $_.Name -eq "$propertyName"}) } -- cgit v1.2.3 From 90cf4371c3852a69477dd165538edec04b525e25 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:44:02 -0800 Subject: [getWindowsSDK.ps1] Fix error when registry key was not found --- scripts/getWindowsSDK.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 index ed2fd11c7..d5e2f59a2 100644 --- a/scripts/getWindowsSDK.ps1 +++ b/scripts/getWindowsSDK.ps1 @@ -7,6 +7,10 @@ param( [switch]$DisableWin81SDK = $False ) +Set-StrictMode -Version Latest +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + if ($DisableWin10SDK -and $DisableWin81SDK) { throw "Both Win10SDK and Win81SDK were disabled." @@ -61,8 +65,10 @@ function CheckWindows10SDK($path) Write-Verbose "`n" Write-Verbose "Looking for Windows 10 SDK" -CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) -CheckWindows10SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue).KitsRoot10) +$regkey10 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue +$regkey10Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue +if (vcpkgHasProperty -object $regkey10 "KitsRoot10") { CheckWindows10SDK($regkey10.KitsRoot10) } +if (vcpkgHasProperty -object $regkey10Wow6432 "KitsRoot10") { CheckWindows10SDK($regkey10Wow6432.KitsRoot10) } CheckWindows10SDK("$env:ProgramFiles\Windows Kits\10") CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") @@ -89,8 +95,10 @@ function CheckWindows81SDK($path) Write-Verbose "`n" Write-Verbose "Looking for Windows 8.1 SDK" -CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) -CheckWindows81SDK((Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue).KitsRoot81) +$regkey81 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue +$regkey81Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue +if (vcpkgHasProperty -object $regkey81 "KitsRoot81") { CheckWindows81SDK($regkey81.KitsRoot81) } +if (vcpkgHasProperty -object $regkey81Wow6432 "KitsRoot81") { CheckWindows81SDK($regkey81Wow6432.KitsRoot81) } CheckWindows81SDK("$env:ProgramFiles\Windows Kits\8.1") CheckWindows81SDK("${env:ProgramFiles(x86)}\Windows Kits\8.1") -- cgit v1.2.3 From 2d2ff28c772a78fa76a656f1a66e04eeea9c879f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:44:57 -0800 Subject: [bootstrap] Set-StrictMode to latest --- scripts/bootstrap.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a3c842dc0..c8ba503d8 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -3,13 +3,12 @@ param( [ValidateNotNullOrEmpty()][string]$disableMetrics = "0", [Parameter(Mandatory=$False)][string]$withVSPath = "" ) - +Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root Write-Verbose("vcpkg Path " + $vcpkgRootDir) - $gitHash = "unknownhash" $oldpath = $env:path try -- cgit v1.2.3 From bbe0aa9230ffa919bec4c3e2b8f51acf4ac052b7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:51:25 -0800 Subject: [fetchTool.ps1] Set-StrictMode to Latest --- scripts/fetchTool.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 1f72bb39e..2c2f599ef 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -3,6 +3,7 @@ param( [Parameter(Mandatory=$true)][string]$tool ) +Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" @@ -31,7 +32,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) return $exePath } - if ($toolData.archiveRelativePath) + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + if ($isArchive) { $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" } @@ -52,7 +54,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if ($toolData.archiveRelativePath) + if ($isArchive) { $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." -- cgit v1.2.3 From 1fb3785beed7dfb24c796619d3c596f34758298e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:59:51 -0800 Subject: [findMSBuild.ps1] Set-StrictMode to Latest --- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 index 570ebdf44..d7fd24e24 100644 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 @@ -4,9 +4,11 @@ param( [string]$withVSPath = "" ) +Set-StrictMode -Version Latest +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition + $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 if ($VisualStudioInstallationInstances -eq $null) { -- cgit v1.2.3 From 045c80a7f465d3a037fa2488f37d044f84c79625 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 1 Mar 2018 17:31:14 +0100 Subject: configure debug before release (#2911) --- scripts/cmake/vcpkg_configure_cmake.cmake | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 9bb7d6da3..724446f92 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -107,7 +107,7 @@ function(vcpkg_configure_cmake) else() message(FATAL_ERROR "Unable to determine appropriate generator for: ${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") endif() - + # If we use Ninja, make sure it's on PATH if(GENERATOR STREQUAL "Ninja") vcpkg_find_acquire_program(NINJA) @@ -252,17 +252,6 @@ function(vcpkg_configure_cmake) ) message(STATUS "Configuring ${TARGET_TRIPLET} done") else() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - message(STATUS "Configuring ${TARGET_TRIPLET}-rel") - file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) - vcpkg_execute_required_process( - COMMAND ${rel_command} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME config-${TARGET_TRIPLET}-rel - ) - message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) @@ -273,7 +262,18 @@ function(vcpkg_configure_cmake) ) message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done") endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${rel_command} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME config-${TARGET_TRIPLET}-rel + ) + message(STATUS "Configuring ${TARGET_TRIPLET}-rel done") + endif() endif() set(_VCPKG_CMAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE) -endfunction() \ No newline at end of file +endfunction() -- cgit v1.2.3 From e70250ca199f9e55c88c242ee980313b8acb45e5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 1 Mar 2018 10:36:13 -0800 Subject: [vcpkg] Improve handling of HDF5 targets --- scripts/buildsystems/vcpkg.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d5108471f..7b738bd5e 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -233,12 +233,22 @@ macro(find_package name) elseif("${name}" STREQUAL "tinyxml2") _find_package(${ARGV}) if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) - add_library(tinyxml2 INTERFACE IMPORTED) + _add_library(tinyxml2 INTERFACE IMPORTED) set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") endif() - elseif("${name}" STREQUAL "HDF5" AND NOT PROJECT_NAME STREQUAL "VTK") + elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK") # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) + # Fill in missing static/shared targets + foreach(HDF5TARGET hdf5 hdf5_hl hdf5_cpp hdf5_hl_cpp) + if(TARGET hdf5::${HDF5TARGET}-static AND NOT TARGET hdf5::${HDF5TARGET}-shared) + _add_library(hdf5::${HDF5TARGET}-shared INTERFACE IMPORTED) + set_target_properties(hdf5::${HDF5TARGET}-shared PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-static") + elseif(TARGET hdf5::${HDF5TARGET}-shared AND NOT TARGET hdf5::${HDF5TARGET}-static) + _add_library(hdf5::${HDF5TARGET}-static INTERFACE IMPORTED) + set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") + endif() + endforeach() elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) if(CURL_FOUND) -- cgit v1.2.3 From a0eece81c68faf9713441c3aeb283a16bc232c52 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 1 Mar 2018 11:10:19 -0800 Subject: [vcpkg-download-distfile] Add proxy usage information to download failed message --- scripts/cmake/vcpkg_download_distfile.cmake | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index af4926008..4b111f3f0 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -71,22 +71,22 @@ function(vcpkg_download_distfile VAR) file(REMOVE_RECURSE "${DOWNLOADS}/temp") file(MAKE_DIRECTORY "${DOWNLOADS}/temp") - function(test_hash FILE_KIND CUSTOM_ERROR_ADVICE) + function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE) if(_VCPKG_INTERNAL_NO_HASH_CHECK) # When using the internal hash skip, do not output an explicit message. return() endif() if(vcpkg_download_distfile_SKIP_SHA512) - message(STATUS "Skipping hash check for ${downloaded_file_path}.") + message(STATUS "Skipping hash check for ${FILE_PATH}.") return() endif() message(STATUS "Testing integrity of ${FILE_KIND}...") - file(SHA512 ${downloaded_file_path} FILE_HASH) + file(SHA512 ${FILE_PATH} FILE_HASH) if(NOT "${FILE_HASH}" STREQUAL "${vcpkg_download_distfile_SHA512}") message(FATAL_ERROR "\nFile does not have expected hash:\n" - " File path: [ ${downloaded_file_path} ]\n" + " File path: [ ${FILE_PATH} ]\n" " Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n" " Actual hash: [ ${FILE_HASH} ]\n" "${CUSTOM_ERROR_ADVICE}\n") @@ -96,7 +96,7 @@ function(vcpkg_download_distfile VAR) if(EXISTS ${downloaded_file_path}) message(STATUS "Using cached ${downloaded_file_path}") - test_hash("cached file" "Please delete the file and retry if this file should be downloaded again.") + test_hash("${downloaded_file_path}" "cached file" "Please delete the file and retry if this file should be downloaded again.") else() if(_VCPKG_NO_DOWNLOADS) message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") @@ -111,9 +111,6 @@ function(vcpkg_download_distfile VAR) message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") set(download_success 0) else() - get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) - file(MAKE_DIRECTORY "${downloaded_file_dir}") - file(RENAME ${download_file_path_part} ${downloaded_file_path}) message(STATUS "Downloading ${url}... OK") set(download_success 1) break() @@ -122,11 +119,16 @@ function(vcpkg_download_distfile VAR) if (NOT download_success) message(FATAL_ERROR - "\n" + " \n" " Failed to download file.\n" - " Add mirrors or submit an issue at https://github.com/Microsoft/vcpkg/issues\n") + " If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment\n" + " variables to \"https://user:password@your-proxy-ip-address:port/\".\n" + " Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n") else() - test_hash("downloaded file" "The file may have been corrupted in transit.") + test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n") + get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY) + file(MAKE_DIRECTORY "${downloaded_file_dir}") + file(RENAME ${download_file_path_part} ${downloaded_file_path}) endif() endif() set(${VAR} ${downloaded_file_path} PARENT_SCOPE) -- cgit v1.2.3 From bad51b04626f25d323433ec159af1d60f93cadb1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 2 Mar 2018 08:59:17 -0800 Subject: [vcpkg] Improve handling of external toolchain files --- scripts/buildsystems/vcpkg.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 7b738bd5e..50001e97d 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -59,7 +59,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "Wind set(_VCPKG_TARGET_TRIPLET_PLAT uwp) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(_VCPKG_TARGET_TRIPLET_PLAT osx) +else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) endif() -- cgit v1.2.3 From 41db37fc3dda2597f66db4f7da9ed69d02544b45 Mon Sep 17 00:00:00 2001 From: ucker Date: Sat, 3 Mar 2018 21:40:32 +0800 Subject: update the address of msys2 (#2941) --- scripts/cmake/vcpkg_acquire_msys.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index ab0f4d047..13639cb89 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -48,13 +48,13 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) if(_vam_HOST_ARCHITECTURE STREQUAL "AMD64") set(TOOLSUBPATH msys64) - set(URL "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20161025.tar.xz/download") + set(URL "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz") set(ARCHIVE "msys2-base-x86_64-20161025.tar.xz") set(HASH 6c4c18ec59db80b8269698d074866438a624f1ce735ee5005a01b148b02e8f2e966ae381aa1cb4c50f6226c3b7feb271e36907cf26580df084d695b3c9f5c0eb) set(STAMP "initialized-msys2_64.stamp") else() set(TOOLSUBPATH msys32) - set(URL "https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20161025.tar.xz/download") + set(URL "http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz") set(ARCHIVE "msys2-base-i686-20161025.tar.xz") set(HASH c9260a38e0c6bf963adeaea098c4e376449c1dd0afe07480741d6583a1ac4c138951ccb0c5388bd148e04255a5c1a23bf5ee2d58dcd6607c14f1eaa5639a7c85) set(STAMP "initialized-msys2_32.stamp") -- cgit v1.2.3 From a084120ab45f70113b819f4cd55fbb50d7d98247 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 3 Mar 2018 10:46:07 -0800 Subject: [vcpkg-acquire-msys] Restore sourceforge as a fallback mirror --- scripts/cmake/vcpkg_acquire_msys.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index 13639cb89..eec08e3f1 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -48,13 +48,19 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) if(_vam_HOST_ARCHITECTURE STREQUAL "AMD64") set(TOOLSUBPATH msys64) - set(URL "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz") + set(URLS + "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20161025.tar.xz" + "https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-base-x86_64-20161025.tar.xz/download" + ) set(ARCHIVE "msys2-base-x86_64-20161025.tar.xz") set(HASH 6c4c18ec59db80b8269698d074866438a624f1ce735ee5005a01b148b02e8f2e966ae381aa1cb4c50f6226c3b7feb271e36907cf26580df084d695b3c9f5c0eb) set(STAMP "initialized-msys2_64.stamp") else() set(TOOLSUBPATH msys32) - set(URL "http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz") + set(URLS + "http://repo.msys2.org/distrib/i686/msys2-base-i686-20161025.tar.xz" + "https://sourceforge.net/projects/msys2/files/Base/i686/msys2-base-i686-20161025.tar.xz/download" + ) set(ARCHIVE "msys2-base-i686-20161025.tar.xz") set(HASH c9260a38e0c6bf963adeaea098c4e376449c1dd0afe07480741d6583a1ac4c138951ccb0c5388bd148e04255a5c1a23bf5ee2d58dcd6607c14f1eaa5639a7c85) set(STAMP "initialized-msys2_32.stamp") @@ -66,7 +72,7 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) message(STATUS "Acquiring MSYS2...") vcpkg_download_distfile(ARCHIVE_PATH - URLS ${URL} + URLS ${URLS} FILENAME ${ARCHIVE} SHA512 ${HASH} ) -- cgit v1.2.3 From 6f5573e889c4125f15fff0ee63b60ebcb79fed2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 3 Mar 2018 22:09:55 +0100 Subject: [vcpkg] Allow ninja-based parallel configuration for UWP targets (#2929) Allow using ninja as parallel configuration runner even if it is not used as generator. This significantly improves throughput for usecases like CI with timeouts and more than one CPU (e.g. AppVeyor). --- scripts/cmake/vcpkg_configure_cmake.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 724446f92..e590fb8e7 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -62,10 +62,12 @@ function(vcpkg_configure_cmake) set(_csc_HOST_ARCHITECTURE $ENV{PROCESSOR_ARCHITECTURE}) endif() - set(NINJA_CAN_BE_USED ON) + set(NINJA_CAN_BE_USED ON) # Ninja as generator + set(NINJA_HOST ON) # Ninja as parallel configurator if(_csc_HOST_ARCHITECTURE STREQUAL "x86") # Prebuilt ninja binaries are only provided for x64 hosts set(NINJA_CAN_BE_USED OFF) + set(NINJA_HOST OFF) elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") # Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility set(NINJA_CAN_BE_USED OFF) @@ -214,7 +216,7 @@ function(vcpkg_configure_cmake) -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug) - if(NINJA_CAN_BE_USED AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _csc_DISABLE_PARALLEL_CONFIGURE) + if(NINJA_HOST AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT _csc_DISABLE_PARALLEL_CONFIGURE) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) -- cgit v1.2.3 From 59795e2a8e4e2ecd0f1a09e165b61291764df94d Mon Sep 17 00:00:00 2001 From: Viktor Gal Date: Wed, 7 Mar 2018 18:56:59 +0100 Subject: add shogun 6.1.3 (#2977) * add shogun 6.1.3 * [shogun] Add additional dependencies, force static linking --- scripts/buildsystems/vcpkg.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 50001e97d..2f3af6598 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -260,6 +260,11 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() + elseif("${name}" STREQUAL "LibXml2") + _find_package(${ARGV}) + if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) + list(APPEND LIBXML2_LIBRARIES libiconv libcharset ws2_32) + endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From ae1ce5aaa794c7d3415cabe4f46ea150a01db5ca Mon Sep 17 00:00:00 2001 From: Bruce Jones Date: Wed, 7 Mar 2018 13:17:52 -0500 Subject: applocal-deps applied to MODULE_LIBRARY target too (#2972) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries * applocal-deps applied to MODULE_LIBRARY target too --- scripts/buildsystems/vcpkg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 2f3af6598..b3e27b5d0 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -170,7 +170,7 @@ function(add_library name) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) get_target_property(IS_LIBRARY_SHARED ${name} TYPE) - if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY") + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND (IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY" OR IS_LIBRARY_SHARED STREQUAL "MODULE_LIBRARY")) add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -- cgit v1.2.3 From a759caf15e031744e99e9718633fcc8d9a60b077 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Mar 2018 11:56:21 -0800 Subject: [gsl] Fix finding release libs in debug configurations. Fixes #2982. --- scripts/buildsystems/vcpkg.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b3e27b5d0..a1989b23a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -251,6 +251,18 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() + elseif("${name}" STREQUAL "GSL") + _find_package(${ARGV}) + 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() elseif("${name}" STREQUAL "CURL") _find_package(${ARGV}) if(CURL_FOUND) -- cgit v1.2.3 From 8d70abd134aaa81a84169ec0b352d1aef0f78446 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Mar 2018 01:43:13 -0800 Subject: [libxml2] Fix vcpkg toolchain helper --- scripts/buildsystems/vcpkg.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index a1989b23a..ce5efc1de 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -275,7 +275,12 @@ macro(find_package name) elseif("${name}" STREQUAL "LibXml2") _find_package(${ARGV}) if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) - list(APPEND LIBXML2_LIBRARIES libiconv libcharset ws2_32) + list(APPEND LIBXML2_LIBRARIES + debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib + optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib + debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib + optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib + ws2_32) endif() else() _find_package(${ARGV}) -- cgit v1.2.3 From ad7fa55bb004571bc7d2aad337dda978fe4d2bac Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Mar 2018 09:57:37 -0800 Subject: [vcpkg] Improve handling of external toolchains. Extract MSVC settings to a separate toolchain file. --- scripts/cmake/vcpkg_configure_cmake.cmake | 45 ++++++++----------------------- scripts/toolchains/windows.cmake | 23 ++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 scripts/toolchains/windows.cmake (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index e590fb8e7..aa549903b 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -80,7 +80,7 @@ function(vcpkg_configure_cmake) set(GENERATOR ${_csc_GENERATOR}) elseif(_csc_PREFER_NINJA AND NINJA_CAN_BE_USED) set(GENERATOR "Ninja") - elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + elseif(VCPKG_CHAINLOAD_TOOLCHAIN_FILE OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) set(GENERATOR "Ninja") elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86" AND VCPKG_PLATFORM_TOOLSET MATCHES "v120") @@ -152,39 +152,8 @@ function(vcpkg_configure_cmake) if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - else() - set(VCPKG_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}") - set(VCPKG_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}") - if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") - list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" - ) - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" - ) - elseif(VCPKG_CRT_LINKAGE STREQUAL "static") - list(APPEND _csc_OPTIONS_DEBUG - "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" - "-DCMAKE_C_FLAGS_DEBUG=/D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" - ) - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" - "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" - ) - else() - message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") - endif() - - list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" - "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" - ) - list(APPEND _csc_OPTIONS - "-DCMAKE_CXX_FLAGS=${VCPKG_CXX_FLAGS}" - "-DCMAKE_C_FLAGS=${VCPKG_C_FLAGS}" - ) + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME) + list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/windows.cmake") endif() list(APPEND _csc_OPTIONS @@ -197,6 +166,14 @@ function(vcpkg_configure_cmake) "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" + "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}" + "-DVCPKG_CXX_FLAGS_RELEASE=${VCPKG_CXX_FLAGS_RELEASE}" + "-DVCPKG_CXX_FLAGS_DEBUG=${VCPKG_CXX_FLAGS_DEBUG}" + "-DVCPKG_C_FLAGS=${VCPKG_C_FLAGS}" + "-DVCPKG_C_FLAGS_RELEASE=${VCPKG_C_FLAGS_RELEASE}" + "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" + "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" + "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" ) if(DEFINED ARCH) diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake new file mode 100644 index 000000000..7bfc2282b --- /dev/null +++ b/scripts/toolchains/windows.cmake @@ -0,0 +1,23 @@ +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if(NOT _CMAKE_IN_TRY_COMPILE) + + if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") + set(VCPKG_CRT_LINK_FLAG_PREFIX "/MD") + elseif(VCPKG_CRT_LINKAGE STREQUAL "static") + set(VCPKG_CRT_LINK_FLAG_PREFIX "/MT") + else() + message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") + endif() + + set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") + set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + + set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") + set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") + set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "") + set(CMAKE_C_FLAGS_RELEASE "${VCPKG_CRT_LINK_FLAG_PREFIX} /O2 /Oi /Gy /DNDEBUG /Z7 ${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "") + + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") + +endif() -- cgit v1.2.3 From f56a5e4e94a1151bc09f073b3597ff3b40e9d4b8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 6 Mar 2018 10:07:39 -0800 Subject: [vcpkg] Improve defaults for other platforms --- scripts/buildsystems/vcpkg.cmake | 4 ++-- scripts/cmake/vcpkg_configure_cmake.cmake | 6 ++++++ scripts/cmake/vcpkg_find_acquire_program.cmake | 12 ++++++++++++ scripts/toolchains/android.cmake | 13 +++++++++++++ scripts/toolchains/linux.cmake | 3 +++ scripts/toolchains/osx.cmake | 1 + 6 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 scripts/toolchains/android.cmake create mode 100644 scripts/toolchains/linux.cmake create mode 100644 scripts/toolchains/osx.cmake (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ce5efc1de..e621da861 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,9 +57,9 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(_VCPKG_TARGET_TRIPLET_PLAT osx) else() set(_VCPKG_TARGET_TRIPLET_PLAT windows) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index aa549903b..951b6443f 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -154,6 +154,12 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME) list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/windows.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/linux.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") + list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/android.cmake") + elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/osx.cmake") endif() list(APPEND _csc_OPTIONS diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index b24345021..21d7ecd8f 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -106,6 +106,8 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME ninja) set(SUBDIR "ninja-1.8.2") set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) + set(BREW_PACKAGE_NAME "ninja") + set(APT_PACKAGE_NAME "ninja-build") 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) @@ -181,6 +183,16 @@ function(vcpkg_find_acquire_program VAR) do_find() if("${${VAR}}" MATCHES "-NOTFOUND") + if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(EXAMPLE ".") + if(DEFINED BREW_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(EXAMPLE ":\n brew install ${BREW_PACKAGE_NAME}") + elseif(DEFINED APT_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(EXAMPLE ":\n sudo apt-get install ${APT_PACKAGE_NAME}") + endif() + message(FATAL_ERROR "Could not find ${PROGNAME}. Please install it via your package manager${EXAMPLE}") + endif() + vcpkg_download_distfile(ARCHIVE_PATH URLS ${URL} SHA512 ${HASH} diff --git a/scripts/toolchains/android.cmake b/scripts/toolchains/android.cmake new file mode 100644 index 000000000..2a37e4c39 --- /dev/null +++ b/scripts/toolchains/android.cmake @@ -0,0 +1,13 @@ + +set(ANDROID_CPP_FEATURES "rtti exceptions" CACHE STRING "") +set(CMAKE_SYSTEM_NAME Android CACHE STRING "") +set(ANDROID_ABI x86_64 CACHE STRING "") +set(ANDROID_TOOLCHAIN clang CACHE STRING "") +set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "") +set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "") + +if(NOT EXISTS "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/build/cmake/android.toolchain.cmake") + message(FATAL_ERROR "Could not find android ndk. Searched at $ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b") +endif() + +include("$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/build/cmake/android.toolchain.cmake") diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake new file mode 100644 index 000000000..80983b500 --- /dev/null +++ b/scripts/toolchains/linux.cmake @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_SYSTEM_NAME Linux CACHE STRING "") diff --git a/scripts/toolchains/osx.cmake b/scripts/toolchains/osx.cmake new file mode 100644 index 000000000..1a164f178 --- /dev/null +++ b/scripts/toolchains/osx.cmake @@ -0,0 +1 @@ +set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "") -- cgit v1.2.3 From 7aaa59fc9d7b814fc6cabd369e9f148f381ffe59 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:03:18 -0700 Subject: [vcpkg] Fix extracting on Windows Server Core. Related to #2518. --- scripts/VcpkgPowershellUtils.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 2dbf04085..73a3fc9ad 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -172,10 +172,6 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $file).fullname) - $itemCount = $zip.Items().Count - if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") @@ -189,6 +185,8 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, else { Write-Verbose("Extracting via shell") + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $file).fullname) foreach($item in $zip.items()) { # Piping to Out-Null is used to block until finished @@ -196,6 +194,8 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, } } + $itemCount = @(Get-ChildItem "$destinationPartial").Count + if ($itemCount -eq 1) { Move-Item -Path "$destinationPartial\*" -Destination $output -- cgit v1.2.3 From 4338ae25a1ac1f81499d12f0c5e4acef5fa1e426 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:04:09 -0700 Subject: [vcpkg] Enable packages to provide cmake wrapper scripts. --- scripts/buildsystems/vcpkg.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index e621da861..1d1977e6a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -184,7 +184,11 @@ function(add_library name) endfunction() macro(find_package name) - if("${name}" STREQUAL "Boost") + string(TOLOWER "${name}" _vcpkg_lowercase_name) + if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake") + set(ARGS "${ARGV}") + include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake) + elseif("${name}" STREQUAL "Boost") set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS}) set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}) set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME}) -- cgit v1.2.3 From 6d748257418551dbf24ad0cec9b7e5591ccc3e4d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:04:52 -0700 Subject: [vcpkg-fixup-cmake-targets] Remove stray absolute references inside top-level cmake files. --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 4bd4d135f..7f1f827c2 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -158,4 +158,13 @@ function(vcpkg_fixup_cmake_targets) if(NOT REMAINING_FILES) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) endif() + + # Patch out any remaining absolute references + file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" CMAKE_CURRENT_PACKAGES_DIR) + file(GLOB CMAKE_FILES ${RELEASE_SHARE}/*.cmake) + foreach(CMAKE_FILE IN LISTS CMAKE_FILES) + file(READ ${CMAKE_FILE} _contents) + string(REPLACE "${CMAKE_CURRENT_PACKAGES_DIR}" "\${CMAKE_CURRENT_LIST_DIR}/../.." _contents "${_contents}") + file(WRITE ${CMAKE_FILE} "${_contents}") + endforeach() endfunction() -- cgit v1.2.3 From ece289b9a6466dca885fd2555ed783d70dcad9bf Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 11 Mar 2018 23:05:28 -0700 Subject: [vcpkg] Don't set CMAKE_CROSSCOMPILING when targetting Linux-on-Linux --- scripts/toolchains/linux.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index 80983b500..d09d374c8 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -1,3 +1,6 @@ cmake_minimum_required(VERSION 3.5) +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") +endif() set(CMAKE_SYSTEM_NAME Linux CACHE STRING "") -- cgit v1.2.3 From 7142a093448baad2869e1ac99e619f02d3a395c1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 05:56:02 -0700 Subject: [vcpkg] Improve non-Windows default triplet detection --- scripts/buildsystems/vcpkg.cmake | 8 +++++--- scripts/toolchains/freebsd.cmake | 4 ++++ scripts/toolchains/linux.cmake | 2 -- scripts/toolchains/osx.cmake | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 scripts/toolchains/freebsd.cmake (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1d1977e6a..196ddcb3c 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,12 +57,14 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")) set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) set(_VCPKG_TARGET_TRIPLET_PLAT osx) -else() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) set(_VCPKG_TARGET_TRIPLET_PLAT windows) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) + set(_VCPKG_TARGET_TRIPLET_PLAT freebsd) endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") diff --git a/scripts/toolchains/freebsd.cmake b/scripts/toolchains/freebsd.cmake new file mode 100644 index 000000000..bfeabe18b --- /dev/null +++ b/scripts/toolchains/freebsd.cmake @@ -0,0 +1,4 @@ +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") + set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") +endif() +set(CMAKE_SYSTEM_NAME FreeBSD CACHE STRING "") diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index d09d374c8..ea4f15d60 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 3.5) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") endif() diff --git a/scripts/toolchains/osx.cmake b/scripts/toolchains/osx.cmake index 1a164f178..dd21f5264 100644 --- a/scripts/toolchains/osx.cmake +++ b/scripts/toolchains/osx.cmake @@ -1 +1,4 @@ +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") +endif() set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "") -- cgit v1.2.3 From 94360c2c65c6b38844ee75890d2be4632cdb4514 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 11:35:19 -0700 Subject: [vcpkg-find-acquire-program] Handle PERL and NASM on non-windows --- scripts/cmake/vcpkg_find_acquire_program.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 21d7ecd8f..083b86fc2 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -49,12 +49,16 @@ function(vcpkg_find_acquire_program VAR) if(VAR MATCHES "PERL") set(PROGNAME perl) set(PATHS ${DOWNLOADS}/tools/perl/perl/bin) + set(BREW_PACKAGE_NAME "perl") + set(APT_PACKAGE_NAME "perl") set(URL "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit-portable.zip") set(ARCHIVE "strawberry-perl-5.24.1.1-32bit-portable.zip") set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26) elseif(VAR MATCHES "NASM") set(PROGNAME nasm) set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02) + set(BREW_PACKAGE_NAME "nasm") + set(APT_PACKAGE_NAME "nasm") set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/win32/nasm-2.12.02-win32.zip" "http://mirrors.kodi.tv/build-deps/win32/nasm-2.12.02-win32.zip" -- cgit v1.2.3 From c5f93055a09629247236d1d7dca2c4aa9c1de7c9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 05:08:35 -0700 Subject: [vcpkg-cmake-toolchain] Only wrap find_package(Boost) if a boost library is installed. --- scripts/buildsystems/vcpkg.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 196ddcb3c..10e3c3f13 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,23 +190,13 @@ macro(find_package name) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake") set(ARGS "${ARGV}") include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake) - elseif("${name}" STREQUAL "Boost") - set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS}) - set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED}) - set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME}) - set(_Boost_COMPILER ${Boost_COMPILER}) + elseif("${name}" STREQUAL "Boost" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/boost") + # Checking for the boost headers disables this wrapper unless the user has installed at least one boost library unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - if(NOT Boost_FOUND) - set(Boost_USE_STATIC_LIBS ${_Boost_USE_STATIC_LIBS}) - set(Boost_USE_MULTITHREADED ${_Boost_USE_MULTITHREADED}) - set(Boost_USE_STATIC_RUNTIME ${_Boost_USE_STATIC_RUNTIME}) - set(Boost_COMPILER ${_Boost_COMPILER}) - _find_package(${ARGV}) - endif() elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3 From 49a719b78a4c7feccc2aca970ec7fb242e1c121b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 19 Mar 2018 10:30:33 -0700 Subject: [libmysql] Use system dependencies to avoid ODR violations --- scripts/cmake/vcpkg_build_cmake.cmake | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index bdf192792..630662588 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -15,6 +15,9 @@ ## The target passed to the cmake build command (`cmake --build . --target `). If not specified, no target will ## be passed. ## +## ### ADD_BIN_TO_PATH +## Adds the appropriate Release and Debug `bin\` directories to the path during the build such that executables can run against the in-tree DLLs. +## ## ## Notes: ## This command should be preceeded by a call to [`vcpkg_configure_cmake()`](vcpkg_configure_cmake.md). ## You can use the alias [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) function if your CMake script supports the @@ -27,7 +30,7 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_build_cmake) - cmake_parse_arguments(_bc "DISABLE_PARALLEL" "TARGET;LOGFILE_ROOT" "" ${ARGN}) + cmake_parse_arguments(_bc "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "TARGET;LOGFILE_ROOT" "" ${ARGN}) if(NOT _bc_LOGFILE_ROOT) set(_bc_LOGFILE_ROOT "build") @@ -65,20 +68,24 @@ function(vcpkg_build_cmake) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") set(SHORT_BUILDTYPE "dbg") + set(CONFIG "Debug") else() set(SHORT_BUILDTYPE "rel") + set(CONFIG "Release") endif() message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") set(LOGS) - if(BUILDTYPE STREQUAL "release") - set(CONFIG "Release") - else() - set(CONFIG "Debug") + if(_bc_ADD_BIN_TO_PATH) + set(_BACKUP_ENV_PATH "$ENV{PATH}") + if(BUILDTYPE STREQUAL "debug") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin;$ENV{PATH}") + else() + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin;$ENV{PATH}") + endif() endif() - execute_process( COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out.log" @@ -134,6 +141,9 @@ function(vcpkg_build_cmake) endif() endif() message(STATUS "Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} done") + if(_bc_ADD_BIN_TO_PATH) + set(ENV{PATH} "${_BACKUP_ENV_PATH}") + endif() endif() endforeach() endfunction() -- cgit v1.2.3 From fdf8d471ed553fa802db784e1b049cd77e721ce2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 20 Mar 2018 12:39:43 -0700 Subject: [TLS 1.2] Add message for Powershell 5.1+ --- scripts/VcpkgPowershellUtils.ps1 | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 73a3fc9ad..82718ecdc 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -140,6 +140,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, { Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" Write-Warning "Please manually download $url to $downloadPath" + Write-Warning "To solve this issue for future downloads, you can also install PowerShell 5.1+" throw "Download failed" } } -- cgit v1.2.3 From 9e54b3792daca1898a1b751d37fa22360721eba5 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 20 Mar 2018 21:45:01 -0700 Subject: [mpg123] Disable LTCG for static libs to avoid ABI incompatibility --- scripts/cmake/vcpkg_build_msbuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index b8403d277..6da8a7369 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -87,6 +87,12 @@ function(vcpkg_build_msbuild) /m ) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions + # TODO: Add a way for the user to override this if they want to opt-in to incompatibility + list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -- cgit v1.2.3 From d5e433f03bf5220ef075489c18f5d1522fda1a4d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 17 Feb 2018 04:46:38 -0800 Subject: [vcpkg-build-msbuild] Add option to use vcpkg's integration. Fixes #891. Fixes #828. --- scripts/cmake/vcpkg_build_msbuild.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index 6da8a7369..db04530ef 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -19,6 +19,11 @@ ## ``` ## ## ## Parameters +## ### USE_VCPKG_INTEGRATION +## Apply the normal `integrate install` integration for building the project. +## +## By default, projects built with this command will not automatically link libraries or have header paths set. +## ## ### PROJECT_PATH ## The path to the solution (`.sln`) or project (`.vcxproj`) file. ## @@ -56,7 +61,13 @@ ## * [cppunit](https://github.com/Microsoft/vcpkg/blob/master/ports/cppunit/portfile.cmake) function(vcpkg_build_msbuild) - cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN}) + cmake_parse_arguments( + _csc + "USE_VCPKG_INTEGRATION" + "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" + ${ARGN} + ) if(NOT DEFINED _csc_RELEASE_CONFIGURATION) set(_csc_RELEASE_CONFIGURATION Release) @@ -93,6 +104,10 @@ function(vcpkg_build_msbuild) list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false) endif() + if(_csc_USE_VCPKG_INTEGRATION) + list(APPEND _csc_OPTIONS /p:ForceImportBeforeCppTargets=${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/vcpkg.targets) + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -- cgit v1.2.3 From 38c9c97b6b2106304a9602ddf580b17e7bf56311 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 21 Mar 2018 11:34:24 -0700 Subject: [double-conversion] Fix on non-windows --- scripts/cmake/vcpkg_configure_cmake.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 951b6443f..5fa42cb11 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -180,6 +180,8 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_BINDIR=bin" ) if(DEFINED ARCH) -- cgit v1.2.3 From c3fb0b169751ec0f25ac3752a7e83e21173073a4 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 22 Mar 2018 03:08:25 -0700 Subject: [vcpkg] Download cmake on osx and linux --- scripts/fetchTool.ps1 | 8 ++++---- scripts/vcpkgTools.xml | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 2c2f599ef..86174ee19 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -35,14 +35,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" if ($isArchive) { - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + $downloadPath = "$downloadsDir\$(@($toolData.archiveRelativePath)[0])" } else { - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + $downloadPath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" } - $url = $toolData.url + [String]$url = @($toolData.url)[0] if (!(Test-Path $downloadPath)) { Write-Host "Downloading $tool..." @@ -50,7 +50,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool has completed successfully." } - $expectedDownloadedFileHash = $toolData.sha256 + $expectedDownloadedFileHash = @($toolData.sha256)[0] $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 02fd0b996..9c78e92d9 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -6,6 +6,12 @@ https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 cmake-3.10.2-win32-x86.zip + cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 -- cgit v1.2.3 From 637c9bc0f012e402f5cff5e5f9ac1ca993f89ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 22 Mar 2018 22:28:17 +0100 Subject: [vcpkg] Fix setting exePath in fetchTool (#3114) --- scripts/fetchTool.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 86174ee19..ff9b5d9bf 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $exePath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" if (Test-Path $exePath) { -- cgit v1.2.3 From bc4fd2653bba4b22b2a9b94a5f22ee0e253413b5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Mar 2018 16:46:52 -0700 Subject: Improve warning message about Powershell 5.1 --- scripts/VcpkgPowershellUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 82718ecdc..d9c9e3760 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -140,7 +140,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, { Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" Write-Warning "Please manually download $url to $downloadPath" - Write-Warning "To solve this issue for future downloads, you can also install PowerShell 5.1+" + Write-Warning "To solve this issue for future downloads, you can also install Windows Management Framework 5.1+" throw "Download failed" } } -- cgit v1.2.3 From 6c690a22837bff0804e7ea4c9b2934cf97cd2211 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 23 Mar 2018 16:23:37 -0700 Subject: [vcpkg-configure-cmake] Set CMAKE_INSTALL_LIBDIR as type string to avoid CMake forming an absolute path --- scripts/cmake/vcpkg_configure_cmake.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 5fa42cb11..4ab02f710 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -180,8 +180,8 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" - "-DCMAKE_INSTALL_LIBDIR=lib" - "-DCMAKE_INSTALL_BINDIR=bin" + "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + "-DCMAKE_INSTALL_BINDIR:STRING=bin" ) if(DEFINED ARCH) -- cgit v1.2.3 From e8d1666d9c88ff1ccce3b388ea09f500735f17b7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 24 Mar 2018 13:08:06 -0700 Subject: [aws-sdk-cpp] Update and fix cmake files --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 7f1f827c2..475047737 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -81,7 +81,7 @@ function(vcpkg_fixup_cmake_targets) endif() endif() - file(GLOB UNUSED_FILES + file(GLOB_RECURSE UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake" "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake" @@ -91,10 +91,10 @@ function(vcpkg_fixup_cmake_targets) file(REMOVE ${UNUSED_FILES}) endif() - file(GLOB RELEASE_TARGETS + file(GLOB_RECURSE RELEASE_TARGETS "${RELEASE_SHARE}/*-release.cmake" ) - foreach(RELEASE_TARGET ${RELEASE_TARGETS}) + foreach(RELEASE_TARGET IN LISTS RELEASE_TARGETS) file(READ ${RELEASE_TARGET} _contents) string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") @@ -102,25 +102,25 @@ function(vcpkg_fixup_cmake_targets) endforeach() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB DEBUG_TARGETS + file(GLOB_RECURSE DEBUG_TARGETS "${DEBUG_SHARE}/*-debug.cmake" ) - foreach(DEBUG_TARGET ${DEBUG_TARGETS}) - get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) + foreach(DEBUG_TARGET IN LISTS DEBUG_TARGETS) + file(RELATIVE_PATH DEBUG_TARGET_REL "${DEBUG_SHARE}" "${DEBUG_TARGET}") file(READ ${DEBUG_TARGET} _contents) string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}") string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}") string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}") - file(WRITE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}/${DEBUG_TARGET_NAME} "${_contents}") + file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}") file(REMOVE ${DEBUG_TARGET}) endforeach() endif() - file(GLOB MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") - foreach(MAIN_TARGET ${MAIN_TARGETS}) + file(GLOB_RECURSE MAIN_TARGETS "${RELEASE_SHARE}/*[Tt]argets.cmake") + foreach(MAIN_TARGET IN LISTS MAIN_TARGETS) file(READ ${MAIN_TARGET} _contents) string(REGEX REPLACE "get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*" @@ -133,8 +133,8 @@ function(vcpkg_fixup_cmake_targets) file(WRITE ${MAIN_TARGET} "${_contents}") endforeach() - file(GLOB MAIN_CONFIGS "${RELEASE_SHARE}/*[Cc]onfig.cmake") - foreach(MAIN_CONFIG ${MAIN_CONFIGS}) + 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\\))*" -- cgit v1.2.3 From 72758773321476dcbb7b9d18f11bf57134bb4545 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 03:04:05 -0700 Subject: [ps1] Fixes/tweaks --- scripts/VcpkgPowershellUtils.ps1 | 13 ++++++------- scripts/fetchTool.ps1 | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d9c9e3760..bc84afa7f 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -110,9 +110,9 @@ function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath) function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath, [Parameter(Mandatory=$true)][string]$expectedHash, - [Parameter(Mandatory=$true)][string]$actualHash ) + [Parameter(Mandatory=$true)][string]$actualHash) { - if ($expectedDownloadedFileHash -ne $downloadedFileHash) + if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + " File path: [ $filePath ]`n" + @@ -150,7 +150,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath - $wc = New-Object System.Net.WebClient if (!$wc.Proxy.IsBypassed($url)) { @@ -161,7 +160,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, +function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, [Parameter(Mandatory=$true)][string]$destinationDir, [Parameter(Mandatory=$true)][string]$outFilename) { @@ -176,18 +175,18 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file, if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') { Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destinationPartial + Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial } elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') { Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $file -OutputPath $destinationPartial + Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial } else { Write-Verbose("Extracting via shell") $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $file).fullname) + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) foreach($item in $zip.items()) { # Piping to Out-Null is used to block until finished diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index ff9b5d9bf..a52986553 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -47,7 +47,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool has completed successfully." + Write-Host "Downloading $tool... done." } $expectedDownloadedFileHash = @($toolData.sha256)[0] -- cgit v1.2.3 From 72194ae8a0e435aee63b8e40f585646247672e3b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 04:08:57 -0700 Subject: [ps1] More fixes/tweaks --- scripts/VcpkgPowershellUtils.ps1 | 7 +++++-- scripts/fetchTool.ps1 | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index bc84afa7f..92e0f21d0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -194,11 +194,14 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, } } - $itemCount = @(Get-ChildItem "$destinationPartial").Count + $items = @(Get-ChildItem "$destinationPartial") + $itemCount = $items.Count if ($itemCount -eq 1) { - Move-Item -Path "$destinationPartial\*" -Destination $output + $item = $items | Select-Object -first 1 + Write-Host "$item" + Move-Item -Path "$destinationPartial\$item" -Destination $output vcpkgRemoveItem $destinationPartial } else diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index a52986553..af6d4d1d9 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -58,13 +58,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." - vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool has completed successfully." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." } if (-not (Test-Path $exePath)) { - throw ("Could not detect or download " + $tool) + Write-Error "Could not detect or download $tool" + throw } return $exePath -- cgit v1.2.3 From cfd0d9c0e2e90227532f36343907f95908a1864d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 26 Mar 2018 17:21:46 -0700 Subject: [vcpkg-find-acquire-program] Update version of YASM --- scripts/cmake/vcpkg_find_acquire_program.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 083b86fc2..64d0c7599 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -40,6 +40,7 @@ function(vcpkg_find_acquire_program VAR) endif() unset(NOEXTRACT) + unset(_vfa_RENAME) unset(SUBDIR) unset(REQUIRED_INTERPRETER) @@ -67,11 +68,13 @@ function(vcpkg_find_acquire_program VAR) set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36) elseif(VAR MATCHES "YASM") set(PROGNAME yasm) - set(PATHS ${DOWNLOADS}/tools/yasm) - set(URL "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe") - set(ARCHIVE "yasm.exe") + set(SUBDIR 1.3.0.6) + set(PATHS ${DOWNLOADS}/tools/yasm/${SUBDIR}) + set(URL "https://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe") + set(ARCHIVE "yasm-1.3.0.6.g1962.exe") + set(_vfa_RENAME "yasm.exe") set(NOEXTRACT ON) - set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720) + set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b) elseif(VAR MATCHES "PYTHON3") set(PROGNAME python) set(SUBDIR "python3") @@ -205,7 +208,11 @@ function(vcpkg_find_acquire_program VAR) file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) if(DEFINED NOEXTRACT) - file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + if(DEFINED _vfa_RENAME) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} RENAME ${_vfa_RENAME}) + else() + file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + endif() else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) -- cgit v1.2.3 From 45d31162c25e168c46d9dd0f3f00e49edf625f21 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 17:48:33 -0700 Subject: [ps1] Remove extraneous function --- scripts/fetchTool.ps1 | 93 ++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 50 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index af6d4d1d9..8cf8002bc 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -13,64 +13,57 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir -function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) -{ - $tool = $tool.toLower() - - [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" - $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! +$tool = $tool.toLower() - if ($toolData -eq $null) - { - throw "Unkown tool $tool" - } +[xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" +$toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! - $exePath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" +if ($toolData -eq $null) +{ + throw "Unkown tool $tool" +} - if (Test-Path $exePath) - { - return $exePath - } +$exePath = "$downloadsDir\$($toolData.exeRelativePath)" - $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" - if ($isArchive) - { - $downloadPath = "$downloadsDir\$(@($toolData.archiveRelativePath)[0])" - } - else - { - $downloadPath = "$downloadsDir\$(@($toolData.exeRelativePath)[0])" - } +if (Test-Path $exePath) +{ + return $exePath +} - [String]$url = @($toolData.url)[0] - if (!(Test-Path $downloadPath)) - { - Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool... done." - } +$isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" +if ($isArchive) +{ + $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" +} +else +{ + $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" +} - $expectedDownloadedFileHash = @($toolData.sha256)[0] - $downloadedFileHash = vcpkgGetSHA256 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash +[String]$url = $toolData.url +if (!(Test-Path $downloadPath)) +{ + Write-Host "Downloading $tool..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $tool... done." +} - if ($isArchive) - { - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool... done." - } +$expectedDownloadedFileHash = $toolData.sha256 +$downloadedFileHash = vcpkgGetSHA256 $downloadPath +vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if (-not (Test-Path $exePath)) - { - Write-Error "Could not detect or download $tool" - throw - } +if ($isArchive) +{ + $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $tool..." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." +} - return $exePath +if (-not (Test-Path $exePath)) +{ + Write-Error "Could not detect or download $tool" + throw } -$path = fetchToolInternal $tool -Write-Verbose "Fetching tool: $tool. Done." -return "::$path::" +return "::$exePath::" -- cgit v1.2.3 From c814c9b8ac883aa42930e1f48660145fd4234fe6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 13:23:30 -0700 Subject: [vcpkgTools.xml] Restructre os-specific info --- scripts/vcpkgTools.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 9c78e92d9..5df2de7ad 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -6,12 +6,20 @@ https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 cmake-3.10.2-win32-x86.zip - cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake - https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz - cmake-3.10.2-Darwin-x86_64.tar.gz - cmake-3.10.2-Linux-x86_64/bin/cmake - https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz - cmake-3.10.2-Linux-x86_64.tar.gz + + + 3.10.2 + cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz + e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 + cmake-3.10.2-Darwin-x86_64.tar.gz + + + 3.10.2 + cmake-3.10.2-Linux-x86_64/bin/cmake + https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz + 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 -- cgit v1.2.3 From 12d862ab2b6e387b596e680d334daa212b77fb32 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 18:06:02 -0700 Subject: [ps1] Revert function removal --- scripts/fetchTool.ps1 | 93 +++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 43 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 8cf8002bc..26eedac3b 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -13,57 +13,64 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir -$tool = $tool.toLower() +function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) +{ + $tool = $tool.toLower() -[xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" -$toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! + [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" + $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! -if ($toolData -eq $null) -{ - throw "Unkown tool $tool" -} + if ($toolData -eq $null) + { + throw "Unkown tool $tool" + } -$exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $exePath = "$downloadsDir\$($toolData.exeRelativePath)" -if (Test-Path $exePath) -{ - return $exePath -} + if (Test-Path $exePath) + { + return $exePath + } -$isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" -if ($isArchive) -{ - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" -} -else -{ - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" -} + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + if ($isArchive) + { + $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + } + else + { + $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + } -[String]$url = $toolData.url -if (!(Test-Path $downloadPath)) -{ - Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath - Write-Host "Downloading $tool... done." -} + [String]$url = $toolData.url + if (!(Test-Path $downloadPath)) + { + Write-Host "Downloading $tool..." + vcpkgDownloadFile $url $downloadPath + Write-Host "Downloading $tool... done." + } -$expectedDownloadedFileHash = $toolData.sha256 -$downloadedFileHash = vcpkgGetSHA256 $downloadPath -vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash + $expectedDownloadedFileHash = $toolData.sha256 + $downloadedFileHash = vcpkgGetSHA256 $downloadPath + vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash -if ($isArchive) -{ - $outFilename = (Get-ChildItem $downloadPath).BaseName - Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename - Write-Host "Extracting $tool... done." -} + if ($isArchive) + { + $outFilename = (Get-ChildItem $downloadPath).BaseName + Write-Host "Extracting $tool..." + vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + Write-Host "Extracting $tool... done." + } -if (-not (Test-Path $exePath)) -{ - Write-Error "Could not detect or download $tool" - throw + if (-not (Test-Path $exePath)) + { + Write-Error "Could not detect or download $tool" + throw + } + + return $exePath } -return "::$exePath::" +$path = fetchToolInternal $tool +Write-Verbose "Fetching tool: $tool. Done." +return "::$path::" -- cgit v1.2.3 From 3e1104465eb4e40e3b4dce1a212d90a68928d442 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Mar 2018 18:35:27 -0700 Subject: Add ninja to vcpkgTools.xml --- scripts/vcpkgTools.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 5df2de7ad..477584c5a 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -54,4 +54,18 @@ 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac 7za920.zip + + 1.8.2 + ninja + https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip + d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 + ninja-linux.zip + + + 1.8.2 + ninja + https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip + 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc + ninja-mac.zip + -- cgit v1.2.3 From f9d4692749ad68340a07453add49a8ef029fa155 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 29 Mar 2018 21:14:06 -0700 Subject: [vcpkg.cmake] Remove Windows SDK detection. Let cmake detect it --- 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 10e3c3f13..0c32b22fb 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -44,7 +44,7 @@ else() elseif(_VCPKG_CL MATCHES "arm/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(_VCPKG_CL MATCHES "arm64/cl.exe$") - set(_VCPKG_TARGET_TRIPLET_ARCH arm64) + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") @@ -110,16 +110,6 @@ list(APPEND CMAKE_LIBRARY_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/manual-link ) -if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") - include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake) - # This is used as an implicit parameter for vcpkg_get_windows_sdk - set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR}) - vcpkg_get_windows_sdk(WINDOWS_SDK_VERSION) - unset(VCPKG_ROOT_DIR) - set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VERSION} CACHE STRING "Windows SDK version") - message(STATUS "Found Windows SDK ${WINDOWS_SDK_VERSION}") -endif() - file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) set(CMAKE_SYSTEM_IGNORE_PATH "${_programfiles}/OpenSSL" -- cgit v1.2.3 From 800f8b0e1dca9cfdb90a9e74c01060bc0440d2a6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 30 Mar 2018 16:59:59 -0700 Subject: Specify ninja exe --- scripts/cmake/vcpkg_configure_cmake.cmake | 1 + scripts/cmake/vcpkg_find_acquire_program.cmake | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 4ab02f710..3a3a88515 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -115,6 +115,7 @@ function(vcpkg_configure_cmake) vcpkg_find_acquire_program(NINJA) get_filename_component(NINJA_PATH ${NINJA} DIRECTORY) set(ENV{PATH} "$ENV{PATH};${NINJA_PATH}") + list(APPEND _csc_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") endif() file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 64d0c7599..0352b1890 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -105,14 +105,18 @@ function(vcpkg_find_acquire_program VAR) set(HASH 830cd94ed6518fbe4604a0f5a3322671b4674b87d25a71349c745500d38e85c0fac4f6995242fc5521eb048e3966bb5ec2a96a06b041343ed8da9bba78124f34) elseif(VAR MATCHES "7Z") set(PROGNAME 7z) - set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" ${DOWNLOADS}/tools/7z/Files/7-Zip) + set(PATHS "${PROGRAM_FILES_PLATFORM_BITNESS}/7-Zip" "${PROGRAM_FILES_32_BIT}/7-Zip" "${DOWNLOADS}/tools/7z/Files/7-Zip") set(URL "http://7-zip.org/a/7z1604.msi") set(ARCHIVE "7z1604.msi") set(HASH 556f95f7566fe23704d136239e4cf5e2a26f939ab43b44145c91b70d031a088d553e5c21301f1242a2295dcde3143b356211f0108c68e65eef8572407618326d) elseif(VAR MATCHES "NINJA") set(PROGNAME ninja) set(SUBDIR "ninja-1.8.2") - set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR}) + if(CMAKE_HOST_WIN32) + set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + else() + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}") + endif() set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip") -- cgit v1.2.3 From 892f7052f943570eb5d8da991ace01725323c695 Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Wed, 7 Mar 2018 17:57:16 +0800 Subject: [vcpkg] Add support of external downloader aria2 --- scripts/cmake/vcpkg_download_distfile.cmake | 47 +++++++++++++++++++++----- scripts/cmake/vcpkg_find_acquire_program.cmake | 8 +++++ 2 files changed, 46 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index 4b111f3f0..fc6199146 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -103,19 +103,48 @@ function(vcpkg_download_distfile VAR) endif() # Tries to download the file. - foreach(url IN LISTS vcpkg_download_distfile_URLS) - message(STATUS "Downloading ${url}...") - file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) - list(GET download_status 0 status_code) - if (NOT "${status_code}" STREQUAL "0") - message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") + list(GET vcpkg_download_distfile_URLS 0 SAMPLE_URL) + if(${_VCPKG_DOWNLOAD_TOOL} MATCHES "ARIA2" AND NOT ${SAMPLE_URL} MATCHES "aria2") + vcpkg_find_acquire_program("ARIA2") + message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...") + execute_process( + COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS} + -o temp/${vcpkg_download_distfile_FILENAME} + -l download-${vcpkg_download_distfile_FILENAME}-detailed.log + OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log + ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${DOWNLOADS} + ) + if (NOT "${error_code}" STREQUAL "0") + message(STATUS + "Downloading ${vcpkg_download_distfile_FILENAME}... Failed.\n" + " Exit Code: ${error_code}\n" + " See logs for more information:\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log\n" + " ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log\n" + ) set(download_success 0) else() - message(STATUS "Downloading ${url}... OK") + message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}... OK") set(download_success 1) - break() endif() - endforeach(url) + else() + foreach(url IN LISTS vcpkg_download_distfile_URLS) + message(STATUS "Downloading ${url}...") + file(DOWNLOAD ${url} "${download_file_path_part}" STATUS download_status) + list(GET download_status 0 status_code) + if (NOT "${status_code}" STREQUAL "0") + message(STATUS "Downloading ${url}... Failed. Status: ${download_status}") + set(download_success 0) + else() + message(STATUS "Downloading ${url}... OK") + set(download_success 1) + break() + endif() + endforeach(url) + endif() if (NOT download_success) message(FATAL_ERROR diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 0352b1890..ef0e1584f 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -25,6 +25,7 @@ ## - NASM ## - NINJA ## - YASM +## - ARIA2 (Downloader) ## ## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md). ## @@ -178,6 +179,13 @@ function(vcpkg_find_acquire_program VAR) set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip") set(ARCHIVE "doxygen-1.8.14.windows.bin.zip") set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50) + # Download Tools + elseif(VAR MATCHES "ARIA2") + set(PROGNAME aria2c) + set(PATHS ${DOWNLOADS}/tools/aria2c/aria2-1.33.1-win-32bit-build1) + set(URL "https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip") + set(ARCHIVE "aria2-1.33.1-win-32bit-build1.zip") + set(HASH 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3) else() message(FATAL "unknown tool ${VAR} -- unable to acquire.") endif() -- cgit v1.2.3 From 875410599151252b475234c162c3a9babb8be73f Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Thu, 15 Mar 2018 13:17:54 +0800 Subject: [vcpkg] Remove log files when downloading succeeds. --- scripts/cmake/vcpkg_download_distfile.cmake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_download_distfile.cmake b/scripts/cmake/vcpkg_download_distfile.cmake index fc6199146..9fc0a0c9a 100644 --- a/scripts/cmake/vcpkg_download_distfile.cmake +++ b/scripts/cmake/vcpkg_download_distfile.cmake @@ -128,6 +128,11 @@ function(vcpkg_download_distfile VAR) set(download_success 0) else() message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}... OK") + file(REMOVE + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log + ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log + ) set(download_success 1) endif() else() -- cgit v1.2.3 From 35f5a0de5327efdea1e9aea7979a2c828daacc0d Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 5 Apr 2018 21:39:47 -0700 Subject: [vcpkg-cmake-toolchain] Remove some hardcoded find_package helpers and guard all remaining ones --- scripts/buildsystems/vcpkg.cmake | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0c32b22fb..a9f8190f7 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -187,7 +187,7 @@ macro(find_package name) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - elseif("${name}" STREQUAL "ICU") + elseif("${name}" STREQUAL "ICU" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/unicode/utf.h") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) set(COMPONENTS_IDX ${COMPONENTS_IDX} PARENT_SCOPE) @@ -198,7 +198,7 @@ macro(find_package name) else() _find_package(${ARGV}) endif() - elseif("${name}" STREQUAL "TIFF") + elseif("${name}" STREQUAL "TIFF" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tiff.h") _find_package(${ARGV}) find_package(LibLZMA) if(TARGET TIFF::TIFF) @@ -207,24 +207,7 @@ macro(find_package name) if(TIFF_LIBRARIES) list(APPEND TIFF_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() - elseif("${name}" STREQUAL "Freetype") - _find_package(${ARGV}) - find_package(ZLIB) - find_package(PNG) - find_package(BZip2) - if(TARGET Freetype::Freetype) - set_property(TARGET Freetype::Freetype APPEND PROPERTY INTERFACE_LINK_LIBRARIES BZip2::BZip2 PNG::PNG ZLIB::ZLIB) - endif() - if(FREETYPE_LIBRARIES) - list(APPEND FREETYPE_LIBRARIES ${BZIP2_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) - endif() - elseif("${name}" STREQUAL "tinyxml2") - _find_package(${ARGV}) - if(TARGET tinyxml2_static AND NOT TARGET tinyxml2) - _add_library(tinyxml2 INTERFACE IMPORTED) - set_target_properties(tinyxml2 PROPERTIES INTERFACE_LINK_LIBRARIES "tinyxml2_static") - endif() - elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK") + elseif(("${name}" STREQUAL "HDF5" OR "${name}" STREQUAL "hdf5") AND NOT PROJECT_NAME STREQUAL "VTK" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/hdf5.h") # This is a hack to make VTK work. TODO: find another way to suppress the built-in find module. _find_package(${ARGV} CONFIG) # Fill in missing static/shared targets @@ -237,7 +220,7 @@ macro(find_package name) set_target_properties(hdf5::${HDF5TARGET}-static PROPERTIES INTERFACE_LINK_LIBRARIES "hdf5::${HDF5TARGET}-shared") endif() endforeach() - elseif("${name}" STREQUAL "GSL") + elseif("${name}" STREQUAL "GSL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/gsl") _find_package(${ARGV}) if(GSL_FOUND AND TARGET GSL::gsl) set_property( TARGET GSL::gslcblas APPEND PROPERTY IMPORTED_CONFIGURATIONS Release ) @@ -249,7 +232,7 @@ macro(find_package name) set_target_properties( GSL::gslcblas PROPERTIES IMPORTED_LOCATION_DEBUG "${GSL_CBLAS_LIBRARY_DEBUG}" ) endif() endif() - elseif("${name}" STREQUAL "CURL") + elseif("${name}" STREQUAL "CURL" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/curl") _find_package(${ARGV}) if(CURL_FOUND) if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") @@ -258,16 +241,6 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() - elseif("${name}" STREQUAL "LibXml2") - _find_package(${ARGV}) - if(LibXml2_FOUND AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) - list(APPEND LIBXML2_LIBRARIES - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib - debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib - optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib - ws2_32) - endif() else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From 31377dee20dad9b95357934732996e2448f2eaf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Apr 2018 21:05:31 -0700 Subject: Use 7z for extracting. Extract tools in downloads/tools --- scripts/VcpkgPowershellUtils.ps1 | 58 +++++++--------------------------------- scripts/fetchTool.ps1 | 22 ++++++++++++--- scripts/vcpkgTools.xml | 20 +++++++++----- 3 files changed, 41 insertions(+), 59 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 92e0f21d0..988c6dbf0 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,8 +1,3 @@ -function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) -{ - return [bool](Get-Module -ListAvailable -Name $moduleName) -} - function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -160,54 +155,21 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir, - [Parameter(Mandatory=$true)][string]$outFilename) +function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, + [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { - vcpkgCreateDirectoryIfNotExists $destinationDir - $output = "$destinationDir\$outFilename" - vcpkgRemoveItem $output - $destinationPartial = "$destinationDir\partially-extracted" - + vcpkgRemoveItem $destinationDir + $destinationPartial = "$destinationDir.partial" vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial - - if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') - { - Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial - } - elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') - { - Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial - } - else - { - Write-Verbose("Extracting via shell") - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) - foreach($item in $zip.items()) - { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destinationPartial).copyhere($item) | Out-Null - } - } - - $items = @(Get-ChildItem "$destinationPartial") - $itemCount = $items.Count - - if ($itemCount -eq 1) - { - $item = $items | Select-Object -first 1 - Write-Host "$item" - Move-Item -Path "$destinationPartial\$item" -Destination $output - vcpkgRemoveItem $destinationPartial - } - else + $ec = vcpkgInvokeCommand "$sevenZipExe" "x `"$archivePath`" -o`"$destinationPartial`" -y" + if ($ec -ne 0) { - Move-Item -Path "$destinationPartial" -Destination $output + Write-Host "Could not extract $archivePath" + throw } + Rename-Item -Path "$destinationPartial" -NewName $destinationDir } function vcpkgInvokeCommand() diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 26eedac3b..315983841 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $toolPath="$downloadsDir\tools\$tool-$($toolData.requiredVersion)-windows" + $exePath = "$toolPath\$($toolData.exeRelativePath)" if (Test-Path $exePath) { @@ -39,7 +40,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) } else { - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + $downloadPath = "$toolPath\$($toolData.exeRelativePath)" } [String]$url = $toolData.url @@ -56,9 +57,22 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { - $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + if ($tool -eq "7zip") + { + $sevenZipR = fetchToolInternal "7zr" + $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + if ($ec -ne 0) + { + Write-Host "Could not extract $downloadPath" + throw + } + } + else + { + $sevenZipExe = fetchToolInternal "7zip" + vcpkgExtractFile -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath + } Write-Host "Extracting $tool... done." } diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 477584c5a..6ef1e4d35 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -23,20 +23,20 @@ 2.16.2 - MinGit-2.16.2-32-bit\cmd\git.exe + cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da MinGit-2.16.2-32-bit.zip 2.3.2 - vswhere-2.3.2\vswhere.exe + vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 4.4.0 - nuget-4.4.0\nuget.exe + nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 @@ -49,10 +49,16 @@ 18.01.0 - 7za920\7za.exe - http://www.7-zip.org/a/7za920.zip - 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac - 7za920.zip + 7za.exe + https://www.7-zip.org/a/7z1801-extra.7z + 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 + 7z1801-extra.7z + + + 18.01.0 + 7zr.exe + https://www.7-zip.org/a/7zr.exe + 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b 1.8.2 -- cgit v1.2.3 From 54c68da907e4881d29e8017e085e6786e1c34ace Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 3 Apr 2018 22:15:17 -0700 Subject: Use aria2 to do downloads (other than aria2 itself, 7za and 7zr) --- scripts/VcpkgPowershellUtils.ps1 | 26 ++++++++++++++++++++++++++ scripts/fetchTool.ps1 | 13 ++++++++++++- scripts/vcpkgTools.xml | 7 +++++++ 3 files changed, 45 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 988c6dbf0..7082ca747 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -155,6 +155,32 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, Move-Item -Path $downloadPartPath -Destination $downloadPath } +function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe, + [Parameter(Mandatory=$true)][string]$url, + [Parameter(Mandatory=$true)][string]$downloadPath) +{ + if (Test-Path $downloadPath) + { + return + } + + vcpkgCreateParentDirectoryIfNotExists $downloadPath + $downloadPartPath = "$downloadPath.part" + vcpkgRemoveItem $downloadPartPath + + $parentDir = split-path -parent $downloadPath + $filename = split-path -leaf $downloadPath + + $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" + if ($ec -ne 0) + { + Write-Host "Could not download $url" + throw + } + + Move-Item -Path $downloadPartPath -Destination $downloadPath +} + function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, [Parameter(Mandatory=$true)][string]$archivePath, [Parameter(Mandatory=$true)][string]$destinationDir) diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 315983841..05335c724 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -47,7 +47,18 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if (!(Test-Path $downloadPath)) { Write-Host "Downloading $tool..." - vcpkgDownloadFile $url $downloadPath + + # aria2 needs 7zip & 7zr to extract. So, we need to download those trough powershell + if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zr") + { + vcpkgDownloadFile $url $downloadPath + } + else + { + $aria2exe = fetchToolInternal "aria2" + vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath + } + Write-Host "Downloading $tool... done." } diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 6ef1e4d35..fe1cc12a9 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -60,6 +60,13 @@ https://www.7-zip.org/a/7zr.exe 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b + + 18.01.0 + aria2-1.33.1-win-32bit-build1\aria2c.exe + https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip + 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f + aria2-1.33.1-win-32bit-build1.zip + 1.8.2 ninja -- cgit v1.2.3 From e3099b458b5c11742c1b88c27847801090870f2d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:26:14 -0700 Subject: Use 7zip920 instead of 7zr --- scripts/VcpkgPowershellUtils.ps1 | 19 +++++++++++++++++++ scripts/fetchTool.ps1 | 14 +++++++++----- scripts/vcpkgTools.xml | 11 ++++++----- 3 files changed, 34 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 7082ca747..d7967889e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -198,6 +198,25 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, Rename-Item -Path "$destinationPartial" -NewName $destinationDir } +function vcpkgExtractZipFileWithShell( [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) +{ + vcpkgRemoveItem $destinationDir + $destinationPartial = "$destinationDir.partial" + vcpkgRemoveItem $destinationPartial + vcpkgCreateDirectoryIfNotExists $destinationPartial + + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + } + + Rename-Item -Path "$destinationPartial" -NewName $destinationDir +} + function vcpkgInvokeCommand() { param ( [Parameter(Mandatory=$true)][string]$executable, diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 05335c724..e46c7808d 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -48,8 +48,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." - # aria2 needs 7zip & 7zr to extract. So, we need to download those trough powershell - if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zr") + # aria2 needs 7zip & 7zip920 to extract. So, we need to download those trough powershell + if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zip920") { vcpkgDownloadFile $url $downloadPath } @@ -69,10 +69,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { Write-Host "Extracting $tool..." - if ($tool -eq "7zip") + if ($tool -eq "7zip920") { - $sevenZipR = fetchToolInternal "7zr" - $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath + } + elseif ($tool -eq "7zip") + { + $sevenZip920 = fetchToolInternal "7zip920" + $ec = vcpkgInvokeCommand "$sevenZip920" "x `"$downloadPath`" -o`"$toolPath`" -y" if ($ec -ne 0) { Write-Host "Could not extract $downloadPath" diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fe1cc12a9..810818998 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -54,11 +54,12 @@ 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 7z1801-extra.7z - - 18.01.0 - 7zr.exe - https://www.7-zip.org/a/7zr.exe - 2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b + + 9.20.0 + 7za.exe + https://www.7-zip.org/a/7za920.zip + 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 7za920.zip 18.01.0 -- cgit v1.2.3 From 23c2b82535d24a8ef343ce2ca36e5a63d111dcd8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:28:10 -0700 Subject: [vcpkgTools.xml] Add os="windows" to relevant entries --- scripts/vcpkgTools.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 810818998..fbd6aabd6 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,6 +1,6 @@ - + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip @@ -21,47 +21,47 @@ 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea cmake-3.10.2-Linux-x86_64.tar.gz - + 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da MinGit-2.16.2-32-bit.zip - + 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 - + 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 - + 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 QtInstallerFramework-win-x86.zip - + 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 7z1801-extra.7z - + 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac 7za920.zip - + 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip -- cgit v1.2.3 From 863a8f3329356d260c02c0d6f855e81fd1e2cea9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 19:37:31 -0700 Subject: [vcpkgTools.xml] Rename archiveRelativePath to archiveName --- scripts/fetchTool.ps1 | 4 ++-- scripts/vcpkgTools.xml | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index e46c7808d..79ac82cb0 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -33,10 +33,10 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) return $exePath } - $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveName" if ($isArchive) { - $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" + $downloadPath = "$downloadsDir\$($toolData.archiveName)" } else { diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fbd6aabd6..839e476b0 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -5,28 +5,28 @@ cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 - cmake-3.10.2-win32-x86.zip + cmake-3.10.2-win32-x86.zip 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 - cmake-3.10.2-Darwin-x86_64.tar.gz + cmake-3.10.2-Darwin-x86_64.tar.gz 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea - cmake-3.10.2-Linux-x86_64.tar.gz + cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da - MinGit-2.16.2-32-bit.zip + MinGit-2.16.2-32-bit.zip 2.3.2 @@ -45,41 +45,41 @@ QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 - QtInstallerFramework-win-x86.zip + QtInstallerFramework-win-x86.zip 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 - 7z1801-extra.7z + 7z1801-extra.7z 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac - 7za920.zip + 7za920.zip 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f - aria2-1.33.1-win-32bit-build1.zip + aria2-1.33.1-win-32bit-build1.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 - ninja-linux.zip + ninja-linux.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc - ninja-mac.zip + ninja-mac.zip -- cgit v1.2.3 From 2fa16cda18856ae7f6685c48c0aeefd15225af11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:07:45 -0700 Subject: [vcpkgTools.xml] Change sha256 to sha512 --- scripts/VcpkgPowershellUtils.ps1 | 8 ++++---- scripts/fetchTool.ps1 | 4 ++-- scripts/vcpkgTools.xml | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index d7967889e..676ee5c03 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -79,22 +79,22 @@ function vcpkgGetCredentials() } } -function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath) +function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) { if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') { Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA256).Hash + $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash } elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') { Write-Verbose("Hashing with Pscx\Get-Hash") - $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA256).HashString + $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA512).HashString } else { Write-Verbose("Hashing with .NET") - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA256") + $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA512") $fileAsByteArray = [io.File]::ReadAllBytes($filePath) $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) $hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 79ac82cb0..d5c8fe77e 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -62,8 +62,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool... done." } - $expectedDownloadedFileHash = $toolData.sha256 - $downloadedFileHash = vcpkgGetSHA256 $downloadPath + $expectedDownloadedFileHash = $toolData.sha512 + $downloadedFileHash = vcpkgGetSHA512 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash if ($isArchive) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 839e476b0..c3114c2e5 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -4,82 +4,82 @@ 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip - f5f7e41a21d0e9b655aca58498b08e17ecd27796bf82837e2c84435359169dd6 + 9c16861a2ac09c7011b84f38459ecfec2829a9f825b254acbbde46d98f12f8ca0d4db3a6764758cb671507ee7c0327576d87658b81d7ddf1e8280b37569eb16d cmake-3.10.2-win32-x86.zip 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz - e748eb7698f8e2783c2eea9ab81eebf66da0238bbf8e8fa722a67a38f2110718 + cb7d76e11c892eb786da5804282c4141564390c3552e08c506c7abb93015eb5f619c55255459872b219399ce8114ac321fe92df7f82a7e42bbc874eec240571e cmake-3.10.2-Darwin-x86_64.tar.gz 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz - 7a82b46c35f4e68a0807e8dc04e779dee3f36cd42c6387fd13b5c29fe62a69ea + 54389b5cb3f3cb9d182d35e0b1eaf7b301695899930da0d26e9df1dc25056213a077646d23ea609a93daa81d30687757d9cf0dc263339fa3d73dbeb1284bc1a9 cmake-3.10.2-Linux-x86_64.tar.gz 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip - 322c727e482aa97522c64a5ac68bdda3780111e8670bcfb532beac8e11ece5da + 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a MinGit-2.16.2-32-bit.zip 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe - 103f2784c4b2c8e70c7c1c03687abbf22bce052aae30639406e4e13ffa29ee04 + 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe - 2cf9b118937eef825464e548f0c44f7f64090047746de295d75ac3dcffa3e1f6 + fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip - f2ce23cf5cf9fc7ce409bdca49328e09a070c0026d3c8a04e4dfde7b05b83fe8 + 1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73 QtInstallerFramework-win-x86.zip 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z - 9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2 + 9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc 7z1801-extra.7z 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip - 2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac + 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 7za920.zip 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip - 04bf07c0449c703db17fbcd586365aebba00201ca513ca4808b543f1f9208f1f + 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3 aria2-1.33.1-win-32bit-build1.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip - d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 + 38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5 ninja-linux.zip 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip - 0347d55c66061652b26f48769d566761630ffde3143793b29064a57f356542cc + acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3 ninja-mac.zip -- cgit v1.2.3 From 408cd5ccb8d8260efd9a8f2ff956414587d42e28 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:33:45 -0700 Subject: [vcpkgTools.xml] requiredVersion -> version --- scripts/fetchTool.ps1 | 2 +- scripts/vcpkgTools.xml | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index d5c8fe77e..55d04ec98 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $toolPath="$downloadsDir\tools\$tool-$($toolData.requiredVersion)-windows" + $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows" $exePath = "$toolPath\$($toolData.exeRelativePath)" if (Test-Path $exePath) diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index c3114c2e5..07284333c 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,82 +1,82 @@ - 3.10.2 + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe https://cmake.org/files/v3.10/cmake-3.10.2-win32-x86.zip 9c16861a2ac09c7011b84f38459ecfec2829a9f825b254acbbde46d98f12f8ca0d4db3a6764758cb671507ee7c0327576d87658b81d7ddf1e8280b37569eb16d cmake-3.10.2-win32-x86.zip - 3.10.2 + 3.10.2 cmake-3.10.2-Darwin-x86_64/CMake.app/Contents/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Darwin-x86_64.tar.gz cb7d76e11c892eb786da5804282c4141564390c3552e08c506c7abb93015eb5f619c55255459872b219399ce8114ac321fe92df7f82a7e42bbc874eec240571e cmake-3.10.2-Darwin-x86_64.tar.gz - 3.10.2 + 3.10.2 cmake-3.10.2-Linux-x86_64/bin/cmake https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz 54389b5cb3f3cb9d182d35e0b1eaf7b301695899930da0d26e9df1dc25056213a077646d23ea609a93daa81d30687757d9cf0dc263339fa3d73dbeb1284bc1a9 cmake-3.10.2-Linux-x86_64.tar.gz - 2.16.2 + 2.16.2 cmd\git.exe https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a MinGit-2.16.2-32-bit.zip - 2.3.2 + 2.3.2 vswhere.exe https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed - 4.4.0 + 4.4.0 nuget.exe https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 - 3.1.81 + 3.1.81 QtInstallerFramework-win-x86\bin\installerbase.exe https://github.com/podsvirov/installer-framework/releases/download/cr203958-9/QtInstallerFramework-win-x86.zip 1f3e593270d7c2a4e271fdb49c637a2de462351310ef66bba298d30f6ca23365ec6aecf2e57799a00c873267cd3f92060ecac03eb291d42903d0e0869cd17c73 QtInstallerFramework-win-x86.zip - 18.01.0 + 18.01.0 7za.exe https://www.7-zip.org/a/7z1801-extra.7z 9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc 7z1801-extra.7z - 9.20.0 + 9.20.0 7za.exe https://www.7-zip.org/a/7za920.zip 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 7za920.zip - 18.01.0 + 18.01.0 aria2-1.33.1-win-32bit-build1\aria2c.exe https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip 2456176ba3d506a07cf0cc4f61f080e1ff8cb4106426d66f354c5bb67a9a8720b5ddb26904275e61b1f623c932355f7dcde4cd17556cc895f11293c23c3a9bf3 aria2-1.33.1-win-32bit-build1.zip - 1.8.2 + 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip 38fcb68e745c1f15b4b50f20069ffe686b1ef5baf93b74958e132ea5d30d155cf6970d6dc1b095aafd421ebd8bcc63acf4f64e305c496266b5182f99b815cca5 ninja-linux.zip - 1.8.2 + 1.8.2 ninja https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip acadfb286eb7d93676629701917fa0c3c39f36daa068c169e4a098c29f97380d1ea95abfd42b04798ff118fd9dc93fdb250fcda36086bac20bc5506354214fc3 -- cgit v1.2.3 From ab9dd6e6eb85331631ba41f16b04c21e292c93d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:56:55 -0700 Subject: [find_acquire] Extract variable --- scripts/cmake/vcpkg_find_acquire_program.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index ef0e1584f..3f0142377 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -218,19 +218,20 @@ function(vcpkg_find_acquire_program VAR) FILENAME ${ARCHIVE} ) - file(MAKE_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + set(PROG_PATH_SUBDIR "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}") + file(MAKE_DIRECTORY ${PROG_PATH_SUBDIR}) if(DEFINED NOEXTRACT) if(DEFINED _vfa_RENAME) - file(INSTALL ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} RENAME ${_vfa_RENAME}) + file(INSTALL ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR} RENAME ${_vfa_RENAME}) else() - file(COPY ${ARCHIVE_PATH} DESTINATION ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}) + file(COPY ${ARCHIVE_PATH} DESTINATION ${PROG_PATH_SUBDIR}) endif() else() get_filename_component(ARCHIVE_EXTENSION ${ARCHIVE} EXT) string(TOLOWER "${ARCHIVE_EXTENSION}" ARCHIVE_EXTENSION) if(ARCHIVE_EXTENSION STREQUAL ".msi") file(TO_NATIVE_PATH "${ARCHIVE_PATH}" ARCHIVE_NATIVE_PATH) - file(TO_NATIVE_PATH "${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR}" DESTINATION_NATIVE_PATH) + file(TO_NATIVE_PATH "${PROG_PATH_SUBDIR}" DESTINATION_NATIVE_PATH) execute_process( COMMAND msiexec /a ${ARCHIVE_NATIVE_PATH} /qn TARGETDIR=${DESTINATION_NATIVE_PATH} WORKING_DIRECTORY ${DOWNLOADS} @@ -238,7 +239,7 @@ function(vcpkg_find_acquire_program VAR) else() execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ARCHIVE_PATH} - WORKING_DIRECTORY ${DOWNLOADS}/tools/${PROGNAME}/${SUBDIR} + WORKING_DIRECTORY ${PROG_PATH_SUBDIR} ) endif() endif() -- cgit v1.2.3 From e6ed2f89027bd35744f0522c49643449ee12ee33 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 20:58:50 -0700 Subject: [find_acquire] Fix ninja path --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 3f0142377..30ecb0573 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -116,7 +116,7 @@ function(vcpkg_find_acquire_program VAR) if(CMAKE_HOST_WIN32) set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") else() - set(PATHS "${DOWNLOADS}/tools/${SUBDIR}") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") endif() set(BREW_PACKAGE_NAME "ninja") set(APT_PACKAGE_NAME "ninja-build") -- cgit v1.2.3 From 5b78dfaf68d33c2444437f92d253d7fa912152ec Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 22:13:12 -0700 Subject: [fetchTool] Extract aria2 with shell --- scripts/fetchTool.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 55d04ec98..c076d304a 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -48,8 +48,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." - # aria2 needs 7zip & 7zip920 to extract. So, we need to download those trough powershell - if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zip920") + # Download aria2 with .NET. aria2 will be used to download everything else. + if ($tool -eq "aria2") { vcpkgDownloadFile $url $downloadPath } @@ -69,7 +69,9 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { Write-Host "Extracting $tool..." - if ($tool -eq "7zip920") + # Extract 7zip920 with shell because we need it to extract 7zip + # Extract aria2 with shell because we need it to download 7zip + if ($tool -eq "7zip920" -or $tool -eq "aria2") { vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath } -- cgit v1.2.3 From 3a9be92f7e9cb867eaef4091ace282e4c8e82b92 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 03:16:22 -0700 Subject: [fetchTool.ps1] Move downloaded file in place after hash check --- scripts/VcpkgPowershellUtils.ps1 | 19 +++++++++++++++---- scripts/fetchTool.ps1 | 8 ++------ 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 676ee5c03..63069f44d 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -103,22 +103,25 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) return $hash.ToLower() } -function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath, +function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url, + [Parameter(Mandatory=$true)][string]$filePath, [Parameter(Mandatory=$true)][string]$expectedHash, [Parameter(Mandatory=$true)][string]$actualHash) { if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + + " url: [ $url ]`n" + " File path: [ $filePath ]`n" + " Expected hash: [ $expectedHash ]`n" + " Actual hash: [ $actualHash ]`n") - throw "Invalid Hash for file $filePath" + throw } } function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath) + [Parameter(Mandatory=$true)][string]$downloadPath, + [Parameter(Mandatory=$true)][string]$sha512) { if (Test-Path $downloadPath) { @@ -152,12 +155,17 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $wc.DownloadFile($url, $downloadPartPath) + + $actualHash = vcpkgGetSHA512 $downloadPartPath + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash + Move-Item -Path $downloadPartPath -Destination $downloadPath } function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe, [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath) + [Parameter(Mandatory=$true)][string]$downloadPath, + [Parameter(Mandatory=$true)][string]$sha512) { if (Test-Path $downloadPath) { @@ -178,6 +186,9 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari throw } + $actualHash = vcpkgGetSHA512 $downloadPartPath + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash + Move-Item -Path $downloadPartPath -Destination $downloadPath } diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index c076d304a..c1e8d87fc 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -51,21 +51,17 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) # Download aria2 with .NET. aria2 will be used to download everything else. if ($tool -eq "aria2") { - vcpkgDownloadFile $url $downloadPath + vcpkgDownloadFile $url $downloadPath $toolData.sha512 } else { $aria2exe = fetchToolInternal "aria2" - vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath + vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath $toolData.sha512 } Write-Host "Downloading $tool... done." } - $expectedDownloadedFileHash = $toolData.sha512 - $downloadedFileHash = vcpkgGetSHA512 $downloadPath - vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if ($isArchive) { Write-Host "Extracting $tool..." -- cgit v1.2.3 From 3f6f9f3f4d48ef0115f3095f7d8d2c6d3b0c63e1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Apr 2018 17:12:59 -0700 Subject: [metrics] Use new string-hash functions instead of ps1 script --- scripts/SHA256Hash.ps1 | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 scripts/SHA256Hash.ps1 (limited to 'scripts') diff --git a/scripts/SHA256Hash.ps1 b/scripts/SHA256Hash.ps1 deleted file mode 100644 index 348d461b7..000000000 --- a/scripts/SHA256Hash.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -[CmdletBinding()] -Param( - [Parameter(Mandatory=$True)] - [String]$Value -) - -$sha256 = New-Object -TypeName System.Security.Cryptography.SHA256CryptoServiceProvider -$utf8 = New-Object -TypeName System.Text.UTF8Encoding -[System.BitConverter]::ToString($sha256.ComputeHash($utf8.GetBytes($Value))) -- cgit v1.2.3 From 7d5c33cf1b9483c94894e5f1831c8411b36f37cf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 14:36:48 -0700 Subject: [vcpkgTools.xml] Bump version to "2" --- scripts/vcpkgTools.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 07284333c..ba81ed926 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -1,5 +1,5 @@ - + 3.10.2 cmake-3.10.2-win32-x86\bin\cmake.exe -- cgit v1.2.3 From d5a1e1054120c993560e5de1c6ad8ac16131d356 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 15:22:50 -0700 Subject: [ps1] Verify hash for already present files. Dont check for path twice --- scripts/VcpkgPowershellUtils.ps1 | 23 ++++------------------- scripts/fetchTool.ps1 | 4 ++++ 2 files changed, 8 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 63069f44d..f6882409b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -105,9 +105,9 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$filePath, - [Parameter(Mandatory=$true)][string]$expectedHash, - [Parameter(Mandatory=$true)][string]$actualHash) + [Parameter(Mandatory=$true)][string]$expectedHash) { + $actualHash = vcpkgGetSHA512 $filePath if ($expectedHash -ne $actualHash) { Write-Host ("`nFile does not have expected hash:`n" + @@ -123,11 +123,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$downloadPath, [Parameter(Mandatory=$true)][string]$sha512) { - if (Test-Path $downloadPath) - { - return - } - if ($url -match "github") { if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12")) @@ -155,10 +150,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, } $wc.DownloadFile($url, $downloadPartPath) - - $actualHash = vcpkgGetSHA512 $downloadPartPath - vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash - + vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 Move-Item -Path $downloadPartPath -Destination $downloadPath } @@ -167,11 +159,6 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari [Parameter(Mandatory=$true)][string]$downloadPath, [Parameter(Mandatory=$true)][string]$sha512) { - if (Test-Path $downloadPath) - { - return - } - vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath @@ -186,9 +173,7 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari throw } - $actualHash = vcpkgGetSHA512 $downloadPartPath - vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $sha512 -actualHash $actualHash - + vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 Move-Item -Path $downloadPartPath -Destination $downloadPath } diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index c1e8d87fc..8de642674 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -61,6 +61,10 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) Write-Host "Downloading $tool... done." } + else + { + vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $toolData.sha512 + } if ($isArchive) { -- cgit v1.2.3 From f63994db6c02266525b33c014f1447cb72a19e82 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 20:34:06 -0700 Subject: Update nuget.exe to 4.6.2 --- scripts/vcpkgTools.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index ba81ed926..a11ee344f 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -35,10 +35,10 @@ 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed - 4.4.0 + 4.6.2 nuget.exe - https://dist.nuget.org/win-x86-commandline/v4.4.0/nuget.exe - fb0903665d2a64ce1da3f40961eb19e46c152a631b2441750aa8b30b20acd2a5e78d7f1058e79e83e37959b3ce9a090a60f081895fdba9998715e3a64437c3e5 + https://dist.nuget.org/win-x86-commandline/v4.6.2/nuget.exe + 60daea7bec2de23089f7ad73985dd788ac154171d6326c2c456726849b8f97dfc38cbdd9b9bf8d96aced009ccaaed317905b65c108e149cfbbbcdfb95f8f0519 3.1.81 -- cgit v1.2.3 From 340320487342740ff2313f44efd35eeba9423ac2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 6 Apr 2018 20:36:07 -0700 Subject: Update vswhere.exe to 2.4.1 --- scripts/vcpkgTools.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index a11ee344f..daaf29214 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -29,10 +29,10 @@ MinGit-2.16.2-32-bit.zip - 2.3.2 + 2.4.1 vswhere.exe - https://github.com/Microsoft/vswhere/releases/download/2.3.2/vswhere.exe - 42f8a8ffd0b156b2e30b2ec7bf7d19582b3ce38a2046ff62bd7fd82f12a8d66ed601e74865957864cef0a376e33a7d07cad746f03c57d1b95a7929a1f8f119ed + https://github.com/Microsoft/vswhere/releases/download/2.4.1/vswhere.exe + f477842d0cebefcd6bf9c6d536ab8ea20ec5b0aa967ee963ab6a101aeff9df8742ca600d35f39e2e7158d76d8231f1ed2bef6104dce84d2bf8d6b07d17d706a1 4.6.2 -- cgit v1.2.3 From 1e1899c3a27f3816c39145049e2c33832071b8c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 8 Apr 2018 15:12:19 -0700 Subject: [ps1] Handle "downloading" local files Fixes #3230 --- scripts/VcpkgPowershellUtils.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index f6882409b..3ab301c55 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -166,6 +166,12 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari $parentDir = split-path -parent $downloadPath $filename = split-path -leaf $downloadPath + if ((Test-Path $url) -or ($url.StartsWith("file://"))) # if is local file + { + vcpkgDownloadFile $url $downloadPath $sha512 + return + } + $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" if ($ec -ne 0) { -- cgit v1.2.3 From 908e714980fe2f2ab32cba4dd44f6a61b5991733 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 9 Apr 2018 22:14:47 -0700 Subject: Fix typo --- scripts/fetchTool.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 8de642674..be18656c7 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -22,7 +22,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($toolData -eq $null) { - throw "Unkown tool $tool" + throw "Unknown tool $tool" } $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows" -- cgit v1.2.3 From bb054e645d6a91adc6d533929ff3b4d9fd1d8788 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 2 Apr 2018 20:40:25 -0700 Subject: [vcpkg] Don't pass /utf-8 to VS 2013 --- scripts/cmake/vcpkg_configure_cmake.cmake | 1 + scripts/toolchains/windows.cmake | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 3a3a88515..3e0922428 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -165,6 +165,7 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 7bfc2282b..753723bd9 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -9,8 +9,16 @@ if(NOT _CMAKE_IN_TRY_COMPILE) message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") endif() - set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") - set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 /utf-8 /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + set(CHARSET_FLAG "/utf-8") + if(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + # VS 2013 does not support /utf-8 + set(CHARSET_FLAG) + endif() + + set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") + set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + + unset(CHARSET_FLAG) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") -- cgit v1.2.3 From 58be8482764c4bae5a62418786b30432a69649aa Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 10 Apr 2018 10:52:19 -0700 Subject: [vcpkg] Always use -c65001 for the resource compiler on windows. Fixes #3221. --- scripts/toolchains/windows.cmake | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 753723bd9..266e023b1 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -17,6 +17,7 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") + set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "") unset(CHARSET_FLAG) -- cgit v1.2.3 From 401e7a0e7ca47cefb7e332f50333f8719d26a90c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 10 Apr 2018 15:38:58 -0700 Subject: [vcpkg_build_cmake] Add workaround for WSL filesystem issues --- scripts/cmake/vcpkg_build_cmake.cmake | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 630662588..41415d9a8 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -105,6 +105,7 @@ function(vcpkg_build_cmake) if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ") # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} without parallelism because memory exceeded") execute_process( COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} OUTPUT_FILE "${LOGPREFIX}-out-1.log" @@ -123,6 +124,33 @@ function(vcpkg_build_cmake) list(APPEND LOGS "${LOGPREFIX}-err-1.log") endif() endif() + elseif(out_contents MATCHES ": No such file or directory") + # WSL workaround - WSL occassionally fails with no such file or directory. Detect if we are running in WSL and restart. + execute_process(COMMAND "uname" "-r" + OUTPUT_VARIABLE UNAME_R ERROR_VARIABLE UNAME_R + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) + + if (UNAME_R MATCHES "Microsoft") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of (potential) wsl subsystem issue.") + execute_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} + OUTPUT_FILE "${LOGPREFIX}-out-1.log" + ERROR_FILE "${LOGPREFIX}-err-1.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-1.log" out_contents) + file(READ "${LOGPREFIX}-err-1.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-1.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-1.log") + endif() + endif() + endif() endif() if(error_code) -- cgit v1.2.3 From dc207a2c891fe6deb2710ccde0abf48078f64fcd Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Apr 2018 18:15:38 -0700 Subject: Restore powershell extracting because shell may not be available (see #3252) --- scripts/VcpkgPowershellUtils.ps1 | 40 ++++++++++++++++++++++++++++++---------- scripts/fetchTool.ps1 | 4 ++-- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 3ab301c55..fdd89e7b9 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,3 +1,8 @@ +function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) +{ + return [bool](Get-Module -ListAvailable -Name $moduleName) +} + function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -183,9 +188,9 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari Move-Item -Path $downloadPartPath -Destination $downloadPath } -function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, - [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) +function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe, + [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { vcpkgRemoveItem $destinationDir $destinationPartial = "$destinationDir.partial" @@ -200,20 +205,35 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, Rename-Item -Path "$destinationPartial" -NewName $destinationDir } -function vcpkgExtractZipFileWithShell( [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) +function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) { vcpkgRemoveItem $destinationDir $destinationPartial = "$destinationDir.partial" vcpkgRemoveItem $destinationPartial vcpkgCreateDirectoryIfNotExists $destinationPartial - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) - foreach($item in $zip.items()) + + if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') + { + Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") + Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial + } + elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + Write-Verbose("Extracting with Pscx\Expand-Archive") + Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial + } + else + { + Write-Verbose("Extracting via shell") + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + } } Rename-Item -Path "$destinationPartial" -NewName $destinationDir diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index be18656c7..dd3f0f9f4 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -73,7 +73,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) # Extract aria2 with shell because we need it to download 7zip if ($tool -eq "7zip920" -or $tool -eq "aria2") { - vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath + vcpkgExtractZipFile -ArchivePath $downloadPath -DestinationDir $toolPath } elseif ($tool -eq "7zip") { @@ -88,7 +88,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) else { $sevenZipExe = fetchToolInternal "7zip" - vcpkgExtractFile -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath + vcpkgExtractFileWith7z -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath } Write-Host "Extracting $tool... done." } -- cgit v1.2.3 From a4b35f14baac9ccaadca7c6daf6dea39cb9817a2 Mon Sep 17 00:00:00 2001 From: John Farrier Date: Tue, 17 Apr 2018 19:11:18 -0400 Subject: Upgrade Celero to v2.2.0 (#3259) * Upgrade Celero to v2.2.0 * [celero] Fix installed cmake targets --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 475047737..47c91f83c 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -28,6 +28,12 @@ function(vcpkg_fixup_cmake_targets) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}) if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}") + if(_vfct_CONFIG_PATH STREQUAL "share") + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/debug/share2) + file(RENAME ${CURRENT_PACKAGES_DIR}/share ${CURRENT_PACKAGES_DIR}/share2) + set(_vfct_CONFIG_PATH share2) + endif() + set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH}) set(RELEASE_CONFIG ${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}) @@ -36,6 +42,7 @@ function(vcpkg_fixup_cmake_targets) message(FATAL_ERROR "'${DEBUG_CONFIG}' does not exist.") endif() + # This roundabout handling enables CONFIG_PATH share file(MAKE_DIRECTORY ${DEBUG_SHARE}) file(GLOB FILES ${DEBUG_CONFIG}/*) file(COPY ${FILES} DESTINATION ${DEBUG_SHARE}) @@ -76,7 +83,7 @@ function(vcpkg_fixup_cmake_targets) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS ${DEBUG_SHARE}) + if(NOT EXISTS "${DEBUG_SHARE}") message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") endif() endif() -- cgit v1.2.3 From 3a3fa5cd8f02dde78b00c12273b338e293edcd51 Mon Sep 17 00:00:00 2001 From: Jonathan Hale Date: Thu, 19 Apr 2018 04:33:12 +0200 Subject: [magnum] Properly deploy plugins (#3191) * [magnum] Properly deploy magnum plugins Signed-off-by: Squareys * [magnum-plugins] Add tinygltfimporter feature Signed-off-by: Squareys * [magnum][magnum-plugins] Add features: trade and any* Prepares upcoming move of those sublibraries and allows building --head immediately. For current release this only adds some unused cmake flags that will be ignored. Signed-off-by: Squareys * [magnum] Add gl feature, cleanup dependencies, mark upcoming features And sort features alphabetically. Signed-off-by: Squareys * [magnum-plugins] Prepare renaming of static flag for --head installs Signed-off-by: Squareys * [magnum] Add two missing feature dependencies Signed-off-by: Squareys * [magnum] Enable magnum[any*] features by default Signed-off-by: Squareys --- scripts/buildsystems/msbuild/applocal.ps1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 3f0f2ef37..e5f3c3dd0 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -4,6 +4,7 @@ param([string]$targetBinary, [string]$installedDir, [string]$tlogFile, [string]$ $g_searched = @{} # Note: installedDir is actually the bin\ directory. $g_install_root = Split-Path $installedDir -parent +$g_is_debug = $g_install_root -match '(.*\\)?debug(\\)?$' # Ensure we create the copied files log, even if we don't end up copying any files if ($copiedFilesLog) @@ -63,6 +64,13 @@ function resolve([string]$targetBinary) { deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } + if (Test-Path function:\deployPluginsIfMagnum) { + if ($g_is_debug) { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum-d" "$_" + } else { + deployPluginsIfMagnum $targetBinaryDir "$g_install_root\bin\magnum" "$_" + } + } resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" @@ -85,5 +93,12 @@ if (Test-Path "$g_install_root\bin\OpenNI2\openni2deploy.ps1") { . "$g_install_root\bin\OpenNI2\openni2deploy.ps1" } +# Note: This is a hack to make Magnum work. +if (Test-Path "$g_install_root\bin\magnum\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum\magnumdeploy.ps1" +} elseif (Test-Path "$g_install_root\bin\magnum-d\magnumdeploy.ps1") { + . "$g_install_root\bin\magnum-d\magnumdeploy.ps1" +} + resolve($targetBinary) -Write-Verbose $($g_searched | out-string) \ No newline at end of file +Write-Verbose $($g_searched | out-string) -- cgit v1.2.3 From d2f69445b6394f197f986d1b6945e7960fd10b22 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 17 Apr 2018 16:21:36 -0700 Subject: Retry the wsl workaround up to 10 times --- scripts/cmake/vcpkg_build_cmake.cmake | 42 ++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index 41415d9a8..983ac9221 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -131,25 +131,31 @@ function(vcpkg_build_cmake) OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) if (UNAME_R MATCHES "Microsoft") - message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of (potential) wsl subsystem issue.") - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} - OUTPUT_FILE "${LOGPREFIX}-out-1.log" - ERROR_FILE "${LOGPREFIX}-err-1.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - - if(error_code) - file(READ "${LOGPREFIX}-out-1.log" out_contents) - file(READ "${LOGPREFIX}-err-1.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out-1.log") + set(ITERATION 0) + while (ITERATION LESS 10 AND out_contents MATCHES ": No such file or directory") + MATH(EXPR ITERATION "${ITERATION}+1") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of wsl subsystem 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() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err-1.log") - endif() - endif() + endwhile() endif() endif() -- cgit v1.2.3 From d84e86a910126e91c781af63e33e3516aa171f2a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 18 Apr 2018 18:13:11 -0700 Subject: Fix grpc lookup (case-insensitive) --- scripts/buildsystems/vcpkg.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index a9f8190f7..91c196fb9 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -241,6 +241,8 @@ macro(find_package name) "optimized" "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/nghttp2.lib") endif() endif() + elseif("${_vcpkg_lowercase_name}" STREQUAL "grpc" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/grpc") + _find_package(gRPC ${ARGN}) else() _find_package(${ARGV}) endif() -- cgit v1.2.3 From a11086e3b9d560d3b73de91175c57db658e39809 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 27 Mar 2018 03:03:26 -0700 Subject: Introduce bootstrap.sh --- scripts/bootstrap.sh | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh new file mode 100644 index 000000000..66efb1d62 --- /dev/null +++ b/scripts/bootstrap.sh @@ -0,0 +1,188 @@ +#!/bin/sh + +# Find vcpkg-root +vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P) +while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do + vcpkgRootDir="$(dirname "$vcpkgRootDir")" +done + +downloadsDir="$vcpkgRootDir/downloads" + +extractStringBetweenDelimiters() +{ + input=$1;leftDelim=$2;rightDelim=$3 + output="${input##*$leftDelim}" + output="${output%%$rightDelim*}" + echo "$output" +} + +vcpkgCheckRepoTool() +{ + __tool=$1 + if ! command -v "$__tool" >/dev/null 2>&1 ; then + echo "Could not find $__tool. Please install it (and other dependencies) with:" + echo "sudo apt-get install curl unzip tar" + exit 1 + fi +} + +vcpkgCheckEqualFileHash() +{ + url=$1; filePath=$2; expectedHash=$3 + + actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx + actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word + + if ! [ "$expectedHash" = "$actualHash" ]; then + echo "" + echo "File does not have expected hash:" + echo " url: [ $url ]" + echo " File path: [ $downloadPath ]" + echo " Expected hash: [ $sha512 ]" + echo " Actual hash: [ $actualHash ]" + exit + fi +} + +vcpkgDownloadFile() +{ + url=$1; downloadPath=$2 sha512=$3 + vcpkgCheckRepoTool "curl" + rm -rf "$downloadPath.part" + curl -L $url --create-dirs --output "$downloadPath.part" || exit 1 + + vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512 + mv "$downloadPath.part" "$downloadPath" +} + +vcpkgExtractArchive() +{ + archive=$1; toPath=$2 + rm -rf "$toPath" "$toPath.partial" + mkdir -p "$toPath.partial" + + archiveType="${archive##*.}" + if [ "$archiveType" = "zip" ]; then + vcpkgCheckRepoTool "unzip" + $(cd "$toPath.partial" && unzip -qqo "$archive") + else + vcpkgCheckRepoTool "tar" + $(cd "$toPath.partial" && tar xzf "$archive") + fi + mv "$toPath.partial" "$toPath" +} + +fetchTool() +{ + tool=$1; UNAME=$2; __output=$3 + + if [ "$tool" = "" ]; then + echo "No tool name provided" + return 1 + fi + + if [ "$UNAME" = "Linux" ]; then + os="linux" + elif [ "$UNAME" = "Darwin" ]; then + os="osx" + else + echo "Unknown uname: $UNAME" + return 1 + fi + + xmlFileAsString=`cat $vcpkgRootDir/scripts/vcpkgTools.xml` + toolRegexStart="" + toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "")" + if [ "$toolData" = "" ]; then + echo "Unknown tool: $tool" + return 1 + fi + + version="$(extractStringBetweenDelimiters "$toolData" "" "")" + + toolPath="$downloadsDir/tools/$tool-$version-$os" + + exeRelativePath="$(extractStringBetweenDelimiters "$toolData" "" "")" + exePath="$toolPath/$exeRelativePath" + + if [ -e "$exePath" ]; then + eval $__output="'$exePath'" + return 0 + fi + + isArchive=true + if [ $isArchive = true ]; then + archiveName="$(extractStringBetweenDelimiters "$toolData" "" "")" + downloadPath="$downloadsDir/$archiveName" + else + echo "Non-archives not supported yet" + return 1 + fi + + url="$(extractStringBetweenDelimiters "$toolData" "" "")" + sha512="$(extractStringBetweenDelimiters "$toolData" "" "")" + if ! [ -e "$downloadPath" ]; then + echo "Downloading $tool..." + vcpkgDownloadFile $url "$downloadPath" $sha512 + echo "Downloading $tool... done." + else + vcpkgCheckEqualFileHash $url "$downloadPath" $sha512 + fi + + if [ $isArchive = true ]; then + echo "Extracting $tool..." + vcpkgExtractArchive "$downloadPath" "$toolPath" + echo "Extracting $tool... done." + fi + + if ! [ -e "$exePath" ]; then + echo "Could not detect or download $tool" + return 1 + fi + + eval $__output="'$exePath'" + return 0 +} + +selectCXX() +{ + __output=$1 + + if [ "x$CXX" = "x" ]; then + CXX=g++ + if which g++-7 >/dev/null 2>&1; then + CXX=g++-7 + elif which g++-6 >/dev/null 2>&1; then + CXX=g++-6 + fi + fi + + gccversion="$("$CXX" -v 2>&1)" + gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")" + if [ "$gccversion" = "5" ]; then + echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." + echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" + echo "sudo apt-get update -y" + echo "sudo apt-get install g++-7 -y" + return 1 + fi + + eval $__output="'$CXX'" +} + +# Preparation +UNAME="$(uname)" +fetchTool "cmake" "$UNAME" cmakeExe || exit 1 +fetchTool "ninja" "$UNAME" ninjaExe || exit 1 +selectCXX CXX || exit 1 + +# Do the build +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") +(cd "$buildDir" && "$cmakeExe" --build .) + +rm -rf "$vcpkgRootDir/vcpkg" +cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file -- cgit v1.2.3 From f12ded7fd0ca91fb128ddaf20b933f8457d9c1f3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Apr 2018 22:44:46 +0000 Subject: [sh] Fix permission --- scripts/bootstrap.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From b5e4c4c7cf68b807e222b09415b678d2f47a3d3b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 24 Apr 2018 16:04:14 -0700 Subject: [find_acquire.cmake] Fix ninja path for mac --- scripts/cmake/vcpkg_find_acquire_program.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index 30ecb0573..39a722d93 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -115,6 +115,8 @@ function(vcpkg_find_acquire_program VAR) set(SUBDIR "ninja-1.8.2") if(CMAKE_HOST_WIN32) set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}") + elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx") else() set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux") endif() -- cgit v1.2.3 From 6a3c1db30bbdc0d2580a3c787d90811e6bb7823a Mon Sep 17 00:00:00 2001 From: Rudi Lee Date: Thu, 26 Apr 2018 07:38:45 +0700 Subject: Checking for sha512sum on OS which doesn't have shasum --- scripts/bootstrap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 66efb1d62..58eb9e9fb 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -29,8 +29,15 @@ vcpkgCheckRepoTool() vcpkgCheckEqualFileHash() { url=$1; filePath=$2; expectedHash=$3 + + SHASUM="shasum -a 512" # sha512sum is not available on osx - actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx + # checking for sha512sum on os which doesn't have shasum + if which sha512sum >/dev/null 2>&1; then + SHASUM=sha512sum + fi + + actualHash=$("$SHASUM" "$filePath") actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word if ! [ "$expectedHash" = "$actualHash" ]; then -- cgit v1.2.3 From c78a609dabb0df43d0443452261f7c3b592b9b41 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Apr 2018 02:11:04 +0000 Subject: [sh] Tweak so only the sh forwarder needs to be +x --- scripts/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 scripts/bootstrap.sh (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh old mode 100755 new mode 100644 index 66efb1d62..c69dc0135 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -185,4 +185,4 @@ mkdir -p "$buildDir" (cd "$buildDir" && "$cmakeExe" --build .) rm -rf "$vcpkgRootDir/vcpkg" -cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file +cp "$buildDir/vcpkg" "$vcpkgRootDir/" -- cgit v1.2.3 From ef594607829ad6ed2bd462a0ddcbb0ee698b3f4f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Apr 2018 22:23:45 -0700 Subject: [bootstrap.sh] Minor refactoring for clarity --- scripts/bootstrap.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 2225f029d..95ee75af1 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -29,15 +29,15 @@ vcpkgCheckRepoTool() vcpkgCheckEqualFileHash() { url=$1; filePath=$2; expectedHash=$3 - - SHASUM="shasum -a 512" # sha512sum is not available on osx - # checking for sha512sum on os which doesn't have shasum - if which sha512sum >/dev/null 2>&1; then - SHASUM=sha512sum + if command -v "sha512sum" >/dev/null 2>&1 ; then + actualHash=$(sha512sum "$filePath") + else + # sha512sum is not available by default on osx + # shasum is not available by default on Fedora + actualHash=$(shasum -a 512 "$filePath") fi - actualHash=$("$SHASUM" "$filePath") actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word if ! [ "$expectedHash" = "$actualHash" ]; then -- cgit v1.2.3 From 540a32c8413df21bc11aa714ff3086c9520fe6f5 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Fri, 27 Apr 2018 11:14:47 -0400 Subject: Require the version of g++ to be at least 6 On Ubuntu 16.04, old versions of g++ such as 4.9 are available. Other Linux distributions may also ship with g++ versions older than 5. With the previous test, the bootstrap script was not failing fast and instead was starting to compile vcpkg before it encountered the unsupported flag -std=c++1z. The error message was not very explicit and that was making it difficult to the developer to understand what the problem was. However, when using g++ 5, an clear error message was printed to help the user. This commit shows the helpful error message anytime g++ is older than version 6. --- 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 95ee75af1..037a9136d 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -166,7 +166,7 @@ selectCXX() gccversion="$("$CXX" -v 2>&1)" gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")" - if [ "$gccversion" = "5" ]; then + if [ "$gccversion" -lt "6" ]; then echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7." echo "sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y" echo "sudo apt-get update -y" -- cgit v1.2.3 From 08afae2a7a5cd276fd251cbeef9a27f15261fc0c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Apr 2018 16:17:18 -0700 Subject: Bump version of git to 2.17.0 (was 2.16.2) --- scripts/vcpkgTools.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index daaf29214..1a2abae81 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -22,11 +22,11 @@ cmake-3.10.2-Linux-x86_64.tar.gz - 2.16.2 + 2.17.0 cmd\git.exe - https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/MinGit-2.16.2-32-bit.zip - 004e1dc1904f2e2d5c3534d0a56f58bf030b1146f5b263d6d191e60f72cd35455977c588604708125a1e93268ee8f7a5ab32ed6115adc028257b12d5926f350a - MinGit-2.16.2-32-bit.zip + https://github.com/git-for-windows/git/releases/download/v2.17.0.windows.1/MinGit-2.17.0-32-bit.zip + a34575ab1b4f553e62535e38492904b512df4d6a837cf4abf205dbcdd05edf1eef450cc5b15a4f63f901424d5f3cd1f78b6b22437d0d4f8cd9ce4e42e82617b9 + MinGit-2.17.0-32-bit.zip 2.4.1 -- cgit v1.2.3 From 468bfeb56e29e0130a1b56adb4c23fdba403221e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Feb 2018 21:17:14 -0800 Subject: [Clean patching] Each portref-patchset combo gets its own hash-based directory --- scripts/cmake/vcpkg_from_github.cmake | 73 ++++++++++++++++++++++++++--------- 1 file changed, 55 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index c6a23cff6..28ada0631 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -51,7 +51,7 @@ ## * [beast](https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake) function(vcpkg_from_github) set(oneValueArgs OUT_SOURCE_PATH REPO REF SHA512 HEAD_REF) - set(multipleValuesArgs) + set(multipleValuesArgs PATCHES) cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN}) if(NOT DEFINED _vdud_OUT_SOURCE_PATH) @@ -73,21 +73,17 @@ function(vcpkg_from_github) string(REGEX REPLACE ".*/" "" REPO_NAME ${_vdud_REPO}) string(REGEX REPLACE "/.*" "" ORG_NAME ${_vdud_REPO}) - macro(set_SOURCE_PATH BASE BASEREF) - set(SOURCE_PATH "${BASE}/${REPO_NAME}-${BASEREF}") - if(EXISTS ${SOURCE_PATH}) - set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) - else() - # Sometimes GitHub strips a leading 'v' off the REF. - string(REGEX REPLACE "^v" "" REF ${BASEREF}) - string(REPLACE "/" "-" REF ${REF}) - set(SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") - if(EXISTS ${SOURCE_PATH}) - set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) - else() - message(FATAL_ERROR "Could not determine source path: '${BASE}/${REPO_NAME}-${BASEREF}' does not exist") - endif() + macro(set_TEMP_SOURCE_PATH BASE BASEREF) + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${BASEREF}") + if(NOT EXISTS ${TEMP_SOURCE_PATH}) + # Sometimes GitHub strips a leading 'v' off the REF. + string(REGEX REPLACE "^v" "" REF ${BASEREF}) + string(REPLACE "/" "-" REF ${REF}) + set(TEMP_SOURCE_PATH "${BASE}/${REPO_NAME}-${REF}") + if(NOT EXISTS ${TEMP_SOURCE_PATH}) + message(FATAL_ERROR "Could not determine source path: '${BASE}/${REPO_NAME}-${BASEREF}' does not exist") endif() + endif() endmacro() if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF) @@ -108,8 +104,44 @@ function(vcpkg_from_github) SHA512 "${_vdud_SHA512}" FILENAME "${ORG_NAME}-${REPO_NAME}-${SANITIZED_REF}.tar.gz" ) - vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}") - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src ${SANITIZED_REF}) + + # Take the last 10 chars of the REF + set(REF_MAX_LENGTH 10) + string(LENGTH ${SANITIZED_REF} REF_LENGTH) + math(EXPR FROM_REF ${REF_LENGTH}-${REF_MAX_LENGTH}) + if(FROM_REF LESS 0) + set(FROM_REF 0) + endif() + string(SUBSTRING ${SANITIZED_REF} ${FROM_REF} ${REF_LENGTH} SHORTENED_SANITIZED_REF) + + # Hash the archive hash along with the patches. Take the first 10 chars of the hash + set(PATCHSET_HASH "${_vdud_SHA512}") + foreach(PATCH IN LISTS _vdud_PATCHES) + file(SHA512 ${PATCH} CURRENT_HASH) + string(APPEND PATCHSET_HASH ${CURRENT_HASH}) + endforeach() + + string(SHA512 PATCHSET_HASH ${PATCHSET_HASH}) + string(SUBSTRING ${PATCHSET_HASH} 0 10 PATCHSET_HASH) + set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}") + + if(NOT EXISTS ${SOURCE_PATH}) + set(TEMP_DIR "${CURRENT_BUILDTREES_DIR}/src/TEMP") + file(REMOVE_RECURSE ${TEMP_DIR}) + vcpkg_extract_source_archive_ex(ARCHIVE "${ARCHIVE}" WORKING_DIRECTORY ${TEMP_DIR}) + set_TEMP_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/TEMP ${SANITIZED_REF}) + + vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES ${_vdud_PATCHES} + ) + + file(RENAME ${TEMP_SOURCE_PATH} ${SOURCE_PATH}) + file(REMOVE_RECURSE ${TEMP_DIR}) + endif() + + set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE) + return() endif() @@ -167,5 +199,10 @@ function(vcpkg_from_github) set(VCPKG_HEAD_VERSION ${_version} PARENT_SCOPE) endif() - set_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) + set_TEMP_SOURCE_PATH(${CURRENT_BUILDTREES_DIR}/src/head ${SANITIZED_HEAD_REF}) + vcpkg_apply_patches( + SOURCE_PATH ${TEMP_SOURCE_PATH} + PATCHES ${_vdud_PATCHES} + ) + set(${_vdud_OUT_SOURCE_PATH} "${TEMP_SOURCE_PATH}" PARENT_SCOPE) endfunction() -- cgit v1.2.3 From c4caf29213f54b1786102c1b4dc085b6d7142998 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 30 Apr 2018 19:08:34 -0700 Subject: [vcpkg] Fix temporary download directory when vcpkg is located at the root of a drive --- scripts/VcpkgPowershellUtils.ps1 | 17 ++++++++++++++--- scripts/fetchTool.ps1 | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index fdd89e7b9..3ea18116b 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -89,7 +89,13 @@ function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') { Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $hash = (Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512).Hash + $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable hashError + if ($hashError) + { + Start-Sleep 3 + $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable Stop + } + $hash = $hashresult.Hash } elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') { @@ -177,7 +183,7 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari return } - $ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url" + $ec = vcpkgInvokeCommand "$aria2exe" "--dir=`"$parentDir`" --out=`"$filename.part`" $url" if ($ec -ne 0) { Write-Host "Could not download $url" @@ -202,7 +208,12 @@ function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe Write-Host "Could not extract $archivePath" throw } - Rename-Item -Path "$destinationPartial" -NewName $destinationDir + Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorVariable renameResult + if ($renameResult) + { + Start-Sleep 3 + Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorAction Stop + } } function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath, diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index dd3f0f9f4..eca405b62 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -4,6 +4,7 @@ param( ) Set-StrictMode -Version Latest + $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" @@ -12,6 +13,7 @@ $vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root $downloadsDir = "$vcpkgRootDir\downloads" vcpkgCreateDirectoryIfNotExists $downloadsDir +$downloadsDir = Resolve-Path $downloadsDir function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { -- cgit v1.2.3 From ab58f531ccf6da9895502cb8ae7bd85b29823d1d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 4 May 2018 18:14:54 -0700 Subject: git for linux/osx version moved to vcpkgTools.xml --- scripts/vcpkgTools.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scripts') diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 1a2abae81..1f17102d2 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -28,6 +28,18 @@ a34575ab1b4f553e62535e38492904b512df4d6a837cf4abf205dbcdd05edf1eef450cc5b15a4f63f901424d5f3cd1f78b6b22437d0d4f8cd9ce4e42e82617b9 MinGit-2.17.0-32-bit.zip + + 2.7.4 + + + + + + 2.7.4 + + + + 2.4.1 vswhere.exe -- cgit v1.2.3 From 8ce92654856897d5da7649ecea5d28818f3bcadd Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 15 May 2018 20:57:10 -0700 Subject: [bootstrap-vcpkg.sh] Find g++-8. Fixes #3486. --- scripts/bootstrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 037a9136d..8a4c92936 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -157,7 +157,9 @@ selectCXX() if [ "x$CXX" = "x" ]; then CXX=g++ - if which g++-7 >/dev/null 2>&1; then + if which g++-8 >/dev/null 2>&1; then + CXX=g++-8 + elif which g++-7 >/dev/null 2>&1; then CXX=g++-7 elif which g++-6 >/dev/null 2>&1; then CXX=g++-6 -- cgit v1.2.3 From 52f01eefa6e1da7a9458807a1eb3d288ecd50613 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 May 2018 04:48:26 +0000 Subject: [bootstrap.sh] Fix whitespace-in-path issues --- 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 8a4c92936..e999fa55e 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -97,7 +97,7 @@ fetchTool() return 1 fi - xmlFileAsString=`cat $vcpkgRootDir/scripts/vcpkgTools.xml` + xmlFileAsString=`cat "$vcpkgRootDir/scripts/vcpkgTools.xml"` toolRegexStart="" toolData="$(extractStringBetweenDelimiters "$xmlFileAsString" "$toolRegexStart" "")" if [ "$toolData" = "" ]; then -- cgit v1.2.3 From 1b0682a39e1143660c3d5aa371f66591a64e8a5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 5 May 2018 04:23:19 -0700 Subject: [vcpkg] Significantly reduce usage of powershell. Reduce console font switching bug --- scripts/VcpkgPowershellUtils.ps1 | 322 +--------------------- scripts/addPoshVcpkgToPowershellProfile.ps1 | 7 +- scripts/bootstrap.ps1 | 108 ++++++-- scripts/fetchTool.ps1 | 109 -------- scripts/findAnyMSBuildWithCppPlatformToolset.ps1 | 58 ---- scripts/findVisualStudioInstallationInstances.ps1 | 61 ---- scripts/getProgramFiles32bit.ps1 | 17 -- scripts/getProgramFilesPlatformBitness.ps1 | 17 -- scripts/getVisualStudioInstances.ps1 | 74 +++++ scripts/vcpkgTools.xml | 15 +- 10 files changed, 174 insertions(+), 614 deletions(-) delete mode 100644 scripts/fetchTool.ps1 delete mode 100644 scripts/findAnyMSBuildWithCppPlatformToolset.ps1 delete mode 100644 scripts/findVisualStudioInstallationInstances.ps1 delete mode 100644 scripts/getProgramFiles32bit.ps1 delete mode 100644 scripts/getProgramFilesPlatformBitness.ps1 create mode 100644 scripts/getVisualStudioInstances.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 3ea18116b..259df4acb 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -1,8 +1,3 @@ -function vcpkgHasModule([Parameter(Mandatory=$true)][string]$moduleName) -{ - return [bool](Get-Module -ListAvailable -Name $moduleName) -} - function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -10,320 +5,21 @@ function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Par return $false } - return [bool]($object.psobject.Properties | where { $_.Name -eq "$propertyName"}) -} - -function vcpkgCreateDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$dirPath) -{ - if (!(Test-Path $dirPath)) - { - New-Item -ItemType Directory -Path $dirPath | Out-Null - } -} - -function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][string]$path) -{ - $parentDir = split-path -parent $path - if ([string]::IsNullOrEmpty($parentDir)) - { - return - } - - if (!(Test-Path $parentDir)) - { - New-Item -ItemType Directory -Path $parentDir | Out-Null - } -} - -function vcpkgIsDirectory([Parameter(Mandatory=$true)][string]$path) -{ - return (Get-Item $path) -is [System.IO.DirectoryInfo] -} - -function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$path) -{ - if ([string]::IsNullOrEmpty($path)) - { - return - } - - if (Test-Path $path) - { - # Remove-Item -Recurse occasionally fails. This is a workaround - if (vcpkgIsDirectory $path) - { - & cmd.exe /c rd /s /q $path - } - else - { - Remove-Item $path -Force - } - } -} - -function vcpkgHasCommand([Parameter(Mandatory=$true)][string]$commandName) -{ - return [bool](Get-Command -Name $commandName -ErrorAction SilentlyContinue) -} - -function vcpkgHasCommandParameter([Parameter(Mandatory=$true)][string]$commandName, [Parameter(Mandatory=$true)][string]$parameterName) -{ - return (Get-Command $commandName).Parameters.Keys -contains $parameterName -} - -function vcpkgGetCredentials() -{ - if (vcpkgHasCommandParameter -commandName 'Get-Credential' -parameterName 'Message') - { - return Get-Credential -Message "Enter credentials for Proxy Authentication" - } - else - { - Write-Host "Enter credentials for Proxy Authentication" - return Get-Credential - } -} - -function vcpkgGetSHA512([Parameter(Mandatory=$true)][string]$filePath) -{ - if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Utility\Get-FileHash') - { - Write-Verbose("Hashing with Microsoft.PowerShell.Utility\Get-FileHash") - $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable hashError - if ($hashError) - { - Start-Sleep 3 - $hashresult = Microsoft.PowerShell.Utility\Get-FileHash -Path $filePath -Algorithm SHA512 -ErrorVariable Stop - } - $hash = $hashresult.Hash - } - elseif(vcpkgHasCommand -commandName 'Pscx\Get-Hash') - { - Write-Verbose("Hashing with Pscx\Get-Hash") - $hash = (Pscx\Get-Hash -Path $filePath -Algorithm SHA512).HashString - } - else - { - Write-Verbose("Hashing with .NET") - $hashAlgorithm = [Security.Cryptography.HashAlgorithm]::Create("SHA512") - $fileAsByteArray = [io.File]::ReadAllBytes($filePath) - $hashByteArray = $hashAlgorithm.ComputeHash($fileAsByteArray) - $hash = -Join ($hashByteArray | ForEach-Object {"{0:x2}" -f $_}) - } - - return $hash.ToLower() + return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) } -function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$filePath, - [Parameter(Mandatory=$true)][string]$expectedHash) +function getProgramFiles32bit() { - $actualHash = vcpkgGetSHA512 $filePath - if ($expectedHash -ne $actualHash) + $out = ${env:PROGRAMFILES(X86)} + if ($out -eq $null) { - Write-Host ("`nFile does not have expected hash:`n" + - " url: [ $url ]`n" + - " File path: [ $filePath ]`n" + - " Expected hash: [ $expectedHash ]`n" + - " Actual hash: [ $actualHash ]`n") - throw + $out = ${env:PROGRAMFILES} } -} -function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath, - [Parameter(Mandatory=$true)][string]$sha512) -{ - if ($url -match "github") + if ($out -eq $null) { - if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12")) - { - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - } - else - { - Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" - Write-Warning "Please manually download $url to $downloadPath" - Write-Warning "To solve this issue for future downloads, you can also install Windows Management Framework 5.1+" - throw "Download failed" - } + throw "Could not find [Program Files 32-bit]" } - vcpkgCreateParentDirectoryIfNotExists $downloadPath - - $downloadPartPath = "$downloadPath.part" - vcpkgRemoveItem $downloadPartPath - - $wc = New-Object System.Net.WebClient - if (!$wc.Proxy.IsBypassed($url)) - { - $wc.Proxy.Credentials = vcpkgGetCredentials - } - - $wc.DownloadFile($url, $downloadPartPath) - vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 - Move-Item -Path $downloadPartPath -Destination $downloadPath -} - -function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$aria2exe, - [Parameter(Mandatory=$true)][string]$url, - [Parameter(Mandatory=$true)][string]$downloadPath, - [Parameter(Mandatory=$true)][string]$sha512) -{ - vcpkgCreateParentDirectoryIfNotExists $downloadPath - $downloadPartPath = "$downloadPath.part" - vcpkgRemoveItem $downloadPartPath - - $parentDir = split-path -parent $downloadPath - $filename = split-path -leaf $downloadPath - - if ((Test-Path $url) -or ($url.StartsWith("file://"))) # if is local file - { - vcpkgDownloadFile $url $downloadPath $sha512 - return - } - - $ec = vcpkgInvokeCommand "$aria2exe" "--dir=`"$parentDir`" --out=`"$filename.part`" $url" - if ($ec -ne 0) - { - Write-Host "Could not download $url" - throw - } - - vcpkgCheckEqualFileHash -url $url -filePath $downloadPartPath -expectedHash $sha512 - Move-Item -Path $downloadPartPath -Destination $downloadPath -} - -function vcpkgExtractFileWith7z([Parameter(Mandatory=$true)][string]$sevenZipExe, - [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) -{ - vcpkgRemoveItem $destinationDir - $destinationPartial = "$destinationDir.partial" - vcpkgRemoveItem $destinationPartial - vcpkgCreateDirectoryIfNotExists $destinationPartial - $ec = vcpkgInvokeCommand "$sevenZipExe" "x `"$archivePath`" -o`"$destinationPartial`" -y" - if ($ec -ne 0) - { - Write-Host "Could not extract $archivePath" - throw - } - Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorVariable renameResult - if ($renameResult) - { - Start-Sleep 3 - Rename-Item -Path "$destinationPartial" -NewName $destinationDir -ErrorAction Stop - } -} - -function vcpkgExtractZipFile( [Parameter(Mandatory=$true)][string]$archivePath, - [Parameter(Mandatory=$true)][string]$destinationDir) -{ - vcpkgRemoveItem $destinationDir - $destinationPartial = "$destinationDir.partial" - vcpkgRemoveItem $destinationPartial - vcpkgCreateDirectoryIfNotExists $destinationPartial - - - if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive') - { - Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive") - Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial - } - elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive') - { - Write-Verbose("Extracting with Pscx\Expand-Archive") - Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial - } - else - { - Write-Verbose("Extracting via shell") - $shell = new-object -com shell.application - $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) - foreach($item in $zip.items()) - { - # Piping to Out-Null is used to block until finished - $shell.Namespace($destinationPartial).copyhere($item) | Out-Null - } - } - - Rename-Item -Path "$destinationPartial" -NewName $destinationDir -} - -function vcpkgInvokeCommand() -{ - param ( [Parameter(Mandatory=$true)][string]$executable, - [string]$arguments = "") - - Write-Verbose "Executing: ${executable} ${arguments}" - $process = Start-Process -FilePath "`"$executable`"" -ArgumentList $arguments -PassThru -NoNewWindow - Wait-Process -InputObject $process - $ec = $process.ExitCode - Write-Verbose "Execution terminated with exit code $ec." - return $ec -} - -function vcpkgInvokeCommandClean() -{ - param ( [Parameter(Mandatory=$true)][string]$executable, - [string]$arguments = "") - - Write-Verbose "Clean-Executing: ${executable} ${arguments}" - $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition - $cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1" - $tripleQuotes = "`"`"`"" - $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes - $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes" - $arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command" - - $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow - Wait-Process -InputObject $process - $ec = $process.ExitCode - Write-Verbose "Execution terminated with exit code $ec." - return $ec -} - -function vcpkgFormatElapsedTime([TimeSpan]$ts) -{ - if ($ts.TotalHours -ge 1) - { - return [string]::Format( "{0:N2} h", $ts.TotalHours); - } - - if ($ts.TotalMinutes -ge 1) - { - return [string]::Format( "{0:N2} min", $ts.TotalMinutes); - } - - if ($ts.TotalSeconds -ge 1) - { - return [string]::Format( "{0:N2} s", $ts.TotalSeconds); - } - - if ($ts.TotalMilliseconds -ge 1) - { - return [string]::Format( "{0:N2} ms", $ts.TotalMilliseconds); - } - - throw $ts -} - -function vcpkgFindFileRecursivelyUp() -{ - param( - [ValidateNotNullOrEmpty()] - [Parameter(Mandatory=$true)][string]$startingDir, - [ValidateNotNullOrEmpty()] - [Parameter(Mandatory=$true)][string]$filename - ) - - $currentDir = $startingDir - - while (!($currentDir -eq "") -and !(Test-Path "$currentDir\$filename")) - { - Write-Verbose "Examining $currentDir for $filename" - $currentDir = Split-path $currentDir -Parent - } - Write-Verbose "Examining $currentDir for $filename - Found" - return $currentDir -} + return $out +} \ No newline at end of file diff --git a/scripts/addPoshVcpkgToPowershellProfile.ps1 b/scripts/addPoshVcpkgToPowershellProfile.ps1 index dcbd2e0be..5c13a8d4a 100644 --- a/scripts/addPoshVcpkgToPowershellProfile.ps1 +++ b/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -18,10 +18,10 @@ $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $profileEntry = "Import-Module '$scriptsDir\posh-vcpkg'" $profilePath = $PROFILE # Implicit powershell variable -if (!(Test-Path $profilePath)) +$profileDir = Split-Path $profilePath -Parent +if (!(Test-Path $profileDir)) { - $profileDir = Split-Path $profilePath -Parent - vcpkgCreateDirectoryIfNotExists $profileDir + New-Item -ItemType Directory -Path $profileDir | Out-Null } Write-Host "`nAdding the following line to ${profilePath}:" @@ -38,6 +38,7 @@ if ($existingImports.Count -gt 0) return } +# Modifying the profile will invalidate any signatures. # Posh-git does the following check, so we should too. # https://github.com/dahlbyk/posh-git/blob/master/src/Utils.ps1 # If the profile script exists and is signed, then we should not modify it diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index c8ba503d8..41ba25746 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,35 +5,18 @@ param( ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" -$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root -Write-Verbose("vcpkg Path " + $vcpkgRootDir) -$gitHash = "unknownhash" -$oldpath = $env:path -try -{ - [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" - $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"git`"]") - $gitFromDownload = "$vcpkgRootDir\downloads\$($toolData.exeRelativePath)" - $gitDir = split-path -parent $gitFromDownload +$vcpkgRootDir = $scriptsDir +$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash - $env:path += ";$gitDir" - if (Get-Command "git" -ErrorAction SilentlyContinue) - { - $gitHash = git log HEAD -n 1 --format="%cd-%H" --date=short - if ($LASTEXITCODE -ne 0) - { - $gitHash = "unknownhash" - } - } -} -finally +while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) { - $env:path = $oldpath + Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root" + $vcpkgRootDir = Split-path $vcpkgRootDir -Parent } -Write-Verbose("Git repo version string is " + $gitHash) +Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" +$gitHash = "nohash" $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" if (!(Test-Path $vcpkgSourcesPath)) @@ -42,7 +25,58 @@ if (!(Test-Path $vcpkgSourcesPath)) return } -$msbuildExeWithPlatformToolset = & $scriptsDir\findAnyMSBuildWithCppPlatformToolset.ps1 $withVSPath +function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) +{ + $VisualStudioInstances = & $scriptsDir\getVisualStudioInstances.ps1 + if ($VisualStudioInstances -eq $null) + { + throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." + } + + Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstances))" + foreach ($instanceCandidateWithEOL in $VisualStudioInstances) + { + $instanceCandidate = $instanceCandidateWithEOL -replace "::" -replace "::" + Write-Verbose "Inspecting: $instanceCandidate" + $split = $instanceCandidate -split "::" + # $preferenceWeight = $split[0] + # $releaseType = $split[1] + $version = $split[2] + $path = $split[3] + + if ($withVSPath -ne "" -and $withVSPath -ne $path) + { + Write-Verbose "Skipping: $instanceCandidate" + continue + } + + $majorVersion = $version.Substring(0,2); + if ($majorVersion -eq "15") + { + $VCFolder= "$path\VC\Tools\MSVC\" + if (Test-Path $VCFolder) + { + Write-Verbose "Picking: $instanceCandidate" + return "$path\MSBuild\15.0\Bin\MSBuild.exe", "v141" + } + } + + if ($majorVersion -eq "14") + { + $clExe= "$path\VC\bin\cl.exe" + if (Test-Path $clExe) + { + Write-Verbose "Picking: $instanceCandidate" + $programFilesPath = getProgramFiles32bit + return "$programFilesPath\MSBuild\14.0\Bin\MSBuild.exe", "v140" + } + } + } + + throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." +} + +$msbuildExeWithPlatformToolset = findAnyMSBuildWithCppPlatformToolset $withVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = & $scriptsDir\getWindowsSDK.ps1 @@ -54,10 +88,33 @@ $arguments = ( "/p:Platform=x86", "/p:PlatformToolset=$platformToolset", "/p:TargetPlatformVersion=$windowsSDK", +"/verbosity:minimal", "/m", +"/nologo", "`"$vcpkgSourcesPath\dirs.proj`"") -join " " +function vcpkgInvokeCommandClean() +{ + param ( [Parameter(Mandatory=$true)][string]$executable, + [string]$arguments = "") + + Write-Verbose "Clean-Executing: ${executable} ${arguments}" + $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition + $cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1" + $tripleQuotes = "`"`"`"" + $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes + $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes" + $arg = "-NoProfile", "-ExecutionPolicy Bypass", "-command $command" + + $process = Start-Process -FilePath powershell.exe -ArgumentList $arg -PassThru -NoNewWindow + Wait-Process -InputObject $process + $ec = $process.ExitCode + Write-Verbose "Execution terminated with exit code $ec." + return $ec +} + # vcpkgInvokeCommandClean cmd "/c echo %PATH%" +Write-Host "`nBuilding vcpkg.exe ...`n" $ec = vcpkgInvokeCommandClean $msbuildExe $arguments if ($ec -ne 0) @@ -65,6 +122,7 @@ if ($ec -ne 0) Write-Error "Building vcpkg.exe failed. Please ensure you have installed Visual Studio with the Desktop C++ workload and the Windows SDK for Desktop C++." return } +Write-Host "`nBuilding vcpkg.exe... done.`n" Write-Verbose("Placing vcpkg.exe in the correct location") diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 deleted file mode 100644 index eca405b62..000000000 --- a/scripts/fetchTool.ps1 +++ /dev/null @@ -1,109 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$true)][string]$tool -) - -Set-StrictMode -Version Latest - -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -Write-Verbose "Fetching tool: $tool" -$vcpkgRootDir = vcpkgFindFileRecursivelyUp $scriptsDir .vcpkg-root - -$downloadsDir = "$vcpkgRootDir\downloads" -vcpkgCreateDirectoryIfNotExists $downloadsDir -$downloadsDir = Resolve-Path $downloadsDir - -function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) -{ - $tool = $tool.toLower() - - [xml]$asXml = Get-Content "$scriptsDir\vcpkgTools.xml" - $toolData = $asXml.SelectSingleNode("//tools/tool[@name=`"$tool`"]") # Case-sensitive! - - if ($toolData -eq $null) - { - throw "Unknown tool $tool" - } - - $toolPath="$downloadsDir\tools\$tool-$($toolData.version)-windows" - $exePath = "$toolPath\$($toolData.exeRelativePath)" - - if (Test-Path $exePath) - { - return $exePath - } - - $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveName" - if ($isArchive) - { - $downloadPath = "$downloadsDir\$($toolData.archiveName)" - } - else - { - $downloadPath = "$toolPath\$($toolData.exeRelativePath)" - } - - [String]$url = $toolData.url - if (!(Test-Path $downloadPath)) - { - Write-Host "Downloading $tool..." - - # Download aria2 with .NET. aria2 will be used to download everything else. - if ($tool -eq "aria2") - { - vcpkgDownloadFile $url $downloadPath $toolData.sha512 - } - else - { - $aria2exe = fetchToolInternal "aria2" - vcpkgDownloadFileWithAria2 $aria2exe $url $downloadPath $toolData.sha512 - } - - Write-Host "Downloading $tool... done." - } - else - { - vcpkgCheckEqualFileHash -url $url -filePath $downloadPath -expectedHash $toolData.sha512 - } - - if ($isArchive) - { - Write-Host "Extracting $tool..." - # Extract 7zip920 with shell because we need it to extract 7zip - # Extract aria2 with shell because we need it to download 7zip - if ($tool -eq "7zip920" -or $tool -eq "aria2") - { - vcpkgExtractZipFile -ArchivePath $downloadPath -DestinationDir $toolPath - } - elseif ($tool -eq "7zip") - { - $sevenZip920 = fetchToolInternal "7zip920" - $ec = vcpkgInvokeCommand "$sevenZip920" "x `"$downloadPath`" -o`"$toolPath`" -y" - if ($ec -ne 0) - { - Write-Host "Could not extract $downloadPath" - throw - } - } - else - { - $sevenZipExe = fetchToolInternal "7zip" - vcpkgExtractFileWith7z -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath - } - Write-Host "Extracting $tool... done." - } - - if (-not (Test-Path $exePath)) - { - Write-Error "Could not detect or download $tool" - throw - } - - return $exePath -} - -$path = fetchToolInternal $tool -Write-Verbose "Fetching tool: $tool. Done." -return "::$path::" diff --git a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 b/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 deleted file mode 100644 index d7fd24e24..000000000 --- a/scripts/findAnyMSBuildWithCppPlatformToolset.ps1 +++ /dev/null @@ -1,58 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$False)] - [string]$withVSPath = "" -) - -Set-StrictMode -Version Latest -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition - -$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash - -$VisualStudioInstallationInstances = & $scriptsDir\findVisualStudioInstallationInstances.ps1 -if ($VisualStudioInstallationInstances -eq $null) -{ - throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." -} - -Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstallationInstances))" -foreach ($instanceCandidateWithEOL in $VisualStudioInstallationInstances) -{ - $instanceCandidate = $instanceCandidateWithEOL -replace "::" -replace "::" - Write-Verbose "Inspecting: $instanceCandidate" - $split = $instanceCandidate -split "::" - # $preferenceWeight = $split[0] - # $releaseType = $split[1] - $version = $split[2] - $path = $split[3] - - if ($withVSPath -ne "" -and $withVSPath -ne $path) - { - Write-Verbose "Skipping: $instanceCandidate" - continue - } - - $majorVersion = $version.Substring(0,2); - if ($majorVersion -eq "15") - { - $VCFolder= "$path\VC\Tools\MSVC\" - if (Test-Path $VCFolder) - { - Write-Verbose "Picking: $instanceCandidate" - return "$path\MSBuild\15.0\Bin\MSBuild.exe", "v141" - } - } - - if ($majorVersion -eq "14") - { - $clExe= "$path\VC\bin\cl.exe" - if (Test-Path $clExe) - { - Write-Verbose "Picking: $instanceCandidate" - $programFilesPath = & $scriptsDir\getProgramFiles32bit.ps1 - return "$programFilesPath\MSBuild\14.0\Bin\MSBuild.exe", "v140" - } - } -} - -throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." \ No newline at end of file diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1 deleted file mode 100644 index cb51c345d..000000000 --- a/scripts/findVisualStudioInstallationInstances.ps1 +++ /dev/null @@ -1,61 +0,0 @@ -[CmdletBinding()] -param( - -) -Set-StrictMode -Version Latest -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -$vswhereExe = (& $scriptsDir\fetchTool.ps1 "vswhere") -replace "::" -replace "::" - -$output = & $vswhereExe -prerelease -legacy -products * -format xml -[xml]$asXml = $output - -$results = New-Object System.Collections.ArrayList -foreach ($instance in $asXml.instances.instance) -{ - $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash - $installationVersion = $instance.InstallationVersion - - $isPrerelease = -7 - if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") - { - $isPrerelease = $instance.isPrerelease - } - - if ($isPrerelease -eq 0) - { - $releaseType = "PreferenceWeight3::StableRelease" - } - elseif ($isPrerelease -eq 1) - { - $releaseType = "PreferenceWeight2::PreRelease" - } - else - { - $releaseType = "PreferenceWeight1::Legacy" - } - - # Placed like that for easy sorting according to preference - $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null -} - -# If nothing is found, attempt to find VS2015 Build Tools (not detected by vswhere.exe) -if ($results.Count -eq 0) -{ - $programFiles = & $scriptsDir\getProgramFiles32bit.ps1 - $installationPath = "$programFiles\Microsoft Visual Studio 14.0" - $clExe = "$installationPath\VC\bin\cl.exe" - $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - - if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) - { - return "::PreferenceWeight1::Legacy::14.0::$installationPath::" - } -} - - -$results.Sort() -$results.Reverse() - -return $results \ No newline at end of file diff --git a/scripts/getProgramFiles32bit.ps1 b/scripts/getProgramFiles32bit.ps1 deleted file mode 100644 index 6b71915b1..000000000 --- a/scripts/getProgramFiles32bit.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -[CmdletBinding()] -param( - -) - -$out = ${env:PROGRAMFILES(X86)} -if ($out -eq $null) -{ - $out = ${env:PROGRAMFILES} -} - -if ($out -eq $null) -{ - throw "Could not find [Program Files 32-bit]" -} - -return $out \ No newline at end of file diff --git a/scripts/getProgramFilesPlatformBitness.ps1 b/scripts/getProgramFilesPlatformBitness.ps1 deleted file mode 100644 index 2be4c1137..000000000 --- a/scripts/getProgramFilesPlatformBitness.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -[CmdletBinding()] -param( - -) - -$out = ${env:ProgramW6432} -if ($out -eq $null) -{ - $out = ${env:PROGRAMFILES} -} - -if ($out -eq $null) -{ - throw "Could not find [Program Files Platform Bitness]" -} - -return $out \ No newline at end of file diff --git a/scripts/getVisualStudioInstances.ps1 b/scripts/getVisualStudioInstances.ps1 new file mode 100644 index 000000000..83b0b8ebd --- /dev/null +++ b/scripts/getVisualStudioInstances.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding()] +param( + +) +Set-StrictMode -Version Latest +$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" + +$programFiles = getProgramFiles32bit + +$results = New-Object System.Collections.ArrayList + +$vswhereExe = "$programFiles\Microsoft Visual Studio\Installer\vswhere.exe" + +if (Test-Path $vswhereExe) +{ + $output = & $vswhereExe -prerelease -legacy -products * -format xml + [xml]$asXml = $output + + foreach ($instance in $asXml.instances.instance) + { + $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash + $installationVersion = $instance.InstallationVersion + + $isPrerelease = -7 + if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") + { + $isPrerelease = $instance.isPrerelease + } + + if ($isPrerelease -eq 0) + { + $releaseType = "PreferenceWeight3::StableRelease" + } + elseif ($isPrerelease -eq 1) + { + $releaseType = "PreferenceWeight2::PreRelease" + } + else + { + $releaseType = "PreferenceWeight1::Legacy" + } + + # Placed like that for easy sorting according to preference + $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null + } +} +else +{ + Write-Verbose "Could not locate vswhere at $vswhereExe" +} + +$installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") +$clExe = "$installationPath\VC\bin\cl.exe" +$vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + +if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) +{ + $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null +} + +$installationPath = "$programFiles\Microsoft Visual Studio 14.0" +$clExe = "$installationPath\VC\bin\cl.exe" +$vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + +if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) +{ + $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null +} + +$results.Sort() +$results.Reverse() + +return $results diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 1f17102d2..9d5487577 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -61,17 +61,10 @@ 18.01.0 - 7za.exe - https://www.7-zip.org/a/7z1801-extra.7z - 9133fc551d76515e37fdd4dd8c1e28d464aea493548246b44565a42bba46715764f41f9cfa14d470d298c3a6e9829d200f8be5168cb67cf8f23d8042fca833bc - 7z1801-extra.7z - - - 9.20.0 - 7za.exe - https://www.7-zip.org/a/7za920.zip - 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 - 7za920.zip + 7-Zip.CommandLine.18.1.0\tools\7za.exe + https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 + 8c75314102e68d2b2347d592f8e3eb05812e1ebb525decbac472231633753f1d4ca31c8e6881a36144a8da26b2571305b3ae3f4e2b85fc4a290aeda63d1a13b8 + 7-zip.commandline.18.1.0.nupkg 18.01.0 -- cgit v1.2.3 From f35ff4c8bc0fbe52a3c5c78f74f7c33e550b12e1 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Wed, 16 May 2018 17:26:45 +0300 Subject: [openexr] Fix linux build --- scripts/toolchains/linux.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index ea4f15d60..1ad180b4b 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -2,3 +2,17 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "") endif() set(CMAKE_SYSTEM_NAME Linux CACHE STRING "") + +get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE ) +if(NOT _CMAKE_IN_TRY_COMPILE) + set(CMAKE_CXX_FLAGS " ${VCPKG_CXX_FLAGS}" CACHE STRING "") + set(CMAKE_C_FLAGS " ${VCPKG_C_FLAGS}" CACHE STRING "") + + set(CMAKE_CXX_FLAGS_DEBUG "${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") + set(CMAKE_C_FLAGS_DEBUG "${VCPKG_C_FLAGS_DEBUG}" CACHE STRING "") + set(CMAKE_CXX_FLAGS_RELEASE "${VCPKG_CXX_FLAGS_RELEASE}" CACHE STRING "") + set(CMAKE_C_FLAGS_RELEASE "${VCPKG_C_FLAGS_RELEASE}" CACHE STRING "") + + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${VCPKG_LINKER_FLAGS}" CACHE STRING "") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${VCPKG_LINKER_FLAGS}" CACHE STRING "") +endif() -- cgit v1.2.3 From 8347101e63649dab2930bbc11dab39fa37c1e927 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 May 2018 14:51:17 -0700 Subject: [ps1] Add missing "include" --- scripts/bootstrap.ps1 | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 41ba25746..ed9491e2d 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,6 +5,7 @@ param( ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition +. "$scriptsDir\VcpkgPowershellUtils.ps1" $vcpkgRootDir = $scriptsDir $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash -- cgit v1.2.3 From 1e03300470b5235b3026ff94e585adef8f961785 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 16 May 2018 19:19:02 -0700 Subject: [ps1] Fix error when vs140comntools is not available --- scripts/getVisualStudioInstances.ps1 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/getVisualStudioInstances.ps1 b/scripts/getVisualStudioInstances.ps1 index 83b0b8ebd..910d0f98b 100644 --- a/scripts/getVisualStudioInstances.ps1 +++ b/scripts/getVisualStudioInstances.ps1 @@ -50,13 +50,16 @@ else Write-Verbose "Could not locate vswhere at $vswhereExe" } -$installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") -$clExe = "$installationPath\VC\bin\cl.exe" -$vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - -if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) +if ("$env:vs140comntools" -ne "") { - $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + $installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") + $clExe = "$installationPath\VC\bin\cl.exe" + $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + + if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) + { + $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + } } $installationPath = "$programFiles\Microsoft Visual Studio 14.0" -- cgit v1.2.3 From 658f1caaab56e7559eca17653bd9ca87a900f136 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 17:27:30 -0700 Subject: [vcpkg_get_windows_sdk] Don't call powershell. Deduce from env --- scripts/cmake/vcpkg_get_windows_sdk.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/vcpkg_get_windows_sdk.cmake b/scripts/cmake/vcpkg_get_windows_sdk.cmake index a8aad64a9..e7d72a125 100644 --- a/scripts/cmake/vcpkg_get_windows_sdk.cmake +++ b/scripts/cmake/vcpkg_get_windows_sdk.cmake @@ -1,16 +1,6 @@ # Returns Windows SDK number via out variable "ret" function(vcpkg_get_windows_sdk ret) - execute_process( - COMMAND powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& {& '${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1'}" 2>&1 - INPUT_FILE NUL - OUTPUT_VARIABLE WINDOWS_SDK - RESULT_VARIABLE error_code) - - if (error_code) - message(FATAL_ERROR "Could not find Windows SDK") - endif() - - # Remove trailing newline and non-numeric characters - string(REGEX REPLACE "[^0-9.]" "" WINDOWS_SDK "${WINDOWS_SDK}") + set(WINDOWS_SDK $ENV{WindowsSDKVersion}) + string(REPLACE "\\" "" WINDOWS_SDK "${WINDOWS_SDK}") set(${ret} ${WINDOWS_SDK} PARENT_SCOPE) endfunction() \ No newline at end of file -- cgit v1.2.3 From 9e4196d49524d41959e84f27b4080a0ec2cb37e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 17:50:51 -0700 Subject: Merge getWindowsSDK into bootstrap.ps1 --- scripts/bootstrap.ps1 | 119 ++++++++++++++++++++++++++++++++++++++++++- scripts/getWindowsSDK.ps1 | 126 ---------------------------------------------- 2 files changed, 118 insertions(+), 127 deletions(-) delete mode 100644 scripts/getWindowsSDK.ps1 (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index ed9491e2d..970fa0488 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -76,11 +76,128 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) throw "Could not find MSBuild version with C++ support. VS2015 or VS2017 (with C++) needs to be installed." } +function getWindowsSDK( [Parameter(Mandatory=$False)][switch]$DisableWin10SDK = $False, + [Parameter(Mandatory=$False)][switch]$DisableWin81SDK = $False) +{ + if ($DisableWin10SDK -and $DisableWin81SDK) + { + throw "Both Win10SDK and Win81SDK were disabled." + } + + Write-Verbose "Finding WinSDK" + + $validInstances = New-Object System.Collections.ArrayList + + # Windows 10 SDK + function CheckWindows10SDK($path) + { + if ($path -eq $null) + { + return + } + + $folder = (Join-Path $path "Include") + if (!(Test-Path $folder)) + { + Write-Verbose "$folder - Not Found" + return + } + + Write-Verbose "$folder - Found" + $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) + [array]::Reverse($win10sdkVersions) # Newest SDK first + + foreach ($win10sdkV in $win10sdkVersions) + { + $windowsheader = "$folder\$win10sdkV\um\windows.h" + if (!(Test-Path $windowsheader)) + { + Write-Verbose "$windowsheader - Not Found" + continue + } + Write-Verbose "$windowsheader - Found" + + $ddkheader = "$folder\$win10sdkV\shared\sdkddkver.h" + if (!(Test-Path $ddkheader)) + { + Write-Verbose "$ddkheader - Not Found" + continue + } + + Write-Verbose "$ddkheader - Found" + $win10sdkVersionString = $win10sdkV.ToString() + Write-Verbose "Found $win10sdkVersionString" + $validInstances.Add($win10sdkVersionString) > $null + } + } + + Write-Verbose "`n" + Write-Verbose "Looking for Windows 10 SDK" + $regkey10 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue + $regkey10Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue + if (vcpkgHasProperty -object $regkey10 "KitsRoot10") { CheckWindows10SDK($regkey10.KitsRoot10) } + if (vcpkgHasProperty -object $regkey10Wow6432 "KitsRoot10") { CheckWindows10SDK($regkey10Wow6432.KitsRoot10) } + CheckWindows10SDK("$env:ProgramFiles\Windows Kits\10") + CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") + + # Windows 8.1 SDK + function CheckWindows81SDK($path) + { + if ($path -eq $null) + { + return + } + + $folder = "$path\Include" + if (!(Test-Path $folder)) + { + Write-Verbose "$folder - Not Found" + return + } + + Write-Verbose "$folder - Found" + $win81sdkVersionString = "8.1" + Write-Verbose "Found $win81sdkVersionString" + $validInstances.Add($win81sdkVersionString) > $null + } + + Write-Verbose "`n" + Write-Verbose "Looking for Windows 8.1 SDK" + $regkey81 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue + $regkey81Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue + if (vcpkgHasProperty -object $regkey81 "KitsRoot81") { CheckWindows81SDK($regkey81.KitsRoot81) } + if (vcpkgHasProperty -object $regkey81Wow6432 "KitsRoot81") { CheckWindows81SDK($regkey81Wow6432.KitsRoot81) } + CheckWindows81SDK("$env:ProgramFiles\Windows Kits\8.1") + CheckWindows81SDK("${env:ProgramFiles(x86)}\Windows Kits\8.1") + + Write-Verbose "`n`n`n" + Write-Verbose "The following Windows SDKs were found:" + foreach ($instance in $validInstances) + { + Write-Verbose $instance + } + + # Selecting + foreach ($instance in $validInstances) + { + if (!$DisableWin10SDK -and $instance -match "10.") + { + return $instance + } + + if (!$DisableWin81SDK -and $instance -match "8.1") + { + return $instance + } + } + + throw "Could not detect a Windows SDK / TargetPlatformVersion" +} $msbuildExeWithPlatformToolset = findAnyMSBuildWithCppPlatformToolset $withVSPath $msbuildExe = $msbuildExeWithPlatformToolset[0] $platformToolset = $msbuildExeWithPlatformToolset[1] -$windowsSDK = & $scriptsDir\getWindowsSDK.ps1 +$windowsSDK = getWindowsSDK $arguments = ( "`"/p:VCPKG_VERSION=-$gitHash`"", diff --git a/scripts/getWindowsSDK.ps1 b/scripts/getWindowsSDK.ps1 deleted file mode 100644 index d5e2f59a2..000000000 --- a/scripts/getWindowsSDK.ps1 +++ /dev/null @@ -1,126 +0,0 @@ -[CmdletBinding()] -param( - [Parameter(Mandatory=$False)] - [switch]$DisableWin10SDK = $False, - - [Parameter(Mandatory=$False)] - [switch]$DisableWin81SDK = $False -) - -Set-StrictMode -Version Latest -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -if ($DisableWin10SDK -and $DisableWin81SDK) -{ - throw "Both Win10SDK and Win81SDK were disabled." -} - -Write-Verbose "Executing $($MyInvocation.MyCommand.Name)" - -$validInstances = New-Object System.Collections.ArrayList - -# Windows 10 SDK -function CheckWindows10SDK($path) -{ - if ($path -eq $null) - { - return - } - - $folder = (Join-Path $path "Include") - if (!(Test-Path $folder)) - { - Write-Verbose "$folder - Not Found" - return - } - - Write-Verbose "$folder - Found" - $win10sdkVersions = @(Get-ChildItem $folder | Where-Object {$_.Name -match "^10"} | Sort-Object) - [array]::Reverse($win10sdkVersions) # Newest SDK first - - foreach ($win10sdkV in $win10sdkVersions) - { - $windowsheader = "$folder\$win10sdkV\um\windows.h" - if (!(Test-Path $windowsheader)) - { - Write-Verbose "$windowsheader - Not Found" - continue - } - Write-Verbose "$windowsheader - Found" - - $ddkheader = "$folder\$win10sdkV\shared\sdkddkver.h" - if (!(Test-Path $ddkheader)) - { - Write-Verbose "$ddkheader - Not Found" - continue - } - - Write-Verbose "$ddkheader - Found" - $win10sdkVersionString = $win10sdkV.ToString() - Write-Verbose "Found $win10sdkVersionString" - $validInstances.Add($win10sdkVersionString) > $null - } -} - -Write-Verbose "`n" -Write-Verbose "Looking for Windows 10 SDK" -$regkey10 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue -$regkey10Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot10' -ErrorAction SilentlyContinue -if (vcpkgHasProperty -object $regkey10 "KitsRoot10") { CheckWindows10SDK($regkey10.KitsRoot10) } -if (vcpkgHasProperty -object $regkey10Wow6432 "KitsRoot10") { CheckWindows10SDK($regkey10Wow6432.KitsRoot10) } -CheckWindows10SDK("$env:ProgramFiles\Windows Kits\10") -CheckWindows10SDK("${env:ProgramFiles(x86)}\Windows Kits\10") - -# Windows 8.1 SDK -function CheckWindows81SDK($path) -{ - if ($path -eq $null) - { - return - } - - $folder = "$path\Include" - if (!(Test-Path $folder)) - { - Write-Verbose "$folder - Not Found" - return - } - - Write-Verbose "$folder - Found" - $win81sdkVersionString = "8.1" - Write-Verbose "Found $win81sdkVersionString" - $validInstances.Add($win81sdkVersionString) > $null -} - -Write-Verbose "`n" -Write-Verbose "Looking for Windows 8.1 SDK" -$regkey81 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue -$regkey81Wow6432 = Get-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots\' -Name 'KitsRoot81' -ErrorAction SilentlyContinue -if (vcpkgHasProperty -object $regkey81 "KitsRoot81") { CheckWindows81SDK($regkey81.KitsRoot81) } -if (vcpkgHasProperty -object $regkey81Wow6432 "KitsRoot81") { CheckWindows81SDK($regkey81Wow6432.KitsRoot81) } -CheckWindows81SDK("$env:ProgramFiles\Windows Kits\8.1") -CheckWindows81SDK("${env:ProgramFiles(x86)}\Windows Kits\8.1") - -Write-Verbose "`n`n`n" -Write-Verbose "The following Windows SDKs were found:" -foreach ($instance in $validInstances) -{ - Write-Verbose $instance -} - -# Selecting -foreach ($instance in $validInstances) -{ - if (!$DisableWin10SDK -and $instance -match "10.") - { - return $instance - } - - if (!$DisableWin81SDK -and $instance -match "8.1") - { - return $instance - } -} - -throw "Could not detect a Windows SDK / TargetPlatformVersion" -- cgit v1.2.3 From 555fa8d7cc25f409fea9626383dfc38c5d5db6b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 17:54:12 -0700 Subject: Merge getVisualStudioInstances into bootstrap.ps1 --- scripts/bootstrap.ps1 | 72 ++++++++++++++++++++++++++++++++- scripts/getVisualStudioInstances.ps1 | 77 ------------------------------------ 2 files changed, 71 insertions(+), 78 deletions(-) delete mode 100644 scripts/getVisualStudioInstances.ps1 (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 970fa0488..a2d9103dd 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -26,9 +26,79 @@ if (!(Test-Path $vcpkgSourcesPath)) return } +function getVisualStudioInstances() +{ + $programFiles = getProgramFiles32bit + $results = New-Object System.Collections.ArrayList + $vswhereExe = "$programFiles\Microsoft Visual Studio\Installer\vswhere.exe" + if (Test-Path $vswhereExe) + { + $output = & $vswhereExe -prerelease -legacy -products * -format xml + [xml]$asXml = $output + + foreach ($instance in $asXml.instances.instance) + { + $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash + $installationVersion = $instance.InstallationVersion + + $isPrerelease = -7 + if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") + { + $isPrerelease = $instance.isPrerelease + } + + if ($isPrerelease -eq 0) + { + $releaseType = "PreferenceWeight3::StableRelease" + } + elseif ($isPrerelease -eq 1) + { + $releaseType = "PreferenceWeight2::PreRelease" + } + else + { + $releaseType = "PreferenceWeight1::Legacy" + } + + # Placed like that for easy sorting according to preference + $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null + } + } + else + { + Write-Verbose "Could not locate vswhere at $vswhereExe" + } + + if ("$env:vs140comntools" -ne "") + { + $installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") + $clExe = "$installationPath\VC\bin\cl.exe" + $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + + if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) + { + $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + } + } + + $installationPath = "$programFiles\Microsoft Visual Studio 14.0" + $clExe = "$installationPath\VC\bin\cl.exe" + $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" + + if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) + { + $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + } + + $results.Sort() + $results.Reverse() + + return $results +} + function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) { - $VisualStudioInstances = & $scriptsDir\getVisualStudioInstances.ps1 + $VisualStudioInstances = getVisualStudioInstances if ($VisualStudioInstances -eq $null) { throw "Could not find Visual Studio. VS2015 or VS2017 (with C++) needs to be installed." diff --git a/scripts/getVisualStudioInstances.ps1 b/scripts/getVisualStudioInstances.ps1 deleted file mode 100644 index 910d0f98b..000000000 --- a/scripts/getVisualStudioInstances.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -[CmdletBinding()] -param( - -) -Set-StrictMode -Version Latest -$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - -$programFiles = getProgramFiles32bit - -$results = New-Object System.Collections.ArrayList - -$vswhereExe = "$programFiles\Microsoft Visual Studio\Installer\vswhere.exe" - -if (Test-Path $vswhereExe) -{ - $output = & $vswhereExe -prerelease -legacy -products * -format xml - [xml]$asXml = $output - - foreach ($instance in $asXml.instances.instance) - { - $installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash - $installationVersion = $instance.InstallationVersion - - $isPrerelease = -7 - if (vcpkgHasProperty -object $instance -propertyName "isPrerelease") - { - $isPrerelease = $instance.isPrerelease - } - - if ($isPrerelease -eq 0) - { - $releaseType = "PreferenceWeight3::StableRelease" - } - elseif ($isPrerelease -eq 1) - { - $releaseType = "PreferenceWeight2::PreRelease" - } - else - { - $releaseType = "PreferenceWeight1::Legacy" - } - - # Placed like that for easy sorting according to preference - $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null - } -} -else -{ - Write-Verbose "Could not locate vswhere at $vswhereExe" -} - -if ("$env:vs140comntools" -ne "") -{ - $installationPath = Split-Path -Parent $(Split-Path -Parent "$env:vs140comntools") - $clExe = "$installationPath\VC\bin\cl.exe" - $vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - - if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) - { - $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null - } -} - -$installationPath = "$programFiles\Microsoft Visual Studio 14.0" -$clExe = "$installationPath\VC\bin\cl.exe" -$vcvarsallbat = "$installationPath\VC\vcvarsall.bat" - -if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) -{ - $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null -} - -$results.Sort() -$results.Reverse() - -return $results -- cgit v1.2.3 From a739df905c129eb13d7060419a78f5a693974b63 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 17:54:50 -0700 Subject: Merge VcpkgPowershellUtils into bootstrap.ps1 --- scripts/VcpkgPowershellUtils.ps1 | 25 ------------------------- scripts/bootstrap.ps1 | 27 +++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 27 deletions(-) delete mode 100644 scripts/VcpkgPowershellUtils.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 deleted file mode 100644 index 259df4acb..000000000 --- a/scripts/VcpkgPowershellUtils.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) -{ - if ($object -eq $null) - { - return $false - } - - return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) -} - -function getProgramFiles32bit() -{ - $out = ${env:PROGRAMFILES(X86)} - if ($out -eq $null) - { - $out = ${env:PROGRAMFILES} - } - - if ($out -eq $null) - { - throw "Could not find [Program Files 32-bit]" - } - - return $out -} \ No newline at end of file diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index a2d9103dd..09c138bb3 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,10 +5,33 @@ param( ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" - $vcpkgRootDir = $scriptsDir $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash +function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) +{ + if ($object -eq $null) + { + return $false + } + + return [bool]($object.psobject.Properties | Where-Object { $_.Name -eq "$propertyName"}) +} + +function getProgramFiles32bit() +{ + $out = ${env:PROGRAMFILES(X86)} + if ($out -eq $null) + { + $out = ${env:PROGRAMFILES} + } + + if ($out -eq $null) + { + throw "Could not find [Program Files 32-bit]" + } + + return $out +} while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) { -- cgit v1.2.3 From 8549a095a8707c2aa38e9ee1642bef2cf0a90d81 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 17:55:15 -0700 Subject: Remove stray entries --- scripts/addPoshVcpkgToPowershellProfile.ps1 | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/addPoshVcpkgToPowershellProfile.ps1 b/scripts/addPoshVcpkgToPowershellProfile.ps1 index 5c13a8d4a..1dd27aacf 100644 --- a/scripts/addPoshVcpkgToPowershellProfile.ps1 +++ b/scripts/addPoshVcpkgToPowershellProfile.ps1 @@ -14,7 +14,6 @@ function findExistingImportModuleDirectives([Parameter(Mandatory=$true)][string] } $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -. "$scriptsDir\VcpkgPowershellUtils.ps1" $profileEntry = "Import-Module '$scriptsDir\posh-vcpkg'" $profilePath = $PROFILE # Implicit powershell variable -- cgit v1.2.3 From bc96c069aced70a51a04a5e009f7c7931c488028 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 18:07:09 -0700 Subject: [bootstrap.ps1] Remove unneeded it was used for communication with vcpkg --- scripts/bootstrap.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 09c138bb3..0427ce2ba 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -7,6 +7,7 @@ Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition $vcpkgRootDir = $scriptsDir $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash + function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) { if ($object -eq $null) @@ -84,7 +85,7 @@ function getVisualStudioInstances() } # Placed like that for easy sorting according to preference - $results.Add("::${releaseType}::${installationVersion}::${installationPath}::") > $null + $results.Add("${releaseType}::${installationVersion}::${installationPath}") > $null } } else @@ -100,7 +101,7 @@ function getVisualStudioInstances() if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) { - $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + $results.Add("PreferenceWeight1::Legacy::14.0::$installationPath") > $null } } @@ -110,7 +111,7 @@ function getVisualStudioInstances() if ((Test-Path $clExe) -And (Test-Path $vcvarsallbat)) { - $results.Add("::PreferenceWeight1::Legacy::14.0::$installationPath::") > $null + $results.Add("PreferenceWeight1::Legacy::14.0::$installationPath") > $null } $results.Sort() @@ -128,9 +129,8 @@ function findAnyMSBuildWithCppPlatformToolset([string]$withVSPath) } Write-Verbose "VS Candidates:`n`r$([system.String]::Join([Environment]::NewLine, $VisualStudioInstances))" - foreach ($instanceCandidateWithEOL in $VisualStudioInstances) + foreach ($instanceCandidate in $VisualStudioInstances) { - $instanceCandidate = $instanceCandidateWithEOL -replace "::" -replace "::" Write-Verbose "Inspecting: $instanceCandidate" $split = $instanceCandidate -split "::" # $preferenceWeight = $split[0] -- cgit v1.2.3 From f1653a23d5a4a1f4ce8b4d034594526a649de0d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 18:08:10 -0700 Subject: Inline variable --- scripts/bootstrap.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 0427ce2ba..43cf96c56 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -41,7 +41,6 @@ while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) } Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root - Found" -$gitHash = "nohash" $vcpkgSourcesPath = "$vcpkgRootDir\toolsrc" if (!(Test-Path $vcpkgSourcesPath)) @@ -293,7 +292,7 @@ $platformToolset = $msbuildExeWithPlatformToolset[1] $windowsSDK = getWindowsSDK $arguments = ( -"`"/p:VCPKG_VERSION=-$gitHash`"", +"`"/p:VCPKG_VERSION=-nohash`"", "`"/p:DISABLE_METRICS=$disableMetrics`"", "/p:Configuration=Release", "/p:Platform=x86", -- cgit v1.2.3 From 3fc199dc52c4c6152ee83e95474a18bb076549e5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 18:23:05 -0700 Subject: Remove unused internalCI.ps1 --- scripts/internalCI.ps1 | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 scripts/internalCI.ps1 (limited to 'scripts') diff --git a/scripts/internalCI.ps1 b/scripts/internalCI.ps1 deleted file mode 100644 index 9529c3766..000000000 --- a/scripts/internalCI.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -$ErrorActionPreference = "Stop" - -rm TEST-internal-ci.xml -errorAction SilentlyContinue - -New-Item -type directory downloads -errorAction SilentlyContinue | Out-Null -./scripts/bootstrap.ps1 -if (-not $?) { throw $? } - -# Clear out any intermediate files from the previous build -if (Test-Path buildtrees) -{ - Get-ChildItem buildtrees/*/* | ? { $_.Name -ne "src" } | Remove-Item -Recurse -Force -} - -# Purge any outdated packages -./vcpkg remove --outdated --recurse -if (-not $?) { throw $? } - -./vcpkg.exe install azure-storage-cpp cpprestsdk:x64-windows-static cpprestsdk:x86-uwp ` -bond cryptopp zlib expat sdl2 curl sqlite3 libuv protobuf:x64-windows sfml opencv:x64-windows uwebsockets uwebsockets:x64-windows-static ` -opencv:x86-uwp boost:x86-uwp --keep-going "--x-xunit=TEST-internal-ci.xml" --recurse -if (-not $?) { throw $? } -- cgit v1.2.3 From 6ccd43dfa7bedbfe9323e13085a476cca5d616d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 18:24:50 -0700 Subject: Rename ps1 file --- scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 | 52 ----------------------- scripts/bootstrap.ps1 | 2 +- scripts/cleanEnvironmentHelper.ps1 | 52 +++++++++++++++++++++++ 3 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 create mode 100644 scripts/cleanEnvironmentHelper.ps1 (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 b/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 deleted file mode 100644 index 0a133f5f8..000000000 --- a/scripts/VcpkgPowershellUtils-ClearEnvironment.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -# Capture environment variables for the System and User. Also add some special/built-in variables. -# These will be used to synthesize a clean environment -$specialEnvironmentMap = @{ "SystemDrive"=$env:SystemDrive; "SystemRoot"=$env:SystemRoot; "UserProfile"=$env:UserProfile } # These are built-in and not set in the registry -$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment -$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_CURRENT_USER\Environment - -# Identify the keySet of environment variable names -$nameSet = ($specialEnvironmentMap.Keys + $machineEnvironmentMap.Keys + $userEnvironmentMap.Keys) | Sort-Object | Select-Object -Unique - -# Any environment variable in the $nameSet should be restored to its original value -foreach ($name in $nameSet) -{ - if ($specialEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $specialEnvironmentMap[$name], 'Process') - continue; - } - - # PATH needs to be concatenated as it has values in both machine and user environment. Any other values should be set. - if ($name -match 'path') - { - $pathValuePartial = @() - # Machine values before user values - $pathValuePartial += $machineEnvironmentMap[$name] -split ';' - $pathValuePartial += $userEnvironmentMap[$name] -split ';' - $pathValue = $pathValuePartial -join ';' - [Environment]::SetEnvironmentVariable($name, $pathValue, 'Process') - continue; - } - - if ($userEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $userEnvironmentMap[$name], 'Process') - continue; - } - - if ($machineEnvironmentMap.ContainsKey($name)) - { - [Environment]::SetEnvironmentVariable($name, $machineEnvironmentMap[$name], 'Process') - continue; - } - - throw "Unreachable: Unknown variable $name" -} - -# Any environment variable NOT in the $nameSet should be removed -$processEnvironmentMap = [Environment]::GetEnvironmentVariables('Process') -$variablesForRemoval = $processEnvironmentMap.Keys | Where-Object {$nameSet -notcontains $_} -foreach ($name in $variablesForRemoval) -{ - [Environment]::SetEnvironmentVariable($name, $null, 'Process') -} diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 43cf96c56..c37ffd57f 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -310,7 +310,7 @@ function vcpkgInvokeCommandClean() Write-Verbose "Clean-Executing: ${executable} ${arguments}" $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition - $cleanEnvScript = "$scriptsDir\VcpkgPowershellUtils-ClearEnvironment.ps1" + $cleanEnvScript = "$scriptsDir\cleanEnvironmentHelper.ps1" $tripleQuotes = "`"`"`"" $argumentsWithEscapedQuotes = $arguments -replace "`"", $tripleQuotes $command = ". $tripleQuotes$cleanEnvScript$tripleQuotes; & $tripleQuotes$executable$tripleQuotes $argumentsWithEscapedQuotes" diff --git a/scripts/cleanEnvironmentHelper.ps1 b/scripts/cleanEnvironmentHelper.ps1 new file mode 100644 index 000000000..0a133f5f8 --- /dev/null +++ b/scripts/cleanEnvironmentHelper.ps1 @@ -0,0 +1,52 @@ +# Capture environment variables for the System and User. Also add some special/built-in variables. +# These will be used to synthesize a clean environment +$specialEnvironmentMap = @{ "SystemDrive"=$env:SystemDrive; "SystemRoot"=$env:SystemRoot; "UserProfile"=$env:UserProfile } # These are built-in and not set in the registry +$machineEnvironmentMap = [Environment]::GetEnvironmentVariables('Machine') # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment +$userEnvironmentMap = [Environment]::GetEnvironmentVariables('User') # HKEY_CURRENT_USER\Environment + +# Identify the keySet of environment variable names +$nameSet = ($specialEnvironmentMap.Keys + $machineEnvironmentMap.Keys + $userEnvironmentMap.Keys) | Sort-Object | Select-Object -Unique + +# Any environment variable in the $nameSet should be restored to its original value +foreach ($name in $nameSet) +{ + if ($specialEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $specialEnvironmentMap[$name], 'Process') + continue; + } + + # PATH needs to be concatenated as it has values in both machine and user environment. Any other values should be set. + if ($name -match 'path') + { + $pathValuePartial = @() + # Machine values before user values + $pathValuePartial += $machineEnvironmentMap[$name] -split ';' + $pathValuePartial += $userEnvironmentMap[$name] -split ';' + $pathValue = $pathValuePartial -join ';' + [Environment]::SetEnvironmentVariable($name, $pathValue, 'Process') + continue; + } + + if ($userEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $userEnvironmentMap[$name], 'Process') + continue; + } + + if ($machineEnvironmentMap.ContainsKey($name)) + { + [Environment]::SetEnvironmentVariable($name, $machineEnvironmentMap[$name], 'Process') + continue; + } + + throw "Unreachable: Unknown variable $name" +} + +# Any environment variable NOT in the $nameSet should be removed +$processEnvironmentMap = [Environment]::GetEnvironmentVariables('Process') +$variablesForRemoval = $processEnvironmentMap.Keys | Where-Object {$nameSet -notcontains $_} +foreach ($name in $variablesForRemoval) +{ + [Environment]::SetEnvironmentVariable($name, $null, 'Process') +} -- cgit v1.2.3 From 7932abed8d10b59f6a448c71349667dded004106 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sat, 19 May 2018 19:38:45 -0700 Subject: [ps1] Move variable close to where it is set --- scripts/bootstrap.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index c37ffd57f..149134dff 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -5,7 +5,6 @@ param( ) Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition -$vcpkgRootDir = $scriptsDir $withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash function vcpkgHasProperty([Parameter(Mandatory=$true)][AllowNull()]$object, [Parameter(Mandatory=$true)]$propertyName) @@ -34,6 +33,7 @@ function getProgramFiles32bit() return $out } +$vcpkgRootDir = $scriptsDir while (!($vcpkgRootDir -eq "") -and !(Test-Path "$vcpkgRootDir\.vcpkg-root")) { Write-Verbose "Examining $vcpkgRootDir for .vcpkg-root" -- cgit v1.2.3