Improve handling of external smesh
+ add SMESH_version.h.cmake to set full version number instead of using compiler define + do not set include path of smesh globally + do not set library path of smesh globally + do not set HAVE_NETGEN define globally + improve using debug and release libs of smesh for MSVC
This commit is contained in:
@@ -650,6 +650,9 @@ endif()
|
||||
IF(BUILD_SMESH)
|
||||
# set the internal smesh version:
|
||||
set(SMESH_VERSION_MAJOR 5) # in src/3rdParty it says smesh is version 5.*, is this true?
|
||||
set(SMESH_VERSION_MINOR 1)
|
||||
set(SMESH_VERSION_PATCH 2)
|
||||
set(SMESH_VERSION_TWEAK 2)
|
||||
|
||||
#if we use smesh we definitely also need vtk, no matter of external or internal smesh
|
||||
set (VTK_COMPONENTS
|
||||
@@ -740,11 +743,8 @@ endif()
|
||||
|
||||
else(NOT FREECAD_USE_EXTERNAL_SMESH)
|
||||
find_package(SMESH CONFIG)
|
||||
include_directories(${SMESH_INCLUDE_DIR})
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
set (SMESH_INCLUDE_DIR ${SMESH_INCLUDE_PATH})
|
||||
SET(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES})
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
add_definitions(-DSMESH_VERSION_MAJOR=${SMESH_VERSION_MAJOR})
|
||||
if(NOT SMESH_FOUND)
|
||||
message(ERROR "================\n"
|
||||
"SMESH not found.\n"
|
||||
@@ -752,7 +752,9 @@ endif()
|
||||
endif()
|
||||
include_directories(${SMESH_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
set(SMESH_FOUND TRUE)
|
||||
configure_file(SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h)
|
||||
ENDIF(BUILD_SMESH)
|
||||
|
||||
# -------------------------------- Netgen --------------------------------
|
||||
|
||||
12
SMESH_Version.h.cmake
Normal file
12
SMESH_Version.h.cmake
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef SMESH_VERSION_H
|
||||
#define SMESH_VERSION_H
|
||||
|
||||
/* SMESH_Version.h. Generated from SMESH_Version.h.cmake by cmake. */
|
||||
|
||||
// SMESH version
|
||||
#define SMESH_VERSION_MAJOR ${SMESH_VERSION_MAJOR}
|
||||
#define SMESH_VERSION_MINOR ${SMESH_VERSION_MINOR}
|
||||
#define SMESH_VERSION_PATCH ${SMESH_VERSION_PATCH}
|
||||
#define SMESH_VERSION_TWEAK ${SMESH_VERSION_TWEAK}
|
||||
|
||||
#endif // SMESH_VERSION_H
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <Base/Interpreter.h>
|
||||
#include <CXX/Extensions.hxx>
|
||||
|
||||
#include <SMESH_Version.h>
|
||||
#include "FemMeshPy.h"
|
||||
#include "FemMesh.h"
|
||||
#include "FemMeshProperty.h"
|
||||
|
||||
@@ -50,9 +50,6 @@
|
||||
#include <StdMeshers_LocalLength.hxx>
|
||||
#include <StdMeshers_NumberOfSegments.hxx>
|
||||
#include <StdMeshers_AutomaticLength.hxx>
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#endif
|
||||
#include <StdMeshers_MEFISTO_2D.hxx>
|
||||
#include <StdMeshers_Deflection1D.hxx>
|
||||
#include <StdMeshers_MaxElementArea.hxx>
|
||||
|
||||
@@ -28,23 +28,23 @@ include_directories(
|
||||
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
|
||||
set(Fem_LIBS
|
||||
Part
|
||||
FreeCADApp
|
||||
StdMeshers
|
||||
SMESH
|
||||
SMDS
|
||||
SMESHDS
|
||||
)
|
||||
|
||||
|
||||
if(BUILD_FEM_NETGEN)
|
||||
list(APPEND Fem_LIBS
|
||||
NETGENPlugin
|
||||
)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
if (FREECAD_USE_EXTERNAL_SMESH)
|
||||
list(APPEND Fem_LIBS ${EXTERNAL_SMESH_LIBS})
|
||||
else()
|
||||
if (BUILD_FEM_NETGEN)
|
||||
list(APPEND Fem_LIBS StdMeshers SMESH SMDS SMESHDS NETGENPlugin)
|
||||
else ()
|
||||
list(APPEND Fem_LIBS StdMeshers SMESH SMDS SMESHDS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
generate_from_xml(FemMeshPy)
|
||||
@@ -181,7 +181,7 @@ SET(Fem_SRCS
|
||||
|
||||
|
||||
add_library(Fem SHARED ${Fem_SRCS})
|
||||
target_link_libraries(Fem ${Fem_LIBS} ${VTK_LIBRARIES} ${EXTERNAL_SMESH_LIBS})
|
||||
target_link_libraries(Fem ${Fem_LIBS} ${VTK_LIBRARIES})
|
||||
|
||||
|
||||
SET_BIN_DIR(Fem Fem /Mod/Fem)
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
#include "FemMesh.h"
|
||||
#ifdef FC_USE_VTK
|
||||
#include "FemVTKTools.h"
|
||||
#include "FemVTKTools.h"
|
||||
#endif
|
||||
|
||||
#include <boost/assign/list_of.hpp>
|
||||
@@ -496,7 +496,7 @@ SMESH_Gen * FemMesh::getGenerator()
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
return SMESH_Gen::get();
|
||||
#else
|
||||
if (! FemMesh::_mesh_gen)
|
||||
if (!FemMesh::_mesh_gen)
|
||||
FemMesh::_mesh_gen = new SMESH_Gen();
|
||||
return FemMesh::_mesh_gen;
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <SMESH_Version.h>
|
||||
|
||||
class SMESH_Gen;
|
||||
class SMESH_Mesh;
|
||||
|
||||
@@ -37,9 +37,7 @@
|
||||
#include <SMDSAbs_ElementType.hxx>
|
||||
#include <SMDS_MeshElement.hxx>
|
||||
#include <SMDS_VolumeTool.hxx>
|
||||
#if SMESH_VERSION_MAJOR >= 7
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
#endif
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
#include <Base/Console.h>
|
||||
|
||||
#include <SMESH_Gen.hxx>
|
||||
#if SMESH_VERSION_MAJOR >= 7
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
#endif
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
|
||||
|
||||
@@ -61,9 +61,6 @@
|
||||
#include <StdMeshers_QuadraticMesh.hxx>
|
||||
#include <StdMeshers_RadialPrism_3D.hxx>
|
||||
#include <StdMeshers_SegmentAroundVertex_0D.hxx>
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#endif
|
||||
#include <StdMeshers_ProjectionSource1D.hxx>
|
||||
#include <StdMeshers_ProjectionSource2D.hxx>
|
||||
#include <StdMeshers_ProjectionSource3D.hxx>
|
||||
|
||||
@@ -53,9 +53,7 @@
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
|
||||
#include <SMDS_VolumeTool.hxx>
|
||||
#if SMESH_VERSION_MAJOR >= 7
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
#endif
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
|
||||
# include <TopoDS_Face.hxx>
|
||||
# include <TopoDS_Solid.hxx>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include <StdMeshers_RadialPrism_3D.hxx>
|
||||
#include <StdMeshers_SegmentAroundVertex_0D.hxx>
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#endif
|
||||
#include <StdMeshers_ProjectionSource1D.hxx>
|
||||
#include <StdMeshers_ProjectionSource2D.hxx>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <CXX/Extensions.hxx>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <SMESH_Version.h>
|
||||
|
||||
class SMESH_Hypothesis;
|
||||
class SMESH_Gen;
|
||||
@@ -60,7 +61,7 @@ public:
|
||||
Py::Object repr();
|
||||
Py::Object getLibName(const Py::Tuple& args);
|
||||
Py::Object setLibName(const Py::Tuple& args);
|
||||
#ifndef EXTERNAL_SMESH
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
Py::Object setParameters(const Py::Tuple& args);
|
||||
Py::Object getParameters(const Py::Tuple& args);
|
||||
Py::Object setLastParameters(const Py::Tuple& args);
|
||||
|
||||
@@ -25,6 +25,7 @@ include_directories(
|
||||
)
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
|
||||
set(FemGui_LIBS
|
||||
|
||||
@@ -13,6 +13,7 @@ if(BUILD_FEM_NETGEN)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${OCC_INCLUDE_DIR}
|
||||
@@ -26,31 +27,22 @@ include_directories(
|
||||
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
)
|
||||
|
||||
if(BUILD_FEM_NETGEN)
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
StdMeshers
|
||||
NETGENPlugin
|
||||
SMESH
|
||||
SMDS
|
||||
)
|
||||
elseif(BUILD_SMESH)
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
StdMeshers
|
||||
SMESH
|
||||
SMDS
|
||||
)
|
||||
else(BUILD_FEM_NETGEN)
|
||||
set(MeshPart_LIBS
|
||||
Part
|
||||
Mesh
|
||||
)
|
||||
endif(BUILD_FEM_NETGEN)
|
||||
if (FREECAD_USE_EXTERNAL_SMESH)
|
||||
list(APPEND MeshPart_LIBS ${EXTERNAL_SMESH_LIBS})
|
||||
else()
|
||||
if (BUILD_FEM_NETGEN)
|
||||
list(APPEND MeshPart_LIBS StdMeshers NETGENPlugin SMESH SMDS)
|
||||
elseif (BUILD_SMESH)
|
||||
list(APPEND MeshPart_LIBS StdMeshers SMESH SMDS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
SET(MeshPart_SRCS
|
||||
@@ -67,7 +59,7 @@ SET(MeshPart_SRCS
|
||||
)
|
||||
|
||||
add_library(MeshPart SHARED ${MeshPart_SRCS})
|
||||
target_link_libraries(MeshPart ${MeshPart_LIBS} ${EXTERNAL_SMESH_LIBS})
|
||||
target_link_libraries(MeshPart ${MeshPart_LIBS})
|
||||
|
||||
|
||||
fc_target_copy_resource(MeshPart
|
||||
@@ -84,13 +76,13 @@ INSTALL(TARGETS MeshPart DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
################################ flat mesh ###############################
|
||||
if (FREECAD_USE_PYBIND11)
|
||||
SET(FLATMESH_SRCS
|
||||
MeshFlattening.cpp
|
||||
MeshFlattening.h
|
||||
MeshFlatteningNurbs.h
|
||||
MeshFlatteningNurbs.cpp
|
||||
MeshFlatteningLscmRelax.h
|
||||
MeshFlatteningLscmRelax.cpp
|
||||
MeshFlatteningPy.cpp
|
||||
MeshFlattening.cpp
|
||||
MeshFlattening.h
|
||||
MeshFlatteningNurbs.h
|
||||
MeshFlatteningNurbs.cpp
|
||||
MeshFlatteningLscmRelax.h
|
||||
MeshFlatteningLscmRelax.cpp
|
||||
MeshFlatteningPy.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Woverloaded-virtual"
|
||||
#endif
|
||||
|
||||
#include <SMESH_Gen.hxx>
|
||||
#include <StdMeshers_MaxLength.hxx>
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
|
||||
#if SMESH_VERSION_MAJOR >= 7
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
#else
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#if SMESH_VERSION_MAJOR < 7
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#endif
|
||||
|
||||
#include <StdMeshers_LocalLength.hxx>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <sstream>
|
||||
#include <Base/Stream.h>
|
||||
#include <SMESH_Version.h>
|
||||
|
||||
class TopoDS_Shape;
|
||||
class SMESH_Gen;
|
||||
|
||||
@@ -23,7 +23,9 @@ include_directories(
|
||||
${PYTHON_INCLUDE_DIRS}
|
||||
${XercesC_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
link_directories(${OCC_LIBRARY_DIR})
|
||||
link_directories(${SMESH_LIB_PATH})
|
||||
|
||||
set(MeshPartGui_LIBS
|
||||
MeshPart
|
||||
|
||||
Reference in New Issue
Block a user