mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
[vcpkg-cmake] Remove cmake generator support restrictions (#22626)
* Stop failing in build step on unknown generators CMake already completed configuration using the given generator. * Support parallel build with Unix Makefiles * Documentation fixes for vcpkg_cmake port * `vcpkg_cmake_configure`: links to `opencv4` as example instead of `opencv` which is an empty port * `vcpkg_cmake_install`: fix link to `vcpkg_cmake_build`'s docs * `vcpkg_cmake_build`: fix link to `vcpkg_cmake_install`'s docs * Extra script audit * Update versions * Regenerate docs * [vcpkg-cmake] support Xcode parallel build * no/parallel_args when CMake Generator is "Xcode" * Update versions * CI Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com> Co-authored-by: luncliff <dong-ha-park@linecorp.com>
This commit is contained in:
parent
b89b8a2fa6
commit
dd42206f86
@ -20,6 +20,8 @@ and this is something we recommend doing whenever possible.
|
||||
Otherwise, you can use `TARGET` to set the target to build.
|
||||
This function defaults to not passing a target to cmake.
|
||||
|
||||
[`vcpkg_cmake_install()`]: vcpkg_cmake_install.md
|
||||
|
||||
`LOGFILE_BASE` is used to set the base of the logfile names;
|
||||
by default, this is `build`, and thus the logfiles end up being something like
|
||||
`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`,
|
||||
|
@ -87,7 +87,7 @@ This command supplies many common arguments to CMake. To see the full list, exam
|
||||
* [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)
|
||||
* [opencv4](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv4/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[ports/vcpkg-cmake/vcpkg\_cmake\_configure.cmake](https://github.com/Microsoft/vcpkg/blob/master/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake)
|
||||
|
@ -15,7 +15,7 @@ vcpkg_cmake_install(
|
||||
with additional parameters to set the `TARGET` to `install`,
|
||||
and to set the `LOGFILE_ROOT` to `install` as well.
|
||||
|
||||
[`vcpkg_cmake_build()`]: vcpkg_cmake_build.cmake
|
||||
[`vcpkg_cmake_build()`]: vcpkg_cmake_build.md
|
||||
|
||||
## Examples:
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"version-date": "2021-12-20"
|
||||
"version-date": "2022-01-19"
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ and this is something we recommend doing whenever possible.
|
||||
Otherwise, you can use `TARGET` to set the target to build.
|
||||
This function defaults to not passing a target to cmake.
|
||||
|
||||
[`vcpkg_cmake_install()`]: vcpkg_cmake_install.md
|
||||
|
||||
`LOGFILE_BASE` is used to set the base of the logfile names;
|
||||
by default, this is `build`, and thus the logfiles end up being something like
|
||||
`build-x86-windows-dbg.log`; if you use `vcpkg_cmake_install`,
|
||||
@ -46,10 +48,10 @@ function(vcpkg_cmake_build)
|
||||
set(arg_LOGFILE_BASE "build")
|
||||
endif()
|
||||
|
||||
set(build_args)
|
||||
set(target_args)
|
||||
set(parallel_args)
|
||||
set(no_parallel_args)
|
||||
set(build_args "")
|
||||
set(target_args "")
|
||||
set(parallel_args "")
|
||||
set(no_parallel_args "")
|
||||
|
||||
if(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
set(build_args "-v") # verbose output
|
||||
@ -63,8 +65,15 @@ function(vcpkg_cmake_build)
|
||||
set(parallel_args "/m")
|
||||
elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "NMake Makefiles")
|
||||
# No options are currently added for nmake builds
|
||||
elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles")
|
||||
set(build_args "VERBOSE=1")
|
||||
set(parallel_args "-j${VCPKG_CONCURRENCY}")
|
||||
set(no_parallel_args "")
|
||||
elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
list(APPEND parallel_args -jobs "${VCPKG_CONCURRENCY}")
|
||||
list(APPEND no_parallel_args -jobs 1)
|
||||
else()
|
||||
message(FATAL_ERROR "Unrecognized GENERATOR setting from vcpkg_configure_cmake(). Valid generators are: Ninja, Visual Studio, and NMake Makefiles")
|
||||
message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().")
|
||||
endif()
|
||||
|
||||
if(DEFINED arg_TARGET)
|
||||
|
@ -86,7 +86,7 @@ This command supplies many common arguments to CMake. To see the full list, exam
|
||||
* [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)
|
||||
* [opencv4](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv4/portfile.cmake)
|
||||
#]===]
|
||||
if(Z_VCPKG_CMAKE_CONFIGURE_GUARD)
|
||||
return()
|
||||
|
@ -14,7 +14,7 @@ vcpkg_cmake_install(
|
||||
with additional parameters to set the `TARGET` to `install`,
|
||||
and to set the `LOGFILE_ROOT` to `install` as well.
|
||||
|
||||
[`vcpkg_cmake_build()`]: vcpkg_cmake_build.cmake
|
||||
[`vcpkg_cmake_build()`]: vcpkg_cmake_build.md
|
||||
|
||||
## Examples:
|
||||
|
||||
|
@ -7165,7 +7165,7 @@
|
||||
"port-version": 1
|
||||
},
|
||||
"vcpkg-cmake": {
|
||||
"baseline": "2021-12-20",
|
||||
"baseline": "2022-01-19",
|
||||
"port-version": 0
|
||||
},
|
||||
"vcpkg-cmake-config": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "b7c050fe60f91dcedef6d87a3f87584151bf8aee",
|
||||
"version-date": "2022-01-19",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "a35eb7c761372dc64526d59fa918a13c0dfbba1b",
|
||||
"version-date": "2021-12-20",
|
||||
|
Loading…
x
Reference in New Issue
Block a user