CMakeLists.txt 2.91 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
#############################################################################
22
set( OTBMapla_SRCS
23 24
  mvdMaplaApplication.cxx
  mvdMaplaMainWindow.cxx
25 26
  )

27 28
#############################################################################
set( OTBMapla_HEADERS_MOC
29 30
       ../include/mvdMaplaApplication.h
       ../include/mvdMaplaMainWindow.h
31 32 33 34 35 36 37 38 39 40 41 42 43 44
       # mvdPreferencesDialog.h
)

#############################################################################
set( OTBMapla_FORMS
       mvdMaplaMainWindow.ui
       # mvdPreferencesDialog.ui
)

#############################################################################
set( OTBMapla_RESOURCES
       mvdMaplaMainWindow.qrc
)

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
if (WIN32)
  # Windows Resource file need to have the full path to icon
  # if the .ico is not in the current dir
  set( Mapla_App_WIN32_ICON ${OTB_SOURCE_DIR}/Utilities/Data/Icons/monteverdi.ico)
  configure_file(
    mvdMaplaWin32.rc.in
    mvdMaplaWin32.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( Mapla_App_WIN32_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/mvdMaplaWin32.rc )
endif()

63
#############################################################################
64 65 66
qt5_wrap_cpp( OTBMapla_SRC_MOC ${OTBMapla_HEADERS_MOC} )
qt5_wrap_ui( OTBMapla_FORMS_HEADERS ${OTBMapla_FORMS}  )
qt5_add_resources( OTBMapla_RESOURCES_RCC ${OTBMapla_RESOURCES} OPTIONS "-no-compress")
67

68 69
#############################################################################
add_to_qt4_i18n_sources( ${OTBMapla_SRCS} )
70 71
add_to_qt4_i18n_headers( "../include" ${OTBMapla_SRCS} )
add_to_qt4_i18n_forms( ${OTBMapla_FORMS} )
72

73 74 75 76 77 78 79
##########################[Mapla library]####################################
add_library( OTBMapla
  ${OTBMapla_SRCS}
  ${OTBMapla_FORMS_HEADERS}
  ${OTBMapla_SRC_MOC}
  )
target_link_libraries( OTBMapla
80 81
  ${OTBMonteverdiCore_LIBRARIES}
  ${OTBMonteverdiGUI_LIBRARIES}
82
  ${OTBQt_LIBRARIES}
83
  )
84
otb_module_target( OTBMapla )
85

86 87 88 89 90 91 92 93 94
############################[Mapla executable]###############################
add_executable( mapla
  main.cxx
  ${Mapla_App_WIN32_RC_FILE}
  ${OTBMapla_RESOURCES_RCC}
  )
target_link_libraries( mapla
  OTBMapla
  )
95
otb_module_target( mapla )