Skip to content
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: fix library installation path (again) #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ if(NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
find_library(RT_LIB rt)
endif(NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")

# note: this must be before the include() directives below since
# these directives will change CMAKE_INSTALL_LIBDIR to an absolute path
if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
set (PKG_CONFIG_LIBDIR ${CMAKE_INSTALL_LIBDIR})
set (RTRLIB_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
else()
set (PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
set (RTRLIB_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
endif(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})

include(UseMultiArch) # needed for debian packaging
include(GNUInstallDirs) # for man page install path

set(RTRLIB_SRC rtrlib/rtr_mgr.c rtrlib/lib/utils.c rtrlib/lib/alloc_utils.c rtrlib/lib/convert_byte_order.c
Expand Down Expand Up @@ -109,7 +98,7 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/rtrlib/rtrlib.h.cmake ${CMAKE_SOURCE_DIR}/rtr
set(LIBRARY_VERSION ${RTRLIB_VERSION_MAJOR}.${RTRLIB_VERSION_MINOR}.${RTRLIB_VERSION_PATCH})
set(LIBRARY_SOVERSION ${RTRLIB_VERSION_MAJOR})
set_target_properties(rtrlib PROPERTIES SOVERSION ${LIBRARY_SOVERSION} VERSION ${LIBRARY_VERSION} OUTPUT_NAME rtr)
install(TARGETS rtrlib LIBRARY DESTINATION ${RTRLIB_INSTALL_LIBDIR}/)
install(TARGETS rtrlib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/)


# Get lists of all headers
Expand All @@ -134,6 +123,7 @@ if(LIBSSH_FOUND)
endif(LIBSSH_FOUND)

# '#include <rtrlib/rtrlib.h>' includes the "rtrlib/"
set (PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
set (PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
set (PKG_CONFIG_LIBS "-L\${libdir} -lrtr")
set (PKG_CONFIG_CFLAGS "-I\${includedir}")
Expand All @@ -144,7 +134,7 @@ configure_file (
)
install (
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION "${RTRLIB_INSTALL_LIBDIR}/pkgconfig"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
#add uninstall target
configure_file(
Expand Down