CMakeLists.txt 6.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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
set(OTBQtWidget_SRC
  otbQtLogOutput.cxx
  otbWrapperQtWidgetModel.cxx
  otbWrapperQtWidgetParameterLabel.cxx
  otbWrapperQtWidgetView.cxx
  otbWrapperQtWidgetInputProcessXMLParameter.cxx
  otbWrapperQtWidgetIntParameter.cxx
  otbWrapperQtWidgetInputVectorDataListParameter.cxx
  otbWrapperQtWidgetSimpleProgressReport.cxx
  otbWrapperQtWidgetFloatParameter.cxx
  otbWrapperQtWidgetChoiceParameter.cxx
  otbWrapperQtWidgetComplexOutputImageParameter.cxx
  otbWrapperQtWidgetOutputFilenameParameter.cxx
  otbQtStringSelectionWidget.cxx
  itkQtProgressBar.cxx
  otbWrapperQtWidgetStringParameter.cxx
  otbQtApplication.cxx
  otbWrapperQtWidgetParameterFactory.cxx
  otbWrapperQtWidgetListViewParameter.cxx
  otbWrapperQtWidgetDirectoryParameter.cxx
  otbWrapperQtWidgetOutputImageParameter.cxx
  otbWrapperQtWidgetInputVectorDataParameter.cxx
  otbQtFileSelectionWidget.cxx
  otbWrapperQtWidgetParameterGroup.cxx
  otbWrapperQtWidgetInputFilenameListParameter.cxx
  otbWrapperQtWidgetComplexInputImageParameter.cxx
  otbWrapperQtWidgetRAMParameter.cxx
  otbWrapperQtWidgetProgressReport.cxx
  otbWrapperQtWidgetOutputProcessXMLParameter.cxx
  otbWrapperQtWidgetParameterBase.cxx
  otbWrapperQtWidgetInputImageParameter.cxx
  otbWrapperQtWidgetStringListParameter.cxx
  otbWrapperQtWidgetEmptyParameter.cxx
  otbWrapperQtWidgetOutputVectorDataParameter.cxx
  otbWrapperQtWidgetInputFilenameParameter.cxx
  otbWrapperQtWidgetInputImageListParameter.cxx
57
  otbWrapperQtWidgetListEditWidget.cxx
58
  otbWrapperQtWidgetListEditItemModel.cxx
59
  otbWrapperQtWidgetParameterList.cxx
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  )

set(OTBQtWidget_MOC_HDR
  ../include/otbWrapperQtWidgetEmptyParameter.h
  ../include/otbWrapperQtWidgetFloatParameter.h
  ../include/otbWrapperQtWidgetIntParameter.h
  ../include/otbWrapperQtWidgetStringParameter.h
  ../include/otbWrapperQtWidgetStringListParameter.h
  ../include/otbWrapperQtWidgetChoiceParameter.h
  ../include/otbWrapperQtWidgetInputImageParameter.h
  ../include/otbWrapperQtWidgetComplexInputImageParameter.h
  ../include/otbWrapperQtWidgetComplexOutputImageParameter.h
  ../include/otbWrapperQtWidgetInputImageListParameter.h
  ../include/otbWrapperQtWidgetInputVectorDataListParameter.h
  ../include/otbWrapperQtWidgetInputVectorDataParameter.h
  ../include/otbWrapperQtWidgetOutputImageParameter.h
  ../include/otbWrapperQtWidgetOutputVectorDataParameter.h
  ../include/otbWrapperQtWidgetOutputProcessXMLParameter.h
  ../include/otbWrapperQtWidgetInputProcessXMLParameter.h
  ../include/otbWrapperQtWidgetParameterGroup.h
  ../include/otbWrapperQtWidgetParameterLabel.h
  ../include/otbWrapperQtWidgetParameterBase.h
  ../include/otbWrapperQtWidgetModel.h
  ../include/otbWrapperQtWidgetView.h
  ../include/otbWrapperQtWidgetProgressReport.h
  ../include/otbWrapperQtWidgetListViewParameter.h
  ../include/otbQtFileSelectionWidget.h
  ../include/otbQtStringSelectionWidget.h
  ../include/otbQtApplication.h
  ../include/itkQtProgressBar.h
  ../include/otbWrapperQtWidgetInputFilenameParameter.h
  ../include/otbWrapperQtWidgetInputFilenameListParameter.h
  ../include/otbWrapperQtWidgetOutputFilenameParameter.h
  ../include/otbQtLogOutput.h
  ../include/otbWrapperQtWidgetDirectoryParameter.h
  ../include/otbWrapperQtWidgetSimpleProgressReport.h
  ../include/otbWrapperQtWidgetRAMParameter.h
97
  ../include/otbWrapperQtWidgetListEditWidget.h
98
  ../include/otbWrapperQtWidgetListEditItemModel.h
99
  ../include/otbWrapperQtWidgetParameterList.h
100 101
  )

