Salome HOME
Merge branch 'master' into rnc/t_shape_plugin
[modules/geom.git] / src / VTKPlugin / CMakeLists.txt
1 # Copyright (C) 2014-2015  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   ${OMNIORB_DEFINITIONS}
56   )
57    
58 IF(WIN32)
59   ADD_DEFINITIONS(-DNOGDI)
60 ENDIF(WIN32)
61  
62 IF(SALOME_BUILD_GUI)
63 ADD_DEFINITIONS(
64   ${QT_DEFINITIONS}
65   )
66 ENDIF()
67
68 # libraries to link to
69 SET(_link_engine_LIBRARIES
70   ${CAS_TKVTK}
71   ${KERNEL_SALOMELocalTrace}
72   ${KERNEL_OpUtil}
73   SalomeIDLGEOM
74   SalomeIDLVTKPlugin
75   GEOMEngine
76   GEOMClient
77   vtkIOLegacy
78   OCC2VTK
79   )
80   
81 IF(SALOME_BUILD_GUI)
82   SET(_link_gui_LIBRARIES
83     SalomeIDLVTKPlugin
84     GEOMObject
85     GEOM
86     GEOMBase
87     )
88 ENDIF()
89
90
91 # --- headers ---
92
93 SET(VTKPluginEngine_HEADERS
94   VTKPlugin_IOperations_i.hh
95   VTKPlugin_Engine.hxx
96   VTKPlugin_OperationsCreator.hxx
97   VTKPlugin_IOperations.hxx
98   VTKPlugin_IExport.hxx 
99   VTKPlugin_ExportDriver.hxx
100   VTKPlugin_IECallBack.hxx
101   )
102
103 IF(SALOME_BUILD_GUI)  
104   # header files / to be processed by moc
105   SET(_moc_HEADERS
106     VTKPlugin_GUI.h
107     VTKPlugin_ExportDlg.h
108     )
109 ENDIF()
110
111 # --- sources ---
112
113 IF(SALOME_BUILD_GUI)
114   # sources / moc wrappings
115   QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
116
117   SET(VTKPluginGUI_SOURCES
118     VTKPlugin_GUI.cxx
119     VTKPlugin_ExportDlg.cxx
120     ${_moc_SOURCES}
121     )
122 ENDIF()
123   
124 SET(VTKPluginEngine_SOURCES
125   VTKPlugin_Engine.cxx
126   VTKPlugin_OperationsCreator.cxx
127   VTKPlugin_IOperations_i.cc
128   VTKPlugin_IOperations.cxx
129   VTKPlugin_ExportDriver.cxx
130   VTKPlugin_IECallBack.cxx
131   )
132   
133 # resource files / to be processed by lrelease
134 SET(VTKPlugin_RESOURCES
135   VTKPlugin_msg_en.ts
136   VTKPlugin_msg_fr.ts
137   VTKPlugin_msg_ja.ts
138   )
139
140 # --- rules ---
141
142 ADD_LIBRARY(VTKPluginEngine ${VTKPluginEngine_SOURCES})
143 TARGET_LINK_LIBRARIES(VTKPluginEngine ${_link_engine_LIBRARIES})
144 INSTALL(TARGETS VTKPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
145
146 IF(SALOME_BUILD_GUI)
147   ADD_LIBRARY(VTKPluginGUI ${VTKPluginGUI_SOURCES})
148   TARGET_LINK_LIBRARIES(VTKPluginGUI ${_link_gui_LIBRARIES})
149   INSTALL(TARGETS VTKPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
150   
151   QT4_INSTALL_TS_RESOURCES("${VTKPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
152 ENDIF()
153
154
155 INSTALL(FILES ${VTKPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})