Salome HOME
Copyright update 2022
[modules/gui.git] / src / PVServerService / ServiceLoader / CMakeLists.txt
1 # Copyright (C) 2010-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 INCLUDE(${SWIG_USE_FILE})
21
22 INCLUDE_DIRECTORIES(
23   ${CMAKE_CURRENT_SOURCE_DIR}
24   ${OMNIORB_INCLUDE_DIR}
25   ${KERNEL_INCLUDE_DIRS}
26   )
27
28 ADD_DEFINITIONS(
29   ${OMNIORB_DEFINITIONS}
30   ${KERNEL_DEFINITIONS}
31   )
32
33 SET(_link_LIBRARIES 
34   ${KERNEL_OpUtil}        # class SALOME_Exception
35   ${KERNEL_SalomeNS}
36   ${KERNEL_SalomeLifeCycleCORBA}
37   ${KERNEL_SalomeIDLKernel}
38   )
39
40 # --- headers ---
41 SET(_HEADERS
42   PVServer_ServiceLoader.h
43 )
44
45 # --- sources ---
46 SET(_SOURCES
47  PVServer_ServiceLoader.cxx
48 )
49   
50 SET(_SWIG
51   PVServer_ServiceLoader.i
52 )
53   
54 # --- rules ---
55 ADD_LIBRARY(PVServerServiceLoader ${_SOURCES})
56 TARGET_LINK_LIBRARIES(PVServerServiceLoader ${_link_LIBRARIES})
57 INSTALL(TARGETS PVServerServiceLoader EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
58
59 # --- SWIG part ---
60 SET_SOURCE_FILES_PROPERTIES(${_SWIG} PROPERTIES CPLUSPLUS ON)
61 SET_SOURCE_FILES_PROPERTIES(${_SWIG} PROPERTIES SWIG_FLAGS "-py3")
62 IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
63   SWIG_ADD_MODULE(PVServer_ServiceLoader python ${_SWIG})
64 ELSE()
65   SWIG_ADD_LIBRARY(PVServer_ServiceLoader LANGUAGE python SOURCES ${_SWIG})
66 ENDIF()
67
68
69 IF(WIN32)
70   SET_TARGET_PROPERTIES(_PVServer_ServiceLoader PROPERTIES DEBUG_OUTPUT_NAME _PVServer_ServiceLoader_d)
71 ENDIF(WIN32)
72 SWIG_LINK_LIBRARIES(PVServer_ServiceLoader ${PYTHON_LIBRARIES} PVServerServiceLoader)
73
74 INSTALL(TARGETS ${SWIG_MODULE_PVServer_ServiceLoader_REAL_NAME} EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_PYTHON})
75 SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/PVServer_ServiceLoader.py ${SALOME_INSTALL_PYTHON} EXTRA_DPYS "${SWIG_MODULE_PVServer_ServiceLoader_REAL_NAME}")
76   
77 # --- header installation ---
78 INSTALL(FILES ${_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})