Skip to content

Commit 0212293

Browse files
cmake: Install cmake files in a more common path (#366)
Install cmake files in prefix/lib/cmake/pcre2 rather than prefix/cmake Add PCRE2_INSTALL_CMAKEDIR, as suggested by Alex Reinking --------- Co-authored-by: Alex Reinking <alex_reinking@berkeley.edu>
1 parent ab8052e commit 0212293

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ option(PCRE2_SHOW_REPORT "Show the final configuration report" ON)
351351
option(PCRE2_BUILD_PCRE2GREP "Build pcre2grep" ON)
352352
option(PCRE2_BUILD_TESTS "Build the tests" ON)
353353

354+
set(
355+
PCRE2_INSTALL_CMAKEDIR
356+
"${CMAKE_INSTALL_LIBDIR}/cmake/pcre2"
357+
CACHE STRING
358+
"Path used during CMake install for placing PCRE2's CMake config files, relative to the installation root (prefix)"
359+
)
360+
354361
if(MINGW)
355362
option(
356363
NON_STANDARD_LIB_PREFIX
@@ -1257,7 +1264,7 @@ configure_file(${PCRE2_CONFIG_IN} ${PCRE2_CONFIG_OUT} @ONLY)
12571264
set(PCRE2_CONFIG_VERSION_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/pcre2-config-version.cmake.in)
12581265
set(PCRE2_CONFIG_VERSION_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/pcre2-config-version.cmake)
12591266
configure_file(${PCRE2_CONFIG_VERSION_IN} ${PCRE2_CONFIG_VERSION_OUT} @ONLY)
1260-
install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION cmake)
1267+
install(FILES ${PCRE2_CONFIG_OUT} ${PCRE2_CONFIG_VERSION_OUT} DESTINATION "${PCRE2_INSTALL_CMAKEDIR}")
12611268

12621269
file(GLOB html ${PROJECT_SOURCE_DIR}/doc/html/*.html)
12631270
file(GLOB man1 ${PROJECT_SOURCE_DIR}/doc/*.1)

0 commit comments

Comments
 (0)