Skip to content
Snippets Groups Projects
bootstrap 48.3 KiB
Newer Older
#ifdef TEST3
  cout << c.GetFoo() << endl;
#else
  std::cout << c.GetFoo() << std::endl;
#endif
' > "${TMPFILE}.cxx"
for a in ${cmake_cxx_compilers}; do
  for b in 1 2 3; do
    if [ -z "${cmake_cxx_compiler}" ] && \
      cmake_try_run "${a}" "${cmake_cxx_flags} -DTEST${b}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
      cmake_cxx_compiler="${a}"
    fi
  done
done
rm -f "${TMPFILE}.cxx"

if [ -z "${cmake_cxx_compiler}" ]; then
  cmake_error 7 "Cannot find appropriate C++ compiler on this system.
Bill Hoffman's avatar
Bill Hoffman committed
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted."
fi
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"

#-----------------------------------------------------------------------------
# Test Make

cmake_make_processor=

# If MAKE is set, use that for make processor, otherwise use list of known make
if [ -n "${MAKE}" ]; then
  cmake_make_processors="${MAKE}"
else
  cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
fi

TMPFILE="`cmake_tmp_file`_dir"
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
cd "${cmake_bootstrap_dir}/${TMPFILE}"
test: test.c
	"'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
'>"Makefile"
echo '
#include <stdio.h>
int main(){ printf("1%c", (char)0x0a); return 0; }
cmake_original_make_flags="${cmake_make_flags}"
if [ "x${cmake_parallel_make}" != "x" ]; then
  cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
fi
for a in ${cmake_make_processors}; do
  if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
    cmake_make_processor="${a}"
  fi
done
cmake_full_make_flags="${cmake_make_flags}"
if [ "x${cmake_original_make_flags}" != "x${cmake_make_flags}" ]; then
  if [ -z "${cmake_make_processor}" ]; then
    cmake_make_flags="${cmake_original_make_flags}"
    for a in ${cmake_make_processors}; do
      if [ -z "${cmake_make_processor}" ] && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
        cmake_make_processor="${a}"
      fi
    done
  fi
fi
cd "${cmake_bootstrap_dir}"

if [ -z "${cmake_make_processor}" ]; then
  cmake_error 8 "Cannot find appropriate Makefile processor on this system.
Please specify one using environment variable MAKE."
fi
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
echo "Makefile processor on this system is: ${cmake_make_processor}"
if [ "x${cmake_full_make_flags}" != "x${cmake_make_flags}" ]; then
  echo "---------------------------------------------"
  echo "Makefile processor ${cmake_make_processor} does not support parallel build"
  echo "---------------------------------------------"
fi
# Ok, we have CC, CXX, and MAKE.

# Test C++ compiler features
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#include <iostream>
int main() { std::cout << "This is GNU" << std::endl; return 0;}
#endif
' > ${TMPFILE}.cxx
cmake_cxx_compiler_is_gnu=0
if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  cmake_cxx_compiler_is_gnu=1
fi
if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
  echo "${cmake_cxx_compiler} is GNU compiler"
else
  echo "${cmake_cxx_compiler} is not GNU compiler"
fi
rm -f "${TMPFILE}.cxx"

if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
  # Check for non-GNU compiler flags

  # If we are on IRIX, check for -LANG:std
  cmake_test_flags="-LANG:std"
  if [ "x${cmake_system}" = "xIRIX64" ]; then
    TMPFILE=`cmake_tmp_file`
    int main() { std::cout << "No need for '"${cmake_test_flags}"'" << std::endl; return 0;}
' > ${TMPFILE}.cxx
    if cmake_try_run "${cmake_cxx_compiler}" \
      "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
      :
    else
      if cmake_try_run "${cmake_cxx_compiler}" \
        "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
        cmake_need_lang_std=1
      fi
    if [ "x${cmake_need_lang_std}" = "x1" ]; then
      cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
      echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
    else
      echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
    fi
    rm -f "${TMPFILE}.cxx"
  # If we are on OSF, check for -timplicit_local -no_implicit_include
  cmake_test_flags="-timplicit_local -no_implicit_include"
  if [ "x${cmake_system}" = "xOSF1" ]; then
    TMPFILE=`cmake_tmp_file`
    int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
