aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmake
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2019-02-28 14:36:23 -0800
committerPhil Christensen <philc@microsoft.com>2019-02-28 14:36:23 -0800
commit773c8267dfb506f41c204f61042f30b6143a8095 (patch)
tree5946d1526c3ad77a2df80786a1370d96389d931b /scripts/cmake
parent6afbceb27fd2aa39c66f810a22f5d4ad97575110 (diff)
parent7859944528be28bee1fda9f325b78d6a7f02124e (diff)
downloadvcpkg-773c8267dfb506f41c204f61042f30b6143a8095.tar.gz
vcpkg-773c8267dfb506f41c204f61042f30b6143a8095.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4564
Diffstat (limited to 'scripts/cmake')
-rw-r--r--scripts/cmake/vcpkg_acquire_msys.cmake14
-rw-r--r--scripts/cmake/vcpkg_add_to_path.cmake (renamed from scripts/cmake/vcpkg_append_to_path.cmake)0
-rw-r--r--scripts/cmake/vcpkg_build_qmake.cmake4
-rw-r--r--scripts/cmake/vcpkg_clean_msbuild.cmake19
-rw-r--r--scripts/cmake/vcpkg_common_functions.cmake5
-rw-r--r--scripts/cmake/vcpkg_configure_cmake.cmake5
-rw-r--r--scripts/cmake/vcpkg_extract_source_archive.cmake81
-rw-r--r--scripts/cmake/vcpkg_extract_source_archive_ex.cmake130
-rw-r--r--scripts/cmake/vcpkg_find_acquire_program.cmake59
-rw-r--r--scripts/cmake/vcpkg_fixup_cmake_targets.cmake8
-rw-r--r--scripts/cmake/vcpkg_from_git.cmake127
-rw-r--r--scripts/cmake/vcpkg_install_msbuild.cmake20
-rw-r--r--scripts/cmake/vcpkg_test_cmake.cmake5
13 files changed, 349 insertions, 128 deletions
diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake
index ed4f7ac29..adbd58ca5 100644
--- a/scripts/cmake/vcpkg_acquire_msys.cmake
+++ b/scripts/cmake/vcpkg_acquire_msys.cmake
@@ -53,20 +53,18 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT)
if(_vam_HOST_ARCHITECTURE STREQUAL "AMD64")
set(TOOLSUBPATH msys64)
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"
+ "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20181211.tar.xz"
)
- set(ARCHIVE "msys2-base-x86_64-20161025.tar.xz")
- set(HASH 6c4c18ec59db80b8269698d074866438a624f1ce735ee5005a01b148b02e8f2e966ae381aa1cb4c50f6226c3b7feb271e36907cf26580df084d695b3c9f5c0eb)
+ set(ARCHIVE "msys2-base-x86_64-20181211.tar.xz")
+ set(HASH 1efb9a7ff1daa2d3147ac0fda8e9a645696dbd19a33c986b844bc037d946dddb3353db5a52794ac668718812854400d918e4db13b4a2d0e6f5a9dfe716b48056)
set(STAMP "initialized-msys2_64.stamp")
else()
set(TOOLSUBPATH msys32)
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"
+ "http://repo.msys2.org/distrib/i686/msys2-base-i686-20181211.tar.xz"
)
- set(ARCHIVE "msys2-base-i686-20161025.tar.xz")
- set(HASH c9260a38e0c6bf963adeaea098c4e376449c1dd0afe07480741d6583a1ac4c138951ccb0c5388bd148e04255a5c1a23bf5ee2d58dcd6607c14f1eaa5639a7c85)
+ set(ARCHIVE "msys2-base-i686-20181211.tar.xz")
+ set(HASH a9b9680a511bb205b87811b303eb29d62e2fd851000304f8b087c5893a3891c2aa2d46217ae989e31b5d52a6ba34ac5e6a5e624d9c917df00a752ade4debc20f)
set(STAMP "initialized-msys2_32.stamp")
endif()
diff --git a/scripts/cmake/vcpkg_append_to_path.cmake b/scripts/cmake/vcpkg_add_to_path.cmake
index 6890dfe31..6890dfe31 100644
--- a/scripts/cmake/vcpkg_append_to_path.cmake
+++ b/scripts/cmake/vcpkg_add_to_path.cmake
diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake
index 189a1113b..947178686 100644
--- a/scripts/cmake/vcpkg_build_qmake.cmake
+++ b/scripts/cmake/vcpkg_build_qmake.cmake
@@ -51,7 +51,7 @@ function(vcpkg_build_qmake)
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}")
+ string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib" "/LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib\\manual-link /LIBPATH:${NATIVE_INSTALLED_DIR}\\debug\\lib shell32.lib" _contents "${_contents}")
string(REPLACE "tools\\qt5\\qmlcachegen.exe" "tools\\qt5-declarative\\qmlcachegen.exe" _contents "${_contents}")
string(REPLACE "tools/qt5/qmlcachegen" "tools/qt5-declarative/qmlcachegen" _contents "${_contents}")
string(REPLACE "debug\\lib\\Qt5Bootstrap.lib" "tools\\qt5\\Qt5Bootstrap.lib" _contents "${_contents}")
@@ -72,7 +72,7 @@ function(vcpkg_build_qmake)
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}")
+ string(REPLACE "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib" "/LIBPATH:${NATIVE_INSTALLED_DIR}\\lib\\manual-link /LIBPATH:${NATIVE_INSTALLED_DIR}\\lib shell32.lib" _contents "${_contents}")
string(REPLACE "tools\\qt5\\qmlcachegen.exe" "tools\\qt5-declarative\\qmlcachegen.exe" _contents "${_contents}")
string(REPLACE "tools/qt5/qmlcachegen" "tools/qt5-declarative/qmlcachegen" _contents "${_contents}")
string(REPLACE "debug\\lib\\Qt5Bootstrap.lib" "tools\\qt5\\Qt5Bootstrap.lib" _contents "${_contents}")
diff --git a/scripts/cmake/vcpkg_clean_msbuild.cmake b/scripts/cmake/vcpkg_clean_msbuild.cmake
new file mode 100644
index 000000000..b0d77dfd2
--- /dev/null
+++ b/scripts/cmake/vcpkg_clean_msbuild.cmake
@@ -0,0 +1,19 @@
+## # vcpkg_clean_msbuild
+##
+## Clean intermediate files generated by `vcpkg_install_msbuild()`.
+##
+## ## Usage
+## ```cmake
+## vcpkg_clean_msbuild()
+## ```
+##
+## ## Examples
+##
+## * [xalan-c](https://github.com/Microsoft/vcpkg/blob/master/ports/xalan-c/portfile.cmake)
+
+function(vcpkg_clean_msbuild)
+ file(REMOVE_RECURSE
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
+ ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
+ )
+endfunction()
diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake
index 90a3e2814..d66fc5eff 100644
--- a/scripts/cmake/vcpkg_common_functions.cmake
+++ b/scripts/cmake/vcpkg_common_functions.cmake
@@ -1,8 +1,10 @@
include(vcpkg_acquire_msys)
-include(vcpkg_append_to_path)
+include(vcpkg_add_to_path)
include(vcpkg_check_linkage)
+include(vcpkg_clean_msbuild)
include(vcpkg_download_distfile)
include(vcpkg_extract_source_archive)
+include(vcpkg_extract_source_archive_ex)
include(vcpkg_execute_required_process)
include(vcpkg_execute_required_process_repeat)
include(vcpkg_find_acquire_program)
@@ -26,4 +28,5 @@ include(vcpkg_get_program_files_32_bit)
include(vcpkg_get_program_files_platform_bitness)
include(vcpkg_get_windows_sdk)
include(vcpkg_replace_string)
+include(vcpkg_from_git)
include(vcpkg_test_cmake)
diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake
index 617fe1a0f..f7b81de93 100644
--- a/scripts/cmake/vcpkg_configure_cmake.cmake
+++ b/scripts/cmake/vcpkg_configure_cmake.cmake
@@ -77,9 +77,6 @@ function(vcpkg_configure_cmake)
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)
@@ -170,6 +167,8 @@ function(vcpkg_configure_cmake)
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")
+ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+ list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/freebsd.cmake")
endif()
list(APPEND _csc_OPTIONS
diff --git a/scripts/cmake/vcpkg_extract_source_archive.cmake b/scripts/cmake/vcpkg_extract_source_archive.cmake
index da0ac611a..a55419b19 100644
--- a/scripts/cmake/vcpkg_extract_source_archive.cmake
+++ b/scripts/cmake/vcpkg_extract_source_archive.cmake
@@ -1,6 +1,6 @@
## # vcpkg_extract_source_archive
##
-## Extract an archive into the source directory.
+## Extract an archive into the source directory. Deprecated in favor of [`vcpkg_extract_source_archive_ex`](vcpkg_extract_source_archive_ex.md).
##
## ## Usage
## ```cmake
@@ -48,82 +48,3 @@ function(vcpkg_extract_source_archive ARCHIVE)
file(WRITE ${WORKING_DIRECTORY}/${ARCHIVE_FILENAME}.extracted)
endif()
endfunction()
-
-function(vcpkg_extract_source_archive_ex)
- cmake_parse_arguments(_vesae "NO_REMOVE_ONE_LEVEL" "OUT_SOURCE_PATH;ARCHIVE;REF;WORKING_DIRECTORY" "PATCHES" ${ARGN})
-
- if(NOT _vesae_ARCHIVE)
- message(FATAL_ERROR "Must specify ARCHIVE parameter to vcpkg_extract_source_archive_ex()")
- endif()
-
- if(NOT DEFINED _vesae_OUT_SOURCE_PATH)
- message(FATAL_ERROR "Must specify OUT_SOURCE_PATH parameter to vcpkg_extract_source_archive_ex()")
- endif()
-
- if(NOT DEFINED _vesae_WORKING_DIRECTORY)
- set(_vesae_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src)
- endif()
-
- if(NOT DEFINED _vesae_REF)
- get_filename_component(_vesae_REF ${_vesae_ARCHIVE} NAME_WE)
- endif()
-
- string(REPLACE "/" "-" SANITIZED_REF "${_vesae_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
- file(SHA512 ${_vesae_ARCHIVE} PATCHSET_HASH)
- foreach(PATCH IN LISTS _vesae_PATCHES)
- get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}")
- file(SHA512 ${ABSOLUTE_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 "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}")
-
- if(NOT EXISTS ${SOURCE_PATH})
- set(TEMP_DIR "${_vesae_WORKING_DIRECTORY}/TEMP")
- file(REMOVE_RECURSE ${TEMP_DIR})
- vcpkg_extract_source_archive("${_vesae_ARCHIVE}" "${TEMP_DIR}")
-
- if(_vesae_NO_REMOVE_ONE_LEVEL)
- set(TEMP_SOURCE_PATH ${TEMP_DIR})
- else()
- file(GLOB _ARCHIVE_FILES "${TEMP_DIR}/*")
- list(LENGTH _ARCHIVE_FILES _NUM_ARCHIVE_FILES)
- set(TEMP_SOURCE_PATH)
- foreach(dir IN LISTS _ARCHIVE_FILES)
- if (IS_DIRECTORY ${dir})
- set(TEMP_SOURCE_PATH "${dir}")
- break()
- endif()
- endforeach()
-
- if(NOT _NUM_ARCHIVE_FILES EQUAL 2 OR NOT TEMP_SOURCE_PATH)
- message(FATAL_ERROR "Could not unwrap top level directory from archive. Pass NO_REMOVE_ONE_LEVEL to disable this.")
- endif()
- endif()
-
- vcpkg_apply_patches(
- SOURCE_PATH ${TEMP_SOURCE_PATH}
- PATCHES ${_vesae_PATCHES}
- )
-
- file(RENAME ${TEMP_SOURCE_PATH} ${SOURCE_PATH})
- file(REMOVE_RECURSE ${TEMP_DIR})
- endif()
-
- set(${_vesae_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE)
- message(STATUS "Using source at ${SOURCE_PATH}")
- return()
-endfunction()
diff --git a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake
new file mode 100644
index 000000000..a70a5e4a3
--- /dev/null
+++ b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake
@@ -0,0 +1,130 @@
+## # vcpkg_extract_source_archive_ex
+##
+## Extract an archive into the source directory. Replaces [`vcpkg_extract_source_archive`](vcpkg_extract_source_archive.md).
+##
+## ## Usage
+## ```cmake
+## vcpkg_extract_source_archive_ex(
+## OUT_SOURCE_PATH <SOURCE_PATH>
+## ARCHIVE <${ARCHIVE}>
+## [REF <1.0.0>]
+## [NO_REMOVE_ONE_LEVEL]
+## [WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/src>]
+## [PATCHES <a.patch>...]
+## )
+## ```
+## ## Parameters
+## ### OUT_SOURCE_PATH
+## Specifies the out-variable that will contain the extracted location.
+##
+## This should be set to `SOURCE_PATH` by convention.
+##
+## ### ARCHIVE
+## The full path to the archive to be extracted.
+##
+## This is usually obtained from calling [`vcpkg_download_distfile`](vcpkg_download_distfile.md).
+##
+## ### REF
+## A friendly name that will be used instead of the filename of the archive.
+##
+## By convention, this is set to the version number or tag fetched
+##
+## ### WORKING_DIRECTORY
+## If specified, the archive will be extracted into the working directory instead of `${CURRENT_BUILDTREES_DIR}/src/`.
+##
+## Note that the archive will still be extracted into a subfolder underneath that directory (`${WORKING_DIRECTORY}/${REF}-${HASH}/`).
+##
+## ### PATCHES
+## A list of patches to be applied to the extracted sources.
+##
+## Relative paths are based on the port directory.
+##
+## ### NO_REMOVE_ONE_LEVEL
+## Specifies that the default removal of the top level folder should not occur.
+##
+## ## Examples
+##
+## * [bzip2](https://github.com/Microsoft/vcpkg/blob/master/ports/bzip2/portfile.cmake)
+## * [sqlite3](https://github.com/Microsoft/vcpkg/blob/master/ports/sqlite3/portfile.cmake)
+## * [cairo](https://github.com/Microsoft/vcpkg/blob/master/ports/cairo/portfile.cmake)
+include(vcpkg_apply_patches)
+include(vcpkg_extract_source_archive)
+
+function(vcpkg_extract_source_archive_ex)
+ cmake_parse_arguments(_vesae "NO_REMOVE_ONE_LEVEL" "OUT_SOURCE_PATH;ARCHIVE;REF;WORKING_DIRECTORY" "PATCHES" ${ARGN})
+
+ if(NOT _vesae_ARCHIVE)
+ message(FATAL_ERROR "Must specify ARCHIVE parameter to vcpkg_extract_source_archive_ex()")
+ endif()
+
+ if(NOT DEFINED _vesae_OUT_SOURCE_PATH)
+ message(FATAL_ERROR "Must specify OUT_SOURCE_PATH parameter to vcpkg_extract_source_archive_ex()")
+ endif()
+
+ if(NOT DEFINED _vesae_WORKING_DIRECTORY)
+ set(_vesae_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src)
+ endif()
+
+ if(NOT DEFINED _vesae_REF)
+ get_filename_component(_vesae_REF ${_vesae_ARCHIVE} NAME_WE)
+ endif()
+
+ string(REPLACE "/" "-" SANITIZED_REF "${_vesae_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
+ file(SHA512 ${_vesae_ARCHIVE} PATCHSET_HASH)
+ foreach(PATCH IN LISTS _vesae_PATCHES)
+ get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}")
+ file(SHA512 ${ABSOLUTE_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 "${_vesae_WORKING_DIRECTORY}/${SHORTENED_SANITIZED_REF}-${PATCHSET_HASH}")
+
+ if(NOT EXISTS ${SOURCE_PATH})
+ set(TEMP_DIR "${_vesae_WORKING_DIRECTORY}/TEMP")
+ file(REMOVE_RECURSE ${TEMP_DIR})
+ vcpkg_extract_source_archive("${_vesae_ARCHIVE}" "${TEMP_DIR}")
+
+ if(_vesae_NO_REMOVE_ONE_LEVEL)
+ set(TEMP_SOURCE_PATH ${TEMP_DIR})
+ else()
+ file(GLOB _ARCHIVE_FILES "${TEMP_DIR}/*")
+ list(LENGTH _ARCHIVE_FILES _NUM_ARCHIVE_FILES)
+ set(TEMP_SOURCE_PATH)
+ foreach(dir IN LISTS _ARCHIVE_FILES)
+ if (IS_DIRECTORY ${dir})
+ set(TEMP_SOURCE_PATH "${dir}")
+ break()
+ endif()
+ endforeach()
+
+ if(NOT _NUM_ARCHIVE_FILES EQUAL 2 OR NOT TEMP_SOURCE_PATH)
+ message(FATAL_ERROR "Could not unwrap top level directory from archive. Pass NO_REMOVE_ONE_LEVEL to disable this.")
+ endif()
+ endif()
+
+ vcpkg_apply_patches(
+ SOURCE_PATH ${TEMP_SOURCE_PATH}
+ PATCHES ${_vesae_PATCHES}
+ )
+
+ file(RENAME ${TEMP_SOURCE_PATH} ${SOURCE_PATH})
+ file(REMOVE_RECURSE ${TEMP_DIR})
+ endif()
+
+ set(${_vesae_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE)
+ message(STATUS "Using source at ${SOURCE_PATH}")
+ return()
+endfunction()
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
index 4cb123fd6..1f856b69e 100644
--- a/scripts/cmake/vcpkg_find_acquire_program.cmake
+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
@@ -58,15 +58,12 @@ function(vcpkg_find_acquire_program VAR)
set(HASH a6e685ea24376f50db5f06c5b46075f1d3be25168fa1f27fa9b02e2ac017826cee62a2b43562f9b6c989337a231ba914416c110075457764de2d11f99d5e0f26)
elseif(VAR MATCHES "NASM")
set(PROGNAME nasm)
- set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.12.02)
+ set(PATHS ${DOWNLOADS}/tools/nasm/nasm-2.14)
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"
- )
- set(ARCHIVE "nasm-2.12.02-win32.zip")
- set(HASH df7aaba094e17832688c88993997612a2e2c96cc3dc14ca3e8347b44c7762115f5a7fc6d7f20be402553aaa4c9e43ddfcf6228f581cfe89289bae550de151b36)
+ set(URL "http://www.nasm.us/pub/nasm/releasebuilds/2.14/win32/nasm-2.14-win32.zip")
+ set(ARCHIVE "nasm-2.14-win32.zip")
+ set(HASH 64481b0346b83de8c9568f04a54f68e0f4c71724afa0b414f12e4080951d8c49e489bfc32117f9a489e3e49477b1cadc583c672311316d27c543af304c4b7f2a)
elseif(VAR MATCHES "YASM")
set(PROGNAME yasm)
set(SUBDIR 1.3.0.6)
@@ -77,12 +74,18 @@ function(vcpkg_find_acquire_program VAR)
set(NOEXTRACT ON)
set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b)
elseif(VAR MATCHES "PYTHON3")
- set(PROGNAME 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)
+ if(CMAKE_HOST_WIN32)
+ set(PROGNAME 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)
+ else()
+ set(PROGNAME python3)
+ set(BREW_PACKAGE_NAME "python")
+ set(APT_PACKAGE_NAME "python3")
+ endif()
elseif(VAR MATCHES "PYTHON2")
set(PROGNAME python)
set(SUBDIR "python2")
@@ -117,6 +120,8 @@ function(vcpkg_find_acquire_program VAR)
set(PATHS "${DOWNLOADS}/tools/ninja/${SUBDIR}")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-osx")
+ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+ set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-freebsd")
else()
set(PATHS "${DOWNLOADS}/tools/${SUBDIR}-linux")
endif()
@@ -140,12 +145,16 @@ function(vcpkg_find_acquire_program VAR)
set(ARCHIVE "meson-0.47.1.zip")
set(HASH 0f6462835583a51707bee82d852018cfcb7444c0dad95b2ba08814e500a5cfe3f731dc6c1fb73c765d1120ee2a2d6600e15d8d393bab1993e84bd4354b2e6855)
elseif(VAR MATCHES "FLEX")
- if(CMAKE_HOST_WIN32)
- 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)
+ if(CMAKE_HOST_WIN32)
+ set(PROGNAME win_flex)
+ set(SUBDIR win_flex-2.5.16)
+ set(PATHS ${DOWNLOADS}/tools/win_flex/${SUBDIR})
+ set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download")
+ set(ARCHIVE "win_flex_bison-2.5.16.zip")
+ set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123)
+ if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4")
+ file(REMOVE_RECURSE "${PATHS}")
+ endif()
else()
set(PROGNAME flex)
set(APT_PACKAGE_NAME flex)
@@ -154,10 +163,14 @@ function(vcpkg_find_acquire_program VAR)
elseif(VAR MATCHES "BISON")
if(CMAKE_HOST_WIN32)
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)
+ set(SUBDIR win_bison-2.5.16)
+ set(PATHS ${DOWNLOADS}/tools/win_bison/${SUBDIR})
+ set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download")
+ set(ARCHIVE "win_flex_bison-2.5.16.zip")
+ set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123)
+ if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4")
+ file(REMOVE_RECURSE "${PATHS}")
+ endif()
else()
set(PROGNAME bison)
set(APT_PACKAGE_NAME bison)
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
index 47c91f83c..ea9923df3 100644
--- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
+++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@@ -117,7 +117,7 @@ function(vcpkg_fixup_cmake_targets)
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(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 ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}")
@@ -134,9 +134,9 @@ function(vcpkg_fixup_cmake_targets)
"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}")
- string(REGEX REPLACE "\"_INVALID_ROOT_/[^\";]*\"" "\"\"" _contents "${_contents}")
+ string(REGEX REPLACE "_INVALID_ROOT_/[^\";>]*" "" _contents "${_contents}")
+ string(REGEX REPLACE ";;+" ";" _contents "${_contents}")
+ string(REGEX REPLACE "\";\"" "\"\"" _contents "${_contents}")
file(WRITE ${MAIN_TARGET} "${_contents}")
endforeach()
diff --git a/scripts/cmake/vcpkg_from_git.cmake b/scripts/cmake/vcpkg_from_git.cmake
new file mode 100644
index 000000000..2fc66b279
--- /dev/null
+++ b/scripts/cmake/vcpkg_from_git.cmake
@@ -0,0 +1,127 @@
+## # vcpkg_from_git
+##
+## Download and extract a project from git
+##
+## ## Usage:
+## ```cmake
+## vcpkg_from_git(
+## OUT_SOURCE_PATH <SOURCE_PATH>
+## URL <https://android.googlesource.com/platform/external/fdlibm>
+## REF <59f7335e4d...>
+## SHA512 <abcdef123...>
+## [PATCHES <patch1.patch> <patch2.patch>...]
+## )
+## ```
+##
+## ## Parameters:
+## ### OUT_SOURCE_PATH
+## Specifies the out-variable that will contain the extracted location.
+##
+## This should be set to `SOURCE_PATH` by convention.
+##
+## ### URL
+## The url of the git repository.
+##
+## ### SHA512
+## The SHA512 hash that should match the archive form of the commit.
+##
+## This is most easily determined by first setting it to `0`, then trying to build the port. The error message will contain the full hash, which can be copied back into the portfile.
+##
+## ### REF
+## A stable git commit-ish (ideally a tag or commit) 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.
+##
+## ### PATCHES
+## A list of patches to be applied to the extracted sources.
+##
+## Relative paths are based on the port directory.
+##
+## ## Notes:
+## `OUT_SOURCE_PATH`, `REF`, `SHA512`, and `URL` must be specified.
+##
+## ## Examples:
+##
+## * [fdlibm](https://github.com/Microsoft/vcpkg/blob/master/ports/fdlibm/portfile.cmake)
+
+function(vcpkg_from_git)
+ set(oneValueArgs OUT_SOURCE_PATH URL REF SHA512)
+ set(multipleValuesArgs PATCHES)
+ cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
+
+ if(NOT DEFINED _vdud_OUT_SOURCE_PATH)
+ message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.")
+ endif()
+
+ if(NOT DEFINED _vdud_URL)
+ message(FATAL_ERROR "The git url must be specified")
+ endif()
+
+ if(NOT DEFINED _vdud_REF)
+ message(FATAL_ERROR "The git ref must be specified.")
+ endif()
+
+ if(NOT DEFINED _vdud_SHA512)
+ message(FATAL_ERROR "vcpkg_from_git requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.")
+ endif()
+
+ # using .tar.gz instead of .zip because the hash of the latter is affected by timezone.
+ string(REPLACE "/" "-" SANITIZED_REF "${_vdud_REF}")
+ set(TEMP_ARCHIVE "${DOWNLOADS}/temp/${PORT}-${SANITIZED_REF}.tar.gz")
+ set(ARCHIVE "${DOWNLOADS}/${PORT}-${SANITIZED_REF}.tar.gz")
+ set(TEMP_SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/${SANITIZED_REF}")
+
+ function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE)
+ file(SHA512 ${FILE_PATH} FILE_HASH)
+ if(NOT FILE_HASH STREQUAL _vdud_SHA512)
+ message(FATAL_ERROR
+ "\nFile does not have expected hash:\n"
+ " File path: [ ${FILE_PATH} ]\n"
+ " Expected hash: [ ${_vdud_SHA512} ]\n"
+ " Actual hash: [ ${FILE_HASH} ]\n"
+ "${CUSTOM_ERROR_ADVICE}\n")
+ endif()
+ endfunction()
+
+ if(NOT EXISTS "${ARCHIVE}")
+ if(_VCPKG_NO_DOWNLOADS)
+ message(FATAL_ERROR "Downloads are disabled, but '${ARCHIVE}' does not exist.")
+ endif()
+ message(STATUS "Fetching ${_vdud_URL}...")
+ find_program(GIT NAMES git git.cmd)
+ # Note: git init is safe to run multiple times
+ vcpkg_execute_required_process(
+ COMMAND ${GIT} init git-tmp
+ WORKING_DIRECTORY ${DOWNLOADS}
+ LOGNAME git-init
+ )
+ vcpkg_execute_required_process(
+ COMMAND ${GIT} fetch ${_vdud_URL} ${_vdud_REF} --depth 1 -n
+ WORKING_DIRECTORY ${DOWNLOADS}/git-tmp
+ LOGNAME git-fetch
+ )
+ file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
+ vcpkg_execute_required_process(
+ COMMAND ${GIT} archive FETCH_HEAD -o "${TEMP_ARCHIVE}"
+ WORKING_DIRECTORY ${DOWNLOADS}/git-tmp
+ LOGNAME git-archive
+ )
+ test_hash("${TEMP_ARCHIVE}" "downloaded repo" "")
+ get_filename_component(downloaded_file_dir "${ARCHIVE}" DIRECTORY)
+ file(MAKE_DIRECTORY "${downloaded_file_dir}")
+ file(RENAME "${TEMP_ARCHIVE}" "${ARCHIVE}")
+ else()
+ message(STATUS "Using cached ${ARCHIVE}")
+ test_hash("${ARCHIVE}" "cached file" "Please delete the file and retry if this file should be downloaded again.")
+ endif()
+
+ vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ REF "${SANITIZED_REF}"
+ PATCHES ${_vdud_PATCHES}
+ NO_REMOVE_ONE_LEVEL
+ )
+
+ set(${_vdud_OUT_SOURCE_PATH} "${SOURCE_PATH}" PARENT_SCOPE)
+endfunction()
diff --git a/scripts/cmake/vcpkg_install_msbuild.cmake b/scripts/cmake/vcpkg_install_msbuild.cmake
index ad700dd35..11bcdf189 100644
--- a/scripts/cmake/vcpkg_install_msbuild.cmake
+++ b/scripts/cmake/vcpkg_install_msbuild.cmake
@@ -52,12 +52,16 @@
## ### REMOVE_ROOT_INCLUDES
## Indicates that top-level include files (e.g. `include/Makefile.am`) should be removed.
##
+## ### SKIP_CLEAN
+## Indicates that the intermediate files should not be removed.
+##
+## Ports using this option should later call [`vcpkg_clean_msbuild()`](vcpkg_clean_msbuild.md) to manually clean up.
+##
## ### RELEASE_CONFIGURATION
## The configuration (``/p:Configuration`` msbuild parameter) used for Release builds.
##
## ### DEBUG_CONFIGURATION
-## The configuration (``/p:Configuration`` msbuild parameter)
-## used for Debug builds.
+## The configuration (``/p:Configuration`` msbuild parameter) used for Debug builds.
##
## ### TARGET_PLATFORM_VERSION
## The WindowsTargetPlatformVersion (``/p:WindowsTargetPlatformVersion`` msbuild parameter)
@@ -82,12 +86,15 @@
##
## ## Examples
##
+## * [xalan-c](https://github.com/Microsoft/vcpkg/blob/master/ports/xalan-c/portfile.cmake)
## * [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake)
+include(vcpkg_clean_msbuild)
+
function(vcpkg_install_msbuild)
cmake_parse_arguments(
_csc
- "USE_VCPKG_INTEGRATION;ALLOW_ROOT_INCLUDES;REMOVE_ROOT_INCLUDES"
+ "USE_VCPKG_INTEGRATION;ALLOW_ROOT_INCLUDES;REMOVE_ROOT_INCLUDES;SKIP_CLEAN"
"SOURCE_PATH;PROJECT_SUBPATH;INCLUDES_SUBPATH;LICENSE_SUBPATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET"
"OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG"
${ARGN}
@@ -196,10 +203,9 @@ function(vcpkg_install_msbuild)
vcpkg_copy_pdbs()
- file(REMOVE_RECURSE
- ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
- ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
- )
+ if(NOT _csc_SKIP_CLEAN)
+ vcpkg_clean_msbuild()
+ endif()
if(DEFINED _csc_INCLUDES_SUBPATH)
file(COPY ${_csc_SOURCE_PATH}/${_csc_INCLUDES_SUBPATH}/ DESTINATION ${CURRENT_PACKAGES_DIR}/include/)
diff --git a/scripts/cmake/vcpkg_test_cmake.cmake b/scripts/cmake/vcpkg_test_cmake.cmake
index 718b2f69c..29654346a 100644
--- a/scripts/cmake/vcpkg_test_cmake.cmake
+++ b/scripts/cmake/vcpkg_test_cmake.cmake
@@ -27,6 +27,11 @@ function(vcpkg_test_cmake)
set(PACKAGE_TYPE CONFIG)
endif()
+ if(VCPKG_PLATFORM_TOOLSET STREQUAL "v142")
+ message(STATUS "Skipping CMake integration test due to v142 / CMake interaction issues")
+ return()
+ endif()
+
message(STATUS "Performing CMake integration test")
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test)
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-test)