Salome HOME
[bos #38360] [CEA] improve performances of exportXAO and PublishToStudy
[modules/shaper.git] / src / GeomAPI / CMakeLists.txt
index 8e191e4fd53c93614ce1faf0e1a2025ce9b259a6..20168aab632035aa96a53c5bccaee13af446b345 100644 (file)
@@ -1,30 +1,32 @@
-## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-##
-## See http:##www.salome-platform.org/ or
-## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2014-2024  CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 FIND_PACKAGE(SWIG REQUIRED)
 
 INCLUDE(${SWIG_USE_FILE})
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE(UnitTest)
 
 SET(PROJECT_HEADERS
     GeomAPI.h
+    GeomAPI_BSpline.h
+    GeomAPI_BSpline2d.h
     GeomAPI_Circ.h
     GeomAPI_Circ2d.h
     GeomAPI_Interface.h
@@ -48,6 +50,7 @@ SET(PROJECT_HEADERS
     GeomAPI_Curve.h
     GeomAPI_DataMapOfShapeMapOfShapes.h
     GeomAPI_DataMapOfShapeShape.h
+    GeomAPI_IndexedMapOfShape.h
     GeomAPI_ICustomPrs.h
     GeomAPI_Vertex.h
     GeomAPI_Ax1.h
@@ -55,10 +58,25 @@ SET(PROJECT_HEADERS
     GeomAPI_Ax3.h
     GeomAPI_Trsf.h
     GeomAPI_Angle2d.h
+    GeomAPI_Angle.h
     GeomAPI_Wire.h
+    GeomAPI_Ellipse.h
+    GeomAPI_Ellipse2d.h
+    GeomAPI_Tools.h
+    GeomAPI_Shell.h
+    GeomAPI_Solid.h
+    GeomAPI_Sphere.h
+    GeomAPI_Cylinder.h
+    GeomAPI_Cone.h
+    GeomAPI_Torus.h
+    GeomAPI_Box.h
+    GeomAPI_WireExplorer.h
+    GeomAPI_ShapeHierarchy.h
 )
 
 SET(PROJECT_SOURCES
+    GeomAPI_BSpline.cpp
+    GeomAPI_BSpline2d.cpp
     GeomAPI_Circ.cpp
     GeomAPI_Circ2d.cpp
     GeomAPI_Interface.cpp
@@ -81,6 +99,7 @@ SET(PROJECT_SOURCES
     GeomAPI_Curve.cpp
     GeomAPI_DataMapOfShapeMapOfShapes.cpp
     GeomAPI_DataMapOfShapeShape.cpp
+    GeomAPI_IndexedMapOfShape.cpp
     GeomAPI_Vertex.cpp
     GeomAPI_ICustomPrs.cpp
     GeomAPI_Ax1.cpp
@@ -89,28 +108,38 @@ SET(PROJECT_SOURCES
     GeomAPI_IPresentable.cpp
     GeomAPI_Trsf.cpp
     GeomAPI_Angle2d.cpp
+    GeomAPI_Angle.cpp
     GeomAPI_Wire.cpp
+    GeomAPI_Ellipse.cpp
+    GeomAPI_Ellipse2d.cpp
+    GeomAPI_Tools.cpp
+    GeomAPI_Shell.cpp
+    GeomAPI_Solid.cpp
+    GeomAPI_Sphere.cpp
+    GeomAPI_Cylinder.cpp
+    GeomAPI_Cone.cpp
+    GeomAPI_Torus.cpp
+    GeomAPI_Box.cpp
+    GeomAPI_WireExplorer.cpp
+    GeomAPI_ShapeHierarchy.cpp
 )
 
 SET(PROJECT_LIBRARIES
-    ${CAS_KERNEL}
-    ${CAS_MODELER}
-    ${CAS_VIEWER}
-    ${CAS_SHAPE}
-    ${CAS_TKTopAlgo}
-    ${CAS_TKBO}
+    ${OpenCASCADE_FoundationClasses_LIBRARIES}
+    ${OpenCASCADE_ModelingAlgorithms_LIBRARIES}
+    ${OpenCASCADE_Visualization_LIBRARIES}
 )
 
-ADD_DEFINITIONS(-DGEOMAPI_EXPORTS ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(-DGEOMAPI_EXPORTS ${OpenCASCADE_DEFINITIONS})
 ADD_LIBRARY(GeomAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 
-SET(CMAKE_SWIG_FLAGS -threads -Wall)
+SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,512)
 
 SET_SOURCE_FILES_PROPERTIES(GeomAPI.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(GeomAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 
 INCLUDE_DIRECTORIES(
-  ${CAS_INCLUDE_DIRS}
+  ${OpenCASCADE_INCLUDE_DIR}
 )
 
 TARGET_LINK_LIBRARIES(GeomAPI ${PROJECT_LIBRARIES})
@@ -124,7 +153,11 @@ SET(SWIG_LINK_LIBRARIES
   ${PYTHON_LIBRARIES}
 )
 
-SWIG_ADD_MODULE(GeomAPI python GeomAPI.i ${PROJECT_HEADERS})
+IF(${CMAKE_VERSION} VERSION_GREATER "3.8.0")
+  SWIG_ADD_LIBRARY(GeomAPI LANGUAGE python SOURCES GeomAPI.i ${PROJECT_HEADERS})
+ELSE()
+  SWIG_ADD_MODULE(GeomAPI python GeomAPI.i ${PROJECT_HEADERS})
+ENDIF()
 SWIG_LINK_LIBRARIES(GeomAPI ${SWIG_LINK_LIBRARIES})
 
 IF(WIN32)
@@ -134,3 +167,24 @@ ENDIF(WIN32)
 INSTALL(TARGETS _GeomAPI DESTINATION ${SHAPER_INSTALL_SWIG})
 INSTALL(TARGETS GeomAPI DESTINATION ${SHAPER_INSTALL_BIN})
 INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
+
+include(tests.set)
+
+ADD_UNIT_TESTS(${TEST_NAMES})
+
+if(${HAVE_SALOME})
+  enable_testing()
+  set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/GeomAPI")
+  
+  install(FILES CTestTestfileInstall.cmake
+  DESTINATION ${TEST_INSTALL_DIRECTORY}
+  RENAME CTestTestfile.cmake)
+  install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
+  
+  set(TMP_TESTS_NAMES)
+  foreach(tfile ${TEST_NAMES})
+    list(APPEND TMP_TESTS_NAMES "Test/${tfile}")
+  endforeach(tfile ${TEST_NAMES})
+  
+  install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
+endif(${HAVE_SALOME})