mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 23:15:18 +08:00
[vcpkg-docs] Add documentation for vcpkg_configure_meson()
, vcpkg_install_meson()
, vcpkg_fixup_cmake_targts()
, and vcpkg_prettify_command()
(#7606)
* [vcpkg-docs] Add documentation for `vcpkg_configure_meson()`, `vcpkg_install_meson()`, `vcpkg_fixup_cmake_targts()`, and `vcpkg_prettify_command()` * [docs] Address code review comments. Reformat docs for vcpkg_fail_port_install.
This commit is contained in:
parent
c36db6d3be
commit
5deea3b975
@ -15,6 +15,7 @@
|
||||
- [vcpkg\_common\_definitions](vcpkg_common_definitions.md)
|
||||
- [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md)
|
||||
- [vcpkg\_configure\_make](vcpkg_configure_make.md)
|
||||
- [vcpkg\_configure\_meson](vcpkg_configure_meson.md)
|
||||
- [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md)
|
||||
- [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md)
|
||||
- [vcpkg\_download\_distfile](vcpkg_download_distfile.md)
|
||||
@ -24,12 +25,14 @@
|
||||
- [vcpkg\_extract\_source\_archive\_ex](vcpkg_extract_source_archive_ex.md)
|
||||
- [vcpkg\_fail\_port\_install](vcpkg_fail_port_install.md)
|
||||
- [vcpkg\_find\_acquire\_program](vcpkg_find_acquire_program.md)
|
||||
- [vcpkg\_fixup\_cmake\_targets](vcpkg_fixup_cmake_targets.md)
|
||||
- [vcpkg\_from\_bitbucket](vcpkg_from_bitbucket.md)
|
||||
- [vcpkg\_from\_git](vcpkg_from_git.md)
|
||||
- [vcpkg\_from\_github](vcpkg_from_github.md)
|
||||
- [vcpkg\_from\_gitlab](vcpkg_from_gitlab.md)
|
||||
- [vcpkg\_install\_cmake](vcpkg_install_cmake.md)
|
||||
- [vcpkg\_install\_make](vcpkg_install_make.md)
|
||||
- [vcpkg\_install\_meson](vcpkg_install_meson.md)
|
||||
- [vcpkg\_install\_msbuild](vcpkg_install_msbuild.md)
|
||||
- [vcpkg\_install\_nmake](vcpkg_install_nmake.md)
|
||||
- [vcpkg\_install\_qmake](vcpkg_install_qmake.md)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# vcpkg_apply_patches
|
||||
|
||||
Apply a set of patches to a source tree.
|
||||
Apply a set of patches to a source tree. This function is deprecated in favor of the `PATCHES` argument to `vcpkg_from_github()` et al.
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
@ -27,9 +27,8 @@ This should only be used for edge cases, such as patches that are known to fail
|
||||
|
||||
## Examples
|
||||
|
||||
* [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
|
||||
* [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake)
|
||||
* [libpng](https://github.com/Microsoft/vcpkg/blob/master/ports/libpng/portfile.cmake)
|
||||
* [libbson](https://github.com/Microsoft/vcpkg/blob/master/ports/libbson/portfile.cmake)
|
||||
* [gdal](https://github.com/Microsoft/vcpkg/blob/master/ports/gdal/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[scripts/cmake/vcpkg_apply_patches.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_apply_patches.cmake)
|
||||
|
@ -38,7 +38,7 @@ This is needed for libraries that set their own source code's character set.
|
||||
Specifies the precise generator to use.
|
||||
|
||||
This is useful if some project-specific buildsystem has been wrapped in a cmake script that won't perform an actual build.
|
||||
If used for this purpose, it should be set to "NMake Makefiles".
|
||||
If used for this purpose, it should be set to `"NMake Makefiles"`.
|
||||
|
||||
### OPTIONS
|
||||
Additional options passed to CMake during the configuration.
|
||||
|
38
docs/maintainers/vcpkg_configure_meson.md
Normal file
38
docs/maintainers/vcpkg_configure_meson.md
Normal file
@ -0,0 +1,38 @@
|
||||
# vcpkg_configure_meson
|
||||
|
||||
Configure Meson for Debug and Release builds of a project.
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_configure_meson(
|
||||
SOURCE_PATH <${SOURCE_PATH}>
|
||||
[OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
|
||||
[OPTIONS_RELEASE <-DOPTIMIZE=1>...]
|
||||
[OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### SOURCE_PATH
|
||||
Specifies the directory containing the `meson.build`.
|
||||
By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
|
||||
|
||||
### OPTIONS
|
||||
Additional options passed to Meson during the configuration.
|
||||
|
||||
### OPTIONS_RELEASE
|
||||
Additional options passed to Meson during the Release configuration. These are in addition to `OPTIONS`.
|
||||
|
||||
### OPTIONS_DEBUG
|
||||
Additional options passed to Meson during the Debug configuration. These are in addition to `OPTIONS`.
|
||||
|
||||
## Notes
|
||||
This command supplies many common arguments to Meson. To see the full list, examine the source.
|
||||
|
||||
## Examples
|
||||
|
||||
* [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake)
|
||||
* [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[scripts/cmake/vcpkg_configure_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_meson.cmake)
|
@ -1,30 +1,37 @@
|
||||
# vcpkg_fail_port_install
|
||||
|
||||
Fails the current portfile with a (default) error message
|
||||
Checks common requirements and fails the current portfile with a (default) error message
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_fail_port_install([MESSAGE <message>] [ON_TARGET <target1> [<target2> ...]]
|
||||
vcpkg_fail_port_install(
|
||||
[ALWAYS]
|
||||
[MESSAGE <"Reason for failure">]
|
||||
[ON_TARGET <Windows> [<OSX> ...]]
|
||||
[ON_ARCH <x64> [<arm> ...]]
|
||||
[ON_CRT_LINKAGE <static> [<dynamic> ...]])
|
||||
[ON_LIBRARY_LINKAGE <static> [<dynamic> ...]]
|
||||
)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
### MESSAGE
|
||||
Additional failure message. If non is given a default message will be displayed depending on the failure condition
|
||||
Additional failure message. If none is given, a default message will be displayed depending on the failure condition.
|
||||
|
||||
### ALWAYS
|
||||
will always fail early
|
||||
Will always fail early
|
||||
|
||||
### ON_TARGET
|
||||
targets for which the build should fail early. Valid targets are <target> from VCPKG_IS_TARGET_<target> (see vcpkg_common_definitions.cmake)
|
||||
Targets for which the build should fail early. Valid targets are `<target>` from `VCPKG_IS_TARGET_<target>` (see `vcpkg_common_definitions.cmake`).
|
||||
|
||||
### ON_ARCH
|
||||
architecture for which the build should fail early.
|
||||
Architecture for which the build should fail early.
|
||||
|
||||
### ON_CRT_LINKAGE
|
||||
CRT linkage for which the build should fail early.
|
||||
|
||||
### ON_LIBRARY_LINKAGE
|
||||
library linkage for which the build should fail early.
|
||||
Library linkage for which the build should fail early.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -14,9 +14,13 @@ This variable specifies both the program to be acquired as well as the out param
|
||||
The current list of programs includes:
|
||||
|
||||
- 7Z
|
||||
- ARIA2 (Downloader)
|
||||
- BISON
|
||||
- DARK
|
||||
- DOXYGEN
|
||||
- FLEX
|
||||
- GASPREPROCESSOR
|
||||
- GPERF
|
||||
- PERL
|
||||
- PYTHON2
|
||||
- PYTHON3
|
||||
@ -26,8 +30,8 @@ The current list of programs includes:
|
||||
- NASM
|
||||
- NINJA
|
||||
- NUGET
|
||||
- SCONS
|
||||
- YASM
|
||||
- ARIA2 (Downloader)
|
||||
|
||||
Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md).
|
||||
|
||||
|
@ -1,30 +1,42 @@
|
||||
# vcpkg_fixup_cmake_targets
|
||||
|
||||
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`.
|
||||
|
||||
Transforms all references matching `/bin/\*.exe tools/\<port\>/\*.exe` on Windows.
|
||||
Transforms all references matching `/bin/\* to /tools/\<port\>/\*` on other platforms.
|
||||
|
||||
Fixups *${_IMPORT_PREFIX}* in auto generated targets to be one folder deeper.
|
||||
Replaces *${CURRENT_INSTALLED_DIR}* with *${_IMPORT_PREFIX}* in config files and targets.
|
||||
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH <config_path>)
|
||||
```
|
||||
|
||||
## Parameters:
|
||||
### CONFIG_PATH
|
||||
*.cmake files subdirectory (e.g. "lib/cmake/${PORT}" or "cmake/${PORT}).
|
||||
### TARGET_PATH
|
||||
Optional location to place fixup'd files. Unecessary if target is "share/${PORT}".
|
||||
|
||||
## Examples:
|
||||
- [Azure-uamqp-c](https://github.com/microsoft/vcpkg/blob/master/ports/azure-uamqp-c/portfile.cmake)
|
||||
- [Brigand](https://github.com/microsoft/vcpkg/blob/master/ports/brigand/portfile.cmake)
|
||||
- [cctz](https://github.com/microsoft/vcpkg/blob/master/ports/cctz/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[scripts/cmake/vcpkg_fixup_cmake_targets.cmake](https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_cmake_targets.cmake)
|
||||
# vcpkg_fixup_cmake_targets
|
||||
|
||||
Merge release and debug CMake targets and configs to support multiconfig generators.
|
||||
|
||||
Additionally corrects common issues with targets, such as absolute paths and incorrectly placed binaries.
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_fixup_cmake_targets([CONFIG_PATH <share/${PORT}>] [TARGET_PATH <share/${PORT}>])
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### CONFIG_PATH
|
||||
Subpath currently containing `*.cmake` files subdirectory (like `lib/cmake/${PORT}`). Should be relative to `${CURRENT_PACKAGES_DIR}`.
|
||||
|
||||
Defaults to `share/${PORT}`.
|
||||
|
||||
### TARGET_PATH
|
||||
Subpath to which the above `*.cmake` files should be moved. Should be relative to `${CURRENT_PACKAGES_DIR}`.
|
||||
This needs to be specified if the port name differs from the `find_package()` name.
|
||||
|
||||
Defaults to `share/${PORT}`.
|
||||
|
||||
## Notes
|
||||
Transform all `/debug/<CONFIG_PATH>/*targets-debug.cmake` files and move them to `/<TARGET_PATH>`.
|
||||
Removes all `/debug/<CONFIG_PATH>/*targets.cmake` and `/debug/<CONFIG_PATH>/*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.
|
||||
|
||||
Fix `${_IMPORT_PREFIX}` in auto generated targets to be one folder deeper.
|
||||
Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targets.
|
||||
|
||||
## Examples
|
||||
|
||||
* [concurrentqueue](https://github.com/Microsoft/vcpkg/blob/master/ports/concurrentqueue/portfile.cmake)
|
||||
* [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake)
|
||||
* [nlohmann-json](https://github.com/Microsoft/vcpkg/blob/master/ports/nlohmann-json/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[scripts/cmake/vcpkg_fixup_cmake_targets.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_cmake_targets.cmake)
|
||||
|
16
docs/maintainers/vcpkg_install_meson.md
Normal file
16
docs/maintainers/vcpkg_install_meson.md
Normal file
@ -0,0 +1,16 @@
|
||||
# vcpkg_install_meson
|
||||
|
||||
Builds a meson project previously configured with `vcpkg_configure_meson()`.
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_install_meson()
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
* [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake)
|
||||
* [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake)
|
||||
|
||||
## Source
|
||||
[scripts/cmake/vcpkg_install_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_meson.cmake)
|
@ -4,7 +4,7 @@ Turns list of command arguments into a formatted string.
|
||||
|
||||
## Usage
|
||||
```cmake
|
||||
vcpkg_prettify_command()
|
||||
vcpkg_prettify_command(<INPUT_VAR> <OUTPUT_VAR>)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
## # vcpkg_apply_patches
|
||||
##
|
||||
## Apply a set of patches to a source tree.
|
||||
## Apply a set of patches to a source tree. This function is deprecated in favor of the `PATCHES` argument to `vcpkg_from_github()` et al.
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
@ -27,10 +27,8 @@
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
|
||||
## * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake)
|
||||
## * [libpng](https://github.com/Microsoft/vcpkg/blob/master/ports/libpng/portfile.cmake)
|
||||
|
||||
## * [libbson](https://github.com/Microsoft/vcpkg/blob/master/ports/libbson/portfile.cmake)
|
||||
## * [gdal](https://github.com/Microsoft/vcpkg/blob/master/ports/gdal/portfile.cmake)
|
||||
function(vcpkg_apply_patches)
|
||||
cmake_parse_arguments(_ap "QUIET" "SOURCE_PATH" "PATCHES" ${ARGN})
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
## Specifies the precise generator to use.
|
||||
##
|
||||
## This is useful if some project-specific buildsystem has been wrapped in a cmake script that won't perform an actual build.
|
||||
## If used for this purpose, it should be set to "NMake Makefiles".
|
||||
## If used for this purpose, it should be set to `"NMake Makefiles"`.
|
||||
##
|
||||
## ### OPTIONS
|
||||
## Additional options passed to CMake during the configuration.
|
||||
|
@ -1,3 +1,38 @@
|
||||
## # vcpkg_configure_meson
|
||||
##
|
||||
## Configure Meson for Debug and Release builds of a project.
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_configure_meson(
|
||||
## SOURCE_PATH <${SOURCE_PATH}>
|
||||
## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
|
||||
## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
|
||||
## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
|
||||
## )
|
||||
## ```
|
||||
##
|
||||
## ## Parameters
|
||||
## ### SOURCE_PATH
|
||||
## Specifies the directory containing the `meson.build`.
|
||||
## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
|
||||
##
|
||||
## ### OPTIONS
|
||||
## Additional options passed to Meson during the configuration.
|
||||
##
|
||||
## ### OPTIONS_RELEASE
|
||||
## Additional options passed to Meson during the Release configuration. These are in addition to `OPTIONS`.
|
||||
##
|
||||
## ### OPTIONS_DEBUG
|
||||
## Additional options passed to Meson during the Debug configuration. These are in addition to `OPTIONS`.
|
||||
##
|
||||
## ## Notes
|
||||
## This command supplies many common arguments to Meson. To see the full list, examine the source.
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake)
|
||||
## * [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake)
|
||||
function(vcpkg_configure_meson)
|
||||
cmake_parse_arguments(_vcm "" "SOURCE_PATH" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN})
|
||||
|
||||
@ -5,16 +40,19 @@ function(vcpkg_configure_meson)
|
||||
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
|
||||
|
||||
# use the same compiler options as in vcpkg_configure_cmake
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
message(FATAL_ERROR "vcpkg_configure_meson() currently only supports windows targets.")
|
||||
endif()
|
||||
set(MESON_COMMON_CFLAGS "${MESON_COMMON_CFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8")
|
||||
set(MESON_COMMON_CXXFLAGS "${MESON_COMMON_CXXFLAGS} /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc")
|
||||
|
||||
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
||||
set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1")
|
||||
set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1")
|
||||
|
||||
set(MESON_RELEASE_CFLAGS "${MESON_RELEASE_CFLAGS} /MD /O2 /Gy /DNDEBUG /Z7")
|
||||
set(MESON_RELEASE_CXXFLAGS "${MESON_RELEASE_CXXFLAGS} /MD /O2 /Gy /DNDEBUG /Z7")
|
||||
elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
set(MESON_DEBUG_CFLAGS "${MESON_DEBUG_CFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1")
|
||||
set(MESON_DEBUG_CXXFLAGS "${MESON_DEBUG_CXXFLAGS} /D_DEBUG /MTd /Z7 /Ob0 /Od /RTC1")
|
||||
|
||||
@ -28,7 +66,7 @@ function(vcpkg_configure_meson)
|
||||
# select meson cmd-line options
|
||||
list(APPEND _vcm_OPTIONS -Dcmake_prefix_path=${CURRENT_INSTALLED_DIR})
|
||||
list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja --wrap-mode nodownload)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
list(APPEND _vcm_OPTIONS --default-library shared)
|
||||
else()
|
||||
list(APPEND _vcm_OPTIONS --default-library static)
|
||||
|
@ -1,92 +1,95 @@
|
||||
## # vcpkg_fail_port_install
|
||||
##
|
||||
## Fails the current portfile with a (default) error message
|
||||
## Checks common requirements and fails the current portfile with a (default) error message
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_fail_port_install([MESSAGE <message>] [ON_TARGET <target1> [<target2> ...]]
|
||||
## [ON_ARCH <arch1> [<arch2> ...]]
|
||||
## [ON_CRT_LINKAGE <link1> [<link2> ...]])
|
||||
## [ON_LIBRARY_LINKAGE <linklib1> [<linklib2> ...]])
|
||||
## vcpkg_fail_port_install(
|
||||
## [ALWAYS]
|
||||
## [MESSAGE <"Reason for failure">]
|
||||
## [ON_TARGET <Windows> [<OSX> ...]]
|
||||
## [ON_ARCH <x64> [<arm> ...]]
|
||||
## [ON_CRT_LINKAGE <static> [<dynamic> ...]])
|
||||
## [ON_LIBRARY_LINKAGE <static> [<dynamic> ...]]
|
||||
## )
|
||||
## ```
|
||||
##
|
||||
## ## Parameters
|
||||
## ### MESSAGE
|
||||
## Additional failure message. If non is given a default message will be displayed depending on the failure condition
|
||||
## Additional failure message. If none is given, a default message will be displayed depending on the failure condition.
|
||||
##
|
||||
## ### ALWAYS
|
||||
## will always fail early
|
||||
## Will always fail early
|
||||
##
|
||||
## ### ON_TARGET
|
||||
## targets for which the build should fail early. Valid targets are <target> from VCPKG_IS_TARGET_<target> (see vcpkg_common_definitions.cmake)
|
||||
## Targets for which the build should fail early. Valid targets are `<target>` from `VCPKG_IS_TARGET_<target>` (see `vcpkg_common_definitions.cmake`).
|
||||
##
|
||||
## ### ON_ARCH
|
||||
## architecture for which the build should fail early.
|
||||
## Architecture for which the build should fail early.
|
||||
##
|
||||
## ### ON_CRT_LINKAGE
|
||||
## CRT linkage for which the build should fail early.
|
||||
##
|
||||
## ### ON_LIBRARY_LINKAGE
|
||||
## library linkage for which the build should fail early.
|
||||
## Library linkage for which the build should fail early.
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake)
|
||||
function(vcpkg_fail_port_install)
|
||||
cmake_parse_arguments(PARSE_ARGV 0 _csc "ALWAYS" "MESSAGE" "ON_TARGET;ON_ARCH;ON_CRT_LINKAGE;ON_LIBRARY_LINKAGE")
|
||||
if(DEFINED _csc_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown arguments passed to vcpkg_fail_port_install. Please correct the portfile!")
|
||||
endif()
|
||||
if(DEFINED _csc_MESSAGE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}\n")
|
||||
else()
|
||||
set(_csc_MESSAGE "")
|
||||
endif()
|
||||
|
||||
unset(_fail_port)
|
||||
#Target fail check
|
||||
if(DEFINED _csc_ON_TARGET)
|
||||
foreach(_target ${_csc_ON_TARGET})
|
||||
string(TOUPPER ${_target} _target_upper)
|
||||
if(VCPKG_TARGET_IS_${_target_upper})
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Target '${_target}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#Architecture fail check
|
||||
if(DEFINED _csc_ON_ARCH)
|
||||
foreach(_arch ${_csc_ON_ARCH})
|
||||
if(${VCPKG_TARGET_ARCHITECTURE} MATCHES ${_arch})
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Architecture '${_arch}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#CRT linkage fail check
|
||||
if(DEFINED _csc_ON_CRT_LINKAGE)
|
||||
foreach(_crt_link ${_csc_ON_CRT_LINKAGE})
|
||||
if("${VCPKG_CRT_LINKAGE}" MATCHES "${_crt_link}")
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}CRT linkage '${VCPKG_CRT_LINKAGE}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#Library linkage fail check
|
||||
if(DEFINED _csc_ON_LIBRARY_LINKAGE)
|
||||
foreach(_lib_link ${_csc_ON_LIBRARY_LINKAGE})
|
||||
if("${VCPKG_LIBRARY_LINKAGE}" MATCHES "${_lib_link}")
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Library linkage '${VCPKG_LIBRARY_LINKAGE}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(_fail_port OR _csc_ALWAYS)
|
||||
message(FATAL_ERROR ${_csc_MESSAGE})
|
||||
endif()
|
||||
cmake_parse_arguments(PARSE_ARGV 0 _csc "ALWAYS" "MESSAGE" "ON_TARGET;ON_ARCH;ON_CRT_LINKAGE;ON_LIBRARY_LINKAGE")
|
||||
if(DEFINED _csc_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown arguments passed to vcpkg_fail_port_install. Please correct the portfile!")
|
||||
endif()
|
||||
if(DEFINED _csc_MESSAGE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}\n")
|
||||
else()
|
||||
set(_csc_MESSAGE "")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
unset(_fail_port)
|
||||
#Target fail check
|
||||
if(DEFINED _csc_ON_TARGET)
|
||||
foreach(_target ${_csc_ON_TARGET})
|
||||
string(TOUPPER ${_target} _target_upper)
|
||||
if(VCPKG_TARGET_IS_${_target_upper})
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Target '${_target}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#Architecture fail check
|
||||
if(DEFINED _csc_ON_ARCH)
|
||||
foreach(_arch ${_csc_ON_ARCH})
|
||||
if(${VCPKG_TARGET_ARCHITECTURE} MATCHES ${_arch})
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Architecture '${_arch}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#CRT linkage fail check
|
||||
if(DEFINED _csc_ON_CRT_LINKAGE)
|
||||
foreach(_crt_link ${_csc_ON_CRT_LINKAGE})
|
||||
if("${VCPKG_CRT_LINKAGE}" MATCHES "${_crt_link}")
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}CRT linkage '${VCPKG_CRT_LINKAGE}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
#Library linkage fail check
|
||||
if(DEFINED _csc_ON_LIBRARY_LINKAGE)
|
||||
foreach(_lib_link ${_csc_ON_LIBRARY_LINKAGE})
|
||||
if("${VCPKG_LIBRARY_LINKAGE}" MATCHES "${_lib_link}")
|
||||
set(_fail_port TRUE)
|
||||
set(_csc_MESSAGE "${_csc_MESSAGE}Library linkage '${VCPKG_LIBRARY_LINKAGE}' not supported by ${PORT}!\n")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(_fail_port OR _csc_ALWAYS)
|
||||
message(FATAL_ERROR ${_csc_MESSAGE})
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -14,9 +14,13 @@
|
||||
## The current list of programs includes:
|
||||
##
|
||||
## - 7Z
|
||||
## - ARIA2 (Downloader)
|
||||
## - BISON
|
||||
## - DARK
|
||||
## - DOXYGEN
|
||||
## - FLEX
|
||||
## - GASPREPROCESSOR
|
||||
## - GPERF
|
||||
## - PERL
|
||||
## - PYTHON2
|
||||
## - PYTHON3
|
||||
@ -26,8 +30,8 @@
|
||||
## - NASM
|
||||
## - NINJA
|
||||
## - NUGET
|
||||
## - SCONS
|
||||
## - YASM
|
||||
## - ARIA2 (Downloader)
|
||||
##
|
||||
## Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_acquire_msys.md).
|
||||
##
|
||||
|
@ -1,24 +1,42 @@
|
||||
#.rst:
|
||||
# .. command:: vcpkg_fixup_cmake_targets
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# Transforms all references matching /bin/*.exe to /tools/<port>/*.exe on Windows
|
||||
# Transforms all references matching /bin/* to /tools/<port>/* on other platforms
|
||||
#
|
||||
# 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")
|
||||
|
||||
## # vcpkg_fixup_cmake_targets
|
||||
##
|
||||
## Merge release and debug CMake targets and configs to support multiconfig generators.
|
||||
##
|
||||
## Additionally corrects common issues with targets, such as absolute paths and incorrectly placed binaries.
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_fixup_cmake_targets([CONFIG_PATH <share/${PORT}>] [TARGET_PATH <share/${PORT}>])
|
||||
## ```
|
||||
##
|
||||
## ## Parameters
|
||||
##
|
||||
## ### CONFIG_PATH
|
||||
## Subpath currently containing `*.cmake` files subdirectory (like `lib/cmake/${PORT}`). Should be relative to `${CURRENT_PACKAGES_DIR}`.
|
||||
##
|
||||
## Defaults to `share/${PORT}`.
|
||||
##
|
||||
## ### TARGET_PATH
|
||||
## Subpath to which the above `*.cmake` files should be moved. Should be relative to `${CURRENT_PACKAGES_DIR}`.
|
||||
## This needs to be specified if the port name differs from the `find_package()` name.
|
||||
##
|
||||
## Defaults to `share/${PORT}`.
|
||||
##
|
||||
## ## Notes
|
||||
## Transform all `/debug/<CONFIG_PATH>/*targets-debug.cmake` files and move them to `/<TARGET_PATH>`.
|
||||
## Removes all `/debug/<CONFIG_PATH>/*targets.cmake` and `/debug/<CONFIG_PATH>/*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.
|
||||
##
|
||||
## Fix `${_IMPORT_PREFIX}` in auto generated targets to be one folder deeper.
|
||||
## Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targets.
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * [concurrentqueue](https://github.com/Microsoft/vcpkg/blob/master/ports/concurrentqueue/portfile.cmake)
|
||||
## * [curl](https://github.com/Microsoft/vcpkg/blob/master/ports/curl/portfile.cmake)
|
||||
## * [nlohmann-json](https://github.com/Microsoft/vcpkg/blob/master/ports/nlohmann-json/portfile.cmake)
|
||||
function(vcpkg_fixup_cmake_targets)
|
||||
cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN})
|
||||
|
||||
|
@ -1,7 +1,18 @@
|
||||
## # vcpkg_install_meson
|
||||
##
|
||||
## Builds a meson project previously configured with `vcpkg_configure_meson()`.
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_install_meson()
|
||||
## ```
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * [fribidi](https://github.com/Microsoft/vcpkg/blob/master/ports/fribidi/portfile.cmake)
|
||||
## * [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake)
|
||||
function(vcpkg_install_meson)
|
||||
|
||||
vcpkg_find_acquire_program(NINJA)
|
||||
|
||||
unset(ENV{DESTDIR}) # installation directory was already specified with '--prefix' option
|
||||
|
||||
message(STATUS "Package ${TARGET_TRIPLET}-rel")
|
||||
@ -17,5 +28,4 @@ function(vcpkg_install_meson)
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
||||
LOGNAME package-${TARGET_TRIPLET}-dbg
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
@ -4,7 +4,7 @@
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_prettify_command()
|
||||
## vcpkg_prettify_command(<INPUT_VAR> <OUTPUT_VAR>)
|
||||
## ```
|
||||
##
|
||||
## ## Examples
|
||||
|
Loading…
Reference in New Issue
Block a user