]> SALOME platform Git repositories - plugins/dxfplugin.git/blob - src/CMakeLists.txt
Salome HOME
c6a6cabd96560ad1661e8314b2fd8b2a9f8d3d97
[plugins/dxfplugin.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   ${DXF_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   ${DXF_LIBRARIES}
58   ${KERNEL_SALOMEBasics}
59   ${KERNEL_SALOMELocalTrace}
60   ${KERNEL_OpUtil}
61   ${GEOM_SalomeIDLGEOM}
62   ${GEOM_GEOMEngine}
63   ${GEOM_GEOMImpl}
64   ${GEOM_GEOMClient}
65   SalomeIDLDXFPlugin
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(DXFPluginEngine_HEADERS
79   DXFPlugin_Operations_i.hh
80   DXFPlugin_Engine.hxx
81   DXFPlugin_OperationsCreator.hh
82   DXFPlugin_IOperations.hxx
83   DXFPlugin_IExport.hxx 
84   DXFPlugin_IImport.hxx
85   DXFPlugin_ImportDriver.hxx 
86   DXFPlugin_ExportDriver.hxx
87   DXFPlugin_IECallBack.hxx
88   )
89
90 IF(SALOME_BUILD_GUI)  
91   # header files / to be processed by moc
92   SET(_moc_HEADERS
93     DXFPlugin_ExportDlg.h
94     DXFPlugin_ImportDlg.h
95     )
96 ENDIF()
97
98 # --- sources ---
99
100 IF(SALOME_BUILD_GUI)
101   # sources / moc wrappings
102   QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
103
104   SET(DXFPluginGUI_SOURCES
105     DXFPluginGUI.cxx
106     DXFPlugin_ExportDlg.cxx
107     DXFPlugin_ImportDlg.cxx
108     ${_moc_SOURCES}
109     )
110 ENDIF()
111   
112 SET(DXFPluginEngine_SOURCES
113   DXFPluginEngine.cxx
114   DXFPlugin_OperationsCreator.cc
115   DXFPlugin_Operations_i.cc
116   DXFPlugin_IOperations.cxx
117   DXFPlugin_ExportDriver.cxx
118   DXFPlugin_ImportDriver.cxx
119   DXFPlugin_IECallBack.cxx
120   )
121   
122 # resource files / to be processed by lrelease
123 SET(DXFPlugin_RESOURCES
124   resources/DXFPlugin_msg_en.ts
125   resources/DXFPlugin_msg_fr.ts
126   resources/DXFPlugin_msg_ja.ts
127   )
128
129 # DXF plugin scripts
130 SET(_python_DXF_SCRIPTS
131   DXFPluginBuilder.py
132   __init__.py
133 )
134
135 # --- rules ---
136
137 # install Engine library
138 ADD_LIBRARY(DXFPluginEngine ${DXFPluginEngine_SOURCES})
139 TARGET_LINK_LIBRARIES(DXFPluginEngine ${_link_LIBRARIES})
140 INSTALL(TARGETS DXFPluginEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
141
142 # install GUI library
143 IF(SALOME_BUILD_GUI)
144   ADD_LIBRARY(DXFPluginGUI ${DXFPluginGUI_SOURCES})
145   TARGET_LINK_LIBRARIES(DXFPluginGUI ${_link_LIBRARIES})
146   INSTALL(TARGETS DXFPluginGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
147   # install resources
148   QT4_INSTALL_TS_RESOURCES("${DXFPlugin_RESOURCES}" "${SALOME_DXFPLUGIN_INSTALL_RES_DATA}")
149 ENDIF()
150
151 # install headers
152 INSTALL(FILES ${DXFPluginEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
153
154 # install python scripts
155 SALOME_INSTALL_SCRIPTS("${_python_DXF_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/DXFPlugin DEF_PERMS)
156
157 # configure license file
158 CONFIGURE_FILE(DXFPlugin_license.h.in DXFPlugin_license.h)