-
Notifications
You must be signed in to change notification settings - Fork 320
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
Fix absolute libdirpath builds #75
Fix absolute libdirpath builds #75
Conversation
e57dcd5
to
5a8678a
Compare
CMakeLists.txt
Outdated
if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") | ||
set(CMAKE_INSTALL_LIBDIR_PREFIX "${CMAKE_INSTALL_LIBDIR}") | ||
else() | ||
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
set(CMAKE_INSTALL_LIBDIR_PREFIX "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") | ||
endif() | ||
|
||
install(FILES "${DCMTK_BINARY_DIR}/dcmtk.pc" | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR_PREFIX}/pkgconfig |
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.
I think you can simplify these two hunks to just:
- DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
CMake will ensure that CMAKE_INSTALL_LIBDIR gets prefixed as needed.
I think you mean CMAKE_INSTALL_LIBDIR here, becasue CAKE_INSTALL_FULL_LIBDIR is always absolute. |
5a8678a
to
99beb12
Compare
Yes this is what I meant |
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.
LGTM.
Nit: the PR message still mentions the wrong variable. |
In theory, I could merge this, yes :-) I am not familiar with this part of the CMake toolchain files in DCMTK, I will check tomorrow with someone from the team. Is the patch "clean" meanwhile (variable naming,..)? Are you quite sure it doesn't hurt on other OS? Thank you for the contribution :) |
Thanks @michaelonken, sorry for the terse message (which I deleted), I thought I was commenting on another PR. @StillerHarpo are you able to answer the above questions? |
After talking to the rest of the DCMTK yesterday: If the patch is confirmed (from your side) to be clean, I'm ready to merge it :) |
I build dcmtk with this patch on rasbian and it worked (only other os i have besides NixOS :)) The second hunch (in |
I think the 2nd hunk is a good idea, ref #75 (comment). (Actually I'm surprised it worked without it on NixOS.) |
@bjornfor it's not just NixOS, worked on ubuntu when installed with nixpkgs |
@cfhammill: yes, I should have said nixpkgs, not nixos. Nixpkgs builds the same no matter what distro you run it on. |
@michaelonken I'm comfortable merging this |
I merged this into DCMTK's internal testing branch (04b0d6c). The commit will be visible on public master within the next days. Thank you for the patch :-) |
This fixes builds where CMAKE_INSTALL_LIBDIR is absolute. This is the case on nixos (NixOS/nixpkgs#144170)