2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
2009-09-28 19:46:51 +04:00
|
|
|
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(CMAKE_BINARY_DIR)
|
|
|
|
message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-07-24 20:52:39 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
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)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2007-07-24 20:52:39 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
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)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2007-07-24 20:52:39 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
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)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
2007-07-24 20:52:39 +04:00
|
|
|
|