mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support alternative build-root location (#2286)
- specify any of these
./Allwmake -build-root=...
wmake -build-root=...
FOAM_BUILDROOT=... wmake
these specify an alternative root where build artifacts are to land.
Currently only used as an alternative for the 'build/' hierarchy
since the 'platforms/' target normally includes inputs as well.
Possible use:
```
(
export WM_MPLIB="%{foam_mplib}"
export FOAM_MPI="%{foam_mpi}"
export MPI_ARCH_PATH="%{mpi_prefix}"
export FOAM_BUILDROOT=/tmp/mpibuild
export FOAM_MPI_LIBBIN="$FOAM_BUILDROOT/platforms/$WM_OPTIONS/lib/$FOAM_MPI"
src/Pstream/Allwmake-mpi
)
```
This commit is contained in:
@ -214,7 +214,7 @@ cdSource()
|
||||
# - the objectsDir
|
||||
#
|
||||
# Global variables used:
|
||||
# - WM_PROJECT_DIR, WM_OPTIONS
|
||||
# - FOAM_BUILDROOT, WM_PROJECT_DIR, WM_OPTIONS
|
||||
findObjectDir()
|
||||
{
|
||||
local project="$(expandPath "$WM_PROJECT_DIR")"
|
||||
@ -225,8 +225,13 @@ findObjectDir()
|
||||
relativeDir="${absdir#${project}/}"
|
||||
if [ "$relativeDir" != "$absdir" ]
|
||||
then
|
||||
[ -w "$WM_PROJECT_DIR" ] && \
|
||||
if [ -n "$FOAM_BUILDROOT" ] && [ -w "$FOAM_BUILDROOT" ]
|
||||
then
|
||||
objectsDir="${FOAM_BUILDROOT}/build/${WM_OPTIONS}/${relativeDir}"
|
||||
elif [ -w "$WM_PROJECT_DIR" ]
|
||||
then
|
||||
objectsDir="${WM_PROJECT_DIR}/build/${WM_OPTIONS}/${relativeDir}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Default (local) build directory
|
||||
|
||||
Reference in New Issue
Block a user