]> SALOME platform Git repositories - plugins/xtplugin.git/blob - src/CMakeLists.txt
Salome HOME
Implementation of XTPLUGIN as a GEOM plugin (removed and renamed files)
[plugins/xtplugin.git] / src / 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   ${XT_INCLUDE_DIRS}
31   ${KERNEL_INCLUDE_DIRS}
32   ${GUI_INCLUDE_DIRS}
33   ${PROJECT_BINARY_DIR}
34   ${PROJECT_BINARY_DIR}/idl
35   )
36   
37 IF(SALOME_BUILD_GUI)
38   INCLUDE_DIRECTORIES(
39     ${QT_INCLUDE_DIRS}
40     )
41 ENDIF()
42
43 # additional preprocessor / compiler flags
44 ADD_DEFINITIONS(
45   ${CAS_DEFINITIONS}
46   )
47   
48 IF(SALOME_BUILD_GUI)
49 ADD_DEFINITIONS(
50   ${QT_DEFINITIONS}
51   )
52 ENDIF()
53
54 # libraries to link to
55 SET(_link_LIBRARIES
56   ${CAS_TKXSBase}
57   ${XT_LIBRARIES}
58   ${KERNEL_SALOMEBasics}
59   ${KERNEL_SALOMELocalTrace}
60   ${KERNEL_OpUtil}
61   ${GEOM_SalomeIDLGEOM}
62   ${GEOM_GEOMEngine}
63   ${GEOM_GEOMImpl}
64   ${GEOM_GEOMClient}
65   SalomeIDLXTPlugin
66   )
67   
68 IF(SALOME_BUILD_GUI)
69   SET(_link_LIBRARIES
70     ${_link_LIBRARIES}
71     ${GEOM_GEOMBase}
72     )
73 ENDIF()
74
75
76 # --- headers ---
77
78 SET(XTPluginEngine_HEADERS
79   XTPlugin_Operations_i.hh
80   XTPlugin_Engine.hxx
81   XTPlugin_OperationsCreator.hh
82   XTPlugin_IOperations.hxx
83   XTPlugin_IImport.hxx
84   XTPlugin_ImportDriver.hxx 
85   XTPlugin_IECallBack.hxx
86   )
87
88 IF(SALOME_BUILD_GUI)  
89   # header files / to be processed by moc
90   SET(_moc_HEADERS
91     XTPlugin_ImportDlg.h
92     )
93 ENDIF()
94
95 # --- sources ---
96
97 IF(SALOME_BUILD_GUI)
98   # sources / moc wrappings
99   QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
100
101   SET(XTPluginGUI_SOURCES
102     XTPluginGUI.cxx
103     XTPlugin_ImportDlg.cxx
104     ${_moc_SOURCES}
105     )
106 ENDIF()
107   
108 SET(XTPluginEngine_SOURCES
109   XTPluginEngine.cxx
110   XTPlugin_OperationsCreator.cc
111   XTPlugin_Operations_i.cc
112   XTPlugin_IOperations.cxx
113   XTPlugin_ImportDriver.cxx
114   XTPlugin_IECallBack.cxx
115   )
116   
117 # resource files / to be processed by lrelease
118 SET(XTPlugin_RESOURCES
119   resources/XTPlugin_msg_en.ts
120   resources/XTPlugin_msg_fr.ts
121   resources/XTPlugin_msg_ja.ts
122   )
123
124 # XT plugin scripts
125 SET(_python_XT_SCRIPTS
126   XTPluginBuilder.py
127   __init__.py
128 )
129
130 # --- rules ---
131
132 # install Engine library
133 ADD_LIBRARY(XTPluginEngine ${XTPluginEngine_SOURCES})
134 TARGET_LINK_LIBRARIES(XTPluginEngine ${_link_LIBRARIES})
135 INSTALL(TARGETS XTPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
136
137 # install GUI library
138 IF(SALOME_BUILD_GUI)
139   ADD_LIBRARY(XTPluginGUI ${XTPluginGUI_SOURCES})
140   TARGET_LINK_LIBRARIES(XTPluginGUI ${_link_LIBRARIES})
141   INSTALL(TARGETS XTPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
142   # install resources
143   QT4_INSTALL_TS_RESOURCES("${XTPlugin_RESOURCES}" "${SALOME_XTPLUGIN_INSTALL_RES_DATA}")
144 ENDIF()
145
146 # install headers
147 INSTALL(FILES ${XTPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
148
149 # install python scripts
150 SALOME_INSTALL_SCRIPTS("${_python_XT_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/XTPlugin DEF_PERMS)
151
152 # configure license file
153 CONFIGURE_FILE(XTPlugin_license.h.in XTPlugin_license.h)