CMakeLists.txt 3.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
#     https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

21
set( OTBMonteverdi_SRCS
22 23 24 25 26
  mvdApplication.cxx
  mvdMainWindow.cxx
  mvdPreferencesDialog.cxx
  )

27 28
#############################################################################
set( OTBMonteverdi_HEADERS_MOC
29 30 31
  ../include/mvdApplication.h
  ../include/mvdMainWindow.h
  ../include/mvdPreferencesDialog.h
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
  )

#############################################################################
# Qt designer UI files
set( OTBMonteverdi_FORMS
  mvdMainWindow.ui
  mvdPreferencesDialog.ui
  )

#############################################################################
set( OTBMonteverdi_RESOURCES
  mvdMainWindow.qrc
  )

#############################################################################
47 48 49
qt5_wrap_cpp( OTBMonteverdi_SRC_MOC ${OTBMonteverdi_HEADERS_MOC} )
qt5_wrap_ui( OTBMonteverdi_FORMS_HEADERS ${OTBMonteverdi_FORMS}  )
qt5_add_resources( OTBMonteverdi_RESOURCES_RCC ${OTBMonteverdi_RESOURCES} OPTIONS "-no-compress")
50

51 52
#############################################################################
add_to_qt4_i18n_sources( ${OTBMonteverdi_SRCS} )
53 54
add_to_qt4_i18n_headers( "../include" ${OTBMonteverdi_SRCS} )
add_to_qt4_i18n_forms( ${OTBMonteverdi_FORMS} )
55

56
#############################################################################
57 58 59 60 61 62
add_library( OTBMonteverdi
  ${OTBMonteverdi_SRCS}
  ${OTBMonteverdi_FORMS_HEADERS}
  ${OTBMonteverdi_SRC_MOC}
  )
target_link_libraries( OTBMonteverdi
63 64
  ${OTBMonteverdiCore_LIBRARIES}
  ${OTBMonteverdiGUI_LIBRARIES}
65
  ${OTBQt_LIBRARIES}
66
  ${OTBQtAdapters_LIBRARIES}
67
  )
68
otb_module_target( OTBMonteverdi )
69

70 71 72 73
#######################[ Monteverdi executable ]#############################
if (WIN32)
  # Windows Resource file need to have the full path to icon
  # if the .ico is not in the current dir
74
  set( Monteverdi_App_WIN32_ICON ${OTB_SOURCE_DIR}/Utilities/Data/Icons/monteverdi.ico)
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
  configure_file(
    mvdWin32.rc.in
    mvdWin32.rc
    @ONLY
    )

  if (MINGW)
    set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
  endif()

  # The RC file to be added to source list
  set( Monteverdi_App_WIN32_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/mvdWin32.rc )
endif()

add_executable( monteverdi
  main.cxx
  ${Monteverdi_App_WIN32_RC_FILE}
  ${OTBMonteverdi_RESOURCES_RCC}
  )
94 95 96 97 98 99 100 101

# set monterverdi stack size to 10Mbytes on windows platform because
# the default size with visual compiler it is 1Mbyte
# which is to lower for us (thanks to 6S code).
if (WIN32)
  set_linker_stack_size_flag( monteverdi 10000000 )
endif()

102 103 104
target_link_libraries( monteverdi
  OTBMonteverdi
  )
105
otb_module_target( monteverdi )