Commit 07cd1156 authored by Mark Olesen's avatar Mark Olesen

ENH: use FOAM_MODULE_{PREFIX,LIBBIN} for defining locations

- now derived CMAKE_INSTALL_PREFIX from FOAM_MODULE_PREFIX since this
  improves consistency between the wmake rules and the cmake ones.

- defaults to user locations
parent 59bdcfb3
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
targetType=libso
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
module=visualization
......@@ -11,6 +10,7 @@ date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting compile of $module with ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo " prefix = ${FOAM_MODULE_PREFIX:-default (user)}"
echo
src/Allwmake $targetType $*
......
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
targetType=libso
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
......
......@@ -2,26 +2,22 @@
cd "${0%/*}" || exit # Run from this directory
export WM_CONTINUE_ON_ERROR=true # Optional unit
. ${WM_PROJECT_DIR:?}/wmake/scripts/cmakeFunctions # Cmake functions
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Note
# - use '-prefix=..' to define installation prefix (default: FOAM_LIBBIN)
# - '-prefix=..' to define installation prefix (default: FOAM_USER_LIBBIN)
# - MPI detection may not work properly with later VTK/ParaView versions
#------------------------------------------------------------------------------
# Default is openfoam (FOAM_LIBBIN)
: "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
# Default to user location
: "${FOAM_MODULE_PREFIX:=${FOAM_USER_LIBBIN%/*}}"
: "${CMAKE_INSTALL_PREFIX:=$FOAM_MODULE_PREFIX}"
unset cmakeOpts
if [ -n "$CMAKE_INSTALL_PREFIX" ]
then
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
fi
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
#------------------------------------------------------------------------------
......
......@@ -2,14 +2,14 @@
cd "${0%/*}" || exit # Run from this directory
export WM_CONTINUE_ON_ERROR=true # Optional unit
. ${WM_PROJECT_DIR:?}/wmake/scripts/paraviewFunctions # CMake, PV functions
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Note
# - use '-prefix=..' to define installation prefix (default: FOAM_LIBBIN)
# Build into FOAM_USER_{APPBIN,LIBBIN} unless otherwise specified with
# -prefix or FOAM_MODULE_{APPBIN,LIBBIN} env varables
#
# Note
# For paraview-5.7 (and later) plugins are built into their own subdirs.
......@@ -22,15 +22,13 @@ export WM_CONTINUE_ON_ERROR=true # Optional unit
#
#------------------------------------------------------------------------------
# Default is openfoam (FOAM_LIBBIN)
: "${CMAKE_INSTALL_PREFIX:=${FOAM_LIBBIN%/*}}"
# Default to user location
: "${FOAM_MODULE_PREFIX:=${FOAM_USER_LIBBIN%/*}}"
: "${CMAKE_INSTALL_PREFIX:=$FOAM_MODULE_PREFIX}"
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
unset cmakeOpts
if [ -n "$CMAKE_INSTALL_PREFIX" ]
then
export CMAKE_INSTALL_PREFIX
cmakeOpts="-DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX"
fi
#------------------------------------------------------------------------------
......
......@@ -58,9 +58,6 @@ message("OpenFOAM api = ${foam_api}, libs = ${foamPvLibQualifier}")
#-----------------------------------------------------------------------------
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-library.txt)
# Default is PROJECT target, with supporting libraries from FOAM_LIBBIN
# Possible temporary override with 'STAGED_INSTALL_PREFIX' later
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
......@@ -74,6 +71,8 @@ else()
endif()
message("Install prefix = ${CMAKE_INSTALL_PREFIX}")
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-library.txt)
if (${ParaView_VERSION} VERSION_GREATER_EQUAL 5.7)
message("================")
......
vtkPVblockMesh.C
vtkPVblockMeshConvert.C
LIB = $(CMAKE_INSTALL_PREFIX)/lib/libvtkPVblockReader-pv${PARAVIEW_API}
LIB = $(FOAM_MODULE_LIBBIN)/libvtkPVblockReader-pv${PARAVIEW_API}
/* Default is PROJECT target */
ifeq (,$(CMAKE_INSTALL_PREFIX))
CMAKE_INSTALL_PREFIX := $(dir $(FOAM_LIBBIN))
sinclude $(GENERAL_RULES)/module-path-user
/* Failsafe - user location */
ifeq (,$(strip $(FOAM_MODULE_LIBBIN)))
FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
endif
EXE_INC = \
......@@ -17,5 +19,5 @@ EXE_INC = \
LIB_LIBS = \
-lmeshTools \
-lblockMesh \
-L$(CMAKE_INSTALL_PREFIX)/lib -lvtkPVFoamCommon-pv${PARAVIEW_API} \
-L$(FOAM_MODULE_LIBBIN) -lvtkPVFoamCommon-pv${PARAVIEW_API} \
$(GLIBS)
foamPvCore.C
LIB = $(CMAKE_INSTALL_PREFIX)/lib/libvtkPVFoamCommon-pv${PARAVIEW_API}
LIB = $(FOAM_MODULE_LIBBIN)/libvtkPVFoamCommon-pv${PARAVIEW_API}
/* Default is PROJECT target */
ifeq (,$(CMAKE_INSTALL_PREFIX))
CMAKE_INSTALL_PREFIX := $(dir $(FOAM_LIBBIN))
sinclude $(GENERAL_RULES)/module-path-user
/* Failsafe - user location */
ifeq (,$(strip $(FOAM_MODULE_LIBBIN)))
FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
endif
EXE_INC = \
......
......@@ -51,9 +51,6 @@ message("================")
message("Using ParaView = $ENV{ParaView_DIR}")
message("OpenFOAM api = ${foam_api}, libs = ${foamPvLibQualifier}")
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-library.txt)
# Default is PROJECT target, with supporting libraries from FOAM_LIBBIN
# Possible temporary override with 'STAGED_INSTALL_PREFIX' later
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
......@@ -66,6 +63,8 @@ else()
endif()
message("Install prefix = ${CMAKE_INSTALL_PREFIX}")
include(CMakeLists-OpenFOAM.txt)
include(CMakeLists-library.txt)
if (${ParaView_VERSION} VERSION_GREATER_EQUAL 5.7)
message("================")
......
......@@ -5,4 +5,4 @@ vtkPVFoamMeshLagrangian.C
vtkPVFoamMeshVolume.C
vtkPVFoamUpdateInfo.C
LIB = $(CMAKE_INSTALL_PREFIX)/lib/libvtkPVFoamReader-pv${PARAVIEW_API}
LIB = $(FOAM_MODULE_LIBBIN)/libvtkPVFoamReader-pv${PARAVIEW_API}
/* Default is PROJECT target */
ifeq (,$(CMAKE_INSTALL_PREFIX))
CMAKE_INSTALL_PREFIX := $(dir $(FOAM_LIBBIN))
sinclude $(GENERAL_RULES)/module-path-user
/* Failsafe - user location */
ifeq (,$(strip $(FOAM_MODULE_LIBBIN)))
FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
endif
EXE_INC = \
......@@ -26,5 +28,5 @@ LIB_LIBS = \
-ldynamicMesh \
-lgenericPatchFields \
-llagrangian \
-L$(CMAKE_INSTALL_PREFIX)/lib -lvtkPVFoamCommon-pv${PARAVIEW_API} \
-L$(FOAM_MODULE_LIBBIN) -lvtkPVFoamCommon-pv${PARAVIEW_API} \
$(GLIBS)
......@@ -2,7 +2,6 @@
cd "${0%/*}" || exit # Run from this directory
export WM_CONTINUE_ON_ERROR=true # Optional unit
. ${WM_PROJECT_DIR:?}/wmake/scripts/cmakeFunctions # Cmake functions
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.cmake-args
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
......
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