[libcxx-commits] [pstl] c90d136 - [pstl][cmake] Use `GNUInstallDirs` to support custom installation dirs
John Ericson via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jan 17 12:04:49 PST 2022
Author: John Ericson
Date: 2022-01-17T20:04:46Z
New Revision: c90d136be4e055f1b409f38706d0fe3e2211af08
URL: https://github.com/llvm/llvm-project/commit/c90d136be4e055f1b409f38706d0fe3e2211af08
DIFF: https://github.com/llvm/llvm-project/commit/c90d136be4e055f1b409f38706d0fe3e2211af08.diff
LOG: [pstl][cmake] Use `GNUInstallDirs` to support custom installation dirs
I am breaking apart D99484 so the cause of build failures is easier to
understand.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D117418
Added:
Modified:
pstl/CMakeLists.txt
Removed:
################################################################################
diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
index 181f1164cf456..8784eb07b5742 100644
--- a/pstl/CMakeLists.txt
+++ b/pstl/CMakeLists.txt
@@ -7,6 +7,8 @@
#===----------------------------------------------------------------------===##
cmake_minimum_required(VERSION 3.13.4)
+include(GNUInstallDirs)
+
set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
@@ -90,10 +92,10 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfigVersion.cmake"
DESTINATION lib/cmake/ParallelSTL)
install(DIRECTORY include/
- DESTINATION include
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
PATTERN "*.in" EXCLUDE)
install(FILES "${PSTL_CONFIG_SITE_PATH}"
- DESTINATION include)
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
add_custom_target(install-pstl
COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_install.cmake" -DCOMPONENT=ParallelSTL)
More information about the libcxx-commits
mailing list