Enabled PV Reader compilation with cmake AND wmake build

This commit is contained in:
Henrik Rusche 2018-05-28 21:46:15 +02:00
parent 56d6a9c3cd
commit 5c4b068ebe
8 changed files with 80 additions and 19 deletions

View file

@ -44,5 +44,5 @@ if(BUILD_WITH_CMAKE)
endif(BUILD_WITH_CMAKE) endif(BUILD_WITH_CMAKE)
if(RUN_TESTS) if(RUN_TESTS)
include(tests) include(testFOAM)
endif(RUN_TESTS) endif(RUN_TESTS)

View file

@ -7,14 +7,53 @@
# the pqReader.xml file contains xml defining readers with their # the pqReader.xml file contains xml defining readers with their
# file extensions and descriptions. # file extensions and descriptions.
INCLUDE(${PARAVIEW_USE_FILE}) #
# We a little hack here to support cmake and wmake-compiled FOAM
# libraries simultaneously. This uses the same trigger as externally
# compiled applications (FOAM_FOUND)
#
if(NOT FOAM_FOUND)
# Config when compiling FOAM library with wmake
cmake_minimum_required(VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})
LINK_DIRECTORIES(
$ENV{FOAM_LIBBIN}
)
INCLUDE_DIRECTORIES(
$ENV{WM_PROJECT_DIR}/src/foam/lnInclude
$ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
${PROJECT_SOURCE_DIR}/../vtkPVFoam
)
ADD_DEFINITIONS(
-std=c++11
-DWM_$ENV{WM_PRECISION_OPTION}
-DWM_LABEL_SIZE=$ENV{WM_LABEL_SIZE}
)
# Set output library destination to plugin folder
SET(
LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
CACHE INTERNAL
"Single output directory for building all libraries."
)
else()
# Config when compiling FOAM library with cmake
INCLUDE(${PARAVIEW_USE_FILE})
endif()
# Set output library destination to plugin folder
#SET(
# LIBRARY_OUTPUT_PATH $ENV{PV_PLUGIN_PATH}
# CACHE INTERNAL
# "Single output directory for building all libraries."
#)
# Build the server-side plugin # Build the server-side plugin
ADD_PARAVIEW_PLUGIN( ADD_PARAVIEW_PLUGIN(
@ -23,6 +62,23 @@ ADD_PARAVIEW_PLUGIN(
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
) )
TARGET_LINK_LIBRARIES(PVFoamReader_SM PUBLIC vtkPVFoam pqCore) if(NOT FOAM_FOUND)
# Config when compiling FOAM library with wmake
TARGET_LINK_LIBRARIES(
PVFoamReader_SM
foam
finiteVolume
vtkPVFoam
pqCore
)
else()
# Config when compiling FOAM library with cmake
TARGET_LINK_LIBRARIES(
PVFoamReader_SM
PUBLIC vtkPVFoam pqCore
)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View file

@ -1,7 +1,7 @@
# /*-------------------------------------------------------------------------*\ # /*-------------------------------------------------------------------------*\
# ========= | # ========= |
# \\ / F ield | foam-extend: Open Source CFD # \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | Version: 4.0 # \\ / O peration | Version: 4.1
# \\ / A nd | Web: http://www.foam-extend.org # \\ / A nd | Web: http://www.foam-extend.org
# \\/ M anipulation | For copyright notice see file Copyright # \\/ M anipulation | For copyright notice see file Copyright
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -23,7 +23,7 @@
# #
# Description # Description
# CMakeLists.txt file for implementing a test harness for the compilation # CMakeLists.txt file for implementing a test harness for the compilation
# and test of foam-extend-3.2 using Kitware CTest/CMake/CDash # and test of foam-extend-4.1 using Kitware CTest/CMake/CDash
# #
# The results will be submitted to the CDash server identified by the file # The results will be submitted to the CDash server identified by the file
# CTestConfig.cmake # CTestConfig.cmake
@ -48,13 +48,16 @@ function(GetHostName var)
execute_process( execute_process(
COMMAND hostname COMMAND hostname
OUTPUT_VARIABLE thisHostname OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
) )
else() else()
execute_process( execute_process(
COMMAND hostname -f COMMAND hostname -f
OUTPUT_VARIABLE thisHostname OUTPUT_VARIABLE thisHostname
OUTPUT_STRIP_TRAILING_WHITESPACE
) )
endif() endif()
set(${var} ${thisHostname} PARENT_SCOPE) set(${var} ${thisHostname} PARENT_SCOPE)
endfunction() endfunction()

View file

@ -1,4 +1,5 @@
# /*-------------------------------------------------------------------------*\# ======== | # /*-------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | foam-extend: Open Source CFD # \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | # \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright # \\ / A nd | For copyright notice see file Copyright

View file

@ -1,4 +1,5 @@
# /*-------------------------------------------------------------------------*\# ======== | # /*-------------------------------------------------------------------------*\
# ========= |
# \\ / F ield | foam-extend: Open Source CFD # \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration | Version: 4.1 # \\ / O peration | Version: 4.1
# \\ / A nd | Web: http://www.foam-extend.org # \\ / A nd | Web: http://www.foam-extend.org

View file

@ -75,9 +75,9 @@ fi
# We need cmake version 2.8.0 at least # We need cmake version 2.8.0 at least
if [ "$WM_ARCH_BASE" == "mingw" ] if [ "$WM_ARCH_BASE" == "mingw" ]
then then
cmake $WM_PROJECT_DIR -G "MSYS Makefiles" cmake $WM_PROJECT_DIR -G "MSYS Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
else else
cmake $WM_PROJECT_DIR -G "Unix Makefiles" cmake $WM_PROJECT_DIR -G "Unix Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
fi fi
# All set. Now we can run the available test harness # All set. Now we can run the available test harness

View file

@ -81,9 +81,9 @@ fi
# We need cmake version 2.8.0 at least # We need cmake version 2.8.0 at least
if [ "$WM_ARCH_BASE" == "mingw" ] if [ "$WM_ARCH_BASE" == "mingw" ]
then then
cmake $WM_PROJECT_DIR -G "MSYS Makefiles" cmake $WM_PROJECT_DIR -G "MSYS Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
else else
cmake $WM_PROJECT_DIR -G "Unix Makefiles" cmake $WM_PROJECT_DIR -G "Unix Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
fi fi
# All set. Now we can run the available test harness # All set. Now we can run the available test harness

View file

@ -81,9 +81,9 @@ fi
# We need cmake version 2.8.0 at least # We need cmake version 2.8.0 at least
if [ "$WM_ARCH_BASE" == "mingw" ] if [ "$WM_ARCH_BASE" == "mingw" ]
then then
cmake $WM_PROJECT_DIR -G "MSYS Makefiles" cmake $WM_PROJECT_DIR -G "MSYS Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
else else
cmake $WM_PROJECT_DIR -G "Unix Makefiles" cmake $WM_PROJECT_DIR -G "Unix Makefiles" -DRUN_TESTS=ON -DBUILD_WITH_CMAKE=OFF
fi fi
# All set. Now we can run the available test harness # All set. Now we can run the available test harness