' > ${TMPFILE}.cxx
    cmake_need_flags=1
    if cmake_try_run "${cmake_cxx_compiler}" \
      "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
      :
    else
      cmake_need_flags=0
    fi
    if [ "x${cmake_need_flags}" = "x1" ]; then
      cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
      echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
    else
      echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
    fi
    rm -f "${TMPFILE}.cxx"
  # If we are on OSF, check for -std strict_ansi -nopure_cname
  cmake_test_flags="-std strict_ansi -nopure_cname"
  if [ "x${cmake_system}" = "xOSF1" ]; then
    TMPFILE=`cmake_tmp_file`
    int main() { std::cout << "We need '"${cmake_test_flags}"'" << std::endl; return 0;}
' > ${TMPFILE}.cxx
    cmake_need_flags=1
    if cmake_try_run "${cmake_cxx_compiler}" \
      "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
      :
    else
      cmake_need_flags=0
    fi
    if [ "x${cmake_need_flags}" = "x1" ]; then
      cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
      echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
    else
      echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
    fi
    rm -f "${TMPFILE}.cxx"
  # If we are on HP-UX, check for -Ae for the C compiler.
  if [ "x${cmake_system}" = "xHP-UX" ]; then
    int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
' > ${TMPFILE}.c
    cmake_need_Ae=0
    if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
      :
    else
      if cmake_try_run "${cmake_c_compiler}" \
        "${cmake_c_flags} ${cmake_test_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
        cmake_need_Ae=1
      fi
    if [ "x${cmake_need_Ae}" = "x1" ]; then
      cmake_c_flags="${cmake_c_flags} ${cmake_test_flags}"
      echo "${cmake_c_compiler} needs ${cmake_test_flags}"
    else
      echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
    fi
    rm -f "${TMPFILE}.c"
    echo '
    #include <iostream>
    int main(int argc, char** argv) {
    for(int i=0; i < 1; ++i);
    for(int i=0; i < 1; ++i);
    (void)argc; (void)argv; return 0; }
' > ${TMPFILE}.cxx
    cmake_need_AAstd98=0
    cmake_test_flags="-AA +hpxstd98"
    if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
      :
    else
      if cmake_try_run "${cmake_cxx_compiler}" \
        "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
        cmake_need_AAstd98=1
      fi
    fi
    if [ "x${cmake_need_AAstd98}" = "x1" ]; then
      cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
      echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
    else
      echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
    fi

if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
  # Are we SolarisStudio?

  TMPFILE=`cmake_tmp_file`
  echo '
  #if defined(__SUNPRO_CC)
  #include <iostream>
  int main() { std::cout << "This is SolarisStudio" << std::endl; return 0;}
  #endif
  ' > ${TMPFILE}.cxx
  cmake_cxx_compiler_is_solarisstudio=0
  if cmake_try_run "${cmake_cxx_compiler}" \
    "${cmake_cxx_flags} " "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
    cmake_cxx_compiler_is_solarisstudio=1
  fi
  if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then
    echo "${cmake_cxx_compiler} is SolarisStudio compiler"
  else
    echo "${cmake_cxx_compiler} is not SolarisStudio compiler"
  fi
  rm -f "${TMPFILE}.cxx"

  if [ "x${cmake_cxx_compiler_is_solarisstudio}" = "x1" ]; then
    cmake_cxx_flags="${cmake_cxx_flags} -library=stlport4"
  fi
fi


# Test for kwsys features
KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0
KWSYS_LFS_AVAILABLE=0
KWSYS_LFS_REQUESTED=0
KWSYS_STL_HAS_WSTRING=0
KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0
KWSYS_CXX_HAS_SETENV=0
KWSYS_CXX_HAS_UNSETENV=0
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
KWSYS_CXX_HAS_UTIMENSAT=0
KWSYS_CXX_HAS_UTIMES=0
if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
  "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  KWSYS_CXX_HAS_SETENV=1
  echo "${cmake_cxx_compiler} has setenv"
