Commit 16b76171 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: fix creating zip using 7z on windows (mxe)

parent 8452cdb7
......@@ -69,10 +69,11 @@ get_filename_component(SUPERBUILD_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
get_filename_component(OTB_SOURCE_DIR ${SUPERBUILD_SOURCE_DIR} PATH)
if(MSVC)
find_program(ZIP_EXECUTABLE 7z)
if(WIN32)
set(ZIP_EXE_NAMES 7z 7za)
find_program(ZIP_EXECUTABLE NAMES ${ZIP_EXE_NAMES})
if(NOT ZIP_EXECUTABLE)
message(FATAL_ERROR "Cannot find 7z.exe. Please add it to your path")
message(FATAL_ERROR "Cannot find 7z executable. searched names ${ZIP_EXE_NAMES}. Please add it to your path")
endif()
endif()
......
......@@ -119,8 +119,8 @@ macro(macro_create_targets_for_package pkg)
# creation of package is different from windows and unix like
if(WIN32)
add_custom_target(PACKAGE-${pkg}
COMMAND ${ZIP_EXECUTABLE} "a"
"-ry" "${CMAKE_BINARY_DIR}/${archive_name}.zip" "${archive_name}/*"
COMMAND ${ZIP_EXECUTABLE} "a" "-r" "-y"
"${CMAKE_BINARY_DIR}/${archive_name}.zip" "${archive_name}/*"
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
DEPENDS PACKAGE-${pkg}-build
COMMENT "Creating ${CMAKE_BINARY_DIR}/${archive_name}.zip"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment