Skip to content

Commit

Permalink
Use GNUInstallDirs for lib/include path (#1241)
Browse files Browse the repository at this point in the history
* Use GNUInstallDirs for lib/include path

* Use GNUInstallDirs for share path as well

* Update changelog
  • Loading branch information
j-rivero authored and jslee02 committed Feb 13, 2019
1 parent 252c6f4 commit aed4905
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

* Fixed linking error of FLANN by explicitly linking to lz4: [#1221](https://github.com/dartsim/dart/pull/1221)

* Build system

* Changed to use GNUInstallDirs for install paths: [#1241](https://github.com/dartsim/dart/pull/1241)

#### Compilers Tested

* Linux
Expand Down
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif()

include(GNUInstallDirs)

# Variables used in Components.cmake
set(INCLUDE_INSTALL_DIR "include")
set(LIBRARY_INSTALL_DIR "lib")
set(CONFIG_INSTALL_DIR "share/${PROJECT_NAME}/cmake")
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake")

# Set relative location to install additional documentation (sample data,
# examples, and tutorials)
set(DART_ADDITIONAL_DOCUMENTATION_INSTALL_PATH "share/doc/${PROJECT_NAME}")
set(DART_ADDITIONAL_DOCUMENTATION_INSTALL_PATH
"${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}"
)

set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
Expand Down Expand Up @@ -369,10 +373,12 @@ if(DART_VERBOSE)
message(STATUS ${PC_CONFIG_OUT})
endif()
configure_file(${PC_CONFIG_IN} ${PC_CONFIG_OUT} @ONLY)
install(FILES ${PC_CONFIG_OUT} DESTINATION lib/pkgconfig)
install(FILES ${PC_CONFIG_OUT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

# Install a Catkin 'package.xml' file. This is required by REP-136.
install(FILES package.xml DESTINATION share/${PROJECT_NAME})
install(FILES package.xml DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}
)

#===============================================================================
# Install sample data, examples, and tutorials
Expand Down

0 comments on commit aed4905

Please sign in to comment.