102 103 104 105
set( OTBQtWidget_FORMS
  otbWrapperQtWidgetListEditWidget.ui
  )

106 107
qt5_wrap_cpp( OTBQtWidget_MOC_SRC ${OTBQtWidget_MOC_HDR} )
qt5_wrap_ui( OTBQtWidget_FORMS_HEADERS ${OTBQtWidget_FORMS} )
108

109 110 111 112 113
add_library( OTBQtWidget
  ${OTBQtWidget_SRC}
  ${OTBQtWidget_FORMS_HEADERS}
  ${OTBQtWidget_MOC_SRC}
  )
114 115

target_link_libraries( OTBQtWidget
116 117
  ${OTBApplicationEngine_LIBRARIES}
  ${OTBQt4_LIBRARIES}
118
  ${OTBQtAdapters_LIBRARIES}
119
  )
120

121
otb_module_target(OTBQtWidget)
122 123 124 125 126 127 128 129

add_executable(otbApplicationLauncherQt otbApplicationLauncherQt.cxx)
target_link_libraries(otbApplicationLauncherQt
  ${OTBQtWidget_LIBRARIES}
  ${OTBApplicationEngine_LIBRARIES}
  ${OTBQt4_LIBRARIES}
  )
otb_module_target(otbApplicationLauncherQt)
130
set_linker_stack_size_flag(otbApplicationLauncherQt 10000000)
131 132

# Where we will install the script in the build tree
133
get_target_property(GUI_OUTPUT_DIR otbApplicationLauncherQt RUNTIME_OUTPUT_DIRECTORY)
134 135 136 137 138 139 140 141 142 143 144

# Generate a script in the build dir, next to the gui launcher
# Need a two-step process since configure_file don't support permissions
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Scripts)


if (WIN32)
configure_file( ${CMAKE_SOURCE_DIR}/CMake/otbgui.bat.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Scripts/otbgui.bat
                @ONLY )
file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Scripts/otbgui.bat
145
     DESTINATION ${GUI_OUTPUT_DIR}
146 147 148
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

# TODO : test if NO_INSTALL is set
149
install(PROGRAMS ${GUI_OUTPUT_DIR}/otbgui.bat
150 151 152 153 154 155 156 157
        DESTINATION ${OTBQtWidget_INSTALL_RUNTIME_DIR}
        COMPONENT Runtime)

else()
configure_file( ${CMAKE_SOURCE_DIR}/CMake/otbgui.sh.in
                ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Scripts/otbgui
                @ONLY )
file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Scripts/otbgui
158
     DESTINATION ${GUI_OUTPUT_DIR}
159 160 161
     FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

# TODO : test if NO_INSTALL is set
162
install(PROGRAMS ${GUI_OUTPUT_DIR}/otbgui
163 164 165 166
        DESTINATION ${OTBQtWidget_INSTALL_RUNTIME_DIR}
        COMPONENT Runtime)

endif()