diff --git a/CMakeLists.txt b/CMakeLists.txt index 18aed5b..8c7b1ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,10 +52,11 @@ if (CMAKE_INSTALL_PREFIX) set (CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}" ${CMAKE_PREFIX_PATH}) endif (CMAKE_INSTALL_PREFIX) +include (GNUInstallDirs) find_package (bpp-seq 11.0.0 REQUIRED) # CMake package -set (cmake-package-location lib/cmake/${PROJECT_NAME}) +set (cmake-package-location ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) include (CMakePackageConfigHelpers) configure_package_config_file ( package.cmake.in diff --git a/bpp-popgen.spec b/bpp-popgen.spec index 1fe5bad..72d58c0 100644 --- a/bpp-popgen.spec +++ b/bpp-popgen.spec @@ -58,9 +58,6 @@ building applications which use %{_basename}. %build CFLAGS="$RPM_OPT_FLAGS" CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_TESTING=OFF" -if [ %{_lib} == 'lib64' ] ; then - CMAKE_FLAGS="$CMAKE_FLAGS -DLIB_SUFFIX=64" -fi cmake $CMAKE_FLAGS . make @@ -82,11 +79,11 @@ rm -rf $RPM_BUILD_ROOT %files -n libbpp-popgen-devel %defattr(-,root,root) %doc AUTHORS.txt COPYING.txt INSTALL.txt ChangeLog -%dir %{_prefix}/lib/cmake/ -%dir %{_prefix}/lib/cmake/bpp-popgen +%dir %{_prefix}/%{_lib}/cmake/ +%dir %{_prefix}/%{_lib}/cmake/bpp-popgen %{_prefix}/%{_lib}/lib*.so %{_prefix}/%{_lib}/lib*.a -%{_prefix}/lib/cmake/bpp-popgen/bpp-popgen*.cmake +%{_prefix}/%{_lib}/cmake/bpp-popgen/bpp-popgen*.cmake %{_prefix}/include/* %changelog diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f9c111b..e9bf638 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,7 +43,7 @@ set (CPP_FILES add_library (${PROJECT_NAME}-static STATIC ${CPP_FILES}) target_include_directories (${PROJECT_NAME}-static PUBLIC $ - $/include> + $/${CMAKE_INSTALL_INCLUDEDIR}> ) set_target_properties (${PROJECT_NAME}-static PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) target_link_libraries (${PROJECT_NAME}-static ${BPP_LIBS_STATIC}) @@ -52,7 +52,7 @@ target_link_libraries (${PROJECT_NAME}-static ${BPP_LIBS_STATIC}) add_library (${PROJECT_NAME}-shared SHARED ${CPP_FILES}) target_include_directories (${PROJECT_NAME}-shared PUBLIC $ - $/include> + $/${CMAKE_INSTALL_INCLUDEDIR}> ) set_target_properties (${PROJECT_NAME}-shared PROPERTIES OUTPUT_NAME ${PROJECT_NAME} @@ -66,12 +66,13 @@ target_link_libraries (${PROJECT_NAME}-shared ${BPP_LIBS_SHARED}) install ( TARGETS ${PROJECT_NAME}-static ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bpp - DESTINATION include + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" ) # Install cmake file representing targets