-
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 11 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 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -98,6 +98,15 @@ set(KVZ_COMPILER_STRING "${KVZ_COMPILER_VERSION}") | |||||||||||||
|
||||||||||||||
add_definitions(-DCMAKE_BUILD) | ||||||||||||||
|
||||||||||||||
# Set correct pkgconfig libdir variable | ||||||||||||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") | ||||||||||||||
set(KVAZAAR_PC_LIBDIR "${CMAKE_INSTALL_LIBDIR}") | ||||||||||||||
set(KVAZAAR_PC_INCDIR "${CMAKE_INSTALL_INCLUDEDIR}") | ||||||||||||||
else() | ||||||||||||||
set(KVAZAAR_PC_LIBDIR "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") | ||||||||||||||
set(KVAZAAR_PC_INCDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") | ||||||||||||||
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
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. Silly me. Although it would have worked most of the time:) 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. Probably, but there is no guarantee I guess! |
||||||||||||||
endif() | ||||||||||||||
|
||||||||||||||
# Apply dynamic info to the config files | ||||||||||||||
configure_file("${PROJECT_SOURCE_DIR}/src/kvazaarCMake.pc.in" "${PROJECT_SOURCE_DIR}/src/kvazaar.pc" @ONLY) | ||||||||||||||
configure_file("${PROJECT_SOURCE_DIR}/src/version.h.in" "${PROJECT_SOURCE_DIR}/src/version.h" @ONLY) | ||||||||||||||
|
@@ -173,7 +182,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_LIBDIR}" "./" "../lib" ) | ||||||||||||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) | ||||||||||||||
add_library(kvazaar SHARED ${LIB_SOURCES}) | ||||||||||||||
else() | ||||||||||||||
|
@@ -231,6 +240,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 +291,13 @@ source_group( "" FILES ${SOURCE_GROUP_TOPLEVEL}) | |||||||||||||
|
||||||||||||||
# ToDo: make configurable | ||||||||||||||
|
||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig) | ||||||||||||||
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||||||||||||||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) | ||||||||||||||
if(KVZ_BUILD_SHARED_LIBS) # Just add the lib to the bin directory for now | ||||||||||||||
if(MSVC) | ||||||||||||||
install(TARGETS kvazaar DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | ||||||||||||||
endif() | ||||||||||||||
endif() | ||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include) | ||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/doc/kvazaar.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man) | ||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||||||||||||||
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||||||||||||||
install(TARGETS kvazaar | ||||||||||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||||||||||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||||||||||||||
install(FILES ${PROJECT_SOURCE_DIR}/doc/kvazaar.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) | ||||||||||||||
|
||||||||||||||
IF(UNIX) | ||||||||||||||
# DIST | ||||||||||||||
|
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.