From 991b144a94ebd54a5218d1c313ffd136fcd91455 Mon Sep 17 00:00:00 2001 From: Christopher Meng Date: Mon, 9 Mar 2015 18:13:40 +0800 Subject: [PATCH] Add LIB_SUFFIX option to cmake Red Hat, Fedora and some other distributions use /usr/lib64 for location of libraries to avoid collision when multilib is being used, thus /usr/lib64 should be taken care of. Fedora packagers build software with %cmake macro, with LIB_SUFFIX defined in rpmbuild to help build this policy, furthermore please view: http://pkgs.fedoraproject.org/cgit/cmake.git/tree/macros.cmake#n31 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b62d16..17f744d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,10 +108,10 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) - +set(LIB_SUFFIX "" CACHE STRING "Define suffix of libdir" ) set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix ${prefix}/bin) -set(libdir ${prefix}/lib) +set(libdir ${prefix}/lib${LIB_SUFFIX}) set(includedir ${prefix}/include) get_filename_component(antlr3c_library_path "${ANTLR3C_LIBRARIES}" PATH) set(LIBS_PRIVATE "-L${antlr3c_library_path} -lantlr3c") @@ -195,7 +195,7 @@ configure_file(cmake/BelleSIPConfig.cmake.in @ONLY ) -set(ConfigPackageLocation lib/cmake/BelleSIP) +set(ConfigPackageLocation ${libdir}/cmake/BelleSIP) install(EXPORT BelleSIPTargets FILE BelleSIPTargets.cmake NAMESPACE BelledonneCommunications::