From 2fb14ce9c4977a3a96da2b6176268ef2257efe61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Sun, 22 May 2016 13:03:42 +0200 Subject: [PATCH] FEM Post: Always build except for VTK <6.2 VTK 6.0 has a bug which makes it incompatibel with c++11 --- CMakeLists.txt | 14 +++++--------- src/Mod/Fem/App/CMakeLists.txt | 3 --- src/Mod/Fem/CMakeLists.txt | 3 ++- src/Mod/MeshPart/App/CMakeLists.txt | 1 + 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05e944566..9341c8111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,9 +26,6 @@ include(cMake/FreeCadMacros.cmake) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cMake") -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) - #if(CMAKE_CFG_INTDIR STREQUAL .) # No Debug/Release output paths set(DEBUG_MAIN_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) @@ -173,7 +170,6 @@ if(APPLE) endif(APPLE) OPTION(BUILD_FEM "Build the FreeCAD FEM module, be aware, unfinished code!" ON) -OPTION(BUILD_FEM_VTK "Build the FreeCAD VTK Postprocessing support (need VTK 6 or higher)" OFF) OPTION(BUILD_SANDBOX "Build the FreeCAD Sandbox module which is only for testing purposes" OFF) OPTION(BUILD_TEMPLATE "Build the FreeCAD template module which is only for testing purposes" OFF) OPTION(BUILD_ARCH "Build the FreeCAD Architecture module" ON) @@ -650,6 +646,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") IF(OCC_FOUND) #if we use smesh we definitly also need vtk, no matter of external or internal smesh find_package(VTK REQUIRED) #don't check VERSION 6 as this would exclude version 7 + set(BUILD_FEM_VTK ON) if(${VTK_MAJOR_VERSION} LESS 6) message( FATAL_ERROR "Found VTK version is <6, this is not compatible" ) endif() @@ -657,6 +654,10 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(${VTK_MINOR_VERSION} LESS 2) add_definitions(-DVTK_NO_QUAD_POLY ) endif() + if(${VTK_MINOR_VERSION} EQUAL 0) + message(WARNING "VTK <6.0 cannot be used with c++11, FEM postprocessing is disabled") + set(BUILD_FEM_VTK OFF) + endif() endif() if(NOT FREECAD_USE_EXTERNAL_SMESH) @@ -773,11 +774,6 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif(FREECAD_USE_FREETYPE) #--------------------------------------------------- - -# -------------------------------- VTK -------------------------------- - if(BUILD_FEM_VTK) - find_package(VTK REQUIRED) - endif(BUILD_FEM_VTK) if(BUILD_GUI) # -------------------------------- OpenGL -------------------------------- diff --git a/src/Mod/Fem/App/CMakeLists.txt b/src/Mod/Fem/App/CMakeLists.txt index fbe91eaba..5aa79b0fc 100755 --- a/src/Mod/Fem/App/CMakeLists.txt +++ b/src/Mod/Fem/App/CMakeLists.txt @@ -8,9 +8,6 @@ if(BUILD_FEM_NETGEN) add_definitions(-DFCWithNetgen ${NETGEN_DEFINITIONS}) endif(BUILD_FEM_NETGEN) -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) - include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src diff --git a/src/Mod/Fem/CMakeLists.txt b/src/Mod/Fem/CMakeLists.txt index 8c2e8fdaf..6cab3bab6 100755 --- a/src/Mod/Fem/CMakeLists.txt +++ b/src/Mod/Fem/CMakeLists.txt @@ -1,9 +1,10 @@ if(BUILD_FEM_VTK) - include(${VTK_USE_FILE}) add_definitions(-DFC_USE_VTK) endif(BUILD_FEM_VTK) +include(${VTK_USE_FILE}) + add_subdirectory(App) if(BUILD_GUI) diff --git a/src/Mod/MeshPart/App/CMakeLists.txt b/src/Mod/MeshPart/App/CMakeLists.txt index 735f4746a..f3ec4ebc2 100644 --- a/src/Mod/MeshPart/App/CMakeLists.txt +++ b/src/Mod/MeshPart/App/CMakeLists.txt @@ -6,6 +6,7 @@ endif(MSVC) if (BUILD_SMESH) add_definitions(-DHAVE_SMESH -DHAVE_MEFISTO) + include(${VTK_USE_FILE}) endif(BUILD_SMESH) if(BUILD_FEM_NETGEN)