diff --git a/CMakeLists.txt b/CMakeLists.txt index df37f8d9381d8d7b6535da9285c04f3c453dd9b4..5ded889903f0d6edfe2c05190e2360d87ee93b1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,6 +177,8 @@ add_subdirectory( Code ) # i18n directory must be added after all source files (see add_qt1_i18n_sources). add_subdirectory( i18n ) +add_subdirectory( Packaging ) + #---------------------------------------------------------------------------- # Enable / Disable testing option(BUILD_TESTING "Build testing." OFF) diff --git a/Description.txt b/Description.txt new file mode 100644 index 0000000000000000000000000000000000000000..72de38a29e95a92099474c10854ac41d7d02da0b --- /dev/null +++ b/Description.txt @@ -0,0 +1,12 @@ +Remote sensing processing library developped by CNES ORFEO Toolbox (OTB) is + distributed as an open source library of image processing algorithms. OTB is + based on the medical image processing library ITK and offers particular + functionalities for remote sensing image processing in general and for high + spatial resolution images in particular. OTB is distributed under a free + software licence CeCILL (similar to GPL) to encourage contribution from users + and to promote reproducible research. The library is intensively tested on + several platforms as Linux, Unix and Windows. Most functionnalies are also + adapted to process huge images using streaming and multithreading as often as + possible. + . + This package provide the Monteverdi2 GUI application developped on top of the OTB library \ No newline at end of file diff --git a/Packaging/CMakeLists.txt b/Packaging/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f13fabfdde9e955cde5bde93f7b64c450f216384 --- /dev/null +++ b/Packaging/CMakeLists.txt @@ -0,0 +1,49 @@ +option(Monteverdi2_USE_CPACK "Generate installer using CPack" OFF) +mark_as_advanced(Monteverdi2_USE_CPACK) + +if( Monteverdi2_USE_CPACK ) + +set(CPACK_PACKAGE_NAME "Monteverdi2") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Monteverdi2") + +set(CPACK_PACKAGE_VERSION "${Monteverdi2_VERSION_STRING}") +set(CPACK_PACKAGE_VERSION_MAJOR "${Monteverdi2_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${Monteverdi2_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${Monteverdi2_VERSION_PATCH}") + +set(CPACK_PACKAGE_CONTACT "contact@orfeo-toolbox.org" CACHE STRING "Orfeo toolbox contact email") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${Monteverdi2_SOURCE_DIR}/Description.txt") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "Monteverdi2-${Monteverdi2_VERSION_MAJOR}.${Monteverdi2_VERSION_MINOR}") +set(CPACK_RESOURCE_FILE_LICENSE "${Monteverdi2_SOURCE_DIR}/Copyright.txt") + +# http://www.vtk.org/Bug/view.php?id=7828 +# Need to use the CPACK_PACKAGE_EXECUTABLES +# otherwise the shortcut in the menu will not +# appear. +set(CPACK_PACKAGE_EXECUTABLES "monteverdi2" "Monteverdi2") + +# Manage dependencies between components +set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS Runtime) +set(CPACK_COMPONENT_RUNTIME_DEPENDS Resources) + +set(CPACK_COMPONENT_RUNTIME_REQUIRED ON) +set(CPACK_COMPONENT_RESOURCES_REQUIRED ON) +set(CPACK_COMPONENT_RESOURCES_HIDDEN ON) + +set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Monteverdi2") + +# Don't package the Developement component +set(CPACK_COMPONENTS_ALL "Runtime;Resources;Unspecified") + +if( APPLE ) + add_subdirectory( MacOS ) +endif( APPLE ) + +if( WIN32 AND NOT UNIX ) + add_subdirectory( Windows ) +endif( WIN32 AND NOT UNIX ) + +include(InstallRequiredSystemLibraries) +include(CPack) + +endif() diff --git a/Packaging/MacOS/BundleFixing.cmake b/Packaging/MacOS/BundleFixing.cmake new file mode 100644 index 0000000000000000000000000000000000000000..ebb9d5d62b0b05d19bce59fb5326a8b189022c64 --- /dev/null +++ b/Packaging/MacOS/BundleFixing.cmake @@ -0,0 +1,4 @@ + +include(BundleUtilities) +set(BU_CHMOD_BUNDLE_ITEMS ON) +fixup_bundle("${CMAKE_INSTALL_PREFIX}/bin/monteverdi" "" "${CMAKE_INSTALL_PREFIX}/lib/otb") diff --git a/Packaging/MacOS/CMakeLists.txt b/Packaging/MacOS/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c3b7c9a998f75b3c817cf49e3eddec6bce1e3870 --- /dev/null +++ b/Packaging/MacOS/CMakeLists.txt @@ -0,0 +1,14 @@ +set(CPACK_GENERATOR "Bundle" PARENT_SCOPE) +set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/Monteverdi2.icns" PARENT_SCOPE) +set(CPACK_BUNDLE_NAME "Monteverdi-${Monteverdi_VERSION_MAJOR}.${Monteverdi_VERSION_MINOR}" PARENT_SCOPE) +set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" PARENT_SCOPE) +set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand" PARENT_SCOPE) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) + +install(DIRECTORY $ENV{GDAL_DATA} + DESTINATION share + COMPONENT Resources) + +install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/BundleFixing.cmake + COMPONENT Runtime) diff --git a/Packaging/MacOS/Info.plist.in b/Packaging/MacOS/Info.plist.in new file mode 100644 index 0000000000000000000000000000000000000000..270cacf3e9720d2542814c175b5e1cd259c24720 --- /dev/null +++ b/Packaging/MacOS/Info.plist.in @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleExecutable</key> + <string>Monteverdi2-@Monteverdi_VERSION_MAJOR@.@Monteverdi_VERSION_MINOR@</string> + <key>CFBundleIconFile</key> + <string>Monteverdi2-@Monteverdi_VERSION_MAJOR@.@Monteverdi_VERSION_MINOR@.icns</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + </dict> +</plist> diff --git a/Packaging/MacOS/Monteverdi2.icns b/Packaging/MacOS/Monteverdi2.icns new file mode 100644 index 0000000000000000000000000000000000000000..9f7645a384fe5e6d86d2dde3a4b6fc88bccd2aec Binary files /dev/null and b/Packaging/MacOS/Monteverdi2.icns differ diff --git a/Packaging/MacOS/StartupCommand b/Packaging/MacOS/StartupCommand new file mode 100644 index 0000000000000000000000000000000000000000..f872aa124bb1772f5a6e0db24943c756ca3a7f0a --- /dev/null +++ b/Packaging/MacOS/StartupCommand @@ -0,0 +1,14 @@ +#!/bin/sh + +BUNDLE="`echo "$0" | sed -e 's/\/Contents\/MacOS\/.*//'`" +RESOURCES="$BUNDLE/Contents/Resources" + +#echo "BUNDLE: $BUNDLE" +#echo "RESOURCES: $RESOURCES" + +export GDAL_DATA=$RESOURCES/share/gdal + +# Need to have write access to the monteverdi current dir for Caching +cd $HOME + +exec "$RESOURCES/bin/monteverdi2" diff --git a/Packaging/Windows/BundleFixing.cmake b/Packaging/Windows/BundleFixing.cmake new file mode 100644 index 0000000000000000000000000000000000000000..e6642c8d2042703267781eb7c10067a08eb9a746 --- /dev/null +++ b/Packaging/Windows/BundleFixing.cmake @@ -0,0 +1,2 @@ +include(BundleUtilities) +fixup_bundle("${CMAKE_INSTALL_PREFIX}/bin/monteverdi2.exe" "" "") \ No newline at end of file diff --git a/Packaging/Windows/CMakeLists.txt b/Packaging/Windows/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2000a1cffcd8ec53e9c1d1227e33be1eaea23028 --- /dev/null +++ b/Packaging/Windows/CMakeLists.txt @@ -0,0 +1,44 @@ +set(CPACK_NSIS_MODIFY_PATH ON PARENT_SCOPE) + +file(TO_CMAKE_PATH "$ENV{OSGEO4W_ROOT}" OSGEO4W_ROOT) +if(NOT OSGEO4W_ROOT) + message(FATAL_ERROR "Cannot generate installer without OSGeo4W environment : OSGEO4W_ROOT") +endif(NOT OSGEO4W_ROOT) + +file(TO_CMAKE_PATH "$ENV{GDAL_DATA}" GDAL_DATA) +if(NOT GDAL_DATA) + message(FATAL_ERROR "Cannot generate installer without OSGeo4W environment : GDAL_DATA") +endif(NOT GDAL_DATA) + +# Gather all dlls from which Monteverdi depends, and put them aside the executable +# For this to work, the necessary DLL must be in PATH +install(SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/BundleFixing.cmake + COMPONENT Runtime) + +# For some reason, fixup_bundle won't package the msvc runtime dll +# I guess it's because cpack already handles installing the runtime, +# but here we build with a particular version of Visual, but +# some OSGeo4W dependencies are built upon other runtimes +install(FILES ${OSGEO4W_ROOT}/bin/msvcp60.dll + ${OSGEO4W_ROOT}/bin/msvcp70.dll + ${OSGEO4W_ROOT}/bin/msvcp71.dll + ${OSGEO4W_ROOT}/bin/msvcr71.dll + ${OSGEO4W_ROOT}/bin/msvcrt.dll + DESTINATION bin + COMPONENT Runtime) + +# Need to include csv files provided with OSGeo that contains some needed EPSG definitions +find_path(GDAL_DATA epsg.wkt $ENV{GDAL_DATA}) + +install(DIRECTORY ${GDAL_DATA} + DESTINATION share + COMPONENT Resources) + +install(FILES ${Monteverdi2_SOURCE_DIR}/Packaging/Windows/monteverdi2.bat + DESTINATION bin + COMPONENT Runtime) + +# Override the monteverdi2.exe +# with the monteverdi.bat shortcut +set(CPACK_NSIS_MENU_LINKS + "bin/monteverdi2.bat" "Monteverdi2" PARENT_SCOPE) diff --git a/Packaging/Windows/monteverdi2.bat b/Packaging/Windows/monteverdi2.bat new file mode 100644 index 0000000000000000000000000000000000000000..e0faeccb235a1bc9eacc37cc8d98c2622c46bf5d --- /dev/null +++ b/Packaging/Windows/monteverdi2.bat @@ -0,0 +1,15 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: Monteverdi launcher to set up proper GDAL environment +::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:: Get the directory of the current script +@set CURRENT_SCRIPT_DIR=%~dp0 + +:: Set GDAL_DATA env. variable +@set GDAL_DATA=%CURRENT_SCRIPT_DIR%..\share\gdal + +:: Set current dir to HOME dir because Monteverdi generates temporary files and need write access +@cd %HOMEDRIVE%%HOMEPATH% + +:: Start Monteverdi +@"%CURRENT_SCRIPT_DIR%monteverdi.exe"