2020-04-28 03:37:55 +03:00
## # vcpkg_fixup_pkgconfig
##
## Fix common paths in *.pc files and make everything relativ to $(prefix)
##
## ## Usage
## ```cmake
## vcpkg_fixup_pkgconfig(
## [RELEASE_FILES <PATHS>...]
## [DEBUG_FILES <PATHS>...]
## [SYSTEM_LIBRARIES <NAMES>...]
2020-07-24 21:39:21 +03:00
## [IGNORE_FLAGS <FLAGS>]
## [SKIP_CHECK]
2020-04-28 03:37:55 +03:00
## )
## ```
##
## ## Parameters
## ### RELEASE_FILES
[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-06-30 20:40:18 +03:00
## Specifies a list of files to apply the fixes for release paths.
2020-04-28 03:37:55 +03:00
## 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/
##
## ### SYSTEM_LIBRARIES
## If the *.pc file contains system libraries outside vcpkg these need to be listed here.
[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-06-30 20:40:18 +03:00
## VCPKG checks every -l flag for the existence of the required library within vcpkg.
2020-04-28 03:37:55 +03:00
##
## ### IGNORE_FLAGS
## If the *.pc file contains flags in the lib field which are not libraries. These can be listed here
##
2020-07-24 21:39:21 +03:00
## ### SKIP_CHECK
## Skips the library checks in vcpkg_fixup_pkgconfig. Only use if the script itself has unhandled cases.
##
2020-04-28 03:37:55 +03:00
## ## Notes
## Still work in progress. If there are more cases which can be handled here feel free to add them
##
## ## Examples
[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-06-30 20:40:18 +03:00
## Just call vcpkg_fixup_pkgconfig() after any install step which installs *.pc files.
2020-07-24 21:39:21 +03:00
function ( vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config _system_libs _ignore_flags )
# Setup pkg-config paths
2020-08-18 22:16:39 +03:00
set ( _VCPKG_INSTALLED_PKGCONF "${CURRENT_INSTALLED_DIR}" )
set ( _VCPKG_PACKAGES_PKGCONF "${CURRENT_PACKAGES_DIR}" )
2020-07-24 21:39:21 +03:00
set ( PATH_SUFFIX_DEBUG /debug )
set ( PKGCONFIG_INSTALLED_DIR "${_VCPKG_INSTALLED_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig" )
set ( PKGCONFIG_INSTALLED_SHARE_DIR "${_VCPKG_INSTALLED_PKGCONF}/share/pkgconfig" )
set ( PKGCONFIG_PACKAGES_DIR "${_VCPKG_PACKAGES_PKGCONF}${PATH_SUFFIX_${_config}}/lib/pkgconfig" )
set ( PKGCONFIG_PACKAGES_SHARE_DIR "${_VCPKG_PACKAGES_PKGCONF}/share/pkgconfig" )
if ( ENV{PKG_CONFIG_PATH} )
set ( BACKUP_ENV_PKG_CONFIG_PATH_ ${ _config } $ENV{ PKG_CONFIG_PATH } )
2020-08-18 22:16:39 +03:00
set ( ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}" )
2020-07-24 21:39:21 +03:00
else ( )
2020-08-18 22:16:39 +03:00
set ( ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}" )
2020-07-24 21:39:21 +03:00
endif ( )
# First make sure everything is ok with the package and its deps
get_filename_component ( _package_name "${_file}" NAME_WLE )
debug_message ( "Checking package (${_config}): ${_package_name}" )
execute_process ( COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${ _package_name }
W O R K I N G _ D I R E C T O R Y " $ { C U R R E N T _ B U I L D T R E E S _ D I R } "
R E S U L T _ V A R I A B L E _ p k g _ e r r o r _ v a r
O U T P U T _ V A R I A B L E _ p k g _ o u t p u t
E R R O R _ V A R I A B L E _ p k g _ e r r o r _ o u t
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
E R R O R _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
if ( NOT _pkg_error_var EQUAL 0 )
message ( STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed" )
message ( STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}" )
message ( STATUS "pkg-config call failed with error code:${_pkg_error_var}" )
message ( STATUS "pkg-config output:${_pkg_output}" )
message ( FATAL_ERROR "pkg-config error output:${_pkg_error_out}" )
else ( )
debug_message ( "pkg-config returned:${_pkg_error_var}" )
debug_message ( "pkg-config output:${_pkg_output}" )
debug_message ( "pkg-config error output:${_pkg_error_out}" )
endif ( )
# Get all required libs. --static means we get all libraries required for static linkage
# which is the worst case and includes the case without --static
# This retests already tested *.pc files since pkg-config will recursivly search for
# required packages and add there link flags to the one being tested
# as such NOT_STATIC_PKGCONFIG might be used to deactivate the --static arg to pkg-config
execute_process ( COMMAND "${pkg_cfg_cmd}" --print-errors ${ PKGCONFIG_STATIC } --libs ${ _package_name }
W O R K I N G _ D I R E C T O R Y " $ { C U R R E N T _ B U I L D T R E E S _ D I R } "
R E S U L T _ V A R I A B L E _ p k g _ e r r o r _ v a r
O U T P U T _ V A R I A B L E _ p k g _ l i b s _ o u t p u t
E R R O R _ V A R I A B L E _ p k g _ e r r o r _ o u t
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
E R R O R _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
if ( NOT _pkg_error_var EQUAL 0 )
message ( STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs ${_package_name} failed" )
message ( STATUS "pkg-config call failed with error code:${_pkg_error_var}" )
message ( STATUS "pkg-config output:${_pkg_libs_output}" )
message ( FATAL_ERROR "pkg-config error output:${_pkg_error_out}" )
else ( )
debug_message ( "pkg-config returned:${_pkg_error_var}" )
debug_message ( "pkg-config output:${_pkg_libs_output}" )
debug_message ( "pkg-config error output:${_pkg_error_out}" )
endif ( )
execute_process ( COMMAND "${pkg_cfg_cmd}" --print-errors --static --libs-only-L ${ _package_name }
W O R K I N G _ D I R E C T O R Y " $ { C U R R E N T _ B U I L D T R E E S _ D I R } "
R E S U L T _ V A R I A B L E _ p k g _ e r r o r _ v a r
O U T P U T _ V A R I A B L E _ p k g _ l i b _ p a t h s _ o u t p u t
E R R O R _ V A R I A B L E _ p k g _ e r r o r _ o u t
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
E R R O R _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
if ( NOT _pkg_error_var EQUAL 0 )
message ( STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --libs-only-L ${_package_name} failed" )
message ( STATUS "pkg-config call failed with error code:${_pkg_error_var}" )
message ( STATUS "pkg-config output:${_pkg_lib_paths_output}" )
message ( FATAL_ERROR "pkg-config error output:${_pkg_error_out}" )
else ( )
debug_message ( "pkg-config returned:${_pkg_error_var}" )
debug_message ( "pkg-config output:${_pkg_lib_paths_output}" )
debug_message ( "pkg-config error output:${_pkg_error_out}" )
endif ( )
string ( REPLACE "\\ " "##" _pkg_lib_paths_output "${_pkg_lib_paths_output}" ) # Whitespace path protection
string ( REGEX REPLACE "(^[\t ]*|[\t ]+)-L" ";" _pkg_lib_paths_output "${_pkg_lib_paths_output}" )
debug_message ( "-L LIST TRANSFORMATION:'${_pkg_lib_paths_output}'" )
string ( REGEX REPLACE "^[\t ]*;" "" _pkg_lib_paths_output "${_pkg_lib_paths_output}" )
string ( REPLACE "##" "\\ " _pkg_lib_paths_output "${_pkg_lib_paths_output}" )
list ( REMOVE_DUPLICATES _pkg_lib_paths_output ) # We don't care about linker order and repeats
## Remove search paths from LIBS
foreach ( _search_path IN LISTS _pkg_lib_paths_output )
debug_message ( "REMOVING:'${_search_path}'" )
debug_message ( "FROM:'${_pkg_libs_output}'" )
string ( REGEX REPLACE "(^[\t ]*|[\t ]+|;[\t ]*)-L${_search_path}([\t ]+|[\t ]*$)" ";" _pkg_libs_output "${_pkg_libs_output}" ) # Remove search paths from libs
endforeach ( )
debug_message ( "LIBS AFTER -L<path> REMOVAL:'${_pkg_libs_output}'" )
#Make the remaining libs a proper CMake List
string ( REPLACE "\\ " "##" _pkg_libs_output "${_pkg_libs_output}" ) # Whitespace path protection
string ( REGEX REPLACE "(^[\t ]*|[\t ]+)-l" ";-l" _pkg_libs_output "${_pkg_libs_output}" )
string ( REGEX REPLACE "[\t ]*(-pthreads?)" ";\\1" _pkg_libs_output "${_pkg_libs_output}" ) # handle pthread without -l here (makes a lot of problems otherwise)
string ( REGEX REPLACE "^[\t ]*;[\t ]*" "" _pkg_libs_output "${_pkg_libs_output}" )
string ( REPLACE "##" "\\ " _pkg_libs_output "${_pkg_libs_output}" )
#Windows path transformations
if ( CMAKE_HOST_WIN32 )
string ( REGEX REPLACE "(^|;)/([a-zA-Z])/" "\\1\\2:/" _pkg_lib_paths_output "${_pkg_lib_paths_output}" )
string ( REGEX REPLACE " /([a-zA-Z])/" ";\\1:/" _pkg_libs_output "${_pkg_libs_output}" )
string ( REGEX REPLACE "-l/([a-zA-Z])/" "-l\\1:/" _pkg_libs_output "${_pkg_libs_output}" )
debug_message ( "pkg-config output lib paths after replacement (cmake style):${_pkg_lib_paths_output}" )
debug_message ( "pkg-config output lib after replacement (cmake style):${_pkg_libs_output}" )
endif ( )
2020-04-28 03:37:55 +03:00
if ( "${_config}" STREQUAL "DEBUG" )
2020-07-24 21:39:21 +03:00
set ( lib_suffixes d _d _debug -s -sd _s _sd -static -staticd _static _staticd )
2020-04-28 03:37:55 +03:00
elseif ( "${_config}" STREQUAL "RELEASE" )
2020-07-24 21:39:21 +03:00
set ( lib_suffixes -s _s -static _static )
2020-04-28 03:37:55 +03:00
else ( )
message ( FATAL_ERROR "Unknown configuration in vcpkg_fixup_pkgconfig_check_libraries!" )
endif ( )
2020-07-24 21:39:21 +03:00
debug_message ( "IGNORED FLAGS:'${_ignore_flags}'" )
debug_message ( "BEFORE IGNORE FLAGS REMOVAL: ${_pkg_libs_output}" )
foreach ( _ignore IN LISTS _ignore_flags ) # Remove ignore with whitespace
debug_message ( "REMOVING FLAG:'${_ignore}'" )
string ( REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_ignore}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}" )
debug_message ( "AFTER REMOVAL: ${_pkg_libs_output}" )
2020-04-28 03:37:55 +03:00
endforeach ( )
[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-06-30 20:40:18 +03:00
2020-07-24 21:39:21 +03:00
string ( REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}" ) # Double ;; and Whitespace before/after ; removal
2020-04-28 03:37:55 +03:00
2020-07-24 21:39:21 +03:00
debug_message ( "SYSTEM LIBRARIES:'${_system_libs}'" )
debug_message ( "LIBRARIES in PC:'${_pkg_libs_output}'" )
foreach ( _system_lib IN LISTS _system_libs ) # Remove system libs with whitespace
debug_message ( "REMOVING:'${_system_lib}'" )
debug_message ( "FROM:'${_pkg_libs_output}'" )
string ( REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}" )
string ( REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}" )
string ( TOLOWER "${_system_lib}" _system_lib_lower )
string ( REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)(-l?)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\3" _pkg_libs_output "${_pkg_libs_output}" )
string ( REGEX REPLACE "(^[\t ]*|;[\t ]*|[\t ]+)${_system_lib_lower}([\t ]+|[\t ]*;|[\t ]*$)" "\\2" _pkg_libs_output "${_pkg_libs_output}" )
debug_message ( "AFTER REMOVAL:'${_pkg_libs_output}'" )
endforeach ( )
list ( REMOVE_DUPLICATES _pkg_libs_output ) # We don't care about linker order and repeats
2020-04-28 03:37:55 +03:00
2020-07-24 21:39:21 +03:00
string ( REGEX REPLACE ";?[\t ]*;[\t ]*" ";" _pkg_libs_output "${_pkg_libs_output}" ) # Double ;; and Whitespace before/after ; removal
debug_message ( "Library search paths:${_pkg_lib_paths_output}" )
debug_message ( "Libraries to search:${_pkg_libs_output}" )
set ( CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP ${ CMAKE_FIND_LIBRARY_SUFFIXES } )
list ( APPEND CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a )
foreach ( _lib IN LISTS _pkg_libs_output )
if ( EXISTS "${_lib}" OR "x${_lib}x" STREQUAL "xx" ) # eat; all ok _lib is a fullpath to a library or empty
2020-04-28 03:37:55 +03:00
continue ( )
2020-07-24 21:39:21 +03:00
elseif ( _lib MATCHES "^-l(.+)$" )
debug_message ( "Library match: CMAKE_MATCH_1:${CMAKE_MATCH_1}" )
set ( _libname "${CMAKE_MATCH_1}" )
if ( EXISTS "${_libname}" )
debug_message ( "${_libname} detected as an existing full path!" )
continue ( ) # fullpath in -l argument and exists; all ok
2020-04-28 03:37:55 +03:00
endif ( )
2020-07-24 21:39:21 +03:00
debug_message ( "CHECK_LIB_${_libname}_${_config} before: ${CHECK_LIB_${_libname}_${_config}}" )
find_library ( CHECK_LIB_ ${ _libname } _ ${ _config } NAMES ${ _libname } PATHS ${ _pkg_lib_paths_output } "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH )
debug_message ( "CHECK_LIB_${_libname}_${_config} after: ${CHECK_LIB_${_libname}_${_config}}" )
if ( CHECK_LIB_ ${ _libname } _ ${ _config } )
unset ( CHECK_LIB_ ${ _libname } _ ${ _config } CACHE ) # need to unset or else other configurations will not check correctly
debug_message ( "CHECK_LIB_${_libname}_${_config} after unset: ${CHECK_LIB_${_libname}_${_config}}" )
continue ( ) # found library; all ok
2020-04-28 03:37:55 +03:00
endif ( )
2020-07-24 21:39:21 +03:00
debug_message ( "Searching with additional suffixes: '${lib_suffixes}'" )
foreach ( _lib_suffix IN LISTS lib_suffixes )
string ( REPLACE ".dll.a|.a|.lib|.so" "" _name_without_extension "${_libname}" )
set ( search_name ${ _name_without_extension } ${ _lib_suffix } )
debug_message ( "Search name: '${search_name}'" )
debug_message ( "CHECK_LIB_${search_name}_${_config} before: ${CHECK_LIB_${search_name}_${_config}}" )
debug_message ( "Search paths:'${_pkg_lib_paths_output}' '${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib'" )
find_library ( CHECK_LIB_ ${ search_name } _ ${ _config } NAMES ${ search_name } PATHS ${ _pkg_lib_paths_output } "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib" NO_DEFAULT_PATH )
debug_message ( "CHECK_LIB_${search_name}_${_config} after: ${CHECK_LIB_${search_name}_${_config}}" )
if ( CHECK_LIB_ ${ search_name } _ ${ _config } )
message ( FATAL_ERROR "Found ${CHECK_LIB_${search_name}_${_config}} with additional '${_lib_suffix}' suffix! Please correct the *.pc file!" )
unset ( CHECK_LIB_ ${ search_name } _ ${ _config } CACHE ) # need to unset or else other configurations will not check correctly
2020-04-28 03:37:55 +03:00
endif ( )
2020-07-24 21:39:21 +03:00
endforeach ( )
# Reaching here means error!
message ( STATUS "CHECK_LIB_${_libname}_${_config}:${CHECK_LIB_${_libname}_${_config}}" )
message ( FATAL_ERROR "Library \" ${ _libname } \" was not found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file " )
else ( )
message ( FATAL_ERROR "Unhandled string \" ${ _lib } \" was found! If it is a system library use the SYSTEM_LIBRARIES parameter for the vcpkg_fixup_pkgconfig call! Otherwise, correct the *.pc file or add the case to vcpkg_fixup_pkgconfig " )
2020-04-28 03:37:55 +03:00
endif ( )
endforeach ( )
set ( CMAKE_FIND_LIBRARY_SUFFIXES ${ CMAKE_FIND_LIBRARY_SUFFIXES_BACKUP } )
endfunction ( )
function ( vcpkg_fixup_pkgconfig )
2020-07-24 21:39:21 +03:00
cmake_parse_arguments ( _vfpkg "SKIP_CHECK;NOT_STATIC_PKGCONFIG" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS" ${ ARGN } )
[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-06-30 20:40:18 +03:00
2020-07-24 21:39:21 +03:00
# Note about SYSTEM_PACKAGES: pkg-config requires all packages mentioned in pc files to exists. Otherwise pkg-config will fail to find the pkg.
# As such naming any SYSTEM_PACKAGES is damned to fail which is why it is not mentioned in the docs at the beginning.
2020-06-25 00:59:32 +03:00
if ( VCPKG_SYSTEM_LIBRARIES )
list ( APPEND _vfpkg_SYSTEM_LIBRARIES ${ VCPKG_SYSTEM_LIBRARIES } )
2020-04-28 03:37:55 +03:00
endif ( )
2020-07-24 21:39:21 +03:00
if ( _vfpkg_NOT_STATIC_PKGCONFIG )
set ( PKGCONFIG_STATIC )
else ( )
set ( PKGCONFIG_STATIC --static )
endif ( )
2020-04-28 03:37:55 +03:00
if ( _vfpkg_UNPARSED_ARGUMENTS )
message ( FATAL_ERROR "vcpkg_fixup_pkgconfig was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}" )
endif ( )
if ( NOT _vfpkg_RELEASE_FILES )
file ( GLOB_RECURSE _vfpkg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc" )
list ( FILTER _vfpkg_RELEASE_FILES EXCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/" )
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-06-30 20:40:18 +03:00
2020-04-28 03:37:55 +03:00
if ( NOT _vfpkg_DEBUG_FILES )
file ( GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc" )
list ( FILTER _vfpkg_DEBUG_FILES INCLUDE REGEX "${CURRENT_PACKAGES_DIR}/debug/" )
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-06-30 20:40:18 +03:00
2020-08-18 22:16:39 +03:00
vcpkg_find_acquire_program ( PKGCONFIG )
debug_message ( "Using pkg-config from: ${PKGCONFIG}" )
2020-07-24 21:39:21 +03:00
#Absolute Unix like paths
2020-04-28 03:37:55 +03:00
string ( REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}" )
string ( REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_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-06-30 20:40:18 +03:00
2020-08-18 22:16:39 +03:00
debug_message ( "Release Files: ${_vfpkg_RELEASE_FILES}" )
2020-04-28 03:37:55 +03:00
foreach ( _file ${ _vfpkg_RELEASE_FILES } )
2020-08-18 22:16:39 +03:00
message ( STATUS "Fixing pkgconfig file: ${_file}" )
2020-04-28 03:37:55 +03:00
get_filename_component ( PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY )
file ( RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}" )
string ( REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}" )
2020-07-24 21:39:21 +03:00
#Correct *.pc file
2020-04-28 03:37:55 +03:00
file ( READ "${_file}" _contents )
string ( REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}" )
2020-07-24 21:39:21 +03:00
string ( REGEX REPLACE "^prefix=(\" ) ? ( \ \ \ \ ) ? \ \ \ $ { p r e f i x } ( \ " ) ? " " p r e f i x = \ $ { p c f i l e d i r } / $ { R E L A T I V E _ P C _ P A T H } " _ c o n t e n t s " $ { _ c o n t e n t s } " ) # make pc file relocatable
string ( REGEX REPLACE "[\n]prefix=(\" ) ? ( \ \ \ \ ) ? \ \ \ $ { p r e f i x } ( \ " ) ? " " \ n p r e f i x = \ $ { p c f i l e d i r } / $ { R E L A T I V E _ P C _ P A T H } " _ c o n t e n t s " $ { _ c o n t e n t s } " ) # make pc file relocatable
2020-04-28 03:37:55 +03:00
file ( WRITE "${_file}" "${_contents}" )
unset ( PKG_LIB_SEARCH_PATH )
endforeach ( )
[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-06-30 20:40:18 +03:00
2020-07-24 21:39:21 +03:00
if ( NOT _vfpkg_SKIP_CHECK ) # The check can only run after all files have been corrected!
foreach ( _file ${ _vfpkg_RELEASE_FILES } )
vcpkg_fixup_pkgconfig_check_files ( "${PKGCONFIG}" "${_file}" "RELEASE" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}" )
endforeach ( )
endif ( )
2020-08-18 22:16:39 +03:00
debug_message ( "Debug Files: ${_vfpkg_DEBUG_FILES}" )
2020-04-28 03:37:55 +03:00
foreach ( _file ${ _vfpkg_DEBUG_FILES } )
2020-08-18 22:16:39 +03:00
message ( STATUS "Fixing pkgconfig file: ${_file}" )
2020-04-28 03:37:55 +03:00
get_filename_component ( PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY )
file ( RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/" )
string ( REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}" )
string ( REGEX REPLACE "/pkgconfig/?" "" PKG_LIB_SEARCH_PATH "${PKG_LIB_SEARCH_PATH}" )
2020-07-24 21:39:21 +03:00
#Correct *.pc file
2020-04-28 03:37:55 +03:00
file ( READ "${_file}" _contents )
string ( REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}" )
string ( REPLACE "debug/include" "../include" _contents "${_contents}" )
string ( REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}" )
string ( REPLACE "debug/share" "../share" _contents "${_contents}" )
string ( REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}" )
string ( REPLACE "debug/lib" "lib" _contents "${_contents}" ) # the prefix will contain the debug keyword
2020-07-24 21:39:21 +03:00
string ( REGEX REPLACE "^prefix=(\" ) ? ( \ \ \ \ ) ? \ \ \ $ { p r e f i x } ( / d e b u g ) ? ( \ " ) ? " " p r e f i x = \ $ { p c f i l e d i r } / $ { R E L A T I V E _ P C _ P A T H } " _ c o n t e n t s " $ { _ c o n t e n t s } " ) # make pc file relocatable
string ( REGEX REPLACE "[\n]prefix=(\" ) ? ( \ \ \ \ ) ? \ \ \ $ { p r e f i x } ( / d e b u g ) ? ( \ " ) ? " " \ n p r e f i x = \ $ { p c f i l e d i r } / $ { R E L A T I V E _ P C _ P A T H } " _ c o n t e n t s " $ { _ c o n t e n t s } " ) # make pc file relocatable
string ( REPLACE "\${prefix}/debug" "\${prefix}" _contents "${_contents}" ) # replace remaining debug paths if they exist.
2020-04-28 03:37:55 +03:00
file ( WRITE "${_file}" "${_contents}" )
unset ( PKG_LIB_SEARCH_PATH )
endforeach ( )
2020-07-24 21:39:21 +03:00
if ( NOT _vfpkg_SKIP_CHECK ) # The check can only run after all files have been corrected!
foreach ( _file ${ _vfpkg_DEBUG_FILES } )
vcpkg_fixup_pkgconfig_check_files ( "${PKGCONFIG}" "${_file}" "DEBUG" "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_IGNORE_FLAGS}" )
endforeach ( )
endif ( )
2020-08-18 22:16:39 +03: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-06-30 20:40:18 +03:00
set ( VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE )
# Variable to check if this function has been called!
2020-04-28 03:37:55 +03: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-06-30 20:40:18 +03:00
# or check if this function has been called if *.pc files are detected.
2020-04-28 03:37:55 +03:00
# The same is true for vcpkg_fixup_cmake_targets
endfunction ( )
# script to test the function locally without running vcpkg. Uncomment fix filepaths and use cmake -P vcpkg_fixup_pkgconfig
# set(_file "G:\\xlinux\\packages\\xlib_x64-windows\\lib\\pkgconfig\\x11.pc")
# include(${CMAKE_CURRENT_LIST_DIR}/vcpkg_common_definitions.cmake)
# file(READ "${_file}" _contents)
# set(CURRENT_INSTALLED_DIR "G:/xlinux/installed/x64-windows")
# set(CURRENT_PACKAGES_DIR "G:/xlinux/packages/xlib_x64-windows")
# set(_vfpkg_SYSTEM_LIBRARIES "blu\\ ub")
# set(_vfpkg_SYSTEM_PACKAGES "szip")
# vcpkg_fixup_pkgconfig_check_libraries("RELEASE" _contents "${_vfpkg_SYSTEM_LIBRARIES}" "${_vfpkg_SYSTEM_PACKAGES}")