]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelHighAPI/CMakeLists.txt
Salome HOME
Merge remote-tracking branch 'origin/Custom_Fitter' into CEA_2019
[modules/shaper.git] / src / ModelHighAPI / CMakeLists.txt
1 # Copyright (C) 2014-2019  CEA/DEN, EDF R&D
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
22 SET(PROJECT_HEADERS
23   ModelHighAPI.h
24   ModelHighAPI_Double.h
25   ModelHighAPI_Dumper.h
26   ModelHighAPI_Integer.h
27   ModelHighAPI_Interface.h
28   ModelHighAPI_Macro.h
29   ModelHighAPI_RefAttr.h
30   ModelHighAPI_Reference.h
31   ModelHighAPI_Selection.h
32   ModelHighAPI_Services.h
33   ModelHighAPI_Tools.h
34   ModelHighAPI_FeatureStore.h
35   ModelHighAPI_Folder.h
36 )
37
38 SET(PROJECT_SOURCES
39   ModelHighAPI_Double.cpp
40   ModelHighAPI_Dumper.cpp
41   ModelHighAPI_Integer.cpp
42   ModelHighAPI_Interface.cpp
43   ModelHighAPI_RefAttr.cpp
44   ModelHighAPI_Reference.cpp
45   ModelHighAPI_Selection.cpp
46   ModelHighAPI_Services.cpp
47   ModelHighAPI_Tools.cpp
48   ModelHighAPI_FeatureStore.cpp
49   ModelHighAPI_Folder.cpp
50 )
51
52 SET(PROJECT_LIBRARIES
53   Config
54   Events
55   GeomAPI
56   GeomDataAPI
57   GeomAlgoAPI
58   ModelAPI
59   ModelGeomAlgo
60 )
61
62 ADD_DEFINITIONS(-DMODELHIGHAPI_EXPORTS -DWNT)
63 ADD_LIBRARY(ModelHighAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
64 #TODO(spo): is it necessary?
65 SET_TARGET_PROPERTIES(ModelHighAPI PROPERTIES LINKER_LANGUAGE CXX)
66 TARGET_LINK_LIBRARIES(ModelHighAPI ${PROJECT_LIBRARIES})
67
68 # SWIG wrapper
69
70 INCLUDE(PythonAPI)
71
72 SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES CPLUSPLUS ON)
73 SET_SOURCE_FILES_PROPERTIES(ModelHighAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
74
75 SET(SWIG_LINK_LIBRARIES
76   ModelHighAPI
77   ${PYTHON_LIBRARIES}
78 )
79
80 INCLUDE_DIRECTORIES(
81   ${PROJECT_SOURCE_DIR}/src/Config
82   ${PROJECT_SOURCE_DIR}/src/Events
83   ${PROJECT_SOURCE_DIR}/src/GeomAPI
84   ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
85   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
86   ${PROJECT_SOURCE_DIR}/src/ModelAPI
87   ${PROJECT_SOURCE_DIR}/src/ModelGeomAlgo
88   ${PROJECT_SOURCE_DIR}/src/PartSetPlugin
89   ${OpenCASCADE_INCLUDE_DIR}
90 )
91
92 set(SWIG_MODULE_ModelHighAPI_EXTRA_DEPS
93   doxyhelp.i
94   ${PROJECT_HEADERS}
95 )
96 SET(CMAKE_SWIG_FLAGS -threads -w325,321,302,362,322,383,403,509,503)
97
98 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
99   SWIG_ADD_LIBRARY(ModelHighAPI LANGUAGE python SOURCES ModelHighAPI.i ${PROJECT_HEADERS})
100 ELSE()
101   SWIG_ADD_MODULE(ModelHighAPI python ModelHighAPI.i ${PROJECT_HEADERS})
102 ENDIF()
103 SWIG_LINK_LIBRARIES(ModelHighAPI ${SWIG_LINK_LIBRARIES})
104
105 IF(WIN32)
106   SET_TARGET_PROPERTIES(_ModelHighAPI PROPERTIES DEBUG_OUTPUT_NAME _ModelHighAPI_d)
107 ENDIF(WIN32)
108
109 INSTALL(TARGETS _ModelHighAPI DESTINATION ${SHAPER_INSTALL_SWIG})
110 INSTALL(TARGETS ModelHighAPI DESTINATION ${SHAPER_INSTALL_BIN})
111 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ModelHighAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
112
113 # Tests
114
115 INCLUDE(UnitTest)
116
117 ADD_UNIT_TESTS(
118   TestDouble.py
119   TestInteger.py
120   TestRefAttr.py
121   TestReference.py
122   TestDeflectionDump.py
123   TestUndoRedo.py
124   Test2488.py
125 )