Salome HOME
Updated copyright comment
[modules/shaper.git] / src / Events / CMakeLists.txt
1 # Copyright (C) 2014-2024  CEA, EDF
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(Common)
21 FIND_PACKAGE(SWIG REQUIRED)
22
23 INCLUDE(${SWIG_USE_FILE})
24
25 SET(PROJECT_HEADERS
26     Events.h
27     Events_Message.h
28     Events_MessageGroup.h
29     Events_Listener.h
30     Events_Loop.h
31     Events_LongOp.h
32     Events_InfoMessage.h
33     Events_MessageBool.h
34 )
35
36 SET(PROJECT_SOURCES
37     Events_Message.cpp
38     Events_MessageGroup.cpp
39     Events_Listener.cpp
40     Events_Loop.cpp
41     Events_LongOp.cpp
42     Events_InfoMessage.cpp
43     Events_MessageBool.cpp
44 )
45
46 SET(PROJECT_LIBRARIES
47     Locale
48 )
49
50 ADD_DEFINITIONS(-DEVENTS_EXPORTS)
51 ADD_LIBRARY(Events SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
52
53 SET(CMAKE_SWIG_FLAGS -threads -w362)
54
55 SET_SOURCE_FILES_PROPERTIES(Events.i PROPERTIES CPLUSPLUS ON)
56 SET_SOURCE_FILES_PROPERTIES(Events.i PROPERTIES SWIG_DEFINITIONS "-shadow")
57
58 INCLUDE_DIRECTORIES(
59     ../Locale
60 )
61
62 TARGET_LINK_LIBRARIES(Events ${PROJECT_LIBRARIES})
63
64 SET(SWIG_SCRIPTS
65   ${CMAKE_CURRENT_BINARY_DIR}/EventsAPI.py
66 )
67
68 SET(SWIG_LINK_LIBRARIES
69   Events
70   ${PYTHON_LIBRARIES}
71 )
72
73 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
74   SWIG_ADD_LIBRARY(EventsAPI LANGUAGE python SOURCES Events.i ${PROJECT_HEADERS})
75 ELSE()
76   SWIG_ADD_MODULE(EventsAPI python Events.i ${PROJECT_HEADERS})
77 ENDIF()
78 SWIG_LINK_LIBRARIES(EventsAPI ${SWIG_LINK_LIBRARIES})
79
80 IF(WIN32)
81   SET_TARGET_PROPERTIES(_EventsAPI PROPERTIES DEBUG_OUTPUT_NAME _EventsAPI_d)
82 ENDIF(WIN32)
83
84 INSTALL(TARGETS Events DESTINATION ${SHAPER_INSTALL_BIN})
85 INSTALL(TARGETS _EventsAPI DESTINATION ${SHAPER_INSTALL_SWIG})
86 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})