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