]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomDataAPI/CMakeLists.txt
Salome HOME
Improve code coverage for elliptic arcs.
[modules/shaper.git] / src / GeomDataAPI / 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 FIND_PACKAGE(SWIG REQUIRED)
21 INCLUDE(${SWIG_USE_FILE})
22 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
23 INCLUDE(UnitTest)
24
25 SET(PROJECT_HEADERS
26     GeomDataAPI.h
27     GeomDataAPI_Point.h
28     GeomDataAPI_Dir.h
29     GeomDataAPI_Point2D.h
30 )
31
32 SET(PROJECT_SOURCES
33     GeomDataAPI_Point.cpp
34     GeomDataAPI_Dir.cpp
35     GeomDataAPI_Point2D.cpp
36 )
37
38 SET(PROJECT_LIBRARIES
39     ModelAPI
40 )
41
42 INCLUDE_DIRECTORIES(
43   ../GeomAPI        # only for SWIG
44   ../Events         # only for SWIG
45   ../ModelAPI
46 )
47
48 ADD_DEFINITIONS(-DGEOMDATAAPI_EXPORTS)
49 ADD_LIBRARY(GeomDataAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
50 SET_TARGET_PROPERTIES(GeomDataAPI PROPERTIES LINKER_LANGUAGE CXX)
51 TARGET_LINK_LIBRARIES(GeomDataAPI ${PROJECT_LIBRARIES})
52
53 SET(CMAKE_SWIG_FLAGS -w325,321,362,383,302,403)
54
55 SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES CPLUSPLUS ON)
56 SET_SOURCE_FILES_PROPERTIES(GeomDataAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
57
58 SET(SWIG_SCRIPTS
59   ${CMAKE_CURRENT_BINARY_DIR}/GeomDataAPI.py
60 )
61
62 SET(SWIG_LINK_LIBRARIES
63   GeomDataAPI
64   ${PYTHON_LIBRARIES}
65 )
66
67 IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
68   SWIG_ADD_LIBRARY(GeomDataAPI LANGUAGE python SOURCES GeomDataAPI.i ${PROJECT_HEADERS})
69 ELSE()
70   SWIG_ADD_MODULE(GeomDataAPI python GeomDataAPI.i ${PROJECT_HEADERS})
71 ENDIF()
72 SWIG_LINK_LIBRARIES(GeomDataAPI ${SWIG_LINK_LIBRARIES})
73
74 IF(WIN32)
75   SET_TARGET_PROPERTIES(_GeomDataAPI PROPERTIES DEBUG_OUTPUT_NAME _GeomDataAPI_d)
76 ENDIF(WIN32)
77
78 INSTALL(TARGETS GeomDataAPI DESTINATION ${SHAPER_INSTALL_BIN})
79 INSTALL(TARGETS _GeomDataAPI DESTINATION ${SHAPER_INSTALL_SWIG})
80 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
81
82 ADD_UNIT_TESTS(TestConstants.py)