aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Spaith <jspaith@windows.microsoft.com>2019-10-10 09:36:18 -0700
committerJohn Spaith <jspaith@windows.microsoft.com>2019-10-10 09:36:18 -0700
commit17c9b6bac8270b9740e5d824c6ebfff6cc7d5ed1 (patch)
tree7baa6f699aa57601dbba4ace876fad45958878fc /scripts
parent1d4189d1dde0fa8bbcbc6237cc33b85bca0512e1 (diff)
parent2b049c47b5b2e003f8bcfe6707d4b0eaf8d1b569 (diff)
downloadvcpkg-17c9b6bac8270b9740e5d824c6ebfff6cc7d5ed1.tar.gz
vcpkg-17c9b6bac8270b9740e5d824c6ebfff6cc7d5ed1.zip
Merge from master
Diffstat (limited to 'scripts')
-rw-r--r--scripts/boost/.gitignore3
-rw-r--r--scripts/boost/generate-ports.ps1421
-rw-r--r--scripts/boost/post-build-stubs/config.cmake7
-rw-r--r--scripts/boost/post-build-stubs/context.cmake6
-rw-r--r--scripts/boost/post-build-stubs/exception.cmake3
-rw-r--r--scripts/boost/post-build-stubs/predef.cmake2
-rw-r--r--scripts/boost/post-build-stubs/test.cmake14
-rw-r--r--scripts/boost/post-source-stubs/context.cmake5
-rw-r--r--scripts/boost/post-source-stubs/fiber.cmake5
-rw-r--r--scripts/boost/post-source-stubs/iostreams.cmake18
-rw-r--r--scripts/boost/post-source-stubs/log.cmake13
-rw-r--r--scripts/boost/post-source-stubs/python.cmake5
-rw-r--r--scripts/boost/post-source-stubs/test.cmake5
-rw-r--r--scripts/bootstrap.sh14
-rw-r--r--scripts/cmake/vcpkg_apply_patches.cmake2
-rw-r--r--scripts/cmake/vcpkg_build_make.cmake171
-rw-r--r--scripts/cmake/vcpkg_build_nmake.cmake185
-rw-r--r--scripts/cmake/vcpkg_common_definitions.cmake3
-rw-r--r--scripts/cmake/vcpkg_common_functions.cmake5
-rw-r--r--scripts/cmake/vcpkg_configure_make.cmake347
-rw-r--r--scripts/cmake/vcpkg_extract_source_archive_ex.cmake19
-rw-r--r--scripts/cmake/vcpkg_find_acquire_program.cmake9
-rw-r--r--scripts/cmake/vcpkg_fixup_cmake_targets.cmake16
-rw-r--r--scripts/cmake/vcpkg_from_github.cmake1
-rw-r--r--scripts/cmake/vcpkg_install_make.cmake25
-rw-r--r--scripts/cmake/vcpkg_install_nmake.cmake73
-rw-r--r--scripts/ports.cmake3
-rw-r--r--scripts/templates/CONTROL.in9
-rw-r--r--scripts/templates/portfile.in.cmake38
29 files changed, 1412 insertions, 15 deletions
diff --git a/scripts/boost/.gitignore b/scripts/boost/.gitignore
new file mode 100644
index 000000000..f8e31288e
--- /dev/null
+++ b/scripts/boost/.gitignore
@@ -0,0 +1,3 @@
+/boost
+/downloads
+/libs \ No newline at end of file
diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1
new file mode 100644
index 000000000..5f5897718
--- /dev/null
+++ b/scripts/boost/generate-ports.ps1
@@ -0,0 +1,421 @@
+[CmdletBinding()]
+param (
+ $libraries = @(),
+ $version = "1.71.0"
+)
+
+$scriptsDir = split-path -parent $MyInvocation.MyCommand.Definition
+$portsDir = "$scriptsDir/../../ports"
+
+function TransformReference()
+{
+ param (
+ [string]$library
+ )
+
+ if ($library -match "fiber")
+ {
+ # these only work on windows desktop
+ "$library (windows)"
+ }
+ elseif ($library -match "type[_-]erasure|contract")
+ {
+ # These only work on x86-derived processors
+ "$library (!arm)"
+ }
+ elseif ($library -match "iostreams|filesystem|context|stacktrace|coroutine`$|locale|test|wave|log`$")
+ {
+ "$library (!uwp)"
+ }
+ else
+ {
+ "$library"
+ }
+}
+
+function Generate()
+{
+ param (
+ [string]$Name,
+ [string]$Hash,
+ [bool]$NeedsBuild,
+ $Depends = @()
+ )
+
+ $controlDeps = ($Depends | sort) -join ", "
+
+ $sanitizedName = $name -replace "_","-"
+
+ $versionsuffix = ""
+ if ($Name -eq "asio" -or $Name -eq "mpi")
+ {
+ $versionsuffix = "-1"
+ }
+
+ if ($Name -eq "python" -or $Name -eq "test")
+ {
+ $versionsuffix = "-2"
+ }
+
+ mkdir "$portsDir/boost-$sanitizedName" -erroraction SilentlyContinue | out-null
+ $controlLines = @(
+ "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1"
+ "Source: boost-$sanitizedName"
+ "Version: $version$versionsuffix"
+ "Build-Depends: $controlDeps"
+ "Homepage: https://github.com/boostorg/$name"
+ "Description: Boost $Name module"
+ )
+ if ($Name -eq "locale")
+ {
+ $controlLines += @(
+ ""
+ "Feature: icu"
+ "Description: ICU backend for Boost.Locale"
+ "Build-Depends: icu"
+ )
+ }
+ if ($Name -eq "regex")
+ {
+ $controlLines += @(
+ ""
+ "Feature: icu"
+ "Description: ICU backend for Boost.Regex"
+ "Build-Depends: icu"
+ )
+ }
+ $controlLines | out-file -enc ascii "$portsDir/boost-$sanitizedName/CONTROL"
+
+ $portfileLines = @(
+ "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1"
+ ""
+ "include(vcpkg_common_functions)"
+ ""
+ "vcpkg_from_github("
+ " OUT_SOURCE_PATH SOURCE_PATH"
+ " REPO boostorg/$Name"
+ " REF boost-$version"
+ " SHA512 $Hash"
+ " HEAD_REF master"
+ )
+ if ($Name -eq "asio")
+ {
+ $portfileLines += @(" PATCHES windows_alloca_header.patch")
+ }
+ if ($Name -eq "iostreams")
+ {
+ $portfileLines += @(" PATCHES Removeseekpos.patch")
+ }
+ $portfileLines += @(
+ ")"
+ ""
+ )
+
+ if (Test-Path "$scriptsDir/post-source-stubs/$Name.cmake")
+ {
+ $portfileLines += @(get-content "$scriptsDir/post-source-stubs/$Name.cmake")
+ }
+
+ if ($NeedsBuild)
+ {
+ if ($Name -eq "locale")
+ {
+ $portfileLines += @(
+ "if(`"icu`" IN_LIST FEATURES)"
+ " set(BOOST_LOCALE_ICU on)"
+ "else()"
+ " set(BOOST_LOCALE_ICU off)"
+ "endif()"
+ ""
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)"
+ "boost_modular_build("
+ " SOURCE_PATH `${SOURCE_PATH}"
+ " BOOST_CMAKE_FRAGMENT `"`${CMAKE_CURRENT_LIST_DIR}/cmake-fragment.cmake`""
+ " OPTIONS"
+ " boost.locale.iconv=off"
+ " boost.locale.posix=off"
+ " /boost/locale//boost_locale"
+ " boost.locale.icu=`${BOOST_LOCALE_ICU}"
+ ")"
+ )
+ }
+ elseif ($Name -eq "regex")
+ {
+ $portfileLines += @(
+ "if(`"icu`" IN_LIST FEATURES)"
+ " set(REQUIREMENTS `"<library>/user-config//icuuc <library>/user-config//icudt <library>/user-config//icuin <define>BOOST_HAS_ICU=1`")"
+ "else()"
+ " set(REQUIREMENTS)"
+ "endif()"
+ ""
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)"
+ "boost_modular_build(SOURCE_PATH `${SOURCE_PATH} REQUIREMENTS `"`${REQUIREMENTS}`")"
+ )
+ }
+ elseif ($Name -eq "thread")
+ {
+ $portfileLines += @(
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)"
+ "boost_modular_build("
+ " SOURCE_PATH `${SOURCE_PATH}"
+ " REQUIREMENTS `"<library>/boost/date_time//boost_date_time`""
+ " OPTIONS /boost/thread//boost_thread"
+ " BOOST_CMAKE_FRAGMENT `${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake"
+ ")"
+ )
+ }
+ elseif ($Name -eq "iostreams")
+ {
+ }
+ else
+ {
+ $portfileLines += @(
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)"
+ "boost_modular_build(SOURCE_PATH `${SOURCE_PATH})"
+ )
+ }
+ }
+ if ($Name -ne "iostreams")
+ {
+ $portfileLines += @(
+ "include(`${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake)"
+ "boost_modular_headers(SOURCE_PATH `${SOURCE_PATH})"
+ )
+ }
+
+ if (Test-Path "$scriptsDir/post-build-stubs/$Name.cmake")
+ {
+ $portfileLines += @(get-content "$scriptsDir/post-build-stubs/$Name.cmake")
+ }
+
+ $portfileLines | out-file -enc ascii "$portsDir/boost-$sanitizedName/portfile.cmake"
+}
+
+if (!(Test-Path "$scriptsDir/boost"))
+{
+ "Cloning boost..."
+ pushd $scriptsDir
+ try
+ {
+ git clone https://github.com/boostorg/boost --branch boost-$version
+ }
+ finally
+ {
+ popd
+ }
+}
+else
+{
+ pushd $scriptsDir/boost
+ try
+ {
+ git fetch
+ git checkout -f boost-$version
+ }
+ finally
+ {
+ popd
+ }
+}
+
+$libraries_found = ls $scriptsDir/boost/libs -directory | % name | % {
+ if ($_ -match "numeric")
+ {
+ "numeric_conversion"
+ "interval"
+ "odeint"
+ "ublas"
+ "safe_numerics"
+ }
+ elseif ($_ -eq "headers")
+ {
+ }
+ else
+ {
+ $_
+ }
+}
+
+mkdir $scriptsDir/downloads -erroraction SilentlyContinue | out-null
+
+if ($libraries.Length -eq 0)
+{
+ $libraries = $libraries_found
+}
+
+$libraries_in_boost_port = @()
+
+foreach ($library in $libraries)
+{
+ "Handling boost/$library..."
+ $archive = "$scriptsDir/downloads/$library-boost-$version.tar.gz"
+ if (!(Test-Path $archive))
+ {
+ "Downloading boost/$library..."
+ & @(vcpkg fetch aria2)[-1] "https://github.com/boostorg/$library/archive/boost-$version.tar.gz" -d "$scriptsDir/downloads" -o "$library-boost-$version.tar.gz"
+ }
+ $hash = vcpkg hash $archive
+ $unpacked = "$scriptsDir/libs/$library-boost-$version"
+ if (!(Test-Path $unpacked))
+ {
+ "Unpacking boost/$library..."
+ mkdir $scriptsDir/libs -erroraction SilentlyContinue | out-null
+ pushd $scriptsDir/libs
+ try
+ {
+ cmake -E tar xf $archive
+ }
+ finally
+ {
+ popd
+ }
+ }
+ pushd $unpacked
+ try
+ {
+ $groups = $(
+ findstr /si /C:"include <boost/" include/*
+ findstr /si /C:"include <boost/" src/*
+ ) |
+ % { $_ `
+ -replace "^[^:]*:","" `
+ -replace "boost/numeric/conversion/","boost/numeric_conversion/" `
+ -replace "boost/functional/hash.hpp","boost/container_hash/hash.hpp" `
+ -replace "boost/detail/([^/]+)/","boost/`$1/" `
+ -replace " *# *include *<boost/([a-zA-Z0-9\._]*)(/|>).*", "`$1" `
+ -replace "/|\.hp?p?| ","" } | group | % name | % {
+ # mappings
+ Write-Verbose "${library}: $_"
+ if ($_ -match "aligned_storage") { "type_traits" }
+ elseif ($_ -match "noncopyable|ref|swap|get_pointer|checked_delete|visit_each") { "core" }
+ elseif ($_ -eq "type") { "core" }
+ elseif ($_ -match "unordered_") { "unordered" }
+ elseif ($_ -match "cstdint") { "integer" }
+ elseif ($_ -match "call_traits|operators|current_function|cstdlib|next_prior|compressed_pair") { "utility" }
+ elseif ($_ -match "^version|^workaround") { "config" }
+ elseif ($_ -match "enable_shared_from_this|shared_ptr|make_shared|make_unique|intrusive_ptr|scoped_ptr|pointer_to_other|weak_ptr|shared_array|scoped_array") { "smart_ptr" }
+ elseif ($_ -match "iterator_adaptors|generator_iterator|pointee") { "iterator" }
+ elseif ($_ -eq "regex_fwd") { "regex" }
+ elseif ($_ -eq "make_default") { "convert" }
+ elseif ($_ -eq "foreach_fwd") { "foreach" }
+ elseif ($_ -eq "cerrno") { "system" }
+ elseif ($_ -eq "archive") { "serialization" }
+ elseif ($_ -eq "none") { "optional" }
+ elseif ($_ -eq "integer_traits") { "integer" }
+ elseif ($_ -eq "limits") { "compatibility" }
+ elseif ($_ -eq "math_fwd") { "math" }
+ elseif ($_ -match "polymorphic_cast|implicit_cast") { "conversion" }
+ elseif ($_ -eq "nondet_random") { "random" }
+ elseif ($_ -eq "memory_order") { "atomic" }
+ elseif ($_ -eq "blank") { "detail" }
+ elseif ($_ -match "is_placeholder|mem_fn") { "bind" }
+ elseif ($_ -eq "exception_ptr") { "exception" }
+ elseif ($_ -eq "multi_index_container") { "multi_index" }
+ elseif ($_ -eq "lexical_cast") { "lexical_cast"; "math" }
+ elseif ($_ -match "token_iterator|token_functions") { "tokenizer" }
+ elseif ($_ -eq "numeric" -and $library -notmatch "numeric_conversion|interval|odeint|ublas") { "numeric_conversion"; "interval"; "odeint"; "ublas" }
+ else { $_ }
+ } | group | % name | ? { $_ -ne $library }
+
+ #"`nFor ${library}:"
+ " [known] " + $($groups | ? { $libraries_found -contains $_ })
+ " [unknown] " + $($groups | ? { $libraries_found -notcontains $_ })
+
+ $deps = @($groups | ? { $libraries_found -contains $_ })
+
+ $deps = @($deps | ? {
+ # Boost contains cycles, so remove a few dependencies to break the loop.
+ (($library -notmatch "core|assert|mpl|detail|throw_exception|type_traits|^exception") -or ($_ -notmatch "utility")) `
+ -and `
+ (($library -notmatch "range") -or ($_ -notmatch "algorithm"))`
+ -and `
+ (($library -ne "config") -or ($_ -notmatch "integer"))`
+ -and `
+ (($library -notmatch "multiprecision") -or ($_ -notmatch "random|math"))`
+ -and `
+ (($library -notmatch "lexical_cast") -or ($_ -notmatch "math"))`
+ -and `
+ (($library -notmatch "functional") -or ($_ -notmatch "function"))`
+ -and `
+ (($library -notmatch "detail") -or ($_ -notmatch "static_assert|integer|mpl|type_traits"))`
+ -and `
+ ($_ -notmatch "mpi")`
+ -and `
+ (($library -notmatch "spirit") -or ($_ -notmatch "serialization"))`
+ -and `
+ (($library -notmatch "throw_exception") -or ($_ -notmatch "^exception"))`
+ -and `
+ (($library -notmatch "iostreams") -or ($_ -notmatch "random"))`
+ -and `
+ (($library -notmatch "utility|concept_check") -or ($_ -notmatch "iterator"))
+ } | % { "boost-$_" -replace "_","-" } | % {
+ TransformReference $_
+ })
+
+ $deps += @("boost-vcpkg-helpers")
+
+ $needsBuild = $false
+ if ((Test-Path $unpacked/build/Jamfile.v2) -and $library -ne "metaparse" -and $library -ne "graph_parallel")
+ {
+ $deps += @("boost-build", "boost-modular-build-helper")
+ $needsBuild = $true
+ }
+
+ if ($library -eq "python")
+ {
+ $deps += @("python3 (!osx&!linux)")
+ $needsBuild = $true
+ }
+ elseif ($library -eq "iostreams")
+ {
+ $deps += @("zlib", "bzip2", "liblzma", "zstd")
+ }
+ elseif ($library -eq "locale")
+ {
+ $deps += @("libiconv (!uwp&!windows)", "boost-system")
+ }
+ elseif ($library -eq "asio")
+ {
+ $deps += @("openssl")
+ }
+ elseif ($library -eq "mpi")
+ {
+ $deps += @("mpi")
+ }
+
+ Generate `
+ -Name $library `
+ -Hash $hash `
+ -Depends $deps `
+ -NeedsBuild $needsBuild
+
+ $libraries_in_boost_port += @(TransformReference $library)
+ }
+ finally
+ {
+ popd
+ }
+}
+
+if ($libraries_in_boost_port.length -gt 1) {
+ # Generate master boost control file which depends on each individual library
+ # mpi is excluded due to it having a dependency on msmpi
+ $boostDependsList = @($libraries_in_boost_port | % { "boost-$_" -replace "_","-" } | ? { $_ -notmatch "boost-mpi" }) -join ", "
+
+ @(
+ "# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1"
+ "Source: boost"
+ "Version: $version"
+ "Homepage: https://boost.org"
+ "Description: Peer-reviewed portable C++ source libraries"
+ "Build-Depends: $boostDependsList"
+ ""
+ "Feature: mpi"
+ "Description: Build with MPI support"
+ "Build-Depends: boost-mpi"
+ ) | out-file -enc ascii $portsDir/boost/CONTROL
+
+ "set(VCPKG_POLICY_EMPTY_PACKAGE enabled)`n" | out-file -enc ascii $portsDir/boost/portfile.cmake
+}
+
+return
diff --git a/scripts/boost/post-build-stubs/config.cmake b/scripts/boost/post-build-stubs/config.cmake
new file mode 100644
index 000000000..b09ea209b
--- /dev/null
+++ b/scripts/boost/post-build-stubs/config.cmake
@@ -0,0 +1,7 @@
+file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#ifndef BOOST_ALL_NO_LIB\n#define BOOST_ALL_NO_LIB\n#endif\n")
+file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#undef BOOST_ALL_DYN_LINK\n")
+
+if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ file(APPEND ${CURRENT_PACKAGES_DIR}/include/boost/config/user.hpp "\n#define BOOST_ALL_DYN_LINK\n")
+endif()
+file(COPY ${SOURCE_PATH}/checks DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-config)
diff --git a/scripts/boost/post-build-stubs/context.cmake b/scripts/boost/post-build-stubs/context.cmake
new file mode 100644
index 000000000..a88f8441d
--- /dev/null
+++ b/scripts/boost/post-build-stubs/context.cmake
@@ -0,0 +1,6 @@
+
+# boost-context removed all.hpp, which is used by FindBoost to determine that context is installed
+if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/boost/context/all.hpp)
+ file(WRITE ${CURRENT_PACKAGES_DIR}/include/boost/context/all.hpp
+ "#error \"#include <boost/context/all.hpp> is no longer supported by boost_context.\"")
+endif()
diff --git a/scripts/boost/post-build-stubs/exception.cmake b/scripts/boost/post-build-stubs/exception.cmake
new file mode 100644
index 000000000..43594a044
--- /dev/null
+++ b/scripts/boost/post-build-stubs/exception.cmake
@@ -0,0 +1,3 @@
+
+set(VCPKG_LIBRARY_LINKAGE static)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
diff --git a/scripts/boost/post-build-stubs/predef.cmake b/scripts/boost/post-build-stubs/predef.cmake
new file mode 100644
index 000000000..b960fcd6e
--- /dev/null
+++ b/scripts/boost/post-build-stubs/predef.cmake
@@ -0,0 +1,2 @@
+
+file(COPY ${SOURCE_PATH}/tools/check DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-predef)
diff --git a/scripts/boost/post-build-stubs/test.cmake b/scripts/boost/post-build-stubs/test.cmake
new file mode 100644
index 000000000..c6d07dbc4
--- /dev/null
+++ b/scripts/boost/post-build-stubs/test.cmake
@@ -0,0 +1,14 @@
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(GLOB MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/lib/*_exec_monitor*)
+ file(COPY ${MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ file(REMOVE ${MONITOR_LIBS})
+endif()
+
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(GLOB DEBUG_MONITOR_LIBS ${CURRENT_PACKAGES_DIR}/debug/lib/*_exec_monitor*)
+ file(COPY ${DEBUG_MONITOR_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ file(REMOVE ${DEBUG_MONITOR_LIBS})
+endif()
+
diff --git a/scripts/boost/post-source-stubs/context.cmake b/scripts/boost/post-source-stubs/context.cmake
new file mode 100644
index 000000000..9ccf34233
--- /dev/null
+++ b/scripts/boost/post-source-stubs/context.cmake
@@ -0,0 +1,5 @@
+file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
diff --git a/scripts/boost/post-source-stubs/fiber.cmake b/scripts/boost/post-source-stubs/fiber.cmake
new file mode 100644
index 000000000..9ccf34233
--- /dev/null
+++ b/scripts/boost/post-source-stubs/fiber.cmake
@@ -0,0 +1,5 @@
+file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
diff --git a/scripts/boost/post-source-stubs/iostreams.cmake b/scripts/boost/post-source-stubs/iostreams.cmake
new file mode 100644
index 000000000..55841bb3f
--- /dev/null
+++ b/scripts/boost/post-source-stubs/iostreams.cmake
@@ -0,0 +1,18 @@
+vcpkg_download_distfile(LICENSE
+ URLS "https://raw.githubusercontent.com/boostorg/boost/boost-1.70.0/LICENSE_1_0.txt"
+ FILENAME "boost_LICENSE_1_0.txt"
+ SHA512 d6078467835dba8932314c1c1e945569a64b065474d7aced27c9a7acc391d52e9f234138ed9f1aa9cd576f25f12f557e0b733c14891d42c16ecdc4a7bd4d60b8
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+
+file(COPY ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR})
+file(INSTALL ${LICENSE} DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-iostreams RENAME copyright)
diff --git a/scripts/boost/post-source-stubs/log.cmake b/scripts/boost/post-source-stubs/log.cmake
new file mode 100644
index 000000000..78500ddc3
--- /dev/null
+++ b/scripts/boost/post-source-stubs/log.cmake
@@ -0,0 +1,13 @@
+file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../config/checks/config" "import config/checks/config" _contents "${_contents}")
+string(REPLACE " <conditional>@select-arch-specific-sources" "#<conditional>@select-arch-specific-sources" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/build/config")
+
+file(READ ${SOURCE_PATH}/build/log-architecture.jam _contents)
+string(REPLACE
+ "\nproject.load [ path.join [ path.make $(here:D) ] ../../config/checks/architecture ] ;"
+ "\nproject.load [ path.join [ path.make $(here:D) ] config/checks/architecture ] ;"
+ _contents "${_contents}")
+file(WRITE ${SOURCE_PATH}/build/log-architecture.jam "${_contents}")
+
diff --git a/scripts/boost/post-source-stubs/python.cmake b/scripts/boost/post-source-stubs/python.cmake
new file mode 100644
index 000000000..40b8e0a0b
--- /dev/null
+++ b/scripts/boost/post-source-stubs/python.cmake
@@ -0,0 +1,5 @@
+# Find Python. Can't use find_package here, but we already know where everything is
+file(GLOB PYTHON_INCLUDE_PATH "${CURRENT_INSTALLED_DIR}/include/python[0-9.]*")
+set(PYTHONLIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
+set(PYTHONLIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
+string(REGEX REPLACE ".*python([0-9\.]+)$" "\\1" PYTHON_VERSION "${PYTHON_INCLUDE_PATH}")
diff --git a/scripts/boost/post-source-stubs/test.cmake b/scripts/boost/post-source-stubs/test.cmake
new file mode 100644
index 000000000..b2872338d
--- /dev/null
+++ b/scripts/boost/post-source-stubs/test.cmake
@@ -0,0 +1,5 @@
+file(READ "${SOURCE_PATH}/build/Jamfile.v2" _contents)
+string(REPLACE "import ../../predef/check/predef" "import predef/check/predef" _contents "${_contents}")
+file(WRITE "${SOURCE_PATH}/build/Jamfile.v2" "${_contents}")
+file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-predef/check" DESTINATION "${SOURCE_PATH}/build/predef")
+
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index afdd9c1b3..d89d5a15b 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -17,7 +17,7 @@ fi
# Argument parsing
vcpkgDisableMetrics="OFF"
vcpkgUseSystem=false
-vcpkgAllowAppleClang=OFF
+vcpkgAllowAppleClang=false
for var in "$@"
do
if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then
@@ -25,7 +25,7 @@ do
elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then
vcpkgUseSystem=true
elif [ "$var" = "-allowAppleClang" -o "$var" = "--allowAppleClang" ]; then
- vcpkgAllowAppleClang=ON
+ vcpkgAllowAppleClang=true
elif [ "$var" = "-help" -o "$var" = "--help" ]; then
echo "Usage: ./bootstrap-vcpkg.sh [options]"
echo
@@ -242,7 +242,15 @@ else
fetchTool "cmake" "$UNAME" cmakeExe || exit 1
fetchTool "ninja" "$UNAME" ninjaExe || exit 1
fi
-selectCXX CXX || exit 1
+if [ "$os" = "osx" ]; then
+ if [ "$vcpkgAllowAppleClang" = "true" ] ; then
+ CXX=clang
+ else
+ selectCXX CXX || exit 1
+ fi
+else
+ selectCXX CXX || exit 1
+fi
# Do the build
buildDir="$vcpkgRootDir/toolsrc/build.rel"
diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake
index 9698917de..8957fca27 100644
--- a/scripts/cmake/vcpkg_apply_patches.cmake
+++ b/scripts/cmake/vcpkg_apply_patches.cmake
@@ -49,7 +49,7 @@ function(vcpkg_apply_patches)
)
if(error_code AND NOT _ap_QUIET)
- message(STATUS "Applying patch failed. This is expected if this patch was previously applied.")
+ message(FATAL_ERROR "Applying patch failed. Patch needs to be updated to work with source being used by vcpkg!")
endif()
math(EXPR PATCHNUM "${PATCHNUM}+1")
diff --git a/scripts/cmake/vcpkg_build_make.cmake b/scripts/cmake/vcpkg_build_make.cmake
new file mode 100644
index 000000000..793341655
--- /dev/null
+++ b/scripts/cmake/vcpkg_build_make.cmake
@@ -0,0 +1,171 @@
+## # vcpkg_build_make
+##
+## Build a linux makefile project.
+##
+## ## Usage:
+## ```cmake
+## vcpkg_build_make([TARGET <target>])
+## ```
+##
+## ### TARGET
+## The target passed to the configure/make build command (`./configure/make/make install`). 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_make()`](vcpkg_configure_make.md).
+## You can use the alias [`vcpkg_install_make()`](vcpkg_configure_make.md) function if your CMake script supports the
+## "install" target
+##
+## ## Examples
+##
+## * [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+function(vcpkg_build_make)
+ cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT" "" ${ARGN})
+
+ if(NOT _bc_LOGFILE_ROOT)
+ set(_bc_LOGFILE_ROOT "build")
+ endif()
+
+ if (_VCPKG_PROJECT_SUBPATH)
+ set(_VCPKG_PROJECT_SUBPATH /${_VCPKG_PROJECT_SUBPATH}/)
+ endif()
+
+ set(MAKE )
+ set(MAKE_OPTS )
+ set(INSTALL_OPTS )
+ if (_VCPKG_MAKE_GENERATOR STREQUAL "make")
+ if (CMAKE_HOST_WIN32)
+ # Compiler requriements
+ vcpkg_find_acquire_program(YASM)
+ vcpkg_find_acquire_program(PERL)
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES make)
+ get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
+ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
+
+ set(PATH_GLOBAL "$ENV{PATH}")
+ set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}")
+ set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
+ # Set make command and install command
+ set(MAKE ${BASH} --noprofile --norc -c "${_VCPKG_PROJECT_SUBPATH}make")
+ # Must use absolute path to call make in windows
+ set(MAKE_OPTS "-j ${VCPKG_CONCURRENCY}")
+ set(INSTALL_OPTS "install -j ${VCPKG_CONCURRENCY}")
+ else()
+ # Compiler requriements
+ find_program(MAKE make REQUIRED)
+ set(MAKE make)
+ # Set make command and install command
+ set(MAKE_OPTS -j ${VCPKG_CONCURRENCY})
+ set(INSTALL_OPTS install -j ${VCPKG_CONCURRENCY})
+ endif()
+ elseif (_VCPKG_MAKE_GENERATOR STREQUAL "nmake")
+ find_program(NMAKE nmake REQUIRED)
+ get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
+ set(PATH_GLOBAL "$ENV{PATH}")
+ set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
+ set(ENV{CL} "$ENV{CL} /MP")
+ # Set make command and install command
+ set(MAKE ${NMAKE} /NOLOGO /G /U)
+ set(MAKE_OPTS -f makefile all)
+ set(INSTALL_OPTS install)
+ else()
+ message(FATAL_ERROR "${_VCPKG_MAKE_GENERATOR} not supported.")
+ endif()
+
+ set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
+
+ foreach(BUILDTYPE "debug" "release")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
+ if(BUILDTYPE STREQUAL "debug")
+ # Skip debug generate
+ if (_VCPKG_NO_DEBUG)
+ continue()
+ endif()
+ set(SHORT_BUILDTYPE "-dbg")
+ else()
+ # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
+ if (_VCPKG_NO_DEBUG)
+ set(SHORT_BUILDTYPE "")
+ else()
+ set(SHORT_BUILDTYPE "-rel")
+ endif()
+ endif()
+
+ if (CMAKE_HOST_WIN32)
+ # In windows we can remotely call make
+ set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
+ else()
+ set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
+ endif()
+
+ message(STATUS "Building ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
+
+ if(_bc_ADD_BIN_TO_PATH)
+ set(_BACKUP_ENV_PATH "$ENV{PATH}")
+ if(CMAKE_HOST_WIN32)
+ set(_PATHSEP ";")
+ else()
+ set(_PATHSEP ":")
+ endif()
+ if(BUILDTYPE STREQUAL "debug")
+ set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin${_PATHSEP}$ENV{PATH}")
+ else()
+ set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}")
+ endif()
+ endif()
+
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE} ${MAKE_OPTS}
+ WORKING_DIRECTORY ${WORKING_DIRECTORY}
+ LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+
+ if(_bc_ADD_BIN_TO_PATH)
+ set(ENV{PATH} "${_BACKUP_ENV_PATH}")
+ endif()
+ endif()
+ endforeach()
+
+ if (_bc_ENABLE_INSTALL)
+ foreach(BUILDTYPE "debug" "release")
+ if(BUILDTYPE STREQUAL "debug")
+ # Skip debug generate
+ if (_VCPKG_NO_DEBUG)
+ continue()
+ endif()
+ set(SHORT_BUILDTYPE "-dbg")
+ else()
+ # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
+ if (_VCPKG_NO_DEBUG)
+ set(SHORT_BUILDTYPE "")
+ else()
+ set(SHORT_BUILDTYPE "-rel")
+ endif()
+ endif()
+
+ if (CMAKE_HOST_WIN32)
+ # In windows we can remotely call make
+ set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE})
+ else()
+ set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}${SHORT_BUILDTYPE}${_VCPKG_PROJECT_SUBPATH})
+ endif()
+
+ message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
+ vcpkg_execute_required_process(
+ COMMAND ${MAKE} ${INSTALL_OPTS}
+ WORKING_DIRECTORY ${WORKING_DIRECTORY}
+ LOGNAME "install-${TARGET_TRIPLET}${SHORT_BUILDTYPE}"
+ )
+ endforeach()
+ endif()
+
+ if (CMAKE_HOST_WIN32)
+ set(ENV{PATH} "${PATH_GLOBAL}")
+ endif()
+endfunction()
diff --git a/scripts/cmake/vcpkg_build_nmake.cmake b/scripts/cmake/vcpkg_build_nmake.cmake
new file mode 100644
index 000000000..1eb621b0e
--- /dev/null
+++ b/scripts/cmake/vcpkg_build_nmake.cmake
@@ -0,0 +1,185 @@
+## # vcpkg_build_nmake
+##
+## Build a msvc makefile project.
+##
+## ## Usage:
+## ```cmake
+## vcpkg_build_nmake(
+## SOURCE_PATH <${SOURCE_PATH}>
+## [NO_DEBUG]
+## PROJECT_SUBPATH <${SUBPATH}>
+## PROJECT_NAME <${MAKEFILE_NAME}>
+## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+## [TARGET <target>])
+## ```
+##
+## ## Parameters
+## ### SOURCE_PATH
+## Specifies the directory containing the source files.
+## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+##
+## ### PROJECT_SUBPATH
+## Specifies the sub directory containing the `makefile.vc`/`makefile.mak`/`makefile.msvc` or other msvc makefile.
+##
+## ### PROJECT_NAME
+## Specifies the name of msvc makefile name.
+## Default is `makefile.vc`
+##
+## ### NO_DEBUG
+## This port doesn't support debug mode.
+##
+## ### ENABLE_INSTALL
+## Install binaries after build.
+##
+## ### OPTIONS
+## Additional options passed to generate during the generation.
+##
+## ### OPTIONS_RELEASE
+## Additional options passed to generate during the Release generation. These are in addition to `OPTIONS`.
+##
+## ### OPTIONS_DEBUG
+## Additional options passed to generate during the Debug generation. These are in addition to `OPTIONS`.
+##
+## ### TARGET
+## The target passed to the nmake build command (`nmake/nmake install`). 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_nmake()`](vcpkg_configure_nmake.md).
+## You can use the alias [`vcpkg_install_nmake()`](vcpkg_configure_nmake.md) function if your CMake script supports the
+## "install" target
+##
+## ## Examples
+##
+## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+function(vcpkg_build_nmake)
+ cmake_parse_arguments(_bn
+ "ADD_BIN_TO_PATH;ENABLE_INSTALL;NO_DEBUG"
+ "SOURCE_PATH;PROJECT_SUBPATH;PROJECT_NAME;LOGFILE_ROOT"
+ "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG"
+ ${ARGN}
+ )
+
+ if (NOT CMAKE_HOST_WIN32)
+ message(FATAL_ERROR "vcpkg_build_nmake only support windows.")
+ endif()
+
+ if (_bn_OPTIONS_DEBUG STREQUAL _bn_OPTIONS_RELEASE)
+ message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_build_nmake/vcpkg_install_nmake")
+ endif()
+
+ if(NOT _bn_LOGFILE_ROOT)
+ set(_bn_LOGFILE_ROOT "build")
+ endif()
+
+ if (NOT _bn_PROJECT_NAME)
+ set(MAKEFILE_NAME makefile.vc)
+ else()
+ set(MAKEFILE_NAME ${_bn_PROJECT_NAME})
+ endif()
+
+ set(MAKE )
+ set(MAKE_OPTS_BASE )
+ set(INSTALL_OPTS_BASE )
+
+ find_program(NMAKE nmake REQUIRED)
+ get_filename_component(NMAKE_EXE_PATH ${NMAKE} DIRECTORY)
+ # Load toolchains
+ if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
+ set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake")
+ endif()
+ include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
+ # Set needed env
+ set(ENV{PATH} "$ENV{PATH};${NMAKE_EXE_PATH}")
+ set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
+ # Set make command and install command
+ set(MAKE ${NMAKE} /NOLOGO /G /U)
+ set(MAKE_OPTS_BASE -f ${MAKEFILE_NAME} all)
+ set(INSTALL_OPTS_BASE install)
+ # Add subpath to work directory
+ if (_bn_PROJECT_SUBPATH)
+ set(_bn_PROJECT_SUBPATH /${_bn_PROJECT_SUBPATH})
+ else()
+ set(_bn_PROJECT_SUBPATH )
+ endif()
+
+ foreach(BUILDTYPE "debug" "release")
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
+ if(BUILDTYPE STREQUAL "debug")
+ # Skip debug generate
+ if (_bn_NO_DEBUG)
+ continue()
+ endif()
+ # Generate obj dir suffix
+ set(SHORT_BUILDTYPE "-dbg")
+ set(CONFIG "Debug")
+ # Add install command and arguments
+ set(MAKE_OPTS ${MAKE_OPTS_BASE})
+ if (_bn_ENABLE_INSTALL)
+ set(INSTALL_OPTS ${INSTALL_OPTS_BASE} INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug)
+ set(MAKE_OPTS ${MAKE_OPTS} ${INSTALL_OPTS})
+ endif()
+ set(MAKE_OPTS ${MAKE_OPTS} ${_bn_OPTIONS} ${_bn_OPTIONS_DEBUG})
+
+ unset(ENV{CL})
+ set(TMP_CL_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/" "-" TMP_CL_FLAGS "${TMP_CL_FLAGS}")
+ set(ENV{CL} "$ENV{CL} ${TMP_CL_FLAGS}")
+ else()
+ # In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
+ if (_bn_NO_DEBUG)
+ set(SHORT_BUILDTYPE "")
+ else()
+ set(SHORT_BUILDTYPE "-rel")
+ endif()
+ set(CONFIG "Release")
+ # Add install command and arguments
+ set(MAKE_OPTS ${MAKE_OPTS_BASE})
+ if (_bn_ENABLE_INSTALL)
+ set(INSTALL_OPTS ${INSTALL_OPTS_BASE} INSTALLDIR=${CURRENT_PACKAGES_DIR})
+ set(MAKE_OPTS ${MAKE_OPTS} ${INSTALL_OPTS})
+ endif()
+ set(MAKE_OPTS ${MAKE_OPTS} ${_bn_OPTIONS} ${_bn_OPTIONS_RELEASE})
+
+ unset(ENV{CL})
+ set(TMP_CL_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ string(REPLACE "/" "-" TMP_CL_FLAGS "${TMP_CL_FLAGS}")
+ set(ENV{CL} "$ENV{CL} ${TMP_CL_FLAGS}")
+ endif()
+
+ set(CURRENT_TRIPLET_NAME ${TARGET_TRIPLET}${SHORT_BUILDTYPE})
+ set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${CURRENT_TRIPLET_NAME})
+
+ file(REMOVE_RECURSE ${OBJ_DIR})
+ file(MAKE_DIRECTORY ${OBJ_DIR})
+ file(GLOB_RECURSE SOURCE_FILES ${_bn_SOURCE_PATH}/*)
+ foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
+ get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
+ string(REPLACE "${_bn_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
+ file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
+ endforeach()
+
+ if (NOT _bn_ENABLE_INSTALL)
+ message(STATUS "Building ${CURRENT_TRIPLET_NAME}")
+ else()
+ message(STATUS "Building and installing ${CURRENT_TRIPLET_NAME}")
+ endif()
+
+ vcpkg_execute_build_process(
+ COMMAND ${MAKE} ${MAKE_OPTS}
+ WORKING_DIRECTORY ${OBJ_DIR}${_bn_PROJECT_SUBPATH}
+ LOGNAME "${_bn_LOGFILE_ROOT}-${CURRENT_TRIPLET_NAME}"
+ )
+
+ if(_bn_ADD_BIN_TO_PATH)
+ set(ENV{PATH} "${_BACKUP_ENV_PATH}")
+ endif()
+ endif()
+ endforeach()
+endfunction()
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake
index 28177fbbf..60afeaf36 100644
--- a/scripts/cmake/vcpkg_common_definitions.cmake
+++ b/scripts/cmake/vcpkg_common_definitions.cmake
@@ -55,6 +55,7 @@ endif()
#Helper variables for libraries
if(VCPKG_TARGET_IS_WINDOWS)
set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".lib")
+ set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX ".lib")
set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dll")
set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX ".lib")
set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "")
@@ -69,6 +70,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
#set(VCPKG_FIND_LIBRARY_PREFIXES "lib" "")
elseif(VCPKG_TARGET_IS_OSX)
set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a")
+ set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX "")
set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".dylib")
set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib")
set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib")
@@ -76,6 +78,7 @@ elseif(VCPKG_TARGET_IS_OSX)
set(VCPKG_FIND_LIBRARY_PREFIXES "lib" "")
else()
set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a")
+ set(VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX "")
set(VCPKG_TARGET_SHARED_LIBRARY_SUFFIX ".so")
set(VCPKG_TARGET_STATIC_LIBRARY_PREFIX "lib")
set(VCPKG_TARGET_SHARED_LIBRARY_PREFIX "lib")
diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake
index d2ea35608..4aa115f47 100644
--- a/scripts/cmake/vcpkg_common_functions.cmake
+++ b/scripts/cmake/vcpkg_common_functions.cmake
@@ -19,12 +19,17 @@ include(vcpkg_from_bitbucket)
include(vcpkg_build_cmake)
include(vcpkg_build_msbuild)
include(vcpkg_build_qmake)
+include(vcpkg_build_make)
+include(vcpkg_build_nmake)
include(vcpkg_install_cmake)
include(vcpkg_install_meson)
include(vcpkg_install_msbuild)
+include(vcpkg_install_make)
+include(vcpkg_install_nmake)
include(vcpkg_configure_cmake)
include(vcpkg_configure_meson)
include(vcpkg_configure_qmake)
+include(vcpkg_configure_make)
include(vcpkg_apply_patches)
include(vcpkg_copy_pdbs)
include(vcpkg_copy_tool_dependencies)
diff --git a/scripts/cmake/vcpkg_configure_make.cmake b/scripts/cmake/vcpkg_configure_make.cmake
new file mode 100644
index 000000000..a30b962e9
--- /dev/null
+++ b/scripts/cmake/vcpkg_configure_make.cmake
@@ -0,0 +1,347 @@
+## # vcpkg_configure_make
+##
+## Configure configure for Debug and Release builds of a project.
+##
+## ## Usage
+## ```cmake
+## vcpkg_configure_make(
+## SOURCE_PATH <${SOURCE_PATH}>
+## [AUTOCONFIG]
+## [DISABLE_AUTO_HOST]
+## [DISABLE_AUTO_DST]
+## [GENERATOR]
+## [NO_DEBUG]
+## [PROJECT_SUBPATH <${PROJ_SUBPATH}>]
+## [PRERUN_SHELL <${SHELL_PATH}>]
+## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+## )
+## ```
+##
+## ## Parameters
+## ### SOURCE_PATH
+## Specifies the directory containing the `configure`/`configure.ac`.
+## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+##
+## ### PROJECT_SUBPATH
+## Specifies the directory containing the ``configure`/`configure.ac`.
+## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+## Should use `GENERATOR NMake` first.
+##
+## ### NO_DEBUG
+## This port doesn't support debug mode.
+##
+## ### AUTOCONFIG
+## Need to use autoconfig to generate configure file.
+##
+## ### DISABLE_AUTO_HOST
+## Don't set host automatically, the default value is `i686`.
+## If use this option, you will need to set host manually.
+##
+## ### DISABLE_AUTO_DST
+## Don't set installation path automatically, the default value is `${CURRENT_PACKAGES_DIR}` and `${CURRENT_PACKAGES_DIR}/debug`
+## If use this option, you will need to set dst path manually.
+##
+## ### GENERATOR
+## Specifies the precise generator to use.
+## NMake: nmake(windows) make(unix)
+## MAKE: make(windows) make(unix)
+##
+## ### PRERUN_SHELL
+## Script that needs to be called before configuration
+##
+## ### OPTIONS
+## Additional options passed to configure during the configuration.
+##
+## ### OPTIONS_RELEASE
+## Additional options passed to configure during the Release configuration. These are in addition to `OPTIONS`.
+##
+## ### OPTIONS_DEBUG
+## Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`.
+##
+## ## Notes
+## This command supplies many common arguments to configure. To see the full list, examine the source.
+##
+## ## Examples
+##
+## * [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+function(vcpkg_configure_make)
+ cmake_parse_arguments(_csc
+ "AUTOCONFIG;DISABLE_AUTO_HOST;DISABLE_AUTO_DST;NO_DEBUG"
+ "SOURCE_PATH;PROJECT_SUBPATH;GENERATOR;PRERUN_SHELL"
+ "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE"
+ ${ARGN}
+ )
+
+ if(NOT VCPKG_PLATFORM_TOOLSET)
+ message(FATAL_ERROR "Vcpkg has been updated with VS2017 support; "
+ "however, vcpkg.exe must be rebuilt by re-running bootstrap-vcpkg.bat\n")
+ endif()
+
+ if (_csc_OPTIONS_DEBUG STREQUAL _csc_OPTIONS_RELEASE OR NMAKE_OPTION_RELEASE STREQUAL NMAKE_OPTION_DEBUG)
+ message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_configure_make")
+ endif()
+ # Select compiler
+ if(_csc_GENERATOR MATCHES "NMake")
+ message(FATAL_ERROR "Sorry, NMake does not supported currently.")
+ if (CMAKE_HOST_WIN32)
+ set(GENERATOR "nmake")
+ else()
+ set(GENERATOR "make")
+ endif()
+ elseif(NOT _csc_GENERATOR OR _csc_GENERATOR MATCHES "MAKE")
+ if (CMAKE_HOST_WIN32)
+ set(GENERATOR "make")
+ else()
+ set(GENERATOR "make")
+ endif()
+ else()
+ message(FATAL_ERROR "${_csc_GENERATOR} not supported.")
+ endif()
+
+ if (_csc_AUTOCONFIG AND NOT CMAKE_HOST_WIN32)
+ find_program(autoreconf autoreconf REQUIRED)
+ endif()
+
+ set(WIN_TARGET_ARCH )
+ set(WIN_TARGET_COMPILER )
+ # Detect compiler
+ if (GENERATOR STREQUAL "nmake")
+ message(STATUS "Using generator NMAKE")
+ find_program(NMAKE nmake REQUIRED)
+ elseif (GENERATOR STREQUAL "make")
+ message(STATUS "Using generator make")
+ find_program(MAKE make REQUIRED)
+ else()
+ message(FATAL_ERROR "${GENERATOR} not supported.")
+ endif()
+ # Pre-processing windows configure requirements
+ if (CMAKE_HOST_WIN32)
+ vcpkg_find_acquire_program(YASM)
+ vcpkg_find_acquire_program(PERL)
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils)
+ get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
+ get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
+
+ if (NOT _csc_DISABLE_AUTO_HOST)
+ if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
+ set(WIN_TARGET_ARCH --host=i686-pc-mingw32)
+ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
+ set(WIN_TARGET_ARCH --host=i686-pc-mingw64)
+ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm)
+ set(WIN_TARGET_ARCH --host=arm-pc-mingw32)
+ endif()
+ endif()
+ set(WIN_TARGET_COMPILER CC=cl)
+ set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH};${MSYS_ROOT}/usr/bin;${PERL_EXE_PATH}")
+ set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
+ endif()
+
+ if (NOT _csc_NO_DEBUG)
+ file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
+ else()
+ file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
+ endif()
+
+ if (NOT _csc_DISABLE_AUTO_DST)
+ set(_csc_OPTIONS_RELEASE ${_csc_OPTIONS_RELEASE}
+ --prefix=${CURRENT_PACKAGES_DIR}
+ --bindir=${CURRENT_PACKAGES_DIR}/bin
+ --sbindir=${CURRENT_PACKAGES_DIR}/bin
+ --libdir=${CURRENT_PACKAGES_DIR}/lib
+ --includedir=${CURRENT_PACKAGES_DIR}/include)
+
+ set(_csc_OPTIONS_DEBUG ${_csc_OPTIONS_DEBUG}
+ --prefix=${CURRENT_PACKAGES_DIR}/debug
+ --bindir=${CURRENT_PACKAGES_DIR}/debug/bin
+ --sbindir=${CURRENT_PACKAGES_DIR}/debug/bin
+ --libdir=${CURRENT_PACKAGES_DIR}/debug/lib
+ --includedir=${CURRENT_PACKAGES_DIR}/debug/include)
+ endif()
+
+ set(base_cmd )
+ if(CMAKE_HOST_WIN32)
+ set(base_cmd ${BASH} --noprofile --norc -c)
+
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ set(_csc_OPTIONS ${_csc_OPTIONS} --enable-shared)
+ if (VCPKG_TARGET_IS_UWP)
+ set(_csc_OPTIONS ${_csc_OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib)
+ endif()
+ else()
+ set(_csc_OPTIONS ${_csc_OPTIONS} --enable-static)
+ endif()
+ # Load toolchains
+ if(NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
+ set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/windows.cmake")
+ endif()
+ include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
+
+ set(C_FLAGS_GLOBAL "$ENV{CFLAGS} ${VCPKG_C_FLAGS}")
+ set(CXX_FLAGS_GLOBAL "$ENV{CXXFLAGS} ${VCPKG_CXX_FLAGS}")
+ set(LD_FLAGS_GLOBAL "$ENV{LDFLAGS}")
+
+ if(VCPKG_TARGET_IS_UWP)
+ set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
+ set(_csc_OPTIONS ${_csc_OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00)
+ endif()
+
+ list(JOIN _csc_OPTIONS " " _csc_OPTIONS)
+ list(JOIN _csc_OPTIONS_RELEASE " " _csc_OPTIONS_RELEASE)
+ list(JOIN _csc_OPTIONS_DEBUG " " _csc_OPTIONS_DEBUG)
+
+ set(rel_command
+ ${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}"
+ )
+ set(dbg_command
+ ${base_cmd} "${WIN_TARGET_COMPILER} ${_csc_SOURCE_PATH}/configure ${WIN_TARGET_ARCH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}"
+ )
+ else()
+ set(base_cmd ./)
+ set(rel_command
+ ${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_RELEASE}"
+ )
+ set(dbg_command
+ ${base_cmd}configure "${_csc_OPTIONS}" "${_csc_OPTIONS_DEBUG}"
+ )
+ endif()
+
+ # Configure debug
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT _csc_NO_DEBUG)
+ if (CMAKE_HOST_WIN32)
+ unset(ENV{CFLAGS})
+ unset(ENV{CXXFLAGS})
+ unset(ENV{LDFLAGS})
+ set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
+ string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}")
+ set(ENV{CFLAGS} ${TMP_CFLAGS})
+ set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}")
+ set(ENV{CXXFLAGS} ${TMP_CXXFLAGS})
+ set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL}")
+ string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}")
+ set(ENV{LDFLAGS} ${TMP_LDFLAGS})
+ endif()
+
+ set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
+ set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH})
+
+ file(MAKE_DIRECTORY ${OBJ_DIR})
+
+ if (NOT CMAKE_HOST_WIN32)
+ file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*)
+ foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
+ file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${OBJ_DIR})
+ get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
+ string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
+ file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
+ endforeach()
+ endif()
+
+ if (_csc_PRERUN_SHELL)
+ message(STATUS "Prerun shell with ${TARGET_TRIPLET}-dbg")
+ vcpkg_execute_required_process(
+ COMMAND ${base_cmd}${_csc_PRERUN_SHELL}
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME prerun-${TARGET_TRIPLET}-dbg
+ )
+ endif()
+
+ if (_csc_AUTOCONFIG)
+ message(STATUS "Generating configure with ${TARGET_TRIPLET}-dbg")
+ vcpkg_execute_required_process(
+ COMMAND autoreconf -vfi
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME prerun-${TARGET_TRIPLET}-dbg
+ )
+ endif()
+
+ message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
+ vcpkg_execute_required_process(
+ COMMAND ${dbg_command}
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME config-${TARGET_TRIPLET}-dbg
+ )
+ endif()
+
+ # Configure release
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ if (CMAKE_HOST_WIN32)
+ unset(ENV{CFLAGS})
+ unset(ENV{CXXFLAGS})
+ unset(ENV{LDFLAGS})
+ set(TMP_CFLAGS "${C_FLAGS_GLOBAL} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
+ string(REPLACE "/" "-" TMP_CFLAGS "${TMP_CFLAGS}")
+ set(ENV{CFLAGS} ${TMP_CFLAGS})
+
+ set(TMP_CXXFLAGS "${CXX_FLAGS_GLOBAL} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+ string(REPLACE "/" "-" TMP_CXXFLAGS "${TMP_CXXFLAGS}")
+ set(ENV{CXXFLAGS} ${TMP_CXXFLAGS})
+
+ set(TMP_LDFLAGS "${LD_FLAGS_GLOBAL} ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
+ string(REPLACE "/" "-" TMP_LDFLAGS "${TMP_LDFLAGS}")
+ set(ENV{LDFLAGS} ${TMP_LDFLAGS})
+ endif()
+
+ if (_csc_NO_DEBUG)
+ set(TAR_TRIPLET_DIR ${TARGET_TRIPLET})
+ set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR})
+ else()
+ set(TAR_TRIPLET_DIR ${TARGET_TRIPLET}-rel)
+ set(OBJ_DIR ${CURRENT_BUILDTREES_DIR}/${TAR_TRIPLET_DIR})
+ endif()
+ set(PRJ_DIR ${OBJ_DIR}/${_csc_PROJECT_SUBPATH})
+
+ file(MAKE_DIRECTORY ${OBJ_DIR})
+
+ if (NOT CMAKE_HOST_WIN32)
+ file(GLOB_RECURSE SOURCE_FILES ${_csc_SOURCE_PATH}/*)
+ foreach(ONE_SOUCRCE_FILE ${SOURCE_FILES})
+ get_filename_component(DST_DIR ${ONE_SOUCRCE_FILE} PATH)
+ string(REPLACE "${_csc_SOURCE_PATH}" "${OBJ_DIR}" DST_DIR "${DST_DIR}")
+ file(COPY ${ONE_SOUCRCE_FILE} DESTINATION ${DST_DIR})
+ endforeach()
+ endif()
+
+ if (_csc_PRERUN_SHELL)
+ message(STATUS "Prerun shell with ${TAR_TRIPLET_DIR}")
+ vcpkg_execute_required_process(
+ COMMAND ${base_cmd}${_csc_PRERUN_SHELL}
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME prerun-${TAR_TRIPLET_DIR}
+ )
+ endif()
+
+ if (_csc_AUTOCONFIG)
+ message(STATUS "Generating configure with ${TAR_TRIPLET_DIR}")
+ vcpkg_execute_required_process(
+ COMMAND autoreconf -vfi
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME prerun-${TAR_TRIPLET_DIR}
+ )
+ endif()
+
+ message(STATUS "Configuring ${TAR_TRIPLET_DIR}")
+ vcpkg_execute_required_process(
+ COMMAND ${rel_command}
+ WORKING_DIRECTORY ${PRJ_DIR}
+ LOGNAME config-${TAR_TRIPLET_DIR}
+ )
+ endif()
+
+ # Restore envs
+ if (CMAKE_HOST_WIN32)
+ set(ENV{CFLAGS} "${C_FLAGS_GLOBAL}")
+ set(ENV{CXXFLAGS} "${CXX_FLAGS_GLOBAL}")
+ set(ENV{LDFLAGS} "${LD_FLAGS_GLOBAL}")
+ endif()
+
+ set(_VCPKG_MAKE_GENERATOR "${GENERATOR}" PARENT_SCOPE)
+ set(_VCPKG_NO_DEBUG ${_csc_NO_DEBUG} PARENT_SCOPE)
+ SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE)
+ set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE)
+endfunction()
diff --git a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake
index a775c2094..67916d09d 100644
--- a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake
+++ b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake
@@ -5,6 +5,7 @@
## ## Usage
## ```cmake
## vcpkg_extract_source_archive_ex(
+## SKIP_PATCH_CHECK
## OUT_SOURCE_PATH <SOURCE_PATH>
## ARCHIVE <${ARCHIVE}>
## [REF <1.0.0>]
@@ -14,6 +15,9 @@
## )
## ```
## ## Parameters
+## ### SKIP_PATCH_CHECK
+## If this option is set the failure to apply a patch is ignored.
+##
## ### OUT_SOURCE_PATH
## Specifies the out-variable that will contain the extracted location.
##
@@ -51,7 +55,13 @@ 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})
+ cmake_parse_arguments(
+ _vesae
+ "NO_REMOVE_ONE_LEVEL;SKIP_PATCH_CHECK"
+ "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()")
@@ -115,7 +125,14 @@ function(vcpkg_extract_source_archive_ex)
endif()
endif()
+ if (_vesae_SKIP_PATCH_CHECK)
+ set (QUIET QUIET)
+ else()
+ set (QUIET)
+ endif()
+
vcpkg_apply_patches(
+ ${QUIET}
SOURCE_PATH ${TEMP_SOURCE_PATH}
PATCHES ${_vesae_PATCHES}
)
diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake
index aa8a70026..b5af58cc2 100644
--- a/scripts/cmake/vcpkg_find_acquire_program.cmake
+++ b/scripts/cmake/vcpkg_find_acquire_program.cmake
@@ -20,6 +20,7 @@
## - PERL
## - PYTHON2
## - PYTHON3
+## - GO
## - JOM
## - MESON
## - NASM
@@ -79,6 +80,14 @@ function(vcpkg_find_acquire_program VAR)
set(_vfa_RENAME "yasm.exe")
set(NOEXTRACT ON)
set(HASH c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b)
+ elseif(VAR MATCHES "GO")
+ set(PROGNAME go)
+ set(PATHS ${DOWNLOADS}/tools/go/go/bin)
+ set(BREW_PACKAGE_NAME "go")
+ set(APT_PACKAGE_NAME "golang-go")
+ set(URL "https://dl.google.com/go/go1.13.1.windows-386.zip")
+ set(ARCHIVE "go1.13.1.windows-386.zip")
+ set(HASH 2ab0f07e876ad98d592351a8808c2de42351ab387217e088bc4c5fa51d6a835694c501e2350802323b55a27dc0157f8b70045597f789f9e50f5ceae50dea3027)
elseif(VAR MATCHES "PYTHON3")
if(CMAKE_HOST_WIN32)
set(PROGNAME python)
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
index 1e0f2493d..c383fcb56 100644
--- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
+++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@@ -1,21 +1,23 @@
#.rst:
# .. command:: vcpkg_fixup_cmake_targets
#
-# Transform all /debug/share/<port>/*targets-debug.cmake files and move them to /share/<port>.
+# Transforms all /debug/share/<port>/*targets-debug.cmake files and move them to /share/<port>.
# Removes all /debug/share/<port>/*targets.cmake and /debug/share/<port>/*config.cmake
#
-# Transform all references matching /bin/*.exe to /tools/<port>/*.exe on Windows
-# Transform all references matching /bin/* to /tools/<port>/* on other platforms
+# Transforms all references matching /bin/*.exe to /tools/<port>/*.exe on Windows
+# Transforms all references matching /bin/* to /tools/<port>/* on other platforms
#
-# Fix ${_IMPORT_PREFIX} in auto generated targets to be one folder deeper.
-# Replace ${CURRENT_INSTALLED_DIR} with ${_IMPORT_PREFIX} in configs/targets.
+# Fixes ${_IMPORT_PREFIX} in auto generated targets to be one folder deeper.
+# Replaces ${CURRENT_INSTALLED_DIR} with ${_IMPORT_PREFIX} in configs/targets.
#
# ::
# vcpkg_fixup_cmake_targets([CONFIG_PATH <config_path>])
#
# ``CONFIG_PATH``
# *.cmake files subdirectory (like "lib/cmake/${PORT}").
-#
+#
+# Example usage:
+# vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/myPort")
function(vcpkg_fixup_cmake_targets)
cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN})
@@ -176,3 +178,5 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${CMAKE_FILE} "${_contents}")
endforeach()
endfunction()
+
+
diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake
index c0d657bbc..a822ee40e 100644
--- a/scripts/cmake/vcpkg_from_github.cmake
+++ b/scripts/cmake/vcpkg_from_github.cmake
@@ -172,6 +172,7 @@ function(vcpkg_from_github)
endif()
vcpkg_extract_source_archive_ex(
+ SKIP_PATCH_CHECK
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${downloaded_file_path}"
REF "${SANITIZED_HEAD_REF}"
diff --git a/scripts/cmake/vcpkg_install_make.cmake b/scripts/cmake/vcpkg_install_make.cmake
new file mode 100644
index 000000000..1672d7c5a
--- /dev/null
+++ b/scripts/cmake/vcpkg_install_make.cmake
@@ -0,0 +1,25 @@
+## # vcpkg_install_make
+##
+## Build and install a make project.
+##
+## ## Usage:
+## ```cmake
+## vcpkg_install_make(...)
+## ```
+##
+## ## Parameters:
+## See [`vcpkg_build_make()`](vcpkg_build_make.md).
+##
+## ## Notes:
+## This command transparently forwards to [`vcpkg_build_make()`](vcpkg_build_make.md), adding `ENABLE_INSTALL`
+##
+## ## Examples
+##
+## * [x264](https://github.com/Microsoft/vcpkg/blob/master/ports/x264/portfile.cmake)
+## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+## * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)
+
+function(vcpkg_install_make)
+ vcpkg_build_make(LOGFILE_ROOT ENABLE_INSTALL)
+endfunction()
diff --git a/scripts/cmake/vcpkg_install_nmake.cmake b/scripts/cmake/vcpkg_install_nmake.cmake
new file mode 100644
index 000000000..0674f9ec3
--- /dev/null
+++ b/scripts/cmake/vcpkg_install_nmake.cmake
@@ -0,0 +1,73 @@
+## # vcpkg_install_nmake
+##
+## Build and install a msvc makefile project.
+##
+## ## Usage:
+## ```cmake
+## vcpkg_install_nmake(
+## SOURCE_PATH <${SOURCE_PATH}>
+## [NO_DEBUG]
+## PROJECT_SUBPATH <${SUBPATH}>
+## PROJECT_NAME <${MAKEFILE_NAME}>
+## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
+## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
+## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
+## ```
+##
+## ## Parameters
+## ### SOURCE_PATH
+## Specifies the directory containing the source files.
+## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
+##
+## ### PROJECT_SUBPATH
+## Specifies the sub directory containing the `makefile.vc`/`makefile.mak`/`makefile.msvc` or other msvc makefile.
+##
+## ### PROJECT_NAME
+## Specifies the name of msvc makefile name.
+## Default is makefile.vc
+##
+## ### NO_DEBUG
+## This port doesn't support debug mode.
+##
+## ### OPTIONS
+## Additional options passed to generate during the generation.
+##
+## ### OPTIONS_RELEASE
+## Additional options passed to generate during the Release generation. These are in addition to `OPTIONS`.
+##
+## ### OPTIONS_DEBUG
+## Additional options passed to generate during the Debug generation. These are in addition to `OPTIONS`.
+##
+## ## Parameters:
+## See [`vcpkg_build_nmake()`](vcpkg_build_nmake.md).
+##
+## ## Notes:
+## This command transparently forwards to [`vcpkg_build_nmake()`](vcpkg_build_nmake.md), adding `ENABLE_INSTALL`
+##
+## ## Examples
+##
+## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
+## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
+
+function(vcpkg_install_nmake)
+ cmake_parse_arguments(_in
+ "NO_DEBUG"
+ "SOURCE_PATH;PROJECT_SUBPATH;PROJECT_NAME"
+ "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG"
+ ${ARGN}
+ )
+
+ if (NOT CMAKE_HOST_WIN32)
+ message(FATAL_ERROR "vcpkg_install_nmake only support windows.")
+ endif()
+
+ if (_in_NO_DEBUG)
+ set(NO_DEBUG NO_DEBUG)
+ endif()
+
+ vcpkg_build_nmake(LOGFILE_ROOT ENABLE_INSTALL
+ ${NO_DEBUG}
+ SOURCE_PATH ${_in_SOURCE_PATH} PROJECT_SUBPATH ${_in_PROJECT_SUBPATH} PROJECT_NAME ${_in_PROJECT_NAME}
+ OPTIONS ${_in_OPTIONS} OPTIONS_RELEASE ${_in_OPTIONS_RELEASE} OPTIONS_DEBUG ${_in_OPTIONS_DEBUG}
+ )
+endfunction()
diff --git a/scripts/ports.cmake b/scripts/ports.cmake
index 456434f12..cdc0bdd99 100644
--- a/scripts/ports.cmake
+++ b/scripts/ports.cmake
@@ -18,6 +18,9 @@ else()
]])
endif()
+# fixup Windows drive letter to uppercase.
+get_filename_component(VCPKG_ROOT_DIR_CANDIDATE ${VCPKG_ROOT_DIR_CANDIDATE} ABSOLUTE)
+
# Validate VCPKG_ROOT_DIR_CANDIDATE
if (NOT EXISTS "${VCPKG_ROOT_DIR_CANDIDATE}/.vcpkg-root")
message(FATAL_ERROR "Could not find .vcpkg-root")
diff --git a/scripts/templates/CONTROL.in b/scripts/templates/CONTROL.in
index c5b706861..77f287e0a 100644
--- a/scripts/templates/CONTROL.in
+++ b/scripts/templates/CONTROL.in
@@ -1,3 +1,10 @@
Source: @PORT@
Version:
-Description: \ No newline at end of file
+Homepage:
+Description:
+Build-Depends:
+Default-Features:
+
+Feature:
+Description:
+Build-Depends: \ No newline at end of file
diff --git a/scripts/templates/portfile.in.cmake b/scripts/templates/portfile.in.cmake
index 33f8a4853..62c53a6db 100644
--- a/scripts/templates/portfile.in.cmake
+++ b/scripts/templates/portfile.in.cmake
@@ -2,15 +2,34 @@
# 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_INSTALLED_DIR = ${VCPKG_ROOT_DIR}\installed\${TRIPLET}
+# DOWNLOADS = ${VCPKG_ROOT_DIR}\downloads
# 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)
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
+# VCPKG_TOOLCHAIN = ON OFF
+# TRIPLET_SYSTEM_ARCH = arm x86 x64
+# BUILD_ARCH = "Win32" "x64" "ARM"
+# MSBUILD_PLATFORM = "Win32"/"x64"/${TRIPLET_SYSTEM_ARCH}
+# DEBUG_CONFIG = "Debug Static" "Debug Dll"
+# RELEASE_CONFIG = "Release Static"" "Release DLL"
+# VCPKG_TARGET_IS_WINDOWS
+# VCPKG_TARGET_IS_UWP
+# VCPKG_TARGET_IS_LINUX
+# VCPKG_TARGET_IS_OSX
+# VCPKG_TARGET_IS_FREEBSD
+# VCPKG_TARGET_IS_ANDROID
+# VCPKG_TARGET_EXECUTABLE_SUFFIX
+# VCPKG_TARGET_STATIC_LIBRARY_SUFFIX
+# VCPKG_TARGET_SHARED_LIBRARY_SUFFIX
#
+# See additional helpful variables in /docs/maintainers/vcpkg_common_definitions.md
-include(vcpkg_common_functions)
+# # Specifies if the port install should fail immediately given a condition
+# vcpkg_fail_port_install(MESSAGE "@PORT@ currently only supports Linux and Mac platforms" ON_TARGET "Windows")
vcpkg_download_distfile(ARCHIVE
URLS "@URL@"
@@ -30,6 +49,15 @@ vcpkg_extract_source_archive_ex(
# 002_more_port_fixes.patch
)
+# # Check if one or more features are a part of a package installation.
+# # See /docs/maintainers/vcpkg_check_features.md for more details
+# vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+# FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used
+# tbb WITH_TBB
+# INVERTED_FEATURES
+# tbb ROCKSDB_IGNORE_PACKAGE_TBB
+# )
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
@@ -40,8 +68,12 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
-# Handle copyright
+# # Moves all .cmake files from /debug/share/@PORT@/ to /share/@PORT@/
+# # See /docs/maintainers/vcpkg_fixup_cmake_targets.md for more details
+# vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/@PORT@)
+
+# # Handle copyright
# file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/@PORT@ RENAME copyright)
-# Post-build test for cmake libraries
+# # Post-build test for cmake libraries
# vcpkg_test_cmake(PACKAGE_NAME @PORT@)