Salome HOME
Qt 5 migration
[plugins/acisplugin.git] / src / CMakeLists.txt
1 # Copyright (C) 2014-2015  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   ${ACIS_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   ${ACIS_LIBRARIES}
59   ${KERNEL_SALOMEBasics}
60   ${KERNEL_SALOMELocalTrace}
61   ${KERNEL_OpUtil}
62   ${GEOM_SalomeIDLGEOM}
63   ${GEOM_GEOMEngine}
64   ${GEOM_GEOMImpl}
65   ${GEOM_GEOMClient}
66   SalomeIDLACISPlugin
67   )
68   
69 IF(SALOME_BUILD_GUI)
70   SET(_link_gui_LIBRARIES
71     SalomeIDLACISPlugin
72     ${GEOM_GEOMObject}
73     ${GEOM_GEOMBase}
74     ${GEOM_GEOMBase}
75     )
76 ENDIF()
77
78
79 # --- headers ---
80
81 SET(ACISPluginEngine_HEADERS
82   ACISPlugin_IOperations_i.hh
83   ACISPlugin_Engine.hxx
84   ACISPlugin_OperationsCreator.hxx
85   ACISPlugin_IOperations.hxx
86   ACISPlugin_IExport.hxx 
87   ACISPlugin_IImport.hxx
88   ACISPlugin_ImportDriver.hxx 
89   ACISPlugin_ExportDriver.hxx
90   ACISPlugin_IECallBack.hxx
91   )
92
93 IF(SALOME_BUILD_GUI)  
94   # header files / to be processed by moc
95   SET(_moc_HEADERS
96     ACISPlugin_GUI.h
97     )
98 ENDIF()
99
100 # --- sources ---
101
102 IF(SALOME_BUILD_GUI)
103   # sources / moc wrappings
104   QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
105
106   SET(ACISPluginGUI_SOURCES
107     ACISPlugin_GUI.cxx
108     ${_moc_SOURCES}
109     )
110 ENDIF()
111   
112 SET(ACISPluginEngine_SOURCES
113   ACISPlugin_Engine.cxx
114   ACISPlugin_OperationsCreator.cxx
115   ACISPlugin_IOperations_i.cc
116   ACISPlugin_IOperations.cxx
117   ACISPlugin_ExportDriver.cxx
118   ACISPlugin_ImportDriver.cxx
119   ACISPlugin_IECallBack.cxx
120   )
121   
122 # resource files / to be processed by lrelease
123 SET(ACISPlugin_RESOURCES
124   resources/ACISPlugin_msg_en.ts
125   resources/ACISPlugin_msg_fr.ts
126   resources/ACISPlugin_msg_ja.ts
127   )
128
129 # ACIS plugin scripts
130 SET(_python_ACIS_SCRIPTS
131   ACISPluginBuilder.py
132   __init__.py
133 )
134
135 # --- rules ---
136
137 # install Engine library
138 ADD_LIBRARY(ACISPluginEngine ${ACISPluginEngine_SOURCES})
139 TARGET_LINK_LIBRARIES(ACISPluginEngine ${_link_engine_LIBRARIES})
140 INSTALL(TARGETS ACISPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
141
142 # install GUI library
143 IF(SALOME_BUILD_GUI)
144   ADD_LIBRARY(ACISPluginGUI ${ACISPluginGUI_SOURCES})
145   TARGET_LINK_LIBRARIES(ACISPluginGUI ${_link_gui_LIBRARIES})
146   INSTALL(TARGETS ACISPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
147   # install resources
148   QT_INSTALL_TS_RESOURCES("${ACISPlugin_RESOURCES}" "${SALOME_ACISPLUGIN_INSTALL_RES_DATA}")
149 ENDIF()
150
151 # install headers
152 INSTALL(FILES ${ACISPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
153
154 # install python scripts
155 SALOME_INSTALL_SCRIPTS("${_python_ACIS_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/ACISPlugin DEF_PERMS)
156
157 # configure license file
158 CONFIGURE_FILE(ACISPlugin_license.h.in ACISPlugin_license.h)