mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 05:11:15 -06:00
These modules are not meant to be included by user code, they are only an internal implementation detail for CPack. Having them live in the main Modules directory with documentation was misleading, so they have been moved into Modules/Internal/CPack, and their documentation has been stripped following its move into the new "CPack Generators" section. No-op modules which contained only documentation have been removed entirely. The only module that hasn't been moved is CPackIFW, because it contains user-facing macros which would be lost if it were moved. So, the CPackIFW module has been updated with a note explaining what needs to (eventually) happen.
31 lines
986 B
CMake
31 lines
986 B
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
|
|
|
|
if(CMAKE_BINARY_DIR)
|
|
message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
|
|
endif()
|
|
|
|
find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
|
|
if(ZIP_EXECUTABLE)
|
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
|
|
set(CPACK_ZIP_NEED_QUOTES TRUE)
|
|
endif()
|
|
|
|
if(NOT ZIP_EXECUTABLE)
|
|
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
|
|
if(ZIP_EXECUTABLE)
|
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
|
|
set(CPACK_ZIP_NEED_QUOTES TRUE)
|
|
endif()
|
|
endif()
|
|
|
|
if(NOT ZIP_EXECUTABLE)
|
|
find_package(Cygwin)
|
|
find_program(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
|
|
if(ZIP_EXECUTABLE)
|
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
|
|
set(CPACK_ZIP_NEED_QUOTES FALSE)
|
|
endif()
|
|
endif()
|