Skip to content

Commit

Permalink
Add GNUInstallDirs CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-moulard committed Jul 3, 2013
1 parent aea1c66 commit e27ac3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set (URDF_VERSION ${URDF_MAJOR_VERSION}.${URDF_MINOR_VERSION}.${URDF_PATCH_VERSI

message (STATUS "${PROJECT_NAME} version ${URDF_VERSION}")

include(GNUInstallDirs)

# set the default build type
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
Expand Down Expand Up @@ -45,7 +47,8 @@ set(PKG_LIBRARIES urdfdom_sensor urdfdom_model_state urdfdom_model urdfdom_world
set(PKG_DEPENDS urdfdom_headers console_bridge)
set(cmake_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/cmake/urdfdom-config.cmake")
configure_file("${cmake_conf_file}.in" "${cmake_conf_file}" @ONLY)
install(FILES ${cmake_conf_file} DESTINATION share/${PROJECT_NAME}/cmake/ COMPONENT cmake)
install(FILES ${cmake_conf_file}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake/ COMPONENT cmake)

# Make the package config file
if (NOT MSVC)
Expand All @@ -54,7 +57,8 @@ if (NOT MSVC)
set(PKG_URDF_LIBS "-lurdfdom_sensor -lurdfdom_model_state -lurdfdom_model -lurdfdom_world")
set(pkg_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig/urdfdom.pc")
configure_file("${pkg_conf_file}.in" "${pkg_conf_file}" @ONLY)
install(FILES ${pkg_conf_file} DESTINATION lib/pkgconfig/ COMPONENT pkgconfig)
install(FILES ${pkg_conf_file}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ COMPONENT pkgconfig)
endif()


Expand Down
13 changes: 7 additions & 6 deletions urdf_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ add_executable(urdf_mem_test test/memtest.cpp)
target_link_libraries(urdf_mem_test urdfdom_model)


INSTALL(TARGETS urdfdom_model DESTINATION lib/)
INSTALL(TARGETS urdfdom_world DESTINATION lib/)
INSTALL(TARGETS check_urdf urdf_to_graphiz urdf_mem_test DESTINATION share/${PROJECT_NAME})
INSTALL(TARGETS urdfdom_sensor DESTINATION lib/)
INSTALL(TARGETS urdfdom_model_state DESTINATION lib/)
INSTALL(DIRECTORY include/urdf_parser DESTINATION include)
INSTALL(TARGETS urdfdom_model DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS urdfdom_world DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS check_urdf urdf_to_graphiz urdf_mem_test
DESTINATION ${CMAKE_INSTALL_BINDIR})
INSTALL(TARGETS urdfdom_sensor DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(TARGETS urdfdom_model_state DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(DIRECTORY include/urdf_parser DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

0 comments on commit e27ac3b

Please sign in to comment.