-
Notifications
You must be signed in to change notification settings - Fork 185
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
Minor cmake fixes #385
Minor cmake fixes #385
Changes from 1 commit
12a6915
0802a0d
ecbc1a4
ebbdaac
1492496
3697d38
0c3b5d0
fe021f4
d1bde02
426a7d1
6c7722e
f282d16
ce2799d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ if (USE_CRYPTO) | |
endif () | ||
|
||
if(KVZ_BUILD_SHARED_LIBS) | ||
list( APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" "./" "../lib" ) | ||
list( APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}" "./" "../lib" ) | ||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||
add_library(kvazaar SHARED ${LIB_SOURCES}) | ||
else() | ||
|
@@ -282,9 +282,9 @@ source_group( "" FILES ${SOURCE_GROUP_TOPLEVEL}) | |
|
||
# ToDo: make configurable | ||
|
||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig) | ||
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) | ||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) | ||
if(KVZ_BUILD_SHARED_LIBS) # Just add the lib to the bin directory for now | ||
if(MSVC) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this MSVC only? One can build shared libs on Also, maybe there is no need to special case this anyway? If you do
this will work out for shared and static libraries for all platforms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
RUNTIME is not being installed that way. Do I need to define it somewhere first? |
||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, here you actually don't want an absolute path always in order to enable a relocatable package... Instead, one has to check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And while you're doing that, you'll realize there's no need for two separate .pc.in templates, you're setting a couple of placeholder variables anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Considering that the kvazaarCMake.pc.in is based on the one that is used by uvg266, we are going to be maintaining two templates regardless, unless automake can also use the CMake version. Additionally, the template has been updated literally once, nine years ago, it is not really an issue to have two templates, even if it is not an optimal solution. If you are adamant on us not having two templates on this repository I will accept a PR, but please submit a similar PR for uvg266 also. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not. Just sharing what has become sort of "best practice" I've experienced across several imaging related libraries, especially ones that are (or were) supporting both autotools and cmake, like libtiff and libheif for example. I see no reason not to reuse it... It's of course your prerogative how you want to maintain your repositories, and apologies to have annoyed you with my comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I understand why having two templates cannot be considered a best practice. However, considering the low maintenance needed for these files, and the fact that we aim not to support both autotools and cmake, but replace autotools with cmake, I'm fine with not following best practices here. For your other suggestions I'm grateful, as I have very little experience with CMake.
I interpreted your usage of ellipsis as a criticism towards the fact that I was not aware of the best practices, which I assume was not the intention? I would like to apologize for my maybe overly harsh comments towards you. Otherwise, in your opinion, does the current state of the PR adhere to the best practices? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem. There's just two more minor details, I'll leave comments on the latest commits. |
||
incdir=${prefix}/include | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
|
||
Name: libkvazaar | ||
|
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.
Use CMAKE_INSTALL_BINDIR