Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
638a2fb0
Commit
638a2fb0
authored
Jun 16, 2016
by
Stéphane Albert
Browse files
Options
Browse Files
Download
Plain Diff
MRG: Merged from origin/develop.
parents
eaacd019
87de61ff
Changes
47
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
1852 additions
and
725 deletions
+1852
-725
CMake/CPackFunctions.cmake
CMake/CPackFunctions.cmake
+143
-235
CMake/MinGWPackage.cmake
CMake/MinGWPackage.cmake
+0
-209
CMake/MonteverdiApplicationMacros.cmake
CMake/MonteverdiApplicationMacros.cmake
+25
-0
CMakeLists.txt
CMakeLists.txt
+30
-45
Code/Application/Mapla/CMakeLists.txt
Code/Application/Mapla/CMakeLists.txt
+0
-1
Code/Application/Mapla/mvdMainWindow.cxx
Code/Application/Mapla/mvdMainWindow.cxx
+0
-43
Code/Application/Monteverdi/CMakeLists.txt
Code/Application/Monteverdi/CMakeLists.txt
+0
-1
Code/Application/Monteverdi/mvdMainWindow.cxx
Code/Application/Monteverdi/mvdMainWindow.cxx
+26
-10
Code/Common/ApplicationsWrapper/mvdApplicationsToolBoxController.cxx
.../ApplicationsWrapper/mvdApplicationsToolBoxController.cxx
+1
-1
Code/Common/ApplicationsWrapper/mvdApplicationsToolBoxController.h
...on/ApplicationsWrapper/mvdApplicationsToolBoxController.h
+1
-1
Code/Common/Core/mvdProcessObjectObserver.cxx
Code/Common/Core/mvdProcessObjectObserver.cxx
+0
-1
Code/Common/Gui/mvdAbstractImageViewRenderer.h
Code/Common/Gui/mvdAbstractImageViewRenderer.h
+33
-1
Code/Common/Gui/mvdAbstractModelController.cxx
Code/Common/Gui/mvdAbstractModelController.cxx
+5
-4
Code/Common/Gui/mvdAbstractModelController.h
Code/Common/Gui/mvdAbstractModelController.h
+1
-1
Code/Common/Gui/mvdColorBandDynamicsWidget.cxx
Code/Common/Gui/mvdColorBandDynamicsWidget.cxx
+23
-11
Code/Common/Gui/mvdColorBandDynamicsWidget.h
Code/Common/Gui/mvdColorBandDynamicsWidget.h
+2
-2
Code/Common/Gui/mvdColorBandDynamicsWidget.ui
Code/Common/Gui/mvdColorBandDynamicsWidget.ui
+29
-17
Code/Common/Gui/mvdColorDynamicsController.cxx
Code/Common/Gui/mvdColorDynamicsController.cxx
+26
-6
Code/Common/Gui/mvdColorDynamicsController.h
Code/Common/Gui/mvdColorDynamicsController.h
+2
-2
Code/Common/Gui/mvdColorSetupController.cxx
Code/Common/Gui/mvdColorSetupController.cxx
+1
-1
Code/Common/Gui/mvdColorSetupController.h
Code/Common/Gui/mvdColorSetupController.h
+1
-1
Code/Common/Gui/mvdDatabaseBrowserController.cxx
Code/Common/Gui/mvdDatabaseBrowserController.cxx
+1
-1
Code/Common/Gui/mvdDatabaseBrowserController.h
Code/Common/Gui/mvdDatabaseBrowserController.h
+1
-1
Code/Common/Gui/mvdDatasetPropertiesController.cxx
Code/Common/Gui/mvdDatasetPropertiesController.cxx
+1
-1
Code/Common/Gui/mvdDatasetPropertiesController.h
Code/Common/Gui/mvdDatasetPropertiesController.h
+1
-1
Code/Common/Gui/mvdGui.h
Code/Common/Gui/mvdGui.h
+1
-0
Code/Common/Gui/mvdHistogramController.cxx
Code/Common/Gui/mvdHistogramController.cxx
+1
-1
Code/Common/Gui/mvdHistogramController.h
Code/Common/Gui/mvdHistogramController.h
+1
-1
Code/Common/Gui/mvdImageViewRenderer.cxx
Code/Common/Gui/mvdImageViewRenderer.cxx
+12
-6
Code/Common/Gui/mvdImageViewWidget.cxx
Code/Common/Gui/mvdImageViewWidget.cxx
+15
-0
Code/Common/Gui/mvdImageViewWidget.h
Code/Common/Gui/mvdImageViewWidget.h
+6
-0
Code/Common/Gui/mvdImportImagesDialog.cxx
Code/Common/Gui/mvdImportImagesDialog.cxx
+5
-5
Code/Common/Gui/mvdImportImagesDialog.ui
Code/Common/Gui/mvdImportImagesDialog.ui
+1
-1
Code/Common/Gui/mvdLayerStackController.cxx
Code/Common/Gui/mvdLayerStackController.cxx
+1
-1
Code/Common/Gui/mvdLayerStackController.h
Code/Common/Gui/mvdLayerStackController.h
+1
-1
Code/Common/Gui/mvdMultiResolutionPyramidWidget.cxx
Code/Common/Gui/mvdMultiResolutionPyramidWidget.cxx
+33
-14
Code/Common/Gui/mvdMultiResolutionPyramidWidget.ui
Code/Common/Gui/mvdMultiResolutionPyramidWidget.ui
+51
-6
Code/Common/Gui/mvdShaderWidget.cxx
Code/Common/Gui/mvdShaderWidget.cxx
+12
-8
Code/Common/Gui/mvdShaderWidget.h
Code/Common/Gui/mvdShaderWidget.h
+1
-1
Code/Common/Gui/mvdStatusBarWidget.ui
Code/Common/Gui/mvdStatusBarWidget.ui
+3
-0
Packaging/MacOS/Info.plist.in
Packaging/MacOS/Info.plist.in
+0
-18
Packaging/MacOS/Monteverdi.icns
Packaging/MacOS/Monteverdi.icns
+0
-0
Packaging/MacOS/StartupCommand.in
Packaging/MacOS/StartupCommand.in
+0
-15
Packaging/Windows/mapla.bat
Packaging/Windows/mapla.bat
+0
-16
Packaging/Windows/monteverdi.bat
Packaging/Windows/monteverdi.bat
+0
-17
RELEASE_NOTES.txt
RELEASE_NOTES.txt
+41
-1
i18n/fr_FR.ts
i18n/fr_FR.ts
+1314
-16
No files found.
CMake/CPackFunctions.cmake
View file @
638a2fb0
# Get the translation files coming with Qt, and install them in the bundle
# They are loaded by Monteverdi.
function
(
get_qt_translation_files RESULT
)
# These files are the "qt_<localename>.qm" files
# They are located in QT_TRANSLATIONS_DIR, which comes from FindQt4
file
(
GLOB translation_files
${
QT_TRANSLATIONS_DIR
}
/qt_*
)
# We need to remove the "qt_help_<localename>.qm" files from this list
foreach
(
translation_item
${
translation_files
}
)
if
(
${
translation_item
}
MATCHES
"qt_help"
)
list
(
REMOVE_ITEM translation_files
${
translation_item
}
)
endif
()
endforeach
()
set
(
${
RESULT
}
${
translation_files
}
PARENT_SCOPE
)
endfunction
()
#RK: two packages.
#function(create_cpack_config application)
function
(
create_cpack_config
)
#should we handle this when calling function ?
#for now mapla has no specific version or it is same as monteverdi
SET
(
CPACK_PACKAGE_VERSION
"
${
Monteverdi_VERSION_MAJOR
}
.
${
Monteverdi_VERSION_MINOR
}
.
${
Monteverdi_VERSION_PATCH
}${
Monteverdi_VERSION_SUFFIX
}
"
)
...
...
@@ -215,67 +197,67 @@ function(configure_app_package app with_otb_apps)
endif
()
#(NOT CMAKE_CROSSCOMPILING AND Monteverdi_USE_CPACK)
if
(
CMAKE_CROSSCOMPILING
)
if
(
NOT DEFINED MXE_TARGET_DIR
)
message
(
FATAL_ERROR
"MXE_TARGET_DIR is missing"
)
endif
()
if
(
MXE_TARGET_DIR MATCHES
"i686"
)
set
(
mxearch x86
)
set
(
archive_name
${
app
}
-
${
Monteverdi_VERSION_STRING
}
-win32
)
elseif
(
MXE_TARGET_DIR MATCHES
"x86_64"
)
set
(
mxearch x64
)
set
(
archive_name
${
app
}
-
${
Monteverdi_VERSION_STRING
}
-win64
)
endif
()
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E remove_directory
"
${
CMAKE_INSTALL_PREFIX
}
/
${
archive_name
}
"
)
get_filename_component
(
mxeroot
${
MXE_TARGET_DIR
}
PATH
)
get_filename_component
(
mxeroot
${
mxeroot
}
PATH
)
file
(
WRITE
"
${
CMAKE_BINARY_DIR
}
/_mingw/
${
app
}
/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.6)
include(CMakeParseArguments)
set(Monteverdi_SOURCE_DIR
\"
${
Monteverdi_SOURCE_DIR
}
\"
)
set(OTB_MODULES_DIR
\"
${
OTB_MODULES_DIR
}
\"
)
set(QT_PLUGINS_DIR
\"
${
QT_PLUGINS_DIR
}
\"
)
set(QT_TRANSLATIONS_DIR
\"
${
QT_TRANSLATIONS_DIR
}
\"
)
set(Monteverdi_BINARY_DIR
\"
${
CMAKE_BINARY_DIR
}
\"
)
set(CMAKE_INSTALL_PREFIX
\"
${
CMAKE_INSTALL_PREFIX
}
\"
)
set(Monteverdi_INSTALL_DATA_DIR
\"
${
Monteverdi_INSTALL_DATA_DIR
}
\"
)
include(
${
CMAKE_SOURCE_DIR
}
/CMake/MinGWPackage.cmake)
include(
${
CMAKE_SOURCE_DIR
}
/CMake/CPackFunctions.cmake)
package_mingw(
ARCH
\"
${
mxearch
}
\"
MXEROOT
\"
${
mxeroot
}
\"
PREFIX_DIR
\"
${
archive_name
}
\"
PEFILES
\"
${
APP_NAME
}
\"
NEEDS_OTB_APPS
${
with_otb_apps
}
SEARCHDIRS
\"\"
)"
)
set
(
GDAL_DATA
${
MXE_TARGET_DIR
}
/share/gdal
)
add_custom_target
(
configure-
${
app
}
-mingw-package
COMMAND
${
CMAKE_COMMAND
}
"
${
CMAKE_BINARY_DIR
}
/_mingw/
${
app
}
"
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/_mingw/
${
app
}
"
)
add_custom_target
(
make-
${
app
}
-mingw-package
COMMAND
${
CMAKE_COMMAND
}
"--build"
"
${
CMAKE_BINARY_DIR
}
/_mingw/
${
app
}
"
"--target"
"install"
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/_mingw/
${
app
}
"
DEPENDS configure-
${
app
}
-mingw-package
)
find_program
(
ZIP_EXECUTABLE zip
)
if
(
ZIP_EXECUTABLE
)
add_custom_target
(
create-
${
app
}
-mingw-archive
COMMAND
${
ZIP_EXECUTABLE
}
"-r"
"
${
CMAKE_BINARY_DIR
}
/
${
archive_name
}
.zip"
"
${
archive_name
}
"
WORKING_DIRECTORY
"
${
CMAKE_INSTALL_PREFIX
}
"
DEPENDS make-
${
app
}
-mingw-package
)
else
()
message
(
FATAL_ERROR
"Cannot find zip executable. Please add it to your path"
)
endif
()
endif
()
# (CMAKE_CROSSCOMPILING)
#
if(CMAKE_CROSSCOMPILING)
#
if(NOT DEFINED MXE_TARGET_DIR)
#
message(FATAL_ERROR "MXE_TARGET_DIR is missing")
#
endif()
#
if(MXE_TARGET_DIR MATCHES "i686")
#
set(mxearch x86)
#
set(archive_name ${app}-${Monteverdi_VERSION_STRING}-win32)
#
elseif(MXE_TARGET_DIR MATCHES "x86_64")
#
set(mxearch x64)
#
set(archive_name ${app}-${Monteverdi_VERSION_STRING}-win64)
#
endif()
#
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_INSTALL_PREFIX}/${archive_name}")
#
get_filename_component(mxeroot ${MXE_TARGET_DIR} PATH)
#
get_filename_component(mxeroot ${mxeroot} PATH)
#
file(WRITE "${CMAKE_BINARY_DIR}/_mingw/${app}/CMakeLists.txt"
#
"cmake_minimum_required(VERSION 2.6)
#
include(CMakeParseArguments)
#
set(Monteverdi_SOURCE_DIR \"${Monteverdi_SOURCE_DIR}\")
#
set(OTB_MODULES_DIR \"${OTB_MODULES_DIR}\")
#
set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")
#
set(QT_TRANSLATIONS_DIR \"${QT_TRANSLATIONS_DIR}\")
#
set(Monteverdi_BINARY_DIR \"${CMAKE_BINARY_DIR}\")
#
set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")
#
set(Monteverdi_INSTALL_DATA_DIR \"${Monteverdi_INSTALL_DATA_DIR}\")
#
include(${CMAKE_SOURCE_DIR}/CMake/MinGWPackage.cmake)
#
include(${CMAKE_SOURCE_DIR}/CMake/CPackFunctions.cmake)
#
package_mingw(
#
ARCH \"${mxearch}\"
#
MXEROOT \"${mxeroot}\"
#
PREFIX_DIR \"${archive_name}\"
#
PEFILES \"${APP_NAME}\"
#
NEEDS_OTB_APPS ${with_otb_apps}
#
SEARCHDIRS \"\")")
#
set(GDAL_DATA ${MXE_TARGET_DIR}/share/gdal)
#
add_custom_target(configure-${app}-mingw-package
#
COMMAND ${CMAKE_COMMAND}
#
"${CMAKE_BINARY_DIR}/_mingw/${app}"
#
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/_mingw/${app}")
#
add_custom_target(make-${app}-mingw-package
#
COMMAND ${CMAKE_COMMAND}
#
"--build" "${CMAKE_BINARY_DIR}/_mingw/${app}" "--target" "install"
#
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/_mingw/${app}"
#
DEPENDS configure-${app}-mingw-package)
#
find_program(ZIP_EXECUTABLE zip)
#
if(ZIP_EXECUTABLE)
#
add_custom_target(create-${app}-mingw-archive
#
COMMAND ${ZIP_EXECUTABLE} "-r" "${CMAKE_BINARY_DIR}/${archive_name}.zip" "${archive_name}"
#
WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
#
DEPENDS make-${app}-mingw-package)
#
else()
#
message(FATAL_ERROR "Cannot find zip executable. Please add it to your path")
#
endif()
#
endif() # (CMAKE_CROSSCOMPILING)
endif
(
WIN32
)
...
...
@@ -321,161 +303,87 @@ function(configure_app_package app with_otb_apps)
endif
(
APPLE
)
################################################################################
################################################################################
################### END OF PLATFORM SPECIFIC CMAKE VARIABLES ###################
################################################################################
################################################################################
####################### install sqldrivers plugin #######################
install
(
FILES
${
QT_PLUGINS_DIR
}
/sqldrivers/
${
APP_QTSQLITE_FILENAME
}
DESTINATION
${
APP_QTPLUGINS_DIR
}
/sqldrivers
COMPONENT Runtime
)
####################### install translations #######################
get_qt_translation_files
(
QT_TRANSLATIONS_FILES
)
install
(
FILES
${
QT_TRANSLATIONS_FILES
}
DESTINATION
${
APP_I18N_DIR
}
COMPONENT Resources
)
####################### install GDAL data #######################
if
(
NOT DEFINED GDAL_DATA
)
file
(
TO_CMAKE_PATH
"$ENV{GDAL_DATA}"
GDAL_DATA
)
if
(
NOT GDAL_DATA
)
if
(
Monteverdi_USE_CPACK
)
message
(
FATAL_ERROR
"Cannot generate installer without GDAL_DATA : GDAL_DATA"
)
else
()
message
(
WARNING
"Cannot generate installer without GDAL_DATA : GDAL_DATA"
)
endif
()
endif
()
endif
()
#(DEFINED GDAL_DATA)
# Need to include csv files provided with GDAL that contains some needed EPSG definitions
install
(
DIRECTORY
${
GDAL_DATA
}
DESTINATION
${
APP_DATA_DIR
}
COMPONENT Resources
)
####################### Check otb applications #######################
if
(
with_otb_apps
)
# message(FATAL_ERROR "No OTB-applications detected")
file
(
GLOB OTB_APPS_LIST
${
OTB_MODULES_DIR
}
/../../../otb/applications/otbapp_*
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
)
# /lib/otb
if
(
NOT OTB_APPS_LIST
)
message
(
FATAL_ERROR
"No OTB-applications detected"
)
endif
()
## otb apps dir /lib/otb/applications
install
(
DIRECTORY
"
${
OTB_MODULES_DIR
}
/../../../otb/applications"
DESTINATION
${
APP_OTBLIBS_DIR
}
COMPONENT Runtime
)
endif
(
with_otb_apps
)
## directories to look for dependencies
set
(
SEARCH_DIRS
)
list
(
APPEND SEARCH_DIRS
"
${
QT_PLUGINS_DIR
}
/sqldrivers"
)
list
(
APPEND SEARCH_DIRS
"
${
ITK_MODULES_DIR
}
/../../../"
)
list
(
APPEND SEARCH_DIRS
"
${
OTB_MODULES_DIR
}
/../../../"
)
list
(
APPEND SEARCH_DIRS
"
${
CMAKE_INSTALL_PREFIX
}
/lib/otb/"
)
####################### install fixup_bundle code #######################
## fixup_bundle code
if
(
NOT CMAKE_CROSSCOMPILING
)
if
(
with_otb_apps
)
install
(
CODE
"file(GLOB APP_LIBS
\"
${
CMAKE_INSTALL_PREFIX
}
/
${
APP_OTBLIBS_DIR
}
/applications/otbapp_*
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
\"
)
list(APPEND APP_LIBS
\"
${
CMAKE_INSTALL_PREFIX
}
/
${
APP_QTPLUGINS_DIR
}
/sqldrivers/
${
APP_QTSQLITE_FILENAME
}
\"
)
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS ON)
fixup_bundle(
\"
${
APP_NAME
}
\"
\"\$
{APP_LIBS}
\"
\"
${
SEARCH_DIRS
}
\"
)"
COMPONENT
${
app
}
)
else
()
#(with_otb_apps)
install
(
CODE
"file(GLOB APP_LIBS
\"
${
CMAKE_INSTALL_PREFIX
}
/
${
APP_QTPLUGINS_DIR
}
/sqldrivers/
${
APP_QTSQLITE_FILENAME
}
\"
)
include(BundleUtilities)
set(BU_CHMOD_BUNDLE_ITEMS ON)
fixup_bundle(
\"
${
APP_NAME
}
\"
\"\$
{APP_LIBS}
\"
\"
${
SEARCH_DIRS
}
\"
)"
COMPONENT
${
app
}
)
endif
()
#(with_otb_apps)
endif
()
#(NOT CMAKE_CROSSCOMPILING)
#
################################################################################
#
################################################################################
#
################### END OF PLATFORM SPECIFIC CMAKE VARIABLES ###################
#
################################################################################
#
################################################################################
#
####################### install sqldrivers plugin #######################
#
install(FILES ${QT_PLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}
#
DESTINATION ${APP_QTPLUGINS_DIR}/sqldrivers
#
COMPONENT Runtime)
#
####################### install translations #######################
#
get_qt_translation_files(QT_TRANSLATIONS_FILES)
#
install(FILES ${QT_TRANSLATIONS_FILES}
#
DESTINATION ${APP_I18N_DIR}
#
COMPONENT Resources)
#
####################### install GDAL data #######################
#
if(NOT DEFINED GDAL_DATA)
#
file(TO_CMAKE_PATH "$ENV{GDAL_DATA}" GDAL_DATA)
#
if(NOT GDAL_DATA)
#
if(Monteverdi_USE_CPACK)
#
message(FATAL_ERROR "Cannot generate installer without GDAL_DATA : GDAL_DATA")
#
else()
#
message(WARNING "Cannot generate installer without GDAL_DATA : GDAL_DATA")
#
endif()
#
endif()
#
endif() #(DEFINED GDAL_DATA)
#
# Need to include csv files provided with GDAL that contains some needed EPSG definitions
#
install(DIRECTORY ${GDAL_DATA}
#
DESTINATION ${APP_DATA_DIR}
#
COMPONENT Resources)
#
####################### Check otb applications #######################
#
if(with_otb_apps)
#
# message(FATAL_ERROR "No OTB-applications detected")
#
file(GLOB OTB_APPS_LIST ${OTB_MODULES_DIR}/../../../otb/applications/otbapp_*${CMAKE_SHARED_LIBRARY_SUFFIX}) # /lib/otb
#
if(NOT OTB_APPS_LIST)
#
message(FATAL_ERROR "No OTB-applications detected")
#
endif()
#
## otb apps dir /lib/otb/applications
#
install(DIRECTORY "${OTB_MODULES_DIR}/../../../otb/applications"
#
DESTINATION ${APP_OTBLIBS_DIR}
#
COMPONENT Runtime)
#
endif(with_otb_apps)
#
## directories to look for dependencies
#
set(SEARCH_DIRS)
#
list(APPEND SEARCH_DIRS "${QT_PLUGINS_DIR}/sqldrivers")
#
list(APPEND SEARCH_DIRS "${ITK_MODULES_DIR}/../../../")
#
list(APPEND SEARCH_DIRS "${OTB_MODULES_DIR}/../../../")
#
list(APPEND SEARCH_DIRS "${CMAKE_INSTALL_PREFIX}/lib/otb/")
#
####################### install fixup_bundle code #######################
#
## fixup_bundle code
#
if(NOT CMAKE_CROSSCOMPILING)
#
if(with_otb_apps)
#
install(CODE
#
"file(GLOB APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_OTBLIBS_DIR}/applications/otbapp_*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
#
list(APPEND APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_QTPLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}\")
#
include(BundleUtilities)
#
set(BU_CHMOD_BUNDLE_ITEMS ON)
#
fixup_bundle(\"${APP_NAME}\" \"\${APP_LIBS}\" \"${SEARCH_DIRS}\")"
#
COMPONENT ${app})
#
else() #(with_otb_apps)
#
install(CODE
#
"file(GLOB APP_LIBS \"${CMAKE_INSTALL_PREFIX}/${APP_QTPLUGINS_DIR}/sqldrivers/${APP_QTSQLITE_FILENAME}\")
#
include(BundleUtilities)
#
set(BU_CHMOD_BUNDLE_ITEMS ON)
#
fixup_bundle(\"${APP_NAME}\" \"\${APP_LIBS}\" \"${SEARCH_DIRS}\")"
#
COMPONENT ${app})
#
endif() #(with_otb_apps)
#
endif() #(NOT CMAKE_CROSSCOMPILING)
endfunction
(
configure_app_package
)
macro
(
create_monteverdi_application
)
cmake_parse_arguments
(
APPLICATION
""
"NAME;OUTPUT_NAME;COMPONENT_NAME;NEEDS_OTB_APPS"
"SOURCES;LINK_LIBRARIES"
${
ARGN
}
)
if
(
NOT DEFINED APPLICATION_NEEDS_OTB_APPS OR APPLICATION_NEEDS_OTB_APPS
)
set
(
APPLICATION_NEEDS_OTB_APPS TRUE
)
else
()
set
(
APPLICATION_NEEDS_OTB_APPS FALSE
)
endif
()
if
(
WIN32
)
add_executable
(
${
APPLICATION_NAME
}
WIN32
${
APPLICATION_SOURCES
}
)
elseif
(
APPLE
)
add_executable
(
${
APPLICATION_NAME
}
MACOSX_BUNDLE
${
APPLICATION_SOURCES
}
)
else
()
#Linux
add_executable
(
${
APPLICATION_NAME
}
${
APPLICATION_SOURCES
}
)
endif
()
set
(
EXECUTABLE_NAME
${
APPLICATION_NAME
}
)
if
(
APPLE
)
string
(
SUBSTRING
${
APPLICATION_NAME
}
0 1 FIRST_LETTER
)
string
(
TOUPPER
${
FIRST_LETTER
}
FIRST_LETTER
)
string
(
REGEX REPLACE
"^.(.*)"
"
${
FIRST_LETTER
}
\\
1"
APPLICATION_OUTPUT_NAME
"
${
APPLICATION_NAME
}
"
)
endif
()
if
(
APPLICATION_OUTPUT_NAME
)
set_target_properties
(
${
APPLICATION_NAME
}
PROPERTIES OUTPUT_NAME
${
APPLICATION_OUTPUT_NAME
}
)
set
(
EXECUTABLE_NAME
${
APPLICATION_OUTPUT_NAME
}
)
endif
()
if
(
APPLE
)
if
(
Monteverdi_USE_CPACK
)
set
(
MACOS_FILES_DIR
"
${
CMAKE_SOURCE_DIR
}
/Packaging/MacOS"
)
configure_file
(
${
MACOS_FILES_DIR
}
/Info.plist.in
${
CMAKE_BINARY_DIR
}
/Code/Application/
${
APPLICATION_NAME
}
/Info.plist
@ONLY
)
configure_file
(
${
MACOS_FILES_DIR
}
/StartupCommand.in
${
CMAKE_BINARY_DIR
}
/Code/Application/
${
APPLICATION_NAME
}
/
${
EXECUTABLE_NAME
}
_start
@ONLY
)
set_target_properties
(
${
APPLICATION_NAME
}
PROPERTIES MACOSX_BUNDLE_INFO_PLIST
"
${
CMAKE_BINARY_DIR
}
/Code/Application/
${
APPLICATION_NAME
}
/Info.plist"
)
endif
(
Monteverdi_USE_CPACK
)
endif
(
APPLE
)
target_link_libraries
(
${
APPLICATION_NAME
}
${
APPLICATION_LINK_LIBRARIES
}
)
#############################################################################
install
(
TARGETS
${
APPLICATION_NAME
}
BUNDLE DESTINATION
${
CMAKE_INSTALL_PREFIX
}
COMPONENT
${
APPLICATION_COMPONENT_NAME
}
RUNTIME DESTINATION
${
Monteverdi_INSTALL_BIN_DIR
}
COMPONENT
${
APPLICATION_COMPONENT_NAME
}
LIBRARY DESTINATION
${
Monteverdi_INSTALL_LIB_DIR
}
COMPONENT
${
APPLICATION_COMPONENT_NAME
}
ARCHIVE DESTINATION
${
Monteverdi_INSTALL_LIB_DIR
}
COMPONENT
${
APPLICATION_COMPONENT_NAME
}
)
#############################################################################
if
(
WIN32
)
if
(
CMAKE_CROSSCOMPILING OR Monteverdi_USE_CPACK
)
configure_app_package
(
${
APPLICATION_COMPONENT_NAME
}
${
APPLICATION_NEEDS_OTB_APPS
}
)
endif
()
elseif
(
APPLE AND Monteverdi_USE_CPACK
)
configure_app_package
(
${
APPLICATION_COMPONENT_NAME
}
${
APPLICATION_NEEDS_OTB_APPS
}
)
endif
()
endmacro
(
create_monteverdi_application
)
\ No newline at end of file
CMake/MinGWPackage.cmake
deleted
100644 → 0
View file @
eaacd019
macro
(
package_mingw
)
cmake_parse_arguments
(
PACKAGE
""
"PREFIX_DIR;ARCH;MXEROOT;NEEDS_OTB_APPS"
"SEARCHDIRS;PEFILES"
${
ARGN
}
)
if
(
"
${
PACKAGE_ARCH
}
"
STREQUAL
"x86"
)
set
(
MXE_BIN_DIR
"
${
PACKAGE_MXEROOT
}
/usr/i686-w64-mingw32.shared/bin"
)
set
(
MXE_OBJDUMP
"
${
PACKAGE_MXEROOT
}
/usr/bin/i686-w64-mingw32.shared-objdump"
)
elseif
(
"
${
PACKAGE_ARCH
}
"
STREQUAL
"x64"
)
set
(
MXE_BIN_DIR
"
${
PACKAGE_MXEROOT
}
/usr/x86_64-w64-mingw32.shared/bin"
)
set
(
MXE_OBJDUMP
"
${
PACKAGE_MXEROOT
}
/usr/bin/x86_64-w64-mingw32.shared-objdump"
)
endif
()
file
(
GLOB MXE_GCC_LIB_DIR
"
${
MXE_BIN_DIR
}
/gcc*"
)
list
(
APPEND PACKAGE_SEARCHDIRS
${
MXE_GCC_LIB_DIR
}
)
list
(
APPEND PACKAGE_SEARCHDIRS
${
MXE_BIN_DIR
}
)
list
(
APPEND PACKAGE_SEARCHDIRS
"
${
MXE_BIN_DIR
}
/../qt/bin"
)
#Qt
list
(
APPEND PACKAGE_SEARCHDIRS
"
${
MXE_BIN_DIR
}
/../qt/lib"
)
#Qwt
list
(
APPEND PACKAGE_SEARCHDIRS
"
${
CMAKE_INSTALL_PREFIX
}
/bin"
)
#mvd
install_common
(
${
PACKAGE_PREFIX_DIR
}
${
PACKAGE_NEEDS_OTB_APPS
}
)
if
(
PACKAGE_NEEDS_OTB_APPS
)
list
(
APPEND PACKAGE_SEARCHDIRS
"
${
OTB_MODULES_DIR
}
/../../../otb/applications"
)
#otb apps
endif
()
foreach
(
exe_file
${
PACKAGE_PEFILES
}
)
get_filename_component
(
base_name
${
exe_file
}
NAME_WE
)
install
(
FILES
${
Monteverdi_SOURCE_DIR
}
/Packaging/Windows/
${
base_name
}
.bat
DESTINATION
${
PACKAGE_PREFIX_DIR
}
/bin
)
endforeach
()
#qt4 translations
file
(
GLOB APP_TS_FILES
${
Monteverdi_SOURCE_DIR
}
/i18n/*.ts
)
# qm files
foreach
(
APP_TS_FILE
${
APP_TS_FILES
}
)
get_filename_component
(
APP_TS_FILENAME
${
APP_TS_FILE
}
NAME_WE
)
install
(
FILES
${
Monteverdi_BINARY_DIR
}
/i18n/
${
APP_TS_FILENAME
}
.qm
DESTINATION
${
PACKAGE_PREFIX_DIR
}
/
${
Monteverdi_INSTALL_DATA_DIR
}
/i18n
)
endforeach
()
#dependency resolution based on copydlldeps.sh from mxe by Timothy Gu
if
(
PACKAGE_NEEDS_OTB_APPS
)
file
(
GLOB otbapps_list
${
OTB_MODULES_DIR
}
/../../../otb/applications/otbapp_*dll
)
# /lib/otb
list
(
APPEND PACKAGE_PEFILES
${
otbapps_list
}
)
endif
()
set
(
alldlls
)
set
(
notfound_dlls
)
foreach
(
infile
${
PACKAGE_PEFILES
}
)
get_filename_component
(
bn
${
infile
}
NAME
)
process_deps
(
${
bn
}
)
endforeach
()
list
(
LENGTH notfound_dlls nos
)
if
(
${
nos
}
GREATER 0
)
string
(
REPLACE
".dll"
".dll,"
notfound
${
notfound_dlls
}
)
message
(
FATAL_ERROR
"Following dlls were not found:
${
notfound
}
Please consider adding their paths to SEARCHDIRS when calling package_mingw macro."
)
endif
()
endmacro
(
package_mingw
)
set
(
SYSTEM_DLLS
msvc.*dll
user32.dll
gdi32.dll
shell32.dll
kernel32.dll
advapi32.dll
crypt32.dll
ws2_32.dll
wldap32.dll
ole32.dll
opengl32.dll
glu32.dll
comdlg32.dll
imm32.dll
oleaut32.dll
comctl32.dll
winmm.dll
shfolder.dll
secur32.dll
wsock32.dll
winspool.drv
)
## http://www.cmake.org/Wiki/CMakeMacroListOperations
macro
(
is_system_dll matched value
)
set
(
${
matched
}
)
string
(
TOLOWER
${
value
}
value_
)
foreach
(
pattern
${
SYSTEM_DLLS
}
)
string
(
TOLOWER
${
pattern
}
pattern_
)
if
(
${
value_
}
MATCHES
${
pattern_
}
)
set
(
${
matched
}
TRUE
)
endif
()
endforeach
()
endmacro
()
macro
(
list_contains var value
)
set
(
${
var
}
)
foreach
(
value2
${
ARGN
}
)
if
(
${
value
}
STREQUAL
${
value2
}
)
set
(
${
var
}
TRUE
)
else
()
string
(
TOLOWER
${
value
}
value_
)
string
(
TOLOWER
${
value2
}
value2_
)
if
(
${
value_
}
STREQUAL
${
value2_
}
)
set
(
${
var
}
TRUE
)
endif
()
endif
()
endforeach
(
value2
)
endmacro
()
function
(
process_deps infile
)
get_filename_component
(
bn
${
infile
}
NAME
)
list_contains
(
contains
"
${
bn
}
"
"
${
alldlls
}
"
)
if
(
NOT contains
)
set
(
DLL_FOUND FALSE
)
foreach
(
SEARCHDIR
${
PACKAGE_SEARCHDIRS
}
)
if
(
NOT DLL_FOUND
)
if
(
EXISTS
${
SEARCHDIR
}
/
${
infile
}
)
set
(
DLL_FOUND TRUE
)
else
()
string
(
TOLOWER
${
infile
}
infile_lower
)
if
(
EXISTS
${
SEARCHDIR
}
/
${
infile_lower
}
)
set
(
DLL_FOUND TRUE
)
set
(
infile
${
infile_lower
}
)
endif
()
endif
()
if
(
DLL_FOUND
)
message
(
STATUS
"Processing
${
SEARCHDIR
}
/
${
infile
}
"
)
if
(
NOT
"
${
infile
}
"
MATCHES
"otbapp"
)
install
(
FILES
"
${
SEARCHDIR
}
/
${
infile
}
"
DESTINATION
${
PACKAGE_PREFIX_DIR
}
/bin
)
else
()
##message(STATUS "skipping..${infile}")
endif
()
if
(
NOT EXISTS
${
MXE_OBJDUMP
}
)
message
(
FATAL_ERROR
"objdump executable not found. please check MXE_OBJDUMP is set to correct cross compiled executable"
)
endif
()
execute_process
(
COMMAND
${
MXE_OBJDUMP
}
"-p"
"
${
SEARCHDIR
}
/
${
infile
}
"
OUTPUT_VARIABLE dlldeps
)
string
(
REGEX MATCHALL
"DLL.Name..[A-Za-z(0-9
\\
.0-9)+_
\\
-]*"
OUT
"
${
dlldeps
}
"
)
string
(
REGEX REPLACE
"DLL.Name.."
""
OUT
"
${
OUT
}
"
)
foreach
(
o
${
OUT
}
)
process_deps
(
${
o
}
)
endforeach
()
endif
()
endif
(
NOT DLL_FOUND
)
endforeach
()
if
(
NOT DLL_FOUND
)
is_system_dll
(
iss
"
${
infile
}
"
)
if
(
NOT iss
)
set
(
notfound_dlls
"
${
notfound_dlls
}
;
${
infile
}
"
)
endif
()
else
(
NOT DLL_FOUND
)
set
(
alldlls
"
${
alldlls
}
;
${
bn
}
"
PARENT_SCOPE
)
endif
(
NOT DLL_FOUND
)
set
(
notfound_dlls
"
${
notfound_dlls
}
"
PARENT_SCOPE
)
endif
()
endfunction
()
function
(
install_common outdir need_otb_apps
)
set
(
APP_PREFIX_DIR
"
${
outdir
}
"
)
set
(
APP_BIN_DIR
"
${
APP_PREFIX_DIR
}
/bin"
)
set
(
APP_QTSQLITE_FILENAME
"qsqlite4.dll"
)
set
(
APP_QTPLUGINS_DIR
"
${
APP_PREFIX_DIR
}
/lib/qt4/plugins"
)
set
(
APP_OTBLIBS_DIR
"
${
APP_PREFIX_DIR
}
/lib/otb"
)
set
(
APP_I18N_DIR
"
${
APP_PREFIX_DIR
}
/lib/qt4/translations"
)
set
(
APP_DATA_DIR
"
${
APP_PREFIX_DIR
}
/share"
)
install
(
CODE
"file(WRITE
\"\$
{CMAKE_INSTALL_PREFIX}/
${
APP_BIN_DIR
}
/qt.conf
\"
\"
[Paths]
Translations=../lib/qt4/translations
Plugins=../lib/qt4/plugins
\"
)"
)
install
(
FILES
${
QT_PLUGINS_DIR
}
/sqldrivers/
${
APP_QTSQLITE_FILENAME
}
DESTINATION
${
APP_QTPLUGINS_DIR
}
/sqldrivers
)
####################### install translations #######################
get_qt_translation_files
(
QT_TRANSLATIONS_FILES
)
install
(
FILES
${
QT_TRANSLATIONS_FILES
}
DESTINATION
${
APP_I18N_DIR
}
)
####################### install GDAL data #######################
set
(
GDAL_DATA
${
MXE_BIN_DIR
}
/../share/gdal
)
if
(
NOT EXISTS
"
${
GDAL_DATA
}
/epsg.wkt"
)
message
(
FATAL_ERROR
"Cannot generate package without GDAL_DATA :
${
GDAL_DATA
}
"
)
endif
()
install
(
DIRECTORY
${
GDAL_DATA
}
DESTINATION
${
APP_DATA_DIR
}
)
####################### Check otb applications #######################
if
(
need_otb_apps
)
file
(
GLOB OTB_APPS_LIST
${
OTB_MODULES_DIR
}
/../../../otb/applications/otbapp_*dll
)
# /lib/otb
if
(
NOT OTB_APPS_LIST
)
message
(
FATAL_ERROR
"No OTB-applications detected"
)
endif
()
## otb apps dir /lib/otb/applications