-
Notifications
You must be signed in to change notification settings - Fork 11
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
Dependency target install paths and expanding INSTALL_RPATH #133
Merged
Conversation
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
I made this a draft since it seems like it's still a work in progress. |
@ryanmrichard I checked that this builds, the tests work, and the Python bindings test script works on my local system as well. |
ryanmrichard
approved these changes
Nov 17, 2023
🚀 [bumpr] Bumped! New version:v0.2.0 Changes:v0.1.11...v0.2.0 |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Is this pull request associated with an issue(s)?
I'm not sure about a specific issue, but there are RPATH issues with CMaize project installations right now and a fix was attempted in #110 but ultimately it was closed without a definitive solution.
Description
This PR lays the groundwork to append the installation paths of dependency targets to the rpath of the main target(s) that the CMaize project is defining. It adds an
install_path
attribute to the CMaizeTarget class and abuild_path
attribute to the BuildTarget class (not actually used for this, but useful down the road for helping Python tests find things). Whencmaize_add_package()
is called at the end of the CMakeLists.txt file, theinstall_path
s for all of a target's dependencies will be appended to its INSTALL_RPATH property, which translates into the rpath added to the resulting library or executable.Currently, the
install_path
attributes are not being filled, so it essentially results in a no-op that maintains the status quo of CMaize. However, if theinstall_path
attributes can be populated correctly, the install locations of all dependency targets should be added to the project's main targets rpaths, fixing our long-standing rpath issues. Using the CMaizePublicDepend test repo, I set the install path of the dependency, CMakePublic, to/example/install/path/to/CMakePublic/lib
manually and the resulting INSTALL_RPATH value for CMaizePublicDepend included this new install path, showing that this implementation seems to be working:Notes
Using the (potentially non-exhaustive) list of target properties from https://www.kitware.com//cmake-target-properties/, I added a loop at the end of the CMakeLists.txt file in our CMaizePublicDepend test project, printing the values of all of the properties for the CMaizePublicDepend target and CMakePublic imported target. No property contained installation information, even though
install()
commands were guaranteed to have been applied to the targets by the end of the file (afaik). The following are the property values that were extracted:CMakePublic
CMaizePublicDepend
On macOS Ventura, the same example installation path was added to CMakePublic and was successfully added to the
libCMaizePublicDepend.1.0.0.dylib
rpath. Output fromotool -l libCMaizePublicDepend.1.0.0.dylib
shows it added to the rpath:TODOs
install_path
property (probably push to an issue and later PR).