FEM Post: Always build except for VTK <6.2

VTK 6.0 has a bug which makes it incompatibel with c++11
This commit is contained in:
Stefan Tröger 2016-05-22 13:03:42 +02:00 committed by wmayer
parent e982084e3f
commit 2fb14ce9c4
4 changed files with 8 additions and 13 deletions

View File

@ -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 --------------------------------

View File

@ -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

View File

@ -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)

View File

@ -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)