@@ -91,20 +91,44 @@ endmacro()
9191# subdirectory named after the library in question (e.g.
9292# "registration/blorgle.h")
9393macro (SET_INSTALL_DIRS )
94+ include (GNUInstallDirs )
95+
9496 if (NOT DEFINED LIB_INSTALL_DIR)
95- set (LIB_INSTALL_DIR "lib" )
97+ set (LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} )
98+ endif ()
99+
100+ if (NOT ANDROID )
101+ set (INCLUDE_INSTALL_ROOT
102+ "${CMAKE_INSTALL_INCLUDEDIR} /${PROJECT_NAME_LOWER} -${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR} " )
103+ else ()
104+ set (INCLUDE_INSTALL_ROOT ${CMAKE_INSTALL_INCLUDEDIR} ) # Android, don't put into subdir
105+ endif ()
106+
107+ if (NOT DEFINED INCLUDE_INSTALL_DIR)
108+ set (INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT} /pcl" )
109+ endif ()
110+
111+ if (NOT DEFINED DOC_INSTALL_DIR)
112+ set (DOC_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR} " )
96113 endif ()
97- if (NOT ANDROID )
98- set (INCLUDE_INSTALL_ROOT
99- "include/${PROJECT_NAME_LOWER} -${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR} " )
114+
115+ if (NOT DEFINED BIN_INSTALL_DIR)
116+ set (BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR} " )
117+ endif ()
118+
119+ if (NOT DEFINED PKGCFG_INSTALL_DIR)
120+ set (PKGCFG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
121+ endif ()
122+
123+ if (NOT DEFINED PCLCONFIG_INSTALL_DIR)
124+ if (WIN32 AND NOT MINGW)
125+ set (PCLCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR} /cmake" )
100126 else ()
101- set (INCLUDE_INSTALL_ROOT "include" ) # Android, don't put into subdir
127+ # Most distributions install cmake config files in /usr/lib*/cmake
128+ # and not in /usr/share/cmake.
129+ set (PCLCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR} /cmake/${PROJECT_NAME_LOWER} -${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR} " )
102130 endif ()
103- set (INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT} /pcl" )
104- set (DOC_INSTALL_DIR "share/doc/${PROJECT_NAME_LOWER} -${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR} " )
105- set (BIN_INSTALL_DIR "bin" )
106- set (PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR} /pkgconfig" )
107- set (PCLCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR} /cmake" )
131+ endif ()
108132endmacro ()
109133
110134
0 commit comments