Fix for --display-cmake in configure

Moved build directory creation further down in the script so that --display-cmake
has a chance to happen before build tree setup.
This commit is contained in:
cknill 2024-07-08 19:24:40 -06:00
parent 4d31335391
commit 8dc120df1d

26
configure vendored
View file

@ -458,6 +458,19 @@ if [ -z "$CMakeCommand" ]; then
fi
fi
echo "Using $(cmake --version | head -1)"
echo
if [ -n "$CMakeGenerator" ]; then
cmake="${CMakeCommand} -G ${CMakeGenerator} ${CMakeCacheEntries} ${sourcedir}"
else
cmake="${CMakeCommand} ${CMakeCacheEntries} ${sourcedir}"
fi
if [ "${display_cmake}" = 1 ]; then
echo "${cmake}"
exit 0
fi
if [ -d $builddir ]; then
# If build directory exists, check if it has a CMake cache
if [ -f $builddir/CMakeCache.txt ]; then
@ -474,19 +487,6 @@ echo "Build Directory : $builddir"
echo "Source Directory: $sourcedir"
cd $builddir
echo "Using $(cmake --version | head -1)"
echo
if [ -n "$CMakeGenerator" ]; then
cmake="${CMakeCommand} -G ${CMakeGenerator} ${CMakeCacheEntries} ${sourcedir}"
else
cmake="${CMakeCommand} ${CMakeCacheEntries} ${sourcedir}"
fi
if [ "${display_cmake}" = 1 ]; then
echo "${cmake}"
exit 0
fi
eval ${cmake} 2>&1
echo "# This is the command used to configure this build" >config.status