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( ...@@ -33,11 +33,7 @@ set(
) )
if (PARAVIEW_QT_VERSION VERSION_GREATER "4") qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
qt5_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamReaderControls.h)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_reader_general_controls" TYPE "openfoam_reader_general_controls"
......
...@@ -13,7 +13,9 @@ endif() ...@@ -13,7 +13,9 @@ endif()
# Simple discovery and sanity checks # Simple discovery and sanity checks
find_package(ParaView REQUIRED) find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE}) if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE})
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
...@@ -27,11 +27,7 @@ set( ...@@ -27,11 +27,7 @@ set(
) )
if (PARAVIEW_QT_VERSION VERSION_GREATER "4") qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
qt5_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
else()
qt4_wrap_cpp(MOC_SRCS pqFoamBlockMeshControls.h)
endif()
add_paraview_property_group_widget(IFACES0 IFACES0_SRCS add_paraview_property_group_widget(IFACES0 IFACES0_SRCS
TYPE "openfoam_blockMesh_general_controls" TYPE "openfoam_blockMesh_general_controls"
......
...@@ -13,7 +13,9 @@ endif() ...@@ -13,7 +13,9 @@ endif()
# Simple discovery and sanity checks # Simple discovery and sanity checks
find_package(ParaView REQUIRED) find_package(ParaView REQUIRED)
include(${PARAVIEW_USE_FILE}) if (PARAVIEW_USE_FILE)
include(${PARAVIEW_USE_FILE})
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
project(runTimePostProcessing) project(runTimePostProcessing)
include(${VTK_USE_FILE}) message("VTK version: " ${VTK_VERSION})
if(VTK_LIBRARIES) if(${VTK_VERSION_MAJOR} LESS 6)
message("Found VTK LIBRARIES: " ${VTK_USE_FILE})
endif()
if(${VTK_VERSION} VERSION_GREATER "6")
message("VTK version: " ${VTK_VERSION})
else()
message(FATAL_ERROR " VTK version is too old - requires VTK6 or newer") message(FATAL_ERROR " VTK version is too old - requires VTK6 or newer")
endif() endif()
...@@ -67,7 +61,7 @@ set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN} ...@@ -67,7 +61,7 @@ set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
## Record VTK version for general bookkeeping ## Record VTK version for general bookkeeping
# file(WRITE # file(WRITE
# ${CMAKE_BINARY_DIR}/version # ${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 file(GLOB SOURCE_FILES
...@@ -119,8 +113,8 @@ add_library( ...@@ -119,8 +113,8 @@ add_library(
set_target_properties( set_target_properties(
runTimePostProcessing runTimePostProcessing
PROPERTIES PROPERTIES
VERSION ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION ${VTK_VERSION}
SOVERSION ${VTK_MAJOR_VERSION} SOVERSION ${VTK_VERSION_MAJOR}
) )
target_link_libraries( target_link_libraries(
......
...@@ -11,22 +11,42 @@ endif() ...@@ -11,22 +11,42 @@ endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Simple discovery and sanity checks # Simple discovery and sanity checks
unset(VTK_VERSION)
unset(VTK_VERSION_MAJOR)
if (EXISTS "$ENV{VTK_DIR}") if (EXISTS "$ENV{VTK_DIR}")
message("Building with VTK from $ENV{VTK_DIR}") message("Building with VTK from $ENV{VTK_DIR}")
find_package(VTK REQUIRED HINTS $ENV{VTK_DIR}) find_package(VTK REQUIRED HINTS $ENV{VTK_DIR})
include(${VTK_USE_FILE})
elseif (EXISTS "$ENV{ParaView_DIR}") elseif (EXISTS "$ENV{ParaView_DIR}")
message("Building with Paraview from $ENV{ParaView_DIR}") message("Building with Paraview from $ENV{ParaView_DIR}")
find_package(ParaView REQUIRED HINTS $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() else()
message(FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR") message(FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR")
endif() 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) 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