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