else
  echo "${cmake_cxx_compiler} does not have setenv"
fi

if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \
  "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  KWSYS_CXX_HAS_UNSETENV=1
  echo "${cmake_cxx_compiler} has unsetenv"
else
  echo "${cmake_cxx_compiler} does not have unsetenv"
fi

if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \
  "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=1
  echo "${cmake_cxx_compiler} has environ in stdlib.h"
else
  echo "${cmake_cxx_compiler} does not have environ in stdlib.h"
fi

if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
  "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  KWSYS_STL_HAS_WSTRING=1
  echo "${cmake_cxx_compiler} has stl wstring"
else
  echo "${cmake_cxx_compiler} does not have stl wstring"
fi

if cmake_try_run "${cmake_cxx_compiler}" \
  "${cmake_cxx_flags} -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H" \
  "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=1
  echo "${cmake_cxx_compiler} has <ext/stdio_filebuf.h>"
else
  echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>"
fi

# Just to be safe, let us store compiler and flags to the header file

cmake_bootstrap_version='$Revision$'
cmake_compiler_settings_comment="/*
 * Generated by ${cmake_source_dir}/bootstrap
 * Version:     ${cmake_bootstrap_version}
 *
 * Source directory: ${cmake_source_dir}
 * Binary directory: ${cmake_bootstrap_dir}
 *
 * C compiler:   ${cmake_c_compiler}
 * C flags:      ${cmake_c_flags}
 *
 * C++ compiler: ${cmake_cxx_compiler}
 * C++ flags:    ${cmake_cxx_flags}
 *
 * Make:         ${cmake_make_processor}
 *
 * Sources:
 * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
 * kwSys Sources:
 * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
# When bootstrapping on MinGW with MSYS we must convert the source
# directory to a windows path.
if ${cmake_system_mingw}; then
    CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W`
    CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W`
    CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
    CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0"
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
# Regenerate configured headers
for h in Configure VersionConfig; do
  if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
    rm -f cm${h}.h${_tmp}
    mv -f cm${h}.h${_tmp} cm${h}.h
# Prepare KWSYS
cmake_kwsys_config_replace_string \
  "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
  "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
  "${cmake_compiler_settings_comment}"
cmake_kwsys_config_replace_string \
  "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
  "${cmake_bootstrap_dir}/cmsys/Configure.h" \
  "${cmake_compiler_settings_comment}"

for a in ${KWSYS_FILES}; do
  cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
     "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
done
cmake_generate_file "${cmake_bootstrap_dir}/cmThirdParty.h" ""

# Generate Makefile
dep="cmConfigure.h cmsys/*.hxx cmsys/*.h `cmake_escape \"${cmake_source_dir}\"`/Source/*.h"
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
  objs="${objs} ${a}.o"
done

if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
  cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
fi

if [ "x${cmake_c_flags}" != "x" ]; then
  cmake_c_flags="${cmake_c_flags} "
fi

if [ "x${cmake_cxx_flags}" != "x" ]; then
  cmake_cxx_flags="${cmake_cxx_flags} "
fi

cmake_c_flags_String="-DKWSYS_STRING_C"
if ${cmake_system_mingw}; then
  cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
fi
cmake_cxx_flags_SystemTools="
  -DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
  -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
  -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
  -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
  -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
"
cmake_c_flags="${cmake_c_flags}-I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
  -I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
cmake_cxx_flags="${cmake_cxx_flags} -I`cmake_escape \"${cmake_bootstrap_dir}\"` -I`cmake_escape \"${cmake_source_dir}/Source\"` \
  -I`cmake_escape \"${cmake_source_dir}/Utilities\"`"
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
echo "	${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
for a in ${CMAKE_CXX_SOURCES}; do
  src=`cmake_escape "${cmake_source_dir}/Source/${a}.cxx"`
  echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  echo "	${cmake_cxx_compiler} ${cmake_cxx_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
