-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[scripts] add new function vcpkg_fixup_pkgconfig #9861
Merged
strega-nil
merged 12 commits into
microsoft:master
from
Neumann-A:add_vcpkg_fixup_pkgconfig
Apr 28, 2020
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
df57a82
add new function vcpkg_fixup_pkgconfig
Neumann-A 8c89d6e
make message with changed files a debug_message
Neumann-A fd3d35d
add two more cases to the debug *.pc files
Neumann-A 1b1d944
comment out prefix.
Neumann-A d7e2962
changed the comment header.
Neumann-A f4bfe74
add missing word
Neumann-A 982c921
Merge branch 'master' into add_vcpkg_fixup_pkgconfig
Neumann-A 3e0dd50
finish vcpkg_fixup_pkgconfig.cmake
Neumann-A a3d4a0b
Update vcpkg_fixup_pkgconfig.cmake
Neumann-A efbf912
transfer changes from x windows pr
Neumann-A a7c6c6c
fix typo in regex
Neumann-A c21893a
make the regex comment aware
Neumann-A File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#.rst: | ||
# .. command:: vcpkg_fixup_pkgconfig | ||
# | ||
# Tries to fix the paths found in *.pc files | ||
|
||
function(vcpkg_fixup_pkgconfig) | ||
cmake_parse_arguments(_vfpkg "" "" "RELEASE_FILES;DEBUG_FILES" ${ARGN}) | ||
|
||
message(STATUS "Fixing pkgconfig") | ||
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() | ||
|
||
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() | ||
|
||
message(STATUS "Fixing pkgconfig - release") | ||
message(STATUS "Files: ${_vfpkg_RELEASE_FILES}") | ||
vicroms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
foreach(_file ${_vfpkg_RELEASE_FILES}) | ||
file(READ "${_file}" _contents) | ||
string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") | ||
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") | ||
string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") | ||
vicroms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
file(WRITE "${_file}" "${_contents}") | ||
endforeach() | ||
|
||
message(STATUS "Fixing pkgconfig - debug") | ||
message(STATUS "Files: ${_vfpkg_DEBUG_FILES}") | ||
foreach(_file ${_vfpkg_DEBUG_FILES}) | ||
file(READ "${_file}" _contents) | ||
string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") | ||
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") | ||
string(REPLACE "debug/include" "../include" _contents "${_contents}") | ||
string(REPLACE "debug/share" "../share" _contents "${_contents}") | ||
string(REPLACE "debug/lib" "lib" _contents "${_contents}") # the prefix will contain the debug keyword | ||
string(REGEX REPLACE "^prefix=\\\${prefix}" "prefix=${CURRENT_INSTALLED_DIR}" _contents "${_contents}") | ||
file(WRITE "${_file}" "${_contents}") | ||
endforeach() | ||
message(STATUS "Fixing pkgconfig --- finished") | ||
endfunction() | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a note: we use a different comment style, which is extracted into
.md
files viadocs/regenerate.ps1
. See some other helpers likevcpkg_configure_cmake()
for examples.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed but still not sure if its 100% correct.