-
Notifications
You must be signed in to change notification settings - Fork 573
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
cmake: add support for DESTDIR install relocation #5152
Conversation
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.
Thank you for the patch. I had a few comments/requests/questions.
add to whitelist |
run arm tests |
CMake might change the value of CMAKE_INSTALL_PREFIX on the fly at install time in case the install is relocated via DESTDIR. This is only supported in case the paths of the install target are encoded as relative path. These paths are anyways located relative to the CMAKE_INSTALL_PREFIX, so manually specifying the prefix there is not required. This patch enables a user to install multiple DynamoRIO versions simultaneously and to switch between them by using tools like xstow. It also helps as a preparation to package DynamoRIO for Linux distributions like Debian. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
d222c3e
to
cd42080
Compare
This patch replaces the install(CODE) commands that generate files on the fly. Instead, the files are generated at configuration time and just copied at install time. By that, install relocation via various strategies like DESTDIR and CPack works correctly. Further, this gets rid of a lot of complex escaping and makes the results more predictable. When appending to cmake-generated files, we also ensure that the file is cleared on a re-configuration run to avoid duplicates in the file. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
The initial strategy did not work under e.g. CPack. In general, the One thing I stumbles upon, but let it as it is: DR_target_install(CODE "file(APPEND \"${PROJECT_BINARY_DIR}/CMakeFiles/Export/cmake/${exported_targets_name}.cmake\" \"${exported_targets_append}\")") There, files in the PROJECT_BINARY_DIR are modified. This just works because the command will be executed prior to the target install (can be checked by reading @derekbruening : Could you please trigger the pipeline, so I can compare the generated packages? |
Thank you for the contribution. |
…5152) This patch replaces the install(CODE) commands that generate files on the fly. Instead, the files are generated at configuration time and just copied at install time. By that, install relocation via various strategies like DESTDIR and CPack works correctly. Further, this gets rid of a lot of complex escaping and makes the results more predictable. When appending to cmake-generated files, we also ensure that the file is cleared on a re-configuration run to avoid duplicates in the file. This patch enables a user to install multiple DynamoRIO versions simultaneously and to switch between them by using tools like xstow. It also helps as a preparation to package DynamoRIO for Linux distributions like Debian. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> Issue: #5153
CMake might change the value of CMAKE_INSTALL_PREFIX on the fly at
install time in case the install is relocated via DESTDIR.
This is only supported in case the paths of the install target are
encoded as relative path.
These paths are anyways located relative to the CMAKE_INSTALL_PREFIX,
so manually specifying the prefix there is not required.
This patch enables a user to install multiple DynamoRIO versions
simultaneously and to switch between them by using tools like xstow.
It also helps as a preparation to package DynamoRIO for Linux
distributions like Debian.
Signed-off-by: Felix Moessbauer felix.moessbauer@siemens.com