Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GNUInstallDirs to set installation locations #5497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PCLConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ if(WIN32 AND NOT MINGW)
set(PCL_ALL_IN_ONE_INSTALLER ON)
endif()
else()
# PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y
get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
# PCLConfig.cmake is installed to PCL_ROOT/lib*/cmake/pcl-x.y
get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
endif()

# check whether PCLConfig.cmake is found into a PCL installation or in a build tree
Expand Down
42 changes: 28 additions & 14 deletions cmake/pcl_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,44 @@ endmacro()

###############################################################################
# Set the destination directories for installing stuff.
# We use GNUInstallDirs for this, to ensure platform indepence.
# Sets LIB_INSTALL_DIR. Install libraries here.
# Sets BIN_INSTALL_DIR. Install binaries here.
# Sets INCLUDE_INSTALL_DIR. Install include files here, preferably in a
# subdirectory named after the library in question (e.g.
# "registration/blorgle.h")
include(GNUInstallDirs)
macro(SET_INSTALL_DIRS)
if(NOT DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR "lib")
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT ANDROID)
set(INCLUDE_INSTALL_ROOT
"include/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
else()
set(INCLUDE_INSTALL_ROOT "include") # Android, don't put into subdir
endif()
if(NOT ANDROID)
set(INCLUDE_INSTALL_ROOT
"${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
else()
set(INCLUDE_INSTALL_ROOT "${CMAKE_INSTALL_INCLUDEDIR}") # Android, don't put into subdir
endif()
if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT}/pcl")
set(DOC_INSTALL_DIR "share/doc/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
set(BIN_INSTALL_DIR "bin")
set(PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig")
endif()
if(NOT DEFINED DOC_INSTALL_DIR)
set(DOC_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR}")
endif()
if(NOT DEFINED BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
endif()
if(NOT DEFINED PKGCFG_INSTALL_DIR)
set(PKGCFG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()
if(NOT DEFINED PCLCONFIG_INSTALL_DIR)
if(WIN32 AND NOT MINGW)
set(PCLCONFIG_INSTALL_DIR "cmake")
else()
set(PCLCONFIG_INSTALL_DIR "share/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
endif()
set(PCLCONFIG_INSTALL_DIR "cmake")
else()
# Most distributions install cmake config files in /usr/lib*/cmake
# and not in /usr/share/cmake.
set(PCLCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
endif()
endif()
endmacro()


Expand Down