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