Salome HOME
39104b1a324f9398fbeb2838b0e095251934bc54
[modules/gui.git] / src / SALOME_PY / CMakeLists.txt
1 # Copyright (C) 2012-2022  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 # --- options ---
21
22 # additional include directories
23 INCLUDE_DIRECTORIES(
24   ${OpenCASCADE_INCLUDE_DIR}
25   ${QT_INCLUDES}
26   ${PYTHON_INCLUDE_DIRS}
27   ${PROJECT_SOURCE_DIR}/src/CAM
28   ${PROJECT_SOURCE_DIR}/src/Event
29   ${PROJECT_SOURCE_DIR}/src/LightApp
30   ${PROJECT_SOURCE_DIR}/src/OBJECT
31   ${PROJECT_SOURCE_DIR}/src/Qtx
32   ${PROJECT_SOURCE_DIR}/src/STD
33   ${PROJECT_SOURCE_DIR}/src/SUIT
34   ${PROJECT_SOURCE_DIR}/src/SVTK
35   ${PROJECT_SOURCE_DIR}/src/VTKViewer
36 )
37
38 # additional preprocessor / compiler flags
39 ADD_DEFINITIONS(
40   ${OpenCASCADE_DEFINITIONS}
41   ${QT_DEFINITIONS}
42   ${PYTHON_DEFINITIONS}
43 )
44
45 # libraries to link to
46 SET(_link_LIBRARIES
47   ${PYTHON_LIBRARIES}
48   ${QT_LIBRARIES}
49   ${OPENGL_LIBRARIES}
50   LightApp
51 )
52
53 # --- rules ---
54
55 ADD_LIBRARY(SalomePy SalomePy.cxx)
56 TARGET_LINK_LIBRARIES(SalomePy ${_link_LIBRARIES})
57 INSTALL(TARGETS SalomePy DESTINATION ${SALOME_INSTALL_LIBS})
58
59 # TODO: check on windows
60 IF(WIN32)
61   SET_TARGET_PROPERTIES(SalomePy PROPERTIES PREFIX "lib" SUFFIX ".pyd" DEBUG_OUTPUT_NAME SalomePy_d RELEASE_OUTPUT_NAME SalomePy)
62 ENDIF(WIN32)
63
64 # TODO: check if PYTHON_ADD_MODULE() macro can be used to build this target
65
66 # --- tests ---
67
68 ADD_TEST(NAME GUI_libSalomePy COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_CURRENT_SOURCE_DIR}/test_vtk_rendering_module.py)