[llvm] 27c4b50 - [CMake]Allow user specified CPack Options
Tobias Hieta via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 01:58:44 PST 2022
Author: HanSheng Zhang
Date: 2022-12-06T10:58:38+01:00
New Revision: 27c4b509cdf344129ae05330e1912ac4281343bd
URL: https://github.com/llvm/llvm-project/commit/27c4b509cdf344129ae05330e1912ac4281343bd
DIFF: https://github.com/llvm/llvm-project/commit/27c4b509cdf344129ae05330e1912ac4281343bd.diff
LOG: [CMake]Allow user specified CPack Options
This should allow downstream vendors to install multiple LLVM distributions in parallel.
Should we also patch the default values to allow multiple upstream llvm distribution?
Reviewed By: thieta
Differential Revision: https://reviews.llvm.org/D138632
Added:
Modified:
llvm/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 253511415606..0d6da9212713 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -325,23 +325,31 @@ set(BUG_REPORT_URL "${PACKAGE_BUGREPORT}" CACHE STRING
"Default URL where bug reports are to be submitted.")
# Configure CPack.
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "LLVM")
-set(CPACK_PACKAGE_VENDOR "LLVM")
+if(NOT DEFINED CPACK_PACKAGE_INSTALL_DIRECTORY)
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "LLVM")
+endif()
+if(NOT DEFINED CPACK_PACKAGE_VENDOR)
+ set(CPACK_PACKAGE_VENDOR "LLVM")
+endif()
set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${LLVM_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT")
-set(CPACK_NSIS_COMPRESSOR "/SOLID lzma \r\n SetCompressorDictSize 32")
if(WIN32 AND NOT UNIX)
- set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "LLVM")
+ set(CPACK_NSIS_COMPRESSOR "/SOLID lzma \r\n SetCompressorDictSize 32")
+ if(NOT DEFINED CPACK_PACKAGE_INSTALL_REGISTRY_KEY)
+ set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "LLVM")
+ endif()
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_logo.bmp")
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_icon.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_icon.ico")
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
if( CMAKE_CL_64 )
- set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+ if(NOT DEFINED CPACK_NSIS_INSTALL_ROOT)
+ set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+ endif()
endif()
endif()
include(CPack)
More information about the llvm-commits
mailing list