-
Notifications
You must be signed in to change notification settings - Fork 184
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 4 commits
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}/lib" "./" "../lib" ) | ||||||
list( APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" "./" "../lib" ) | ||||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||||||
add_library(kvazaar SHARED ${LIB_SOURCES}) | ||||||
else() | ||||||
|
@@ -231,6 +231,7 @@ else() | |||||
set(EXTRA_LIBS ${EXTRA_LIBS} ${CMAKE_BINARY_DIR}/lib/libcryptopp.a) | ||||||
endif () | ||||||
|
||||||
target_link_libraries(kvazaar PUBLIC ${EXTRA_LIBS}) | ||||||
target_link_libraries(kvazaar-bin PUBLIC ${EXTRA_LIBS} ) | ||||||
endif() | ||||||
|
||||||
|
@@ -281,16 +282,16 @@ source_group( "" FILES ${SOURCE_GROUP_TOPLEVEL}) | |||||
|
||||||
# ToDo: make configurable | ||||||
|
||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig) | ||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||||||
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||||||
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. Use CMAKE_INSTALL_BINDIR |
||||||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||||||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_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) | ||||||
endif() | ||||||
endif() | ||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.h DESTINATION ${CMAKE_INSTALL_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. Use |
||||||
install(FILES ${PROJECT_SOURCE_DIR}/doc/kvazaar.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man) | ||||||
install(FILES ${PROJECT_SOURCE_DIR}/doc/kvazaar.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1) | ||||||
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.
Suggested change
|
||||||
|
||||||
IF(UNIX) | ||||||
# DIST | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
libdir=${prefix}/lib | ||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
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.
Great, but
CMAKE_INSTALL_LIBDIR
can be an absolute path on some platforms like NixOS... Perhaps just use${CMAKE_INSTALL_FULL_LIBDIR}
instead of${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
?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 remember that problem on openSUSE, years ago. I thought it had been solved. Not everywhere, it comes out.