From 8dc120df1d4841e417dd41cbdba941abacf481b1 Mon Sep 17 00:00:00 2001 From: cknill Date: Mon, 8 Jul 2024 19:24:40 -0600 Subject: [PATCH] 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. --- configure | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 40f052a220..b365b7dd2a 100755 --- a/configure +++ b/configure @@ -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