From b5b8940d0baa5b0fb11f2abe1459f9d711f56c0f Mon Sep 17 00:00:00 2001
From: Rashad Kanavath <rashad.kanavath@c-s.fr>
Date: Wed, 25 Nov 2015 12:37:36 +0100
Subject: [PATCH] copy otbgui* scripts into mingw package

---
 CMake/MinGWPackage.cmake | 10 +++++-----
 CMakeLists.txt           |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/CMake/MinGWPackage.cmake b/CMake/MinGWPackage.cmake
index 672d8a00e0..ab4d361da3 100644
--- a/CMake/MinGWPackage.cmake
+++ b/CMake/MinGWPackage.cmake
@@ -1,9 +1,9 @@
 macro(package_mingw)
-  cmake_parse_arguments(PACKAGE  "" "PREFIX_DIR;ARCH;MXEROOT;USE_QT4" "SEARCHDIRS;PEFILES" ${ARGN} )
+  cmake_parse_arguments(PACKAGE  "" "PREFIX_DIR;ARCH;MXEROOT;WITH_OTBGUI" "SEARCHDIRS;PEFILES" ${ARGN} )
 
   list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherCommandLine.exe)
   list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver.exe)
-  if(PACKAGE_USE_QT4)
+  if(PACKAGE_WITH_OTBGUI)
     list(APPEND PACKAGE_PEFILES ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLauncherQt.exe)
   endif()
 
@@ -21,7 +21,7 @@ macro(package_mingw)
   list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/bin") #mvd
   list(APPEND PACKAGE_SEARCHDIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/applications") #otb apps
 
-  install_common()
+  install_common(${PACKAGE_WITH_OTBGUI})
 
   file(GLOB otbapps_list ${CMAKE_INSTALL_PREFIX}/lib/otb/applications/otbapp_*dll) # /lib/otb
   list(APPEND PACKAGE_PEFILES ${otbapps_list})
@@ -136,7 +136,7 @@ function(process_deps infile)
    endif()
 endfunction()
 
-function(install_common)
+function(install_common with_otbgui)
   set(APP_PREFIX_DIR "${PACKAGE_PREFIX_DIR}")
   set(APP_BIN_DIR "${APP_PREFIX_DIR}/bin")
   set(APP_OTBLIBS_DIR "${APP_PREFIX_DIR}/lib/otb")
@@ -172,7 +172,7 @@ function(install_common)
       DESTINATION ${APP_BIN_DIR})
   endforeach()
 
-  if(OTB_USE_QT4)
+  if(with_otbgui)
     file(GLOB GUI_SCRIPTS ${CMAKE_INSTALL_PREFIX}/bin/otbgui*)
     foreach(GUI_SCRIPT ${GUI_SCRIPTS})
       install(
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a60016330..e9c7cf3093 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -439,7 +439,7 @@ if(WIN32 AND CMAKE_CROSSCOMPILING)
         MXEROOT \"${mxeroot}\"
         PREFIX_DIR \"${archive_name}\"
         PEFILES \"${pefiles}\"
-        USE_QT4 1
+        WITH_OTBGUI 1
         SEARCHDIRS \"\")")
 
     add_custom_target(configure-mingw
@@ -456,7 +456,7 @@ if(WIN32 AND CMAKE_CROSSCOMPILING)
     find_program(ZIP_EXECUTABLE zip)
 
     if(ZIP_EXECUTABLE)
-      add_custom_target(package-mingw
+      add_custom_target(packages
         COMMAND ${ZIP_EXECUTABLE} "-r" "${CMAKE_BINARY_DIR}/${archive_name}.zip" "${archive_name}"
         WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
         DEPENDS prepare-mingw)
-- 
GitLab