Salome HOME
Copyright update 2022
[modules/med.git] / src / MEDCalc / gui / CMakeLists.txt
1 # Copyright (C) 2012-2022  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 IF(SALOME_FIELDS_WITH_QTTESTING)
21   ADD_DEFINITIONS(-DMED_HAS_QTTESTING)
22 ENDIF()
23
24 ADD_DEFINITIONS(${MEDFILE_DEFINITIONS} ${XDR_DEFINITIONS} ${OMNIORB_DEFINITIONS})
25 SET(QT_LIBS "${QT_LIBRARIES}")
26 INCLUDE(UseQtExt)
27
28 ADD_SUBDIRECTORY(dialogs)
29
30 IF(WIN32)
31  ADD_DEFINITIONS(-DNOMINMAX)
32 ENDIF(WIN32)
33
34 SET(MEDCALCGUI_SOURCES 
35     DatasourceController.cxx
36     factory.cxx
37     MEDEventListener_i.cxx
38     MEDModule.cxx
39     PresentationController.cxx
40     ProcessingController.cxx
41     WorkspaceController.cxx
42     XmedConsoleDriver.cxx
43     XmedDataModel.cxx
44     MEDWidgetHelper.cxx
45     MEDWidgetHelperMeshView.cxx
46     MEDWidgetHelperComponent.cxx
47     MEDWidgetHelperContour.cxx
48     MEDWidgetHelperSlices.cxx
49     MEDWidgetHelperPlot3D.cxx
50     MEDWidgetHelperStreamLines.cxx
51     MEDWidgetHelperCutSegment.cxx
52     MEDWidgetHelperVectorField.cxx
53     MEDCALCGUI_Displayer.cxx
54 )
55
56 IF(SALOME_FIELDS_WITH_QTTESTING)
57   LIST(APPEND MEDCALCGUI_SOURCES TestController.cxx)
58 ENDIF()
59
60 SET(MEDCALCGUI_MOC_HEADERS
61   MEDModule.hxx
62   MEDEventListener_i.hxx
63   WorkspaceController.hxx
64   DatasourceController.hxx
65   PresentationController.hxx
66   ProcessingController.hxx
67   MEDWidgetHelper.hxx
68   MEDWidgetHelperMeshView.hxx
69   MEDWidgetHelperComponent.hxx
70   MEDWidgetHelperScalarMap.hxx
71   MEDWidgetHelperContour.hxx
72   MEDWidgetHelperSlices.hxx
73   MEDWidgetHelperPointSprite.hxx
74   MEDWidgetHelperPlot3D.hxx
75   MEDWidgetHelperStreamLines.hxx
76   MEDWidgetHelperCutSegment.hxx
77   MEDWidgetHelperVectorField.hxx
78   MEDWidgetHelperDeflectionShape.hxx
79   )
80
81 SET(MEDCALCGUI_HEADERS
82   MEDCALCGUI_Displayer.hxx
83   )
84  
85 IF(SALOME_FIELDS_WITH_QTTESTING)
86   LIST(APPEND MEDCALCGUI_MOC_HEADERS TestController.hxx)
87 ENDIF()
88
89 QT_WRAP_MOC(MEDCALCGUI_HEADERS_MOC ${MEDCALCGUI_MOC_HEADERS})
90
91 INCLUDE_DIRECTORIES(
92   ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS}
93   ${Boost_INCLUDE_DIRS}
94   ${PTHREAD_INCLUDE_DIR}
95   ${GUI_INCLUDE_DIRS}
96   ${MEDCOUPLING_INCLUDE_DIRS}
97   ${CMAKE_CURRENT_BINARY_DIR}
98   ${CMAKE_CURRENT_SOURCE_DIR}/dialogs
99   ${CMAKE_CURRENT_BINARY_DIR}/dialogs
100   ${CMAKE_CURRENT_SOURCE_DIR}/..
101   ${CMAKE_CURRENT_SOURCE_DIR}/../cmp
102   ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDGUI
103   ${PROJECT_BINARY_DIR}/idl
104   ${PROJECT_BINARY_DIR}
105 )
106
107 SET(MEDCALCGUITS_SOURCES
108   FIELDS_images.ts
109   FIELDS_msg_en.ts
110   FIELDS_msg_fr.ts
111   FIELDS_msg_ja.ts
112   MEDCALC_msg_en.ts
113   MEDCALC_msg_fr.ts
114   MEDCALC_msg_ja.ts
115 )
116
117 SET(link_libraries
118   ${QT_MT_LIBRARIES}
119   ${OMNIORB_LIBRARIES}
120   ${PLATFORM_LIBRARIES}
121   SalomeIDLMED
122   MEDCALCGUI_dialogs
123   MEDFactoryEngine
124   FIELDSEngine
125   ${GUI_qtx}
126   ${GUI_suit}
127   ${GUI_SalomeObject}
128   ${KERNEL_SalomeLifeCycleCORBA}
129   ${KERNEL_SalomeKernelHelpers}
130   ${KERNEL_SalomeDS}
131   ${GUI_SalomeApp}
132   ${GUI_SalomeGuiHelpers}
133   ${GUI_SalomeTreeData}
134   ${KERNEL_OpUtil}
135   ${GUI_CAM}
136   ${GUI_LightApp}
137   ${GUI_PyConsole}
138   ${MEDCoupling_medloader}
139   ${MEDCoupling_medcoupling}
140   ${MEDCoupling_medcouplingremapper}
141 )
142
143 IF(SALOME_FIELDS_WITH_QTTESTING)
144   LIST(APPEND link_libraries QtTesting)  # from ParaView
145 ENDIF()
146
147 ADD_LIBRARY(MEDCALCGUI SHARED ${MEDCALCGUI_SOURCES} ${MEDCALCGUI_HEADERS_MOC})
148 IF(WITH_MEDMEMGUI)
149   SET_TARGET_PROPERTIES(MEDCALCGUI PROPERTIES COMPILE_FLAGS "-D__WITH_MEDMEMGUI__")
150 ENDIF(WITH_MEDMEMGUI)
151 TARGET_LINK_LIBRARIES(MEDCALCGUI ${link_libraries})
152
153 INSTALL(TARGETS MEDCALCGUI DESTINATION ${SALOME_INSTALL_LIBS})
154 QT_INSTALL_TS_RESOURCES("${MEDCALCGUITS_SOURCES}" "${SALOME_FIELDS_INSTALL_RES_DATA}")
155
156 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
157 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})