From aa18348cf01ca7d0c16c4de7d706a20c087e3a05 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Tue, 20 Nov 2018 11:55:59 -0800 Subject: [PATCH] cmake: fix library installation path (again) --- CMakeLists.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9cfacc1..9fba8d7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -134,6 +123,7 @@ if(LIBSSH_FOUND) endif(LIBSSH_FOUND) # '#include ' 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}") @@ -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(