The cmake build files used some self-named variables or fixed value. Replace them by the new GNUInstallDirs.cmake that introduces variables as defined for GNU autotools. --- CMakeLists.txt | 21 +++++---------------- apps/CMakeLists.txt | 2 +- apps/ircp/CMakeLists.txt | 2 +- apps/obex_test/CMakeLists.txt | 2 +- doc/CMakeLists.txt | 6 +++--- lib/CMakeLists.txt | 8 ++++---- udev/CMakeLists.txt | 8 ++++---- 7 files changed, 19 insertions(+), 30 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a2bde4..fe1d8d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required ( VERSION 2.6.3 FATAL_ERROR ) +cmake_minimum_required ( VERSION 2.8.5 FATAL_ERROR ) project ( openobex C ) @@ -31,6 +31,7 @@ if ( NOT CMAKE_BUILD_TYPE ) endif ( NOT CMAKE_BUILD_TYPE ) include ( MaintainerMode ) +include ( GNUInstallDirs ) # # define how to build libraries @@ -112,8 +113,8 @@ endif ( OPENOBEX_BLUETOOTH ) # set ( prefix "${CMAKE_INSTALL_PREFIX}" ) set ( exec_prefix "\${prefix}" ) -set ( libdir "\${prefix}/lib${LIB_SUFFIX}" ) -set ( includedir "\${prefix}/include" ) +set ( libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}" ) +set ( includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}" ) set ( top_srcdir "${CMAKE_SOURCE_DIR}" ) set ( top_builddir "${CMAKE_BINARY_DIR}" ) if ( OPENOBEX_BLUETOOTH AND UNIT AND NOT WIN32 ) @@ -141,7 +142,7 @@ configure_file ( ) if ( NOT PKGCONFIG_INSTALL_DIR ) - set ( PKGCONFIG_INSTALL_DIR lib${LIB_SUFFIX}/pkgconfig + set ( PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH "Where to install .pc files to" FORCE ) endif ( NOT PKGCONFIG_INSTALL_DIR ) mark_as_advanced ( PKGCONFIG_INSTALL_DIR ) @@ -179,18 +180,6 @@ add_subdirectory ( apps ) # option ( BUILD_DOCUMENTATION "Build library and application documentation" ON) if ( BUILD_DOCUMENTATION ) - if ( NOT DOCUMENTATION_INSTALL_DIR ) - set ( DOCUMENTATION_INSTALL_DIR share/doc/openobex - CACHE PATH "Where to install generic documentation files to" FORCE ) - endif ( NOT DOCUMENTATION_INSTALL_DIR ) - mark_as_advanced ( DOCUMENTATION_INSTALL_DIR ) - - if ( NOT MANPAGE_INSTALL_DIR ) - set ( MANPAGE_INSTALL_DIR share/man - CACHE PATH "Where to install manpage files to" FORCE ) - endif ( NOT MANPAGE_INSTALL_DIR ) - mark_as_advanced ( MANPAGE_INSTALL_DIR ) - add_subdirectory ( doc ) endif ( BUILD_DOCUMENTATION ) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 0e27baf..55268ca 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -37,7 +37,7 @@ foreach ( prog ${OPENOBEX_APPS} ) target_link_libraries ( ${prog} ${${prog}_LIBS} ) get_target_property ( ${prog}_EXECUTABLE ${prog} LOCATION ) install ( PROGRAMS ${${prog}_EXECUTABLE} - DESTINATION bin + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL ) diff --git a/apps/ircp/CMakeLists.txt b/apps/ircp/CMakeLists.txt index 51b230b..ceef156 100644 --- a/apps/ircp/CMakeLists.txt +++ b/apps/ircp/CMakeLists.txt @@ -12,7 +12,7 @@ add_executable ( ircp EXCLUDE_FROM_ALL ${ircp_SOURCES} ) target_link_libraries ( ircp openobex ) get_target_property ( ircp_EXECUTABLE ircp LOCATION ) install ( PROGRAMS ${ircp_EXECUTABLE} - DESTINATION bin + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL ) diff --git a/apps/obex_test/CMakeLists.txt b/apps/obex_test/CMakeLists.txt index 4c12457..a920149 100644 --- a/apps/obex_test/CMakeLists.txt +++ b/apps/obex_test/CMakeLists.txt @@ -18,7 +18,7 @@ endif ( WIN32 ) get_target_property ( obex_test_EXECUTABLE obex_test LOCATION ) install ( PROGRAMS ${obex_test_EXECUTABLE} - DESTINATION bin + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT applications OPTIONAL ) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index bc0afae..2257410 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -48,7 +48,7 @@ if ( DOXYGEN_FOUND ) add_dependencies ( doc apidoc_html ) install ( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" - DESTINATION ${DOCUMENTATION_INSTALL_DIR} + DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation ) endif ( DOXYGEN_FOUND ) @@ -72,7 +72,7 @@ if ( Docbook_FOUND ) string ( REGEX REPLACE "^[.]" "" fileExt ${fileExt} ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} - DESTINATION ${MANPAGE_INSTALL_DIR}/man${fileExt} + DESTINATION ${CMAKE_INSTALL_MANDIR}/man${fileExt} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ @@ -89,7 +89,7 @@ if ( Docbook_FOUND ) list ( APPEND OPENOBEX_HELP_FILES ${file} ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${file} - DESTINATION ${DOCUMENTATION_INSTALL_DIR} + DESTINATION ${CMAKE_INSTALL_DOCDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f404529..90da714 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -193,10 +193,10 @@ set_property ( TARGET openobex PROPERTY ) install ( TARGETS openobex - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib${LIB_SUFFIX} - ARCHIVE DESTINATION lib${LIB_SUFFIX} - PUBLIC_HEADER DESTINATION include/openobex + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openobex COMPONENT library ) diff --git a/udev/CMakeLists.txt b/udev/CMakeLists.txt index 5185b44..69e2d80 100644 --- a/udev/CMakeLists.txt +++ b/udev/CMakeLists.txt @@ -2,18 +2,18 @@ if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" AND OPENOBEX_USB ) add_executable ( obex-check-device obex-check-device.c ) target_link_libraries ( obex-check-device openobex ) install ( TARGETS obex-check-device - DESTINATION sbin + DESTINATION ${CMAKE_INSTALL_SBINDIR} COMPONENT system ) # The udev rules file needs to be configured to have the right # path to obex-check-device. configure_file ( openobex.rules.in openobex.rules @ONLY ) - set ( UDEV_RULES_INSTALL_DIR /lib/udev/rules.d + set ( CMAKE_INSTALL_UDEVRULESDIR /lib/udev/rules.d CACHE PATH "Where to install udev rules" ) - mark_as_advanced ( UDEV_RULES_INSTALL_DIR ) + mark_as_advanced ( CMAKE_INSTALL_UDEVRULESDIR ) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/openobex.rules - DESTINATION ${UDEV_RULES_INSTALL_DIR} + DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR} COMPONENT system RENAME 60-openobex.rules ) -- 1.7.5.4 ------------------------------------------------------------------------------ AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on "Lean Startup Secrets Revealed." This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev _______________________________________________ Openobex-users mailing list Openobex-users@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/openobex-users