Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg_fixup_cmake_targets] Fix up OSX system development path #16706

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
20e3836
[vcpkg_fixup_cmake_targets] Fix up OSX system development path
Mar 15, 2021
7b57ce2
fixing scripts tree rules
strega-nil Mar 15, 2021
0e1daee
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
JackBoosY Mar 21, 2021
34669a6
Merge branch 'master' of https://github.com/JackBoosY/vcpkg into dev/…
Apr 4, 2021
473fc2c
Update ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
JackBoosY Apr 14, 2021
8e6212d
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
JackBoosY Apr 14, 2021
151d004
Update ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
JackBoosY Apr 16, 2021
e6b400e
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
JackBoosY Apr 16, 2021
f41fb50
Update ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
JackBoosY Apr 16, 2021
12ecd4c
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
JackBoosY Apr 16, 2021
5b66887
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
JackBoosY Apr 20, 2021
80d5126
Update ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
JackBoosY Apr 20, 2021
73714eb
Fix exported osx framework config
dg0yt May 16, 2021
3ffe3d1
Revise patterns
dg0yt May 16, 2021
1d85d58
Match line from keyword to newline
dg0yt May 16, 2021
da963a4
Fix usage of vcpkg_internal_get_cmake_vars
dg0yt May 19, 2021
6f629ad
Fix pattern matching
dg0yt May 19, 2021
f112ecf
Copy changes to vcpkg_fixup_cmake_targets.cmake
dg0yt May 19, 2021
d77688e
Use separate build dir for getting cmake vars
dg0yt May 19, 2021
17ab5e6
Use pristine get_cmake_vars
dg0yt May 19, 2021
d71129e
Fix variable name
dg0yt May 29, 2021
96c2367
Merge pull request #2 from dg0yt/osx-framework-config
JackBoosY May 31, 2021
3415629
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jun 2, 2021
f251599
Merge branch 'dev/jack/16259' of https://github.com/JackBoosY/vcpkg i…
Jun 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,38 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(WRITE "${main_cmake}" "${contents}")
endforeach()

if (VCPKG_TARGET_IS_OSX)
# see #16259 for details why this replacement is necessary.
file(GLOB_RECURSE targets_files "${release_share}/*[Tt]argets.cmake")
if (targets_files STREQUAL "")
file(GLOB_RECURSE targets_files "${release_share}/*[Cc]onfig.cmake")
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
endif()
foreach(targets_file IN LISTS targets_files)
file(READ "${targets_file}" targets_content)

string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${targets_content}")
string(REGEX REPLACE
[[/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]]
[[-framework \1]]
fixed_contents
"${library_contents}"
)
string(REGEX REPLACE
[[/Library/Developer/CommandLineTools/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]]
[[-framework \1]]
fixed_contents
"${fixed_contents}"
)
string(REGEX REPLACE
"${library_contents}"
"${fixed_contents}"
targets_content
"${targets_content}"
)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
file(WRITE "${targets_file}" "${targets_content}")
endforeach()
endif()

# Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE remaining_files "${debug_share}/*")
if(NOT remaining_files STREQUAL "")
Expand All @@ -233,5 +265,3 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
endfunction()


34 changes: 32 additions & 2 deletions scripts/cmake/vcpkg_fixup_cmake_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,38 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${MAIN_CMAKE} "${_contents}")
endforeach()

if (VCPKG_TARGET_IS_OSX)
# see #16259 for details why this replacement is necessary.
file(GLOB_RECURSE targets_files "${RELEASE_SHARE}/*[Tt]argets.cmake")
if (targets_files STREQUAL "")
file(GLOB_RECURSE targets_files "${release_share}/*[Cc]onfig.cmake")
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
endif()
foreach(targets_file IN LISTS targets_files)
file(READ "${targets_file}" targets_content)

string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${targets_content}")
string(REGEX REPLACE
[[/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]]
[[-framework \1]]
fixed_contents
"${library_contents}"
)
string(REGEX REPLACE
[[/Library/Developer/CommandLineTools/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]]
[[-framework \1]]
fixed_contents
"${fixed_contents}"
)
string(REGEX REPLACE
"${library_contents}"
"${fixed_contents}"
targets_content
"${targets_content}"
)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
file(WRITE "${targets_file}" "${targets_content}")
endforeach()
endif()

# Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*")
if(NOT REMAINING_FILES)
Expand All @@ -242,5 +274,3 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${CMAKE_FILE} "${_contents}")
endforeach()
endfunction()