2020-12-02 05:37:26 +08:00
|
|
|
#[===[.md:
|
|
|
|
# vcpkg_fixup_pkgconfig
|
2020-08-22 17:23:56 +08:00
|
|
|
|
2021-06-05 07:49:02 +08:00
|
|
|
Fix common paths in *.pc files and make everything relative to $(prefix).
|
|
|
|
Additionally, on static triplets, private entries are merged with their non-private counterparts,
|
|
|
|
allowing pkg-config to be called without the ``--static`` flag.
|
|
|
|
Note that vcpkg is designed to never have to call pkg-config with the ``--static`` flag,
|
|
|
|
since a consumer cannot know if a dependent library has been built statically or not.
|
2020-12-02 05:37:26 +08:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
```cmake
|
|
|
|
vcpkg_fixup_pkgconfig(
|
|
|
|
[RELEASE_FILES <PATHS>...]
|
|
|
|
[DEBUG_FILES <PATHS>...]
|
|
|
|
[SKIP_CHECK]
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
### RELEASE_FILES
|
|
|
|
Specifies a list of files to apply the fixes for release paths.
|
|
|
|
Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR} without ${CURRENT_PACKAGES_DIR}/debug/
|
|
|
|
|
|
|
|
### DEBUG_FILES
|
|
|
|
Specifies a list of files to apply the fixes for debug paths.
|
|
|
|
Defaults to every *.pc file in the folder ${CURRENT_PACKAGES_DIR}/debug/
|
|
|
|
|
2020-12-08 10:17:19 +08:00
|
|
|
### SKIP_CHECK
|
|
|
|
Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases.
|
2020-12-02 05:37:26 +08:00
|
|
|
|
2020-12-08 10:17:19 +08:00
|
|
|
### SYSTEM_PACKAGES (deprecated)
|
|
|
|
This argument has been deprecated and has no effect.
|
2020-12-02 05:37:26 +08:00
|
|
|
|
2020-12-08 10:17:19 +08:00
|
|
|
### SYSTEM_LIBRARIES (deprecated)
|
|
|
|
This argument has been deprecated and has no effect.
|
|
|
|
|
|
|
|
### IGNORE_FLAGS (deprecated)
|
|
|
|
This argument has been deprecated and has no effect.
|
2020-12-02 05:37:26 +08:00
|
|
|
|
|
|
|
## Notes
|
|
|
|
Still work in progress. If there are more cases which can be handled here feel free to add them
|
|
|
|
|
|
|
|
## Examples
|
2020-12-08 10:17:19 +08:00
|
|
|
|
|
|
|
* [brotli](https://github.com/Microsoft/vcpkg/blob/master/ports/brotli/portfile.cmake)
|
2020-12-02 05:37:26 +08:00
|
|
|
#]===]
|
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
function(z_vcpkg_fixup_pkgconfig_check_files file config)
|
|
|
|
set(path_suffix_debug /debug)
|
|
|
|
set(path_suffix_release "")
|
2020-12-08 10:17:19 +08:00
|
|
|
|
|
|
|
if(DEFINED ENV{PKG_CONFIG_PATH})
|
2021-08-17 04:42:31 +08:00
|
|
|
set(backup_env_pkg_config_path "$ENV{PKG_CONFIG_PATH}")
|
2020-12-08 10:17:19 +08:00
|
|
|
else()
|
2021-08-17 04:42:31 +08:00
|
|
|
unset(backup_env_pkg_config_path)
|
2020-12-08 10:17:19 +08:00
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
|
|
|
|
vcpkg_list(SET pkg_config_path
|
|
|
|
"${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig"
|
|
|
|
"${CURRENT_INSTALLED_DIR}/share/pkgconfig"
|
|
|
|
"${CURRENT_PACKAGES_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/pkgconfig"
|
|
|
|
)
|
2020-12-08 10:17:19 +08:00
|
|
|
if(DEFINED ENV{PKG_CONFIG_PATH} AND NOT ENV{PKG_CONFIG_PATH} STREQUAL "")
|
2021-08-17 04:42:31 +08:00
|
|
|
vcpkg_list(APPEND pkg_config_path "$ENV{PKG_CONFIG_PATH}")
|
2020-07-25 02:39:21 +08:00
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
vcpkg_list(JOIN pkg_config_path "${VCPKG_PATH_SEPARATOR}" pkg_config_path)
|
|
|
|
set(ENV{PKG_CONFIG_PATH} "${pkg_config_path}")
|
2020-07-25 02:39:21 +08:00
|
|
|
|
|
|
|
# First make sure everything is ok with the package and its deps
|
2021-08-17 04:42:31 +08:00
|
|
|
cmake_path(GET file STEM package_name)
|
|
|
|
debug_message("Checking package (${config}): ${package_name}")
|
|
|
|
execute_process(
|
|
|
|
COMMAND "${PKGCONFIG}" --print-errors --exists "${package_name}"
|
|
|
|
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
|
|
|
|
RESULT_VARIABLE error_var
|
|
|
|
OUTPUT_VARIABLE output
|
|
|
|
ERROR_VARIABLE output
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
ERROR_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
if(NOT "${error_var}" EQUAL "0")
|
|
|
|
message(FATAL_ERROR "${PKGCONFIG} --exists ${package_name} failed with error code: ${error_var}
|
|
|
|
ENV{PKG_CONFIG_PATH}: \"$ENV{PKG_CONFIG_PATH}\"
|
|
|
|
output: ${output}"
|
|
|
|
)
|
2020-07-25 02:39:21 +08:00
|
|
|
else()
|
2021-08-17 04:42:31 +08:00
|
|
|
debug_message("pkg-config --exists ${package_name} output: ${output}")
|
2020-07-25 02:39:21 +08:00
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
if(DEFINED backup_env_pkg_config_path)
|
|
|
|
set(ENV{PKG_CONFIG_PATH} "${backup_env_pkg_config_path}")
|
2020-04-28 08:37:55 +08:00
|
|
|
else()
|
2020-12-08 10:17:19 +08:00
|
|
|
unset(ENV{PKG_CONFIG_PATH})
|
2020-04-28 08:37:55 +08:00
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(vcpkg_fixup_pkgconfig)
|
2021-08-17 04:42:31 +08:00
|
|
|
cmake_parse_arguments(PARSE_ARGV 0 arg
|
|
|
|
"SKIP_CHECK"
|
|
|
|
""
|
|
|
|
"RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(DEFINED arg_UNPARSED_ARGUMENTS)
|
|
|
|
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
|
2020-04-28 08:37:55 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
if(DEFINED arg_RELEASE_FILES AND NOT DEFINED arg_DEBUG_FILES)
|
|
|
|
message(FATAL_ERROR "DEBUG_FILES must be specified if RELEASE_FILES was specified.")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED arg_RELEASE_FILES AND DEFINED arg_DEBUG_FILES)
|
|
|
|
message(FATAL_ERROR "RELEASE_FILES must be specified if DEBUG_FILES was specified.")
|
2020-04-28 08:37:55 +08:00
|
|
|
endif()
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
if(NOT DEFINED arg_RELEASE_FILES)
|
|
|
|
file(GLOB_RECURSE arg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc")
|
|
|
|
file(GLOB_RECURSE arg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc")
|
|
|
|
foreach(debug_file IN LISTS arg_DEBUG_FILES)
|
|
|
|
vcpkg_list(REMOVE_ITEM arg_RELEASE_FILES "${debug_file}")
|
|
|
|
endforeach()
|
2020-04-28 08:37:55 +08:00
|
|
|
endif()
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
|
2020-08-19 03:16:39 +08:00
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
debug_message("Using pkg-config from: ${PKGCONFIG}")
|
2020-07-25 02:39:21 +08:00
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
string(REGEX REPLACE "^([a-zA-Z]):/" [[/\1/]] unix_packages_dir "${CURRENT_PACKAGES_DIR}")
|
|
|
|
string(REGEX REPLACE "^([a-zA-Z]):/" [[/\1/]] unix_installed_dir "${CURRENT_INSTALLED_DIR}")
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
foreach(config IN ITEMS RELEASE DEBUG)
|
|
|
|
debug_message("${config} Files: ${arg_${config}_FILES}")
|
|
|
|
if("${VCPKG_BUILD_TYPE}" STREQUAL "debug" AND "${config}" STREQUAL "RELEASE")
|
2020-12-08 10:17:19 +08:00
|
|
|
continue()
|
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
if("${VCPKG_BUILD_TYPE}" STREQUAL "release" AND "${config}" STREQUAL "DEBUG")
|
2020-12-08 10:17:19 +08:00
|
|
|
continue()
|
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
foreach(file IN LISTS "arg_${config}_FILES")
|
|
|
|
message(STATUS "Fixing pkgconfig file: ${file}")
|
|
|
|
cmake_path(GET file PARENT_PATH pkg_lib_search_path)
|
|
|
|
if("${config}" STREQUAL "DEBUG")
|
|
|
|
set(relative_pc_path "${CURRENT_PACKAGES_DIR}/debug")
|
|
|
|
cmake_path(RELATIVE_PATH relative_pc_path BASE_DIRECTORY "${pkg_lib_search_path}")
|
2020-12-08 10:17:19 +08:00
|
|
|
else()
|
2021-08-17 04:42:31 +08:00
|
|
|
set(relative_pc_path "${CURRENT_PACKAGES_DIR}")
|
|
|
|
cmake_path(RELATIVE_PATH relative_pc_path BASE_DIRECTORY "${pkg_lib_search_path}")
|
2020-12-08 10:17:19 +08:00
|
|
|
endif()
|
|
|
|
#Correct *.pc file
|
2021-08-17 04:42:31 +08:00
|
|
|
file(READ "${file}" contents)
|
|
|
|
|
|
|
|
string(REPLACE "${CURRENT_PACKAGES_DIR}" [[${prefix}]] contents "${contents}")
|
|
|
|
string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${prefix}]] contents "${contents}")
|
|
|
|
string(REPLACE "${unix_packages_dir}" [[${prefix}]] contents "${contents}")
|
|
|
|
string(REPLACE "${unix_installed_dir}" [[${prefix}]] contents "${contents}")
|
|
|
|
|
|
|
|
string(REGEX REPLACE "(^|\n)prefix[\t ]*=[^\n]*" "" contents "${contents}")
|
|
|
|
if("${config}" STREQUAL "DEBUG")
|
|
|
|
# prefix points at the debug subfolder
|
|
|
|
string(REPLACE [[${prefix}/debug]] [[${prefix}]] contents "${contents}")
|
|
|
|
string(REPLACE [[${prefix}/include]] [[${prefix}/../include]] contents "${contents}")
|
|
|
|
string(REPLACE [[${prefix}/share]] [[${prefix}/../share]] contents "${contents}")
|
2020-12-08 10:17:19 +08:00
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
# quote -L, -I, and -l paths starting with `${blah}`
|
|
|
|
string(REGEX REPLACE " -([LIl])(\\\${[^}]*}[^ \n\t]*)" [[ -\1"\2"]] contents "${contents}")
|
2020-12-08 10:17:19 +08:00
|
|
|
# This section fuses XYZ.private and XYZ according to VCPKG_LIBRARY_LINKAGE
|
|
|
|
#
|
|
|
|
# Pkgconfig searches Requires.private transitively for Cflags in the dynamic case,
|
|
|
|
# which prevents us from removing it.
|
|
|
|
#
|
|
|
|
# Once this transformation is complete, users of vcpkg should never need to pass
|
|
|
|
# --static.
|
2021-08-17 04:42:31 +08:00
|
|
|
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
|
|
|
|
# how this works:
|
|
|
|
# we want to transform:
|
|
|
|
# Libs: $1
|
|
|
|
# Libs.private: $2
|
|
|
|
# into
|
|
|
|
# Libs: $1 $2
|
|
|
|
# and the same thing for Requires and Requires.private
|
|
|
|
|
|
|
|
set(libs_line "")
|
|
|
|
set(requires_line "")
|
|
|
|
if("${contents}" MATCHES "Libs: *([^\n]*)")
|
|
|
|
string(APPEND libs_line " ${CMAKE_MATCH_1}")
|
|
|
|
endif()
|
|
|
|
if("${contents}" MATCHES "Libs.private: *([^\n]*)")
|
|
|
|
string(APPEND libs_line " ${CMAKE_MATCH_1}")
|
|
|
|
endif()
|
|
|
|
if("${contents}" MATCHES "Requires: *([^\n]*)")
|
|
|
|
string(APPEND requires_line " ${CMAKE_MATCH_1}")
|
|
|
|
endif()
|
|
|
|
if("${contents}" MATCHES "Requires.private: *([^\n]*)")
|
|
|
|
string(APPEND requires_line " ${CMAKE_MATCH_1}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
string(REGEX REPLACE "(^|\n)(Requires|Libs)(\\.private)?:[^\n]*\n" [[\1]] contents "${contents}")
|
|
|
|
|
|
|
|
if(NOT "${libs_line}" STREQUAL "")
|
|
|
|
string(APPEND contents "Libs:${libs_line}\n")
|
|
|
|
endif()
|
|
|
|
if(NOT "${requires_line}" STREQUAL "")
|
|
|
|
string(APPEND contents "Requires:${requires_line}\n")
|
|
|
|
endif()
|
2020-12-08 10:17:19 +08:00
|
|
|
endif()
|
2021-08-17 04:42:31 +08:00
|
|
|
file(WRITE "${file}" "prefix=\${pcfiledir}/${relative_pc_path}\n${contents}")
|
2020-07-25 02:39:21 +08:00
|
|
|
endforeach()
|
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
if(NOT arg_SKIP_CHECK) # The check can only run after all files have been corrected!
|
|
|
|
foreach(file IN LISTS "arg_${config}_FILES")
|
|
|
|
z_vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${file}" "${config}")
|
2020-12-08 10:17:19 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|
2020-04-28 08:37:55 +08:00
|
|
|
endforeach()
|
2020-08-19 03:16:39 +08:00
|
|
|
debug_message("Fixing pkgconfig --- finished")
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
|
2021-08-17 04:42:31 +08:00
|
|
|
set(Z_VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE)
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
# Variable to check if this function has been called!
|
2020-04-28 08:37:55 +08:00
|
|
|
# Theoreotically vcpkg could look for *.pc files and automatically call this function
|
[vcpkg manifest] Manifest Implementation (#11757)
==== Changes Related to manifests ====
* Add the `manifests` feature flag
* This only says whether we look for a `vcpkg.json` in the cwd, not
whether we support parsing manifests (for ports, for example)
* Changes to the manifests RFC
* `"authors"` -> `"maintainers"`
* `--x-classic-mode` -> `-manifests` \in `vcpkg_feature_flags`
* reserve `"core"` in addition to `"default"`, since that's already
reserved for features
* Add a small helper note about what identifiers must look like
* `<license-string>`: SPDX v3.8 -> v3.9
* `"feature"."description"` is allowed to be an array of strings as well
* `"version"` -> `"version-string"` for forward-compat with versions
RFC
* Add the `--feature-flags` option
* Add the ability to turn off feature flags via passing
`-<feature-flag>` to `VCPKG_FEATURE_FLAGS` or `--feature-flags`
* Add CMake toolchain support for manifests
* Requires either:
* a feature flag of `manifests` in either `Env{VCPKG_FEATURE_FLAGS}`
or `VCPKG_FEATURE_FLAGS`
* Passing the `VCPKG_ENABLE_MANIFESTS` option
* The toolchain will install your packages to
`${VCPKG_MANIFEST_DIR}/vcpkg_installed`.
* Add MSBuild `vcpkg integrate install` support for manifests
* Requires `VcpkgEnableManifest` to be true
* `vcpkg create` creates a port that has a `vcpkg.json` instead of a
`CONTROL`
* argparse, abseil, 3fd, and avisynthplus ports switched to manifest
from CONTROL
* Add support for `--x-manifest-root`, as well as code for finding it if
not passed
* Add support for parsing manifests!
* Add a filesystem lock!
==== Important Changes which are somewhat unrelated to manifests ====
* Rename `logicexpression.{h,cpp}` to `platform-expression.{h,cpp}`
* Add `PlatformExpression` type which takes the place of the old logic
expression
* Split the parsing of platform expressions from checking whether
they're true or not
* Eagerly parse PlatformExpressions as opposed to leaving them as
strings
* Add checking for feature flag consistency
* i.e., if `-binarycaching` is passed, you shouldn't be passing
`--binarysource`
* Add the `Json::Reader` type which, with the help of user-defined
visitors, converts JSON to your internal type
* VcpkgArgParser: place the switch names into a constant as opposed to
using magic constants
* In general update the parsing code so that this ^ works
* Add `Port-Version` fields to CONTROL files
* This replaces the existing practice of
`Version: <my-version>-<port-version>`
==== Smaller changes ====
* small drive-by cleanups to some CMake
* `${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}` ->
`${CURRENT_INSTALLED_DIR}`
* Remove `-analyze` when compiling with clang-cl, since that's not a
supported flag (vcpkg's build system)
* Add a message about which compiler is detected by vcpkg's build
system machinery
* Fix `Expected::then`
* Convert `""` to `{}` for `std::string` and `fs::path`, to avoid a
`strlen` (additionally, `.empty()` instead of `== ""`, and `.clear()`)
* Add `Strings::strto` which converts strings to numeric types
* Support built-in arrays and `StringView` for `Strings::join`
* Add `operator<` and friends to `StringView`
* Add `substr` to `StringView`
* SourceParagraphParser gets some new errors
2020-07-01 01:40:18 +08:00
|
|
|
# or check if this function has been called if *.pc files are detected.
|
2020-04-28 08:37:55 +08:00
|
|
|
# The same is true for vcpkg_fixup_cmake_targets
|
|
|
|
endfunction()
|