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