Salome HOME
6634a1ac8c52a9b919b612f97e4274a10233e0d9
[modules/geom.git] / src / XAOPlugin / CMakeLists.txt
1 # Copyright (C) 2012-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   ${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/GEOMUtils
37   ${PROJECT_SOURCE_DIR}/src/XAO
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     ${PROJECT_SOURCE_DIR}/src/DlgRef
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_TKXAO}
70   ${KERNEL_SALOMELocalTrace}
71   ${KERNEL_OpUtil}
72   SalomeIDLGEOM
73   SalomeIDLXAOPlugin
74   GEOMEngine
75   GEOMClient
76   XAO
77   )
78   
79 IF(SALOME_BUILD_GUI)
80   SET(_link_gui_LIBRARIES
81     SalomeIDLXAOPlugin
82     DlgRef
83     GEOMObject
84     GEOM
85     GEOMBase
86     )
87 ENDIF()
88
89 # --- headers ---
90
91 SET(XAOPluginEngine_HEADERS
92   XAOPlugin_IOperations_i.hh
93   XAOPlugin_Engine.hxx
94   XAOPlugin_OperationsCreator.hxx
95   XAOPlugin_IOperations.hxx
96   XAOPlugin_IImportExport.hxx 
97   XAOPlugin_Driver.hxx 
98   XAOPlugin_IECallBack.hxx
99   )
100
101 IF(SALOME_BUILD_GUI) 
102   # header files / to be processed by moc
103   SET(_moc_HEADERS
104     XAOPlugin_ExportDlg.h
105     XAOPlugin_ImportDlg.h
106     )
107 ENDIF()
108
109 # --- sources ---
110
111 IF(SALOME_BUILD_GUI)
112   # sources / moc wrappings
113   QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
114
115   SET(XAOPluginGUI_SOURCES
116     XAOPlugin_GUI.cxx
117     XAOPlugin_ExportDlg.cxx
118     XAOPlugin_ImportDlg.cxx
119     ${_moc_SOURCES}
120     )
121 ENDIF()
122   
123 SET(XAOPluginEngine_SOURCES
124   XAOPlugin_Engine.cxx
125   XAOPlugin_OperationsCreator.cxx
126   XAOPlugin_IOperations_i.cc
127   XAOPlugin_IOperations.cxx
128   XAOPlugin_Driver.cxx
129   XAOPlugin_IECallBack.cxx
130   )
131   
132 # resource files / to be processed by lrelease
133 SET(XAOPlugin_RESOURCES
134   XAOPlugin_images.ts
135   XAOPlugin_msg_en.ts
136   XAOPlugin_msg_fr.ts
137   XAOPlugin_msg_ja.ts
138   )
139
140 # --- rules ---
141
142 ADD_LIBRARY(XAOPluginEngine ${XAOPluginEngine_SOURCES})
143 TARGET_LINK_LIBRARIES(XAOPluginEngine ${_link_engine_LIBRARIES})
144 INSTALL(TARGETS XAOPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
145
146 IF(SALOME_BUILD_GUI)
147   ADD_LIBRARY(XAOPluginGUI ${XAOPluginGUI_SOURCES})
148   TARGET_LINK_LIBRARIES(XAOPluginGUI ${_link_gui_LIBRARIES})
149   INSTALL(TARGETS XAOPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
150   
151   QT4_INSTALL_TS_RESOURCES("${XAOPlugin_RESOURCES}" "${SALOME_GEOM_INSTALL_RES_DATA}")
152 ENDIF()
153
154
155 INSTALL(FILES ${XAOPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})