Commit 7eb1ef75 authored by Mark Olesen's avatar Mark Olesen

CONFIG: adjustments for CMake files

- drop plugin support for Qt4 (old paraview)

- handle upcoming changes in VTK version naming in CMake files
  * VTK_MAJOR_VERSION becomes VTK_VERSION_MAJOR etc.
parent 382f1da1
......@@ -33,11 +33,7 @@ set(
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
endif()
qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_reader_general_controls"
......
......@@ -13,7 +13,9 @@ endif()
# Simple discovery and sanity checks
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE})
endif()
#-----------------------------------------------------------------------------
......
......@@ -27,11 +27,7 @@ set(
)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
endif()
qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_blockMesh_general_controls"
......
......@@ -13,7 +13,9 @@ endif()
# Simple discovery and sanity checks
find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE})
if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE})
endif()
#-----------------------------------------------------------------------------
......
#-----------------------------------------------------------------------------
project(runTimePostProcessing)
include(${VTK_USE_FILE})
message("VTK version: " ${VTK_VERSION})
if(VTK_LIBRARIES)
message("Found VTK LIBRARIES: " ${VTK_USE_FILE})
endif()
if(${VTK_VERSION} VERSION_GREATER "6")
message("VTK version: " ${VTK_VERSION})
else()
if(${VTK_VERSION_MAJOR} LESS 6)
message(FATAL_ERROR " VTK version is too old - requires VTK6 or newer")
endif()
......@@ -67,7 +61,7 @@ set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
## Record VTK version for general bookkeeping
# file(WRITE
# ${CMAKE_BINARY_DIR}/version
# "VTK_VERSION=${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}\n"
# "VTK_VERSION=${VTK_VERSION}\n"
# )
file(GLOB SOURCE_FILES
......@@ -119,8 +113,8 @@ add_library(
set_target_properties(
runTimePostProcessing
PROPERTIES
VERSION ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}
SOVERSION ${VTK_MAJOR_VERSION}
VERSION ${VTK_VERSION}
SOVERSION ${VTK_VERSION_MAJOR}
)
target_link_libraries(
......
......@@ -11,22 +11,42 @@ endif()
#-----------------------------------------------------------------------------
# Simple discovery and sanity checks
unset(VTK_VERSION)
unset(VTK_VERSION_MAJOR)
if (EXISTS "$ENV{VTK_DIR}")
message("Building with VTK from $ENV{VTK_DIR}")
find_package(VTK REQUIRED HINTS $ENV{VTK_DIR})
include(${VTK_USE_FILE})
elseif (EXISTS "$ENV{ParaView_DIR}")
message("Building with Paraview from $ENV{ParaView_DIR}")
find_package(ParaView REQUIRED HINTS $ENV{ParaView_DIR})
include(${VTK_USE_FILE})
set(
VTK_VERSION
"${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}"
)
else()
message(FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR")
endif()
if (VTK_USE_FILE)
message("VTK from ${VTK_USE_FILE}")
include(${VTK_USE_FILE})
endif()
#-----------------------------------------------------------------------------
# Handle name changes (eg, VTK_MAJOR_VERSION to VTK_VERSION_MAJOR etc.)
if (VTK_MAJOR_VERSION AND NOT VTK_VERSION_MAJOR)
message("Found older VTK version naming")
set(VTK_VERSION_MAJOR ${VTK_MAJOR_VERSION})
set(VTK_VERSION_MINOR ${VTK_MINOR_VERSION})
set(VTK_VERSION_PATCH ${VTK_BUILD_VERSION})
if (NOT VTK_VERSION)
set(
VTK_VERSION
"${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH}"
)
message("Synthesized VTK version: " ${VTK_VERSION})
endif()
endif()
#-----------------------------------------------------------------------------
include(CMakeLists-OpenFOAM.txt)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment