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