Salome HOME
ddde21c18eab77e2c82868e338c59d1ed3ff41cb
[modules/gui.git] / tools / PyConsole / src / CMakeLists.txt
1 # Copyright (C) 2012-2019  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 INCLUDE(UseQtExt)
21
22 IF(PYCONSOLE_BUILD_PYTHON)
23   ADD_SUBDIRECTORY(python)
24 ENDIF(PYCONSOLE_BUILD_PYTHON)
25
26 # --- options ---
27
28 # additional include directories
29 INCLUDE_DIRECTORIES(
30   ${QT_INCLUDES}
31   ${PYTHON_INCLUDE_DIRS}
32   ${PROJECT_SOURCE_DIR}/src/PyInterp
33 )
34
35 # additional preprocessor / compiler flags
36 ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
37
38 # libraries to link to
39 SET(_link_LIBRARIES ${QT_LIBRARIES} ${PYTHON_LIBRARIES} PyInterp)
40
41 # --- headers ---
42
43 # header files / to be processed by moc
44 SET(_moc_HEADERS
45   PyConsole_Console.h
46   PyConsole_Editor.h
47 )
48
49 # header files / no moc processing
50 SET(_other_HEADERS
51   PyConsole.h
52   PyConsole_Event.h
53   PyConsole_Interp.h
54   PyConsole_Request.h
55 )
56
57 # header files / to install
58 SET(PyConsole_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
59
60 # --- resources ---
61
62 # resource files / to be processed by lrelease
63 SET(_ts_RESOURCES
64   resources/PyConsole_msg_en.ts
65   resources/PyConsole_msg_fr.ts
66   resources/PyConsole_msg_ja.ts
67 )
68
69 # --- sources ---
70
71 # sources / moc wrappings
72 QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
73
74 # sources / static
75 SET(_other_SOURCES
76   PyConsole_Console.cxx
77   PyConsole_Event.cxx
78   PyConsole_Interp.cxx
79   PyConsole_Request.cxx
80   PyConsole_Editor.cxx
81 )
82
83 # sources / to compile
84 SET(PyConsole_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
85
86 # --- rules ---
87
88 ADD_LIBRARY(PyConsole ${PyConsole_SOURCES})
89 TARGET_LINK_LIBRARIES(PyConsole ${_link_LIBRARIES})
90 INSTALL(TARGETS PyConsole EXPORT ${TOOLS_EXPORT_NAME}TargetGroup DESTINATION ${PYCONSOLE_INSTALL_LIBS})
91
92 INSTALL(FILES ${PyConsole_HEADERS} DESTINATION ${PYCONSOLE_INSTALL_HEADERS})
93 QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${PYCONSOLE_INSTALL_RES}")