Salome HOME
48f16313e3ec5783bf01bdff62f3acc1043527bf
[modules/geom.git] / src / VTKPlugin / CMakeLists.txt
1 # Copyright (C) 2014-2023  CEA/DEN, EDF R&D, OPEN CASCADE
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_BUILD_GUI)
21   INCLUDE(UseQtExt)
22 ENDIF()
23
24 # --- options ---
25
26 # additional include directories
27 INCLUDE_DIRECTORIES(
28   ${OpenCASCADE_INCLUDE_DIR}
29   ${KERNEL_INCLUDE_DIRS}
30   ${PROJECT_BINARY_DIR}/idl
31   ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
32   ${PROJECT_SOURCE_DIR}/src/GEOM
33   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
34   ${PROJECT_SOURCE_DIR}/src/GEOM_I
35   ${PROJECT_SOURCE_DIR}/src/GEOMClient
36   ${PROJECT_SOURCE_DIR}/src/OCC2VTK
37   ${PROJECT_SOURCE_DIR}/src/GEOMUtils
38   )
39   
40 IF(SALOME_BUILD_GUI)
41   INCLUDE_DIRECTORIES(
42     ${GUI_INCLUDE_DIRS}
43     ${PROJECT_SOURCE_DIR}/src/OBJECT
44     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
45     ${PROJECT_SOURCE_DIR}/src/GEOMBase
46     )
47 ENDIF()
48
49 # additional preprocessor / compiler flags
50 ADD_DEFINITIONS(
51   ${OpenCASCADE_DEFINITIONS}
52   ${OMNIORB_DEFINITIONS}
53   )
54    
55 IF(WIN32)
56   ADD_DEFINITIONS(-DNOGDI)
57 ENDIF(WIN32)
58  
59 IF(SALOME_BUILD_GUI)
60 ADD_DEFINITIONS(
61   ${QT_DEFINITIONS}
62   )
63 ENDIF()
64
65 # libraries to link to
66 SET(_link_engine_LIBRARIES
67   ${KERNEL_SALOMELocalTrace}
68   ${KERNEL_OpUtil}
69   SalomeIDLGEOM
70   SalomeIDLVTKPlugin
71   GEOMEngine
72   GEOMClient
73   VTK::IOLegacy
74   OCC2VTK
75   )
76   
77 IF(SALOME_BUILD_GUI)
78   SET(_link_gui_LIBRARIES
79     SalomeIDLVTKPlugin
80     GEOMObject
81     GEOM
82     GEOMBase
83     )
84 ENDIF()
85
86
87 # --- headers ---
88
89 SET(VTKPluginEngine_HEADERS
90   VTKPlugin_IOperations_i.hh
91   VTKPlugin_Engine.hxx
92   VTKPlugin_OperationsCreator.hxx
93   VTKPlugin_IOperations.hxx
94   VTKPlugin_IExport.hxx 
95   VTKPlugin_ExportDriver.hxx
96   VTKPlugin_IECallBack.hxx
97   )
98
99 IF(SALOME_BUILD_GUI)  
100   # header files / to be processed by moc
101   SET(_moc_HEADERS
102     VTKPlugin_GUI.h
103     VTKPlugin_ExportDlg.h
104     )
105 ENDIF()
106
107 # --- sources ---
108
109 IF(SALOME_BUILD_GUI)
110   # sources / moc wrappings
111   QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
112
113   SET(VTKPluginGUI_SOURCES
114     VTKPlugin_GUI.cxx
115     VTKPlugin_ExportDlg.cxx
116     ${_moc_SOURCES}
117     )
118 ENDIF()
119   
120 SET(VTKPluginEngine_SOURCES
121   VTKPlugin_Engine.cxx
122   VTKPlugin_OperationsCreator.cxx
123   VTKPlugin_IOperations_i.cc
124   VTKPlugin_IOperations.cxx
125   VTKPlugin_ExportDriver.cxx
126   VTKPlugin_IECallBack.cxx
127   )
128   
129 # resource files / to be processed by lrelease
130 SET(VTKPlugin_RESOURCES
131   VTKPlugin_msg_en.ts
132   VTKPlugin_msg_fr.ts
133   VTKPlugin_msg_ja.ts
134   )
135
136 # --- rules ---
137
138 ADD_LIBRARY(VTKPluginEngine ${VTKPluginEngine_SOURCES})
139 TARGET_LINK_LIBRARIES(VTKPluginEngine ${_link_engine_LIBRARIES})
140 INSTALL(TARGETS VTKPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
141
142 IF(SALOME_BUILD_GUI)
143   ADD_LIBRARY(VTKPluginGUI ${VTKPluginGUI_SOURCES})
144   TARGET_LINK_LIBRARIES(VTKPluginGUI ${_link_gui_LIBRARIES})
145   INSTALL(TARGETS VTKPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
146   
147   QT_INSTALL_TS_RESOURCES("${VTKPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
148 ENDIF()
149
150
151 INSTALL(FILES ${VTKPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})