diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-16 18:36:50 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-16 18:36:50 +0100 |
commit | af7847d80c94f2b5d9012f11b60bd2cb163fc1e3 (patch) | |
tree | 5c13b22712674cba01ceabc5b5454f0264b1f082 | |
parent | d6a6948cb0bd99a21f636ad1d424bb7eec53b5a6 (diff) | |
download | fastwriter-af7847d80c94f2b5d9012f11b60bd2cb163fc1e3.tar.gz fastwriter-af7847d80c94f2b5d9012f11b60bd2cb163fc1e3.tar.bz2 fastwriter-af7847d80c94f2b5d9012f11b60bd2cb163fc1e3.tar.xz fastwriter-af7847d80c94f2b5d9012f11b60bd2cb163fc1e3.zip |
Use GNUInstallDirs to detect install paths
-rw-r--r-- | CMakeLists.txt | 30 | ||||
-rw-r--r-- | fastwriter.spec.in | 2 |
2 files changed, 4 insertions, 28 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2adae92..1eed22a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ set(DISABLE_AIO TRUE CACHE BOOL "Use kernel AIO writer") set(DISABLE_XFS_REALTIME FALSE CACHE BOOL "Disable support of RealTime XFS partition") set(USE_CUSTOM_MEMCPY FALSE CACHE BOOL "Use custom memcpy routine instead of stanadrd") +include(GNUInstallDirs) include(CheckIncludeFiles) check_include_files("linux/falloc.h" HAVE_LINUX_FALLOC_H) @@ -61,7 +62,6 @@ set(PACKAGE_TARNAME "${TARNAME}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket") - set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_PACKAGE_CONTACT "Suren A. Chilingaryan <csa@suren.me>") if (${RELEASE} GREATER 0) @@ -77,36 +77,12 @@ add_custom_target(dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTO add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_source) -if(NOT DEFINED BIN_INSTALL_DIR) - set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin") -endif(NOT DEFINED BIN_INSTALL_DIR) - -if(NOT DEFINED LIB_SUFFIX) - if (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LIB_SUFFIX "64") - else (CMAKE_SIZEOF_VOID_P EQUAL 8) - set(LIB_SUFFIX "") - endif (CMAKE_SIZEOF_VOID_P EQUAL 8) -endif(NOT DEFINED LIB_SUFFIX) - -if(NOT DEFINED LIB_INSTALL_DIR) - set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") -endif(NOT DEFINED LIB_INSTALL_DIR) - -if(NOT DEFINED INCLUDE_INSTALL_DIR) - set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include") -endif(NOT DEFINED INCLUDE_INSTALL_DIR) - -if(NOT DEFINED LOCALE_INSTALL_DIR) - set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale/") -endif(NOT DEFINED LOCALE_INSTALL_DIR) - configure_file(fastwriter.pc.in ${CMAKE_CURRENT_BINARY_DIR}/fastwriter.pc) configure_file(fastwriter.spec.in ${CMAKE_CURRENT_BINARY_DIR}/fastwriter.spec) configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) install(TARGETS fastwriter - LIBRARY DESTINATION lib${LIB_SUFFIX} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install(FILES fastwriter.h @@ -115,5 +91,5 @@ install(FILES fastwriter.h install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fastwriter.pc - DESTINATION ${LIB_INSTALL_DIR}/pkgconfig + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) diff --git a/fastwriter.spec.in b/fastwriter.spec.in index e693079..680dbc3 100644 --- a/fastwriter.spec.in +++ b/fastwriter.spec.in @@ -46,7 +46,7 @@ Development files for fastwriter %setup -q %build -cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=%{_libdir} -DBIN_INSTALL_DIR=%{_bindir} -DDATA_INSTALL_DIR=%{_datadir} -DINCLUDE_INSTALL_DIR=%{_includedir} -DCMAKE_BUILD_TYPE=Release . +cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DCMAKE_INSTALL_BINDIR=%{_bindir} -DCMAKE_INSTALL_DATADIR=%{_datadir} -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} -DCMAKE_BUILD_TYPE=Release . make %install |