Commit 6fd8858c authored by Stéphane Albert's avatar Stéphane Albert

ENH: Separated Common package into Core and Gui sub-packages/libraries.

parent f053620a
......@@ -56,7 +56,7 @@ if (WIN32)
${CMAKE_CURRENT_BINARY_DIR}/mvdWin32.rc
@ONLY
)
# The RC file to be added to source list
set( Monteverdi2_WIN32_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/mvdWin32.rc )
endif()
......@@ -75,8 +75,7 @@ add_library(Monteverdi2_Catalogue
${Catalogue_SRC_MOC}
)
target_link_libraries(Monteverdi2_Catalogue
Monteverdi2_Common
${QT_LIBRARIES}
Monteverdi2_Gui
)
#############################################################################
......@@ -90,8 +89,8 @@ add_executable( mvd2-catalogue
target_link_libraries( mvd2-catalogue
Monteverdi2_Catalogue
Monteverdi2_Common
${QT_LIBRARIES}
#Monteverdi2_Gui
${QT_QTMAIN_LIBRARY}
)
# deploy a qt.conf file in the monteverdi2 target build dir
......
......@@ -44,7 +44,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdI18nApplication.h"
#include "Core/mvdI18nApplication.h"
/*****************************************************************************/
......
......@@ -45,7 +45,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdTypes.h"
#include "Core/mvdTypes.h"
/*****************************************************************************/
......
......@@ -70,19 +70,19 @@ endif()
#############################################################################
# Monteverdi2_Application library
# Monteverdi2_Viewer library
# STATIC so that the monteverdi2 executable does not depend on another shared lib
# The library is also used in tests, waiting for a better test strategy
# The library is not installed
add_library( Monteverdi2_Application
add_library( Monteverdi2_Viewer
STATIC
${Application_SOURCES}
${Application_FORMS_HEADERS}
${Application_SRC_MOC}
)
target_link_libraries( Monteverdi2_Application
Monteverdi2_Common
target_link_libraries( Monteverdi2_Viewer
Monteverdi2_Gui
)
#############################################################################
......@@ -95,8 +95,8 @@ add_executable( mvd2-viewer
)
target_link_libraries( mvd2-viewer
Monteverdi2_Application
Monteverdi2_Common
Monteverdi2_Viewer
#Monteverdi2_Gui
${QT_QTMAIN_LIBRARY}
)
......
......@@ -32,7 +32,8 @@
// Monteverdi includes (sorted by alphabetic order)
#include "mvdApplication.h"
#include "mvdMainWindow.h"
#include "mvdDatasetModel.h"
//
#include "Core/mvdDatasetModel.h"
//
// OTB includes (sorted by alphabetic order)
......
......@@ -34,9 +34,9 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAbstractModel.h"
#include "mvdDatasetModel.h"
#include "mvdVectorImageModel.h"
#include "Core/mvdAbstractModel.h"
#include "Core/mvdDatasetModel.h"
#include "Core/mvdVectorImageModel.h"
//
// Class implementation.
......
......@@ -44,7 +44,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdI18nApplication.h"
#include "Core/mvdI18nApplication.h"
/*****************************************************************************/
......
......@@ -16,9 +16,6 @@
=========================================================================*/
#include "mvdImageLoader.h"
#include "mvdApplication.h"
#include "mvdDatasetModel.h"
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
......@@ -34,6 +31,9 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdApplication.h"
#include "mvdImageLoader.h"
#include "Core/mvdDatasetModel.h"
namespace mvd
{
......
......@@ -36,23 +36,25 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAboutDialog.h"
#include "mvdApplication.h"
#include "mvdColorDynamicsController.h"
#include "mvdColorDynamicsWidget.h"
#include "mvdColorSetupController.h"
#include "mvdDatasetModel.h"
#include "mvdGLImageWidget.h"
#include "mvdImageLoader.h"
#include "mvdImageModelRenderer.h"
#include "mvdImageViewManipulator.h"
#include "mvdPreferencesDialog.h"
#include "mvdQuicklookModel.h"
#include "mvdQuicklookViewManipulator.h"
#include "mvdSystemError.h"
#include "mvdVectorImageModel.h"
#include "mvdStatusBarWidget.h"
#include "mvdMainWindowTitleLoader.h"
//
#include "Core/mvdDatasetModel.h"
#include "Core/mvdQuicklookModel.h"
#include "Core/mvdSystemError.h"
#include "Core/mvdVectorImageModel.h"
//
#include "Gui/mvdAboutDialog.h"
#include "Gui/mvdColorDynamicsController.h"
#include "Gui/mvdColorDynamicsWidget.h"
#include "Gui/mvdColorSetupController.h"
#include "Gui/mvdGLImageWidget.h"
#include "Gui/mvdImageModelRenderer.h"
#include "Gui/mvdImageViewManipulator.h"
#include "Gui/mvdMainWindowTitleLoader.h"
#include "Gui/mvdQuicklookViewManipulator.h"
#include "Gui/mvdStatusBarWidget.h"
namespace mvd
{
......
......@@ -45,8 +45,8 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdTypes.h"
#include "mvdDatasetCreationProgressDialog.h"
#include "Core/mvdTypes.h"
#include "Gui/mvdDatasetCreationProgressDialog.h"
/*****************************************************************************/
......@@ -330,7 +330,7 @@ private slots:
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAbstractModelController.h"
#include "Gui/mvdAbstractModelController.h"
//
// Some constants.
......
#############################################################################
# Source files of Common library
set( Common_SOURCES
mvdAboutDialog.cxx
mvdAbstractImageModel.cxx
mvdAbstractModelController.cxx
mvdAbstractModel.cxx
mvdAbstractViewManipulator.cxx
mvdAlgorithm.cxx
mvdColorBandDynamicsWidget.cxx
mvdColorDynamicsController.cxx
mvdColorDynamicsWidget.cxx
mvdColorSetupController.cxx
mvdColorSetupWidget.cxx
mvdDatasetCreationProgressDialog.cxx
mvdDatasetDescriptor.cxx
mvdDatasetModel.cxx
mvdGLImageWidget.cxx
mvdGui.cxx
mvdHistogramModel.cxx
mvdI18nApplication.cxx
mvdImageModelRenderer.cxx
mvdImageViewManipulator.cxx
mvdMath.cxx
mvdQuicklookModel.cxx
mvdQuicklookViewManipulator.cxx
mvdStatusBarWidget.cxx
mvdSystemError.cxx
mvdTypes.cxx
mvdVectorImageModel.cxx
mvdApplicationsToolBox.cxx
mvdMainWindowTitleLoader.cxx
mvdApplicationsBrowser.cxx
)
# Headers for classes with Q_OBJECT macro (needs to go to Qt moc)
set( Common_HEADERS_MOC
mvdAboutDialog.h
mvdAbstractImageModel.h
mvdAbstractModelController.h
mvdAbstractModel.h
mvdAbstractModelRenderer.h
mvdAbstractViewManipulator.h
mvdColorBandDynamicsWidget.h
mvdColorDynamicsController.h
mvdColorDynamicsWidget.h
mvdColorSetupController.h
mvdColorSetupWidget.h
mvdDatasetCreationProgressDialog.h
mvdDatasetDescriptor.h
mvdDatasetModel.h
mvdGLImageWidget.h
mvdHistogramModel.h
mvdI18nApplication.h
mvdImageModelRenderer.h
mvdImageViewManipulator.h
mvdQuicklookModel.h
mvdQuicklookViewManipulator.h
mvdStatusBarWidget.h
mvdVectorImageModel.h
mvdApplicationsToolBox.h
mvdMainWindowTitleLoader.h
mvdApplicationsBrowser.h
)
# Qt designer UI files
set( Common_FORMS
mvdAboutDialog.ui
mvdColorBandDynamicsWidget.ui
mvdColorDynamicsWidget.ui
mvdColorSetupWidget.ui
mvdDatasetCreationProgressDialog.ui
mvdMyWidget.ui
mvdStatusBarWidget.ui
mvdVideoColorToolBox.ui
mvdApplicationsToolBox.ui
)
# Qt resources
set( Common_RESOURCES
)
include_directories(
${Monteverdi2_BINARY_DIR}
${Monteverdi2_SOURCE_DIR}/Code/Common
${Monteverdi2_BINARY_DIR}/Code/Common
)
#############################################################################
# Qt4 wrapped files.
qt4_wrap_cpp( Common_SRC_MOC ${Common_HEADERS_MOC} )
qt4_wrap_ui( Common_FORMS_HEADERS ${Common_FORMS} )
qt4_add_resources( Common_RESOURCES_RCC ${Common_RESOURCES} )
########################################################################
# Qt4 translations.
# Sources files to translate.
add_to_qt4_i18n_sources(
${Common_SOURCES}
${Common_HEADERS_MOC}
${Common_FORMS}
)
#############################################################################
add_library(Monteverdi2_Common
${Common_SOURCES}
${Common_FORMS_HEADERS}
${Common_SRC_MOC}
${Common_RESOURCES_RCC}
)
#############################################################################
target_link_libraries(Monteverdi2_Common
OTBIO OTBApplicationEngine
${OPENGL_LIBRARIES}
Qt4::QtCore
Qt4::QtGui
Qt4::QtOpenGL
Qt4::QtXml
)
set_target_properties(Monteverdi2_Common
PROPERTIES ${Monteverdi2_LIBRARY_PROPERTIES}
)
#############################################################################
# INSTALL Common application.
install(
TARGETS Monteverdi2_Common
RUNTIME DESTINATION ${Monteverdi2_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Development
)
#############################################################################
############################################################################
# Sub-directory entries
add_subdirectory( Core )
add_subdirectory( Gui )
#############################################################################
# Source files of Common library
# Package CORE (files ordered by lexicographical order i.e. ease of search).
set( Common_Core_SOURCES
mvdAbstractImageModel.cxx
mvdAbstractModel.cxx
mvdAlgorithm.cxx
mvdDatasetDescriptor.cxx
mvdDatasetModel.cxx
mvdHistogramModel.cxx
mvdI18nApplication.cxx
mvdMath.cxx
mvdMyClass.cxx
mvdQuicklookModel.cxx
mvdSystemError.cxx
mvdTypes.cxx
mvdVectorImageModel.cxx
)
#############################################################################
# Qt's MOC header files for Common library (QObject derived classes).
# Package CORE (files ordered by lexicographical order i.e. ease of search).
set( Common_Core_HEADERS_MOC
mvdAbstractImageModel.h
mvdAbstractModel.h
mvdAlgorithm.h
mvdDatasetDescriptor.h
mvdDatasetModel.h
mvdHistogramModel.h
mvdI18nApplication.h
mvdMath.h
mvdMyClass.h
mvdQuicklookModel.h
mvdSystemError.h
mvdTypes.h
mvdVectorImageModel.h
)
#############################################################################
# Includes
include_directories(
${Monteverdi2_BINARY_DIR}
#
${Monteverdi2_SOURCE_DIR}/Code/Common
#
${Monteverdi2_BINARY_DIR}/Code/Common
)
#############################################################################
# Qt4 wrapped files (meta-object generated).
qt4_wrap_cpp( Common_Core_SRC_MOC ${Common_Core_HEADERS_MOC} )
########################################################################
# Qt4 translations.
# Sources files to translate.
add_to_qt4_i18n_sources(
${Common_Core_SOURCES}
)
#############################################################################
add_library(Monteverdi2_Core
${Common_Core_SOURCES}
${Common_Core_SRC_MOC}
)
#############################################################################
target_link_libraries(Monteverdi2_Core
OTBIO
OTBApplicationEngine
Qt4::QtCore
Qt4::QtXml
)
#############################################################################
set_target_properties(Monteverdi2_Core
PROPERTIES ${Monteverdi2_LIBRARY_PROPERTIES}
)
#############################################################################
# INSTALL Common application.
install(
TARGETS Monteverdi2_Core
RUNTIME DESTINATION ${Monteverdi2_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Development
)
#############################################################################
......@@ -47,9 +47,9 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdColorSetupWidget.h"
#include "mvdAbstractImageModel.h"
#include "mvdTypes.h"
#include "Core/mvdAbstractImageModel.h"
#include "Core/mvdTypes.h"
#include "Gui/mvdColorSetupWidget.h"
/*****************************************************************************/
/* PRE-DECLARATION SECTION */
......
#############################################################################
# Source files of Common library
# Package GUI (files ordered by lexicographical order i.e. ease of search).
set( Common_Gui_SOURCES
mvdAboutDialog.cxx
mvdAbstractModelController.cxx
#mvdAbstractModelRenderer.cxx
mvdAbstractViewManipulator.cxx
mvdApplicationsBrowser.cxx
mvdApplicationsToolBox.cxx
mvdColorBandDynamicsWidget.cxx
mvdColorDynamicsController.cxx
mvdColorDynamicsWidget.cxx
mvdColorSetupController.cxx
mvdColorSetupWidget.cxx
mvdDatasetCreationProgressDialog.cxx
mvdGLImageWidget.cxx
mvdGui.cxx
mvdImageModelRenderer.cxx
mvdImageViewManipulator.cxx
mvdMainWindowTitleLoader.cxx
mvdMyWidget.cxx
mvdQuicklookViewManipulator.cxx
mvdStatusBarWidget.cxx
)
#############################################################################
# Qt's MOC header files for Common library (QObject derived classes).
# Package GUI (files ordered by lexicographical order i.e. ease of search).
set( Common_Gui_HEADERS_MOC
mvdAboutDialog.h
mvdAbstractModelController.h
mvdAbstractModelRenderer.h
mvdAbstractViewManipulator.h
mvdApplicationsBrowser.h
mvdApplicationsToolBox.h
mvdColorBandDynamicsWidget.h
mvdColorDynamicsController.h
mvdColorDynamicsWidget.h
mvdColorSetupController.h
mvdColorSetupWidget.h
mvdDatasetCreationProgressDialog.h
mvdGLImageWidget.h
mvdGui.h
mvdImageModelRenderer.h
mvdImageViewManipulator.h
mvdMainWindowTitleLoader.h
mvdMyWidget.h
mvdQuicklookViewManipulator.h
mvdStatusBarWidget.h
)
#############################################################################
# Qt designer UI files
set( Common_Gui_FORMS
mvdAboutDialog.ui
mvdColorBandDynamicsWidget.ui
mvdColorDynamicsWidget.ui
mvdColorSetupWidget.ui
mvdDatasetCreationProgressDialog.ui
mvdMyWidget.ui
mvdStatusBarWidget.ui
mvdVideoColorToolBox.ui
mvdApplicationsToolBox.ui
)
# Qt resources
set( Common_Gui_RESOURCES
)
include_directories(
${Monteverdi2_BINARY_DIR}
#
${Monteverdi2_SOURCE_DIR}/Code/Common
#
${Monteverdi2_BINARY_DIR}/Code/Common
)
#############################################################################
# Qt4 wrapped files.
qt4_wrap_cpp( Common_Gui_SRC_MOC ${Common_Gui_HEADERS_MOC} )
qt4_wrap_ui( Common_Gui_FORMS_HEADERS ${Common_Gui_FORMS} )
qt4_add_resources( Common_Gui_RESOURCES_RCC ${Common_Gui_RESOURCES} )
########################################################################
# Qt4 translations.
# Sources files to translate.
add_to_qt4_i18n_sources(
${Common_Gui_SOURCES}
${Common_Gui_HEADERS_MOC}
${Common_Gui_FORMS}
)
#############################################################################
add_library(Monteverdi2_Gui
${Common_Gui_SOURCES}
${Common_Gui_FORMS_HEADERS}
${Common_Gui_SRC_MOC}
${Common_Gui_RESOURCES_RCC}
)
#############################################################################
target_link_libraries(Monteverdi2_Gui
Monteverdi2_Core
${OPENGL_LIBRARIES}
#Qt4::QtCore
Qt4::QtGui
Qt4::QtOpenGL
)
set_target_properties(Monteverdi2_Gui
PROPERTIES ${Monteverdi2_LIBRARY_PROPERTIES}
)
#############################################################################
# INSTALL Common application.
install(
TARGETS Monteverdi2_Gui
RUNTIME DESTINATION ${Monteverdi2_INSTALL_BIN_DIR} COMPONENT Runtime
LIBRARY DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Runtime
ARCHIVE DESTINATION ${Monteverdi2_INSTALL_LIB_DIR} COMPONENT Development
)
#############################################################################
......@@ -16,8 +16,8 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "mvdAboutDialog.h"
#include "ui_mvdAboutDialog.h"
#include "Gui/mvdAboutDialog.h"
#include "Gui/ui_mvdAboutDialog.h"
//
// Qt includes (sorted by alphabetic order)
......
......@@ -34,7 +34,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#include "mvdAbstractModel.h"
#include "Core/mvdAbstractModel.h"
namespace mvd