mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- incorrectly uses paraview include dirs instead of the more universal vtk include dirs for the MPI test.
134 lines
3.1 KiB
Plaintext
134 lines
3.1 KiB
Plaintext
#-----------------------------------------------------------------------------
|
|
project(runTimePostProcessing)
|
|
|
|
include(${VTK_USE_FILE})
|
|
|
|
if(VTK_LIBRARIES)
|
|
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")
|
|
endif()
|
|
|
|
#-----------------------------------------------------------------------------
|
|
# Test some characteristics
|
|
set(test_file ${CMAKE_CURRENT_BINARY_DIR}/check_mpi.cxx)
|
|
file(WRITE ${test_file}
|
|
"#include <vtkMPICommunicator.h>\n"
|
|
"int main() {\n"
|
|
" vtkMPICommunicator* p = vtkMPICommunicator::New();\n"
|
|
" p->Delete();\n"
|
|
" return 0;\n"
|
|
"}"
|
|
)
|
|
try_compile(FOAM_USING_VTK_MPI
|
|
${CMAKE_CURRENT_BINARY_DIR} ${test_file}
|
|
LINK_LIBRARIES vtkParallelMPI
|
|
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${VTK_INCLUDE_DIRS}"
|
|
)
|
|
if (FOAM_USING_VTK_MPI)
|
|
add_definitions(-DFOAM_USING_VTK_MPI)
|
|
message("Building with VTK MPI")
|
|
include(vtkMPI)
|
|
else()
|
|
message(WARNING "==== Building without VTK MPI ====")
|
|
endif()
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
include_directories(
|
|
${LIB_SRC}/OpenFOAM/include
|
|
${LIB_SRC}/OpenFOAM/lnInclude
|
|
${LIB_SRC}/OSspecific/${WM_OSTYPE}/lnInclude
|
|
${LIB_SRC}/finiteVolume/lnInclude
|
|
${LIB_SRC}/fileFormats/lnInclude
|
|
${LIB_SRC}/conversion/lnInclude
|
|
${LIB_SRC}/surfMesh/lnInclude
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
|
|
link_directories(
|
|
$ENV{FOAM_LIBBIN}
|
|
)
|
|
|
|
set(CMAKE_BUILD_TYPE Release)
|
|
|
|
# Build intermediate (library) directly into the OpenFOAM libdir
|
|
# - implies CMAKE_INSTALL_PREFIX is ignored and there is no 'install' phase
|
|
set(LIBRARY_OUTPUT_PATH $ENV{FOAM_LIBBIN}
|
|
CACHE INTERNAL
|
|
""
|
|
)
|
|
|
|
## Record VTK version for general bookkeeping
|
|
# file(WRITE
|
|
# ${CMAKE_BINARY_DIR}/version
|
|
# "VTK_VERSION=${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}\n"
|
|
# )
|
|
|
|
file(GLOB SOURCE_FILES
|
|
fieldVisualisationBase.C
|
|
scalarBar.C
|
|
functionObjectBase.C
|
|
functionObjectCloud.C
|
|
functionObjectLine.C
|
|
functionObjectSurface.C
|
|
geometryBase.C
|
|
geometryCloud.C
|
|
geometryCloudGather.C
|
|
geometryPatches.C
|
|
geometryPatchesGather.C
|
|
geometrySurface.C
|
|
pathline.C
|
|
pointData.C
|
|
runTimePostProcessing.C
|
|
runTimePostProcessingFunctionObject.C
|
|
scene.C
|
|
surface.C
|
|
surfaceGather.C
|
|
text.C
|
|
contourFilter.C
|
|
cuttingPlaneFilter.C
|
|
volumeFilter.C
|
|
)
|
|
|
|
set(OPENFOAM_LIBRARIES
|
|
OpenFOAM
|
|
finiteVolume
|
|
surfMesh
|
|
fileFormats
|
|
conversion
|
|
)
|
|
|
|
if (FOAM_USING_VTK_MPI)
|
|
set(LINK_LIBRARIES vtkParallelMPI)
|
|
else()
|
|
set(LINK_LIBRARIES)
|
|
endif()
|
|
|
|
add_library(
|
|
runTimePostProcessing
|
|
SHARED
|
|
${SOURCE_FILES}
|
|
)
|
|
|
|
set_target_properties(
|
|
runTimePostProcessing
|
|
PROPERTIES
|
|
VERSION ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}
|
|
SOVERSION ${VTK_MAJOR_VERSION}
|
|
)
|
|
|
|
target_link_libraries(
|
|
runTimePostProcessing
|
|
${VTK_LIBRARIES}
|
|
${LINK_LIBRARIES}
|
|
${OPENFOAM_LIBRARIES}
|
|
)
|
|
|
|
#-----------------------------------------------------------------------------
|