Salome HOME
0022616: [CEA 1038] Improve the quality of stl and vtk exports
[modules/geom.git] / src / BREPPlugin / 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   ${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/GEOMUtils
38   )
39   
40 IF(SALOME_BUILD_GUI)
41   INCLUDE_DIRECTORIES(
42     ${QT_INCLUDE_DIRS}
43     ${GUI_INCLUDE_DIRS}
44     ${PROJECT_SOURCE_DIR}/src/OBJECT
45     ${PROJECT_SOURCE_DIR}/src/GEOMGUI
46     ${PROJECT_SOURCE_DIR}/src/GEOMBase
47     )
48 ENDIF()
49
50 # additional preprocessor / compiler flags
51 ADD_DEFINITIONS(
52   ${CAS_DEFINITIONS}
53   )
54   
55 IF(SALOME_BUILD_GUI)
56 ADD_DEFINITIONS(
57   ${QT_DEFINITIONS}
58   )
59 ENDIF()
60
61 # libraries to link to
62 SET(_link_engine_LIBRARIES
63   ${CAS_TKBREP}
64   ${KERNEL_SALOMELocalTrace}
65   ${KERNEL_OpUtil}
66   SalomeIDLGEOM
67   SalomeIDLBREPPlugin
68   GEOMEngine
69   GEOMClient
70   )
71   
72 IF(SALOME_BUILD_GUI)
73   SET(_link_gui_LIBRARIES
74     SalomeIDLBREPPlugin
75     GEOMObject
76     GEOM
77     GEOMBase
78     )
79 ENDIF()
80
81
82 # --- headers ---
83
84 SET(BREPPluginEngine_HEADERS
85   BREPPlugin_IOperations_i.hh
86   BREPPlugin_Engine.hxx
87   BREPPlugin_OperationsCreator.hxx
88   BREPPlugin_IOperations.hxx
89   BREPPlugin_IExport.hxx 
90   BREPPlugin_IImport.hxx
91   BREPPlugin_ImportDriver.hxx 
92   BREPPlugin_ExportDriver.hxx
93   BREPPlugin_IECallBack.hxx
94   )
95
96 IF(SALOME_BUILD_GUI)  
97   # header files / to be processed by moc
98   SET(_moc_HEADERS
99     BREPPlugin_GUI.h
100     )
101 ENDIF()
102
103 # --- sources ---
104
105 IF(SALOME_BUILD_GUI)
106   # sources / moc wrappings
107   QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
108
109   SET(BREPPluginGUI_SOURCES
110     BREPPlugin_GUI.cxx
111     ${_moc_SOURCES}
112     )
113 ENDIF()
114   
115 SET(BREPPluginEngine_SOURCES
116   BREPPlugin_Engine.cxx
117   BREPPlugin_OperationsCreator.cxx
118   BREPPlugin_IOperations_i.cc
119   BREPPlugin_IOperations.cxx
120   BREPPlugin_ExportDriver.cxx
121   BREPPlugin_ImportDriver.cxx
122   BREPPlugin_IECallBack.cxx
123   )
124   
125 # resource files / to be processed by lrelease
126 SET(BREPPlugin_RESOURCES
127   BREPPlugin_msg_en.ts
128   BREPPlugin_msg_fr.ts
129   BREPPlugin_msg_ja.ts
130   )
131
132 # --- rules ---
133
134 ADD_LIBRARY(BREPPluginEngine ${BREPPluginEngine_SOURCES})
135 TARGET_LINK_LIBRARIES(BREPPluginEngine ${_link_engine_LIBRARIES})
136 INSTALL(TARGETS BREPPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
137
138 IF(SALOME_BUILD_GUI)
139   ADD_LIBRARY(BREPPluginGUI ${BREPPluginGUI_SOURCES})
140   TARGET_LINK_LIBRARIES(BREPPluginGUI ${_link_gui_LIBRARIES})
141   INSTALL(TARGETS BREPPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
142   
143   QT4_INSTALL_TS_RESOURCES("${BREPPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
144 ENDIF()
145
146
147 INSTALL(FILES ${BREPPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})