CMake: Decouple internal SMESH build from Fem build - fixes #18287
This commit is contained in:
committed by
Chris Hennes
parent
037a46ec70
commit
4c492621fc
@@ -25,7 +25,7 @@ macro(CheckInterModuleDependencies)
|
||||
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH BUILD_SMESH)
|
||||
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_FLAT_MESH BUILD_MESH_PART)
|
||||
REQUIRES_MODS(BUILD_OPENSCAD BUILD_MESH_PART BUILD_DRAFT)
|
||||
REQUIRES_MODS(BUILD_PART BUILD_MATERIAL)
|
||||
|
||||
@@ -183,8 +183,16 @@ macro(InitializeFreeCADBuildOptions)
|
||||
#set(FREECAD_USE_EXTERNAL_SMESH ON )
|
||||
endif (FREECAD_BUILD_DEBIAN)
|
||||
|
||||
if(BUILD_FEM)
|
||||
set(BUILD_SMESH ON )
|
||||
if(BUILD_FEM OR BUILD_MESH_PART)
|
||||
set(FREECAD_USE_SMESH ON)
|
||||
if(FREECAD_USE_EXTERNAL_SMESH)
|
||||
set(BUILD_SMESH OFF)
|
||||
else()
|
||||
set(BUILD_SMESH ON)
|
||||
endif()
|
||||
else()
|
||||
set(FREECAD_USE_SMESH OFF)
|
||||
set(BUILD_SMESH OFF)
|
||||
endif()
|
||||
|
||||
# force build directory to be different to source directory
|
||||
|
||||
@@ -142,7 +142,7 @@ macro(PrintFinalReport)
|
||||
simple(ZLIB "${ZLIB_VERSION_STRING}")
|
||||
simple(OCC "${OCC_VERSION_STRING} [${OCC_LIBRARY_DIR}] [${OCC_INCLUDE_DIR}]")
|
||||
simple(OCC_Libs "[${OCC_LIBRARIES}]")
|
||||
if(BUILD_SMESH)
|
||||
if(FREECAD_USE_SMESH)
|
||||
if(FREECAD_USE_EXTERNAL_SMESH)
|
||||
simple(SMESH "${SMESH_VERSION_MAJOR}.${SMESH_VERSION_MINOR}.${SMESH_VERSION_PATCH}.${SMESH_VERSION_TWEAK}")
|
||||
else()
|
||||
@@ -152,7 +152,7 @@ macro(PrintFinalReport)
|
||||
simple(VTK ${VTK_VERSION})
|
||||
endif()
|
||||
else()
|
||||
simple(SMESH "do not build")
|
||||
simple(SMESH "not enabled")
|
||||
endif()
|
||||
conditional(NETGEN NETGEN_FOUND
|
||||
"not enabled"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
macro(SetupSalomeSMESH)
|
||||
# -------------------------------- Salome SMESH --------------------------
|
||||
|
||||
# Salome SMESH sources are under src/3rdParty now
|
||||
if(BUILD_SMESH)
|
||||
if(FREECAD_USE_SMESH)
|
||||
|
||||
# set the internal smesh version:
|
||||
# see src/3rdParty/salomonemesh/CMakeLists.txt and commit https://github.com/FreeCAD/FreeCAD/commit/666a3e5 and https://forum.freecad.org/viewtopic.php?f=10&t=30838
|
||||
set(SMESH_VERSION_MAJOR 7)
|
||||
@@ -145,6 +145,6 @@ macro(SetupSalomeSMESH)
|
||||
|
||||
set(SMESH_FOUND TRUE)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/SMESH_Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/SMESH_Version.h)
|
||||
endif(BUILD_SMESH)
|
||||
endif(FREECAD_USE_SMESH)
|
||||
|
||||
endmacro(SetupSalomeSMESH)
|
||||
|
||||
4
src/3rdParty/CMakeLists.txt
vendored
4
src/3rdParty/CMakeLists.txt
vendored
@@ -1,5 +1,5 @@
|
||||
# Build SalomeMesh for all Platforms since heavily patched
|
||||
if (BUILD_SMESH AND NOT FREECAD_USE_EXTERNAL_SMESH)
|
||||
if (BUILD_SMESH)
|
||||
add_subdirectory(salomesmesh)
|
||||
endif()
|
||||
|
||||
@@ -12,4 +12,4 @@ if (BUILD_ASSEMBLY AND NOT FREECAD_USE_EXTERNAL_ONDSELSOLVER)
|
||||
git submodule update --init" )
|
||||
endif()
|
||||
add_subdirectory(OndselSolver)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
if (BUILD_SMESH)
|
||||
if (SMESH_FOUND)
|
||||
add_definitions(-DHAVE_SMESH)
|
||||
if(SMESH_VERSION_MAJOR LESS_EQUAL 9 AND SMESH_VERSION_MINOR LESS 10 )
|
||||
add_definitions(-DHAVE_MEFISTO)
|
||||
endif()
|
||||
endif(BUILD_SMESH)
|
||||
endif(SMESH_FOUND)
|
||||
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
if (BUILD_SMESH)
|
||||
if (SMESH_FOUND)
|
||||
add_definitions(-DHAVE_SMESH)
|
||||
if(SMESH_VERSION_MAJOR LESS_EQUAL 9 AND SMESH_VERSION_MINOR LESS 10 )
|
||||
add_definitions(-DHAVE_MEFISTO)
|
||||
endif()
|
||||
endif(BUILD_SMESH)
|
||||
endif(SMESH_FOUND)
|
||||
|
||||
if(BUILD_FEM_NETGEN)
|
||||
add_definitions(-DHAVE_NETGEN)
|
||||
|
||||
@@ -3,8 +3,6 @@ target_include_directories(Measure_tests_run PUBLIC
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${OCC_INCLUDE_DIR}
|
||||
${Python3_INCLUDE_DIRS}
|
||||
${SMESH_INCLUDE_DIR}
|
||||
${VTK_INCLUDE_DIRS}
|
||||
${XercesC_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_directories(Measure_tests_run PUBLIC ${OCC_LIBRARY_DIR})
|
||||
|
||||
Reference in New Issue
Block a user