echo "cmBootstrapCommands1.o : $cmBootstrapCommands1Deps" >> "${cmake_bootstrap_dir}/Makefile"
echo "cmBootstrapCommands2.o : $cmBootstrapCommands2Deps" >> "${cmake_bootstrap_dir}/Makefile"
for a in ${CMAKE_C_SOURCES}; do
  src=`cmake_escape "${cmake_source_dir}/Source/${a}.c"`
  echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  echo "	${cmake_c_compiler} ${cmake_c_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
for a in ${KWSYS_C_SOURCES}; do
  src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.c"`
  src_flags=`eval echo \\${cmake_c_flags_\${a}}`
  echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  echo "	${cmake_c_compiler} ${cmake_c_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
done
for a in ${KWSYS_CXX_SOURCES}; do
  src=`cmake_escape "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
  src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
  echo "${a}.o : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  echo "	${cmake_cxx_compiler} ${cmake_cxx_flags} -DKWSYS_NAMESPACE=cmsys ${src_flags} -c ${src} -o ${a}.o" >> "${cmake_bootstrap_dir}/Makefile"
Andy Cedilnik's avatar
Andy Cedilnik committed
rebuild_cache:
	cd "${cmake_binary_dir}" && "${cmake_source_dir}/bootstrap"
' >> "${cmake_bootstrap_dir}/Makefile"
# Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
echo '
# Generated by '"${cmake_source_dir}"'/bootstrap
# Default cmake settings.  These may be overridden any settings below.
set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
set (CMAKE_BIN_DIR "'"${cmake_bin_dir}"'" CACHE PATH "Install location for binaries (relative to prefix)." FORCE)
set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
# Add configuration settings given as command-line options.
if [ "x${cmake_bootstrap_qt_gui}" != "x" ]; then
set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
if [ "x${cmake_bootstrap_server}" != "x" ]; then
  echo '
set (CMake_ENABLE_SERVER_MODE '"${cmake_bootstrap_server}"' CACHE BOOL "Enable server mode" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_sphinx_man}" != "x" ]; then
  echo '
set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_sphinx_html}" != "x" ]; then
  echo '
set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_sphinx_qthelp}" != "x" ]; then
  echo '
set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE BOOL "Build qch help with Sphinx" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_sphinx_build}" != "x" ]; then
  echo '
set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if [ "x${cmake_sphinx_flags}" != "x" ]; then
  echo '
set (SPHINX_FLAGS [==['"${cmake_sphinx_flags}"']==] CACHE STRING "Flags to pass to sphinx-build" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
# Add user-specified settings.  Handle relative-path case for
# specification of cmake_init_file.
(
cd "${cmake_binary_dir}"
if [ -f "${cmake_init_file}" ]; then
  cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
)

echo "---------------------------------------------"

# Run make to build bootstrap cmake
  ${cmake_make_processor} ${cmake_make_flags}
RES=$?
if [ "${RES}" -ne "0" ]; then
  cmake_error 9 "Problem while running ${cmake_make_processor}"
fi
cd "${cmake_binary_dir}"

# Set C, CXX, and MAKE environment variables, so that real real cmake will be
# build with same compiler and make
CC="${cmake_c_compiler}"
CXX="${cmake_cxx_compiler}"
if [ -n "${cmake_ccache_enabled}" ]; then
  CC="ccache ${CC}"
  CXX="ccache ${CXX}"
fi
MAKE="${cmake_make_processor}"
export CC
export CXX
export MAKE

# Run bootstrap CMake to configure real CMake
cmake_options="-DCMAKE_BOOTSTRAP=1"
if [ -n "${cmake_verbose}" ]; then
  cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
fi
"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
RES=$?
if [ "${RES}" -ne "0" ]; then
  cmake_error 11 "Problem while running initial CMake"
fi

echo "---------------------------------------------"

# And we are done. Now just run make
echo "CMake has bootstrapped.  Now run ${cmake_make_processor}."