2003-03-27 12:29:38 -08:00
#!/bin/sh
2016-09-27 12:01:08 -07:00
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
2003-06-21 08:57:13 -07:00
2011-12-16 07:56:47 -08:00
die() {
echo "$@" 1>&2 ; exit 1
}
2017-05-14 10:41:55 -07:00
# Compile flag extraction function.
cmake_extract_standard_flags()
{
2020-03-16 02:45:51 -07:00
id="${1:-*}"
lang="${2}"
ver="${3}"
sed -n "s/ *set *( *CMAKE_${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
"${cmake_source_dir}/Modules/Compiler/"${id}-${lang}.cmake \
2>/dev/null | tr ';' ' '
# Clang's CXX compiler flags are in the common module.
sed -n "s/ *set *( *CMAKE_\\\${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
"${cmake_source_dir}/Modules/Compiler/Clang.cmake" \
2>/dev/null | tr ';' ' '
2017-05-14 10:41:55 -07:00
}
2006-08-25 18:21:10 -07:00
# Version number extraction function.
cmake_version_component()
{
2017-06-07 10:16:42 -07:00
sed -n "
2020-03-16 10:46:16 -07:00
/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\)).*/\1/;p;}
2017-06-07 10:16:42 -07:00
" "${cmake_source_dir}/Source/CMakeVersion.cmake"
2006-08-25 18:21:10 -07:00
}
2013-09-26 11:13:38 -07:00
# Install destination extraction function.
cmake_install_dest_default()
{
2017-06-07 10:16:42 -07:00
sed -n '
2013-09-26 11:13:38 -07:00
/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
2013-10-25 05:55:50 -07:00
s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
s/${CMake_VERSION_MINOR}/'"${cmake_version_minor}"'/
s/${CMake_VERSION_PATCH}/'"${cmake_version_patch}"'/
p
q
}
2017-06-07 10:16:42 -07:00
' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
2013-09-26 11:13:38 -07:00
}
2011-01-10 06:32:09 -08:00
cmake_toupper()
{
2020-05-01 10:16:38 -07:00
echo "$1" | tr '[a-z]' '[A-Z]'
2011-01-10 06:32:09 -08:00
}
2006-01-31 15:50:16 -08:00
# Detect system and directory information.
cmake_system=`uname`
2009-09-25 07:48:24 -07:00
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
2006-01-31 15:50:16 -08:00
cmake_binary_dir=`pwd`
2010-04-23 06:44:23 -07:00
# Load version information.
2007-11-14 18:17:53 -08:00
cmake_version_major="`cmake_version_component MAJOR`"
cmake_version_minor="`cmake_version_component MINOR`"
2010-04-23 06:44:23 -07:00
cmake_version_patch="`cmake_version_component PATCH`"
cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
2013-09-26 11:25:48 -07:00
cmake_version_rc="`cmake_version_component RC`"
2020-05-02 14:42:13 -07:00
if test "$cmake_version_rc" != ""; then
2013-09-26 11:25:48 -07:00
cmake_version="${cmake_version}-rc${cmake_version_rc}"
fi
2010-04-23 06:44:23 -07:00
2013-11-12 12:56:36 -08:00
cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`"
2016-05-27 07:03:43 -07:00
cmake_bin_dir_keyword="OTHER"
2013-09-26 11:13:38 -07:00
cmake_data_dir_keyword="OTHER"
cmake_doc_dir_keyword="OTHER"
cmake_man_dir_keyword="OTHER"
2015-12-21 07:02:11 -08:00
cmake_xdgdata_dir_keyword="OTHER"
2016-05-27 07:03:43 -07:00
cmake_bin_dir=""
2013-09-26 11:13:38 -07:00
cmake_data_dir=""
cmake_doc_dir=""
cmake_man_dir=""
2015-12-21 07:02:11 -08:00
cmake_xdgdata_dir=""
2006-01-31 15:50:16 -08:00
cmake_init_file=""
2006-10-19 12:17:58 -07:00
cmake_bootstrap_system_libs=""
2008-02-13 11:47:03 -08:00
cmake_bootstrap_qt_gui=""
cmake_bootstrap_qt_qmake=""
2023-03-15 17:50:08 -07:00
cmake_bootstrap_debugger=""
2018-06-11 18:14:10 -07:00
cmake_sphinx_info=""
2013-09-17 13:08:05 -07:00
cmake_sphinx_man=""
cmake_sphinx_html=""
2015-02-07 14:23:28 -08:00
cmake_sphinx_qthelp=""
2021-02-19 04:39:28 -08:00
cmake_sphinx_latexpdf=""
2013-09-17 13:08:05 -07:00
cmake_sphinx_build=""
2015-04-30 06:30:14 -07:00
cmake_sphinx_flags=""
2006-01-31 15:50:16 -08:00
2009-05-27 08:33:37 -07:00
# Determine whether this is a Cygwin environment.
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
2009-05-27 08:33:37 -07:00
cmake_system_cygwin=true
2013-09-26 11:13:38 -07:00
cmake_doc_dir_keyword="CYGWIN"
cmake_man_dir_keyword="CYGWIN"
2009-05-27 08:33:37 -07:00
else
cmake_system_cygwin=false
fi
2021-04-01 10:03:52 -07:00
# Determine whether this is a MSYS environment.
if echo "${cmake_system}" | grep MSYS >/dev/null 2>&1; then
cmake_system_msys=true
cmake_doc_dir_keyword="MSYS"
cmake_man_dir_keyword="MSYS"
else
cmake_system_msys=false
fi
2006-01-31 15:50:16 -08:00
# Determine whether this is a MinGW environment.
2021-04-01 10:03:52 -07:00
if echo "${cmake_system}" | grep 'MINGW' >/dev/null 2>&1; then
2006-01-31 15:50:16 -08:00
cmake_system_mingw=true
else
cmake_system_mingw=false
fi
2006-04-13 08:00:52 -07:00
# Determine whether this is OS X
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
2006-04-13 08:00:52 -07:00
cmake_system_darwin=true
else
cmake_system_darwin=false
fi
2012-07-07 10:57:40 -07:00
# Determine whether this is BeOS
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
2006-12-04 14:26:41 -08:00
cmake_system_beos=true
2013-09-26 11:13:38 -07:00
cmake_doc_dir_keyword="HAIKU"
cmake_man_dir_keyword="HAIKU"
2006-12-04 14:26:41 -08:00
else
cmake_system_beos=false
fi
2012-07-07 10:57:40 -07:00
# Determine whether this is Haiku
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
2008-09-15 14:53:28 -07:00
cmake_system_haiku=true
2013-09-26 11:13:38 -07:00
cmake_doc_dir_keyword="HAIKU"
cmake_man_dir_keyword="HAIKU"
2008-09-15 14:53:28 -07:00
else
cmake_system_haiku=false
fi
2009-06-10 10:04:25 -07:00
# Determine whether this is OpenVMS
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
2009-06-10 10:04:25 -07:00
cmake_system_openvms=true
else
cmake_system_openvms=false
fi
2014-11-04 08:01:56 -08:00
# Determine whether this is HP-UX
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
2017-08-04 06:49:04 -07:00
die 'CMake no longer compiles on HP-UX. See
2020-05-26 08:30:01 -07:00
https://gitlab.kitware.com/cmake/cmake/-/issues/17137
2017-08-04 06:49:04 -07:00
Use CMake 3.9 or lower instead.'
2014-11-04 08:01:56 -08:00
cmake_system_hpux=true
else
cmake_system_hpux=false
fi
2022-01-27 06:58:10 -08:00
# Determine whether this is AIX
if echo "${cmake_system}" | grep AIX >/dev/null 2>&1; then
cmake_system_aix=true
else
cmake_system_aix=false
fi
2012-10-28 15:23:29 -07:00
# Determine whether this is Linux
2017-08-16 08:06:40 -07:00
if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
2012-10-28 15:23:29 -07:00
cmake_system_linux=true
2014-11-04 08:01:56 -08:00
else
cmake_system_linux=false
2022-01-27 06:57:33 -08:00
fi
2014-11-04 08:01:56 -08:00
# Determine whether this is a PA-RISC machine
# This only works for Linux or HP-UX, not other PA-RISC OSs (BSD maybe?). Also
# may falsely detect parisc on HP-UX m68k
cmake_machine_parisc=false
if ${cmake_system_linux}; then
2017-08-16 08:06:40 -07:00
if uname -m | grep parisc >/dev/null 2>&1; then
2012-10-28 15:23:29 -07:00
cmake_machine_parisc=true
fi
2014-11-04 08:01:56 -08:00
elif ${cmake_system_hpux}; then
2017-08-16 08:06:40 -07:00
if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
2014-11-04 08:01:56 -08:00
cmake_machine_parisc=true
fi
2012-10-28 15:23:29 -07:00
fi
2006-01-31 15:50:16 -08:00
# Choose the generator to use for bootstrapping.
if ${cmake_system_mingw}; then
# Bootstrapping from an MSYS prompt.
cmake_bootstrap_generator="MSYS Makefiles"
else
# Bootstrapping from a standard UNIX prompt.
cmake_bootstrap_generator="Unix Makefiles"
fi
2009-06-10 10:04:25 -07:00
# Choose tools and extensions for this platform.
if ${cmake_system_openvms}; then
_tmp="_tmp"
_cmk="_cmk"
_diff=`which diff`
else
_tmp=".tmp"
_cmk=".cmk"
_diff="diff"
fi
# Construct bootstrap directory name.
cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap${_cmk}"
2006-02-16 17:13:54 -08:00
# Helper function to fix windows paths.
2012-02-29 11:29:16 -08:00
case "${cmake_system}" in
*MINGW*)
cmake_fix_slashes()
{
cmd //c echo "$(echo "$1" | sed 's/\\/\//g')" | sed 's/^"//;s/" *$//'
}
;;
*)
cmake_fix_slashes()
{
echo "$1" | sed 's/\\/\//g'
}
;;
esac
2006-02-16 17:13:54 -08:00
# Choose the default install prefix.
if ${cmake_system_mingw}; then
2020-05-02 14:42:13 -07:00
if test "x${PROGRAMFILES}" != "x"; then
2006-02-16 17:13:54 -08:00
cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
2020-05-02 14:42:13 -07:00
elif test "x${ProgramFiles}" != "x"; then
2006-02-16 17:13:54 -08:00
cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
2020-05-02 14:42:13 -07:00
elif test "x${SYSTEMDRIVE}" != "x"; then
2006-02-16 17:13:54 -08:00
cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
2020-05-02 14:42:13 -07:00
elif test "x${SystemDrive}" != "x"; then
2006-02-16 17:13:54 -08:00
cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
else
cmake_default_prefix="c:/Program Files/CMake"
fi
2009-09-30 05:31:53 -07:00
elif ${cmake_system_haiku}; then
2013-01-07 12:09:18 -08:00
cmake_default_prefix=`finddir B_COMMON_DIRECTORY`
2006-02-16 17:13:54 -08:00
else
cmake_default_prefix="/usr/local"
fi
2013-09-26 11:13:38 -07:00
# Lookup default install destinations.
2016-05-27 07:03:43 -07:00
cmake_bin_dir_default="`cmake_install_dest_default BIN ${cmake_bin_dir_keyword}`"
2013-09-26 11:13:38 -07:00
cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`"
cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`"
cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`"
2015-12-21 07:02:11 -08:00
cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
2013-09-26 11:13:38 -07:00
2023-10-13 06:45:40 -07:00
CMAKE_KNOWN_C_COMPILERS="cc gcc clang xlc icx tcc"
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ clang++ c++ icpx"
2020-10-14 11:36:10 -07:00
CMAKE_KNOWN_MAKE_PROCESSORS="gmake make smake"
2020-10-14 11:23:59 -07:00
CMAKE_KNOWN_NINJA_PROCESSORS="ninja-build ninja samu"
2003-03-27 12:29:38 -08:00
2004-10-18 08:34:02 -07:00
CMAKE_PROBLEMATIC_FILES="\
CMakeCache.txt \
CMakeSystem.cmake \
CMakeCCompiler.cmake \
CMakeCXXCompiler.cmake \
2012-08-24 05:48:59 -07:00
*/CMakeSystem.cmake \
*/CMakeCCompiler.cmake \
*/CMakeCXXCompiler.cmake \
2004-10-18 08:34:02 -07:00
Source/cmConfigure.h \
Source/CTest/Curl/config.h \
2020-05-05 05:46:40 -07:00
Utilities/cmThirdParty.h \
Utilities/cmcurl/lib/curl_config.h \
Utilities/cmlibarchive/config.h \
Utilities/cmliblzma/config.h \
Utilities/cmnghttp2/config.h \
2004-10-18 08:34:02 -07:00
"
2006-03-22 06:58:11 -08:00
CMAKE_UNUSED_SOURCES="\
cmGlobalXCodeGenerator \
cmLocalXCodeGenerator \
cmXCodeObject \
cmXCode21Object \
cmSourceGroup \
"
2003-12-08 11:11:58 -08:00
CMAKE_CXX_SOURCES="\
2022-09-22 06:22:37 -07:00
cmAddCompileDefinitionsCommand \
2016-10-19 12:59:14 -07:00
cmAddCustomCommandCommand \
cmAddCustomTargetCommand \
cmAddDefinitionsCommand \
cmAddDependenciesCommand \
cmAddExecutableCommand \
cmAddLibraryCommand \
cmAddSubDirectoryCommand \
cmAddTestCommand \
2019-03-23 14:45:41 -07:00
cmArgumentParser \
2019-03-14 08:58:34 -07:00
cmBinUtilsLinker \
cmBinUtilsLinuxELFGetRuntimeDependenciesTool \
cmBinUtilsLinuxELFLinker \
cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool \
cmBinUtilsMacOSMachOGetRuntimeDependenciesTool \
cmBinUtilsMacOSMachOLinker \
cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool \
cmBinUtilsWindowsPEGetRuntimeDependenciesTool \
cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool \
cmBinUtilsWindowsPELinker \
cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool \
2022-08-05 01:55:32 -07:00
cmBlockCommand \
2016-10-19 12:59:14 -07:00
cmBreakCommand \
cmBuildCommand \
2021-10-05 06:47:19 -07:00
cmCMakeLanguageCommand \
2016-10-19 12:59:14 -07:00
cmCMakeMinimumRequired \
2023-03-09 10:00:49 -08:00
cmList \
2020-07-23 07:52:39 -07:00
cmCMakePath \
2020-07-23 07:54:12 -07:00
cmCMakePathCommand \
2016-10-19 12:59:14 -07:00
cmCMakePolicyCommand \
2016-10-19 14:19:41 -07:00
cmCPackPropertiesGenerator \
cmCacheManager \
2016-10-19 15:29:18 -07:00
cmCommand \
2016-10-19 14:19:41 -07:00
cmCommandArgumentParserHelper \
cmCommands \
cmCommonTargetGenerator \
cmComputeComponentGraph \
cmComputeLinkDepends \
cmComputeLinkInformation \
cmComputeTargetDepends \
2020-10-14 07:57:46 -07:00
cmConsoleBuf \
2016-10-19 14:19:41 -07:00
cmConditionEvaluator \
2016-10-19 12:59:14 -07:00
cmConfigureFileCommand \
cmContinueCommand \
cmCoreTryCompile \
cmCreateTestSourceList \
2020-10-05 09:15:17 -07:00
cmCryptoHash \
2016-10-19 14:19:41 -07:00
cmCustomCommand \
cmCustomCommandGenerator \
2019-10-17 07:20:52 -07:00
cmCustomCommandLines \
2022-06-02 14:18:37 -07:00
cmCxxModuleMapper \
2023-01-30 07:24:41 -08:00
cmCxxModuleUsageEffects \
2016-10-19 12:59:14 -07:00
cmDefinePropertyCommand \
2016-10-19 14:19:41 -07:00
cmDefinitions \
cmDocumentationFormatter \
2021-06-17 07:22:34 -07:00
cmELF \
2016-10-19 12:59:14 -07:00
cmEnableLanguageCommand \
cmEnableTestingCommand \
2023-04-03 07:55:13 -07:00
cmEvaluatedTargetProperty \
2016-10-19 12:59:14 -07:00
cmExecProgramCommand \
cmExecuteProcessCommand \
2016-10-19 14:19:41 -07:00
cmExpandedCommandArgument \
2022-05-24 14:19:59 -07:00
cmExperimental \
2016-10-19 14:19:41 -07:00
cmExportBuildFileGenerator \
cmExportFileGenerator \
cmExportInstallFileGenerator \
cmExportSet \
cmExportTryCompileFileGenerator \
cmExprParserHelper \
cmExternalMakefileProjectGenerator \
2016-10-19 12:59:14 -07:00
cmFileCommand \
2019-03-13 08:51:12 -07:00
cmFileCopier \
cmFileInstaller \
2021-06-16 14:09:59 -07:00
cmFileSet \
2019-03-13 08:54:01 -07:00
cmFileTime \
2019-03-13 11:10:19 -07:00
cmFileTimeCache \
2019-05-21 14:36:40 -07:00
cmFileTimes \
2016-10-19 12:59:14 -07:00
cmFindBase \
cmFindCommon \
cmFindFileCommand \
cmFindLibraryCommand \
cmFindPackageCommand \
2023-11-07 08:44:00 -08:00
cmFindPackageStack \
2016-10-19 12:59:14 -07:00
cmFindPathCommand \
cmFindProgramCommand \
cmForEachCommand \
2019-07-30 09:15:13 -07:00
cmFunctionBlocker \
2016-10-19 12:59:14 -07:00
cmFunctionCommand \
2017-11-02 13:42:18 -07:00
cmFSPermissions \
2016-10-19 14:19:41 -07:00
cmGeneratedFileStream \
cmGeneratorExpression \
cmGeneratorExpressionContext \
cmGeneratorExpressionDAGChecker \
cmGeneratorExpressionEvaluationFile \
cmGeneratorExpressionEvaluator \
cmGeneratorExpressionLexer \
cmGeneratorExpressionNode \
cmGeneratorExpressionParser \
cmGeneratorTarget \
2024-05-17 08:58:46 -07:00
cmGeneratorTarget_CompatibleInterface \
2024-05-16 13:16:33 -07:00
cmGeneratorTarget_IncludeDirectories \
2024-05-17 09:13:53 -07:00
cmGeneratorTarget_Link \
2024-05-16 13:37:48 -07:00
cmGeneratorTarget_LinkDirectories \
2024-05-16 13:30:14 -07:00
cmGeneratorTarget_Options \
2024-05-16 12:56:26 -07:00
cmGeneratorTarget_Sources \
2024-05-16 12:25:06 -07:00
cmGeneratorTarget_TargetPropertyEntry \
2024-05-17 09:22:14 -07:00
cmGeneratorTarget_TransitiveProperty \
2016-10-19 13:30:58 -07:00
cmGetCMakePropertyCommand \
cmGetDirectoryPropertyCommand \
cmGetFilenameComponentCommand \
2019-04-30 08:29:30 -07:00
cmGetPipes \
2016-10-19 13:30:58 -07:00
cmGetPropertyCommand \
cmGetSourceFilePropertyCommand \
cmGetTargetPropertyCommand \
cmGetTestPropertyCommand \
2016-10-19 14:19:41 -07:00
cmGlobalCommonGenerator \
cmGlobalGenerator \
2018-02-14 08:26:35 -08:00
cmGlobVerificationManager \
2016-10-19 13:30:58 -07:00
cmHexFileConverter \
cmIfCommand \
2023-02-02 12:53:28 -08:00
cmImportedCxxModuleInfo \
2016-10-19 13:30:58 -07:00
cmIncludeCommand \
2017-06-22 00:53:42 -07:00
cmIncludeGuardCommand \
2016-10-19 13:30:58 -07:00
cmIncludeDirectoryCommand \
cmIncludeRegularExpressionCommand \
cmInstallCommand \
cmInstallCommandArguments \
2022-04-22 15:00:47 -07:00
cmInstallCxxModuleBmiGenerator \
2016-10-19 14:19:41 -07:00
cmInstallDirectoryGenerator \
cmInstallExportGenerator \
2021-06-17 14:01:28 -07:00
cmInstallFileSetGenerator \
2016-10-19 13:30:58 -07:00
cmInstallFilesCommand \
2016-10-19 14:19:41 -07:00
cmInstallFilesGenerator \
cmInstallGenerator \
2021-04-14 07:43:30 -07:00
cmInstallGetRuntimeDependenciesGenerator \
2021-05-26 10:30:32 -07:00
cmInstallImportedRuntimeArtifactsGenerator \
2021-05-19 07:29:17 -07:00
cmInstallRuntimeDependencySet \
2021-04-14 07:43:30 -07:00
cmInstallRuntimeDependencySetGenerator \
2016-10-19 14:19:41 -07:00
cmInstallScriptGenerator \
2018-10-02 13:38:26 -07:00
cmInstallSubdirectoryGenerator \
2016-10-19 14:19:41 -07:00
cmInstallTargetGenerator \
2016-10-19 13:30:58 -07:00
cmInstallTargetsCommand \
2016-10-19 14:19:41 -07:00
cmInstalledFile \
2023-08-16 06:26:08 -07:00
cmJSONHelpers \
2023-07-21 09:01:01 -07:00
cmJSONState \
2019-03-14 08:58:34 -07:00
cmLDConfigLDConfigTool \
cmLDConfigTool \
2016-10-19 13:30:58 -07:00
cmLinkDirectoriesCommand \
2018-09-06 10:10:55 -07:00
cmLinkItem \
2019-10-07 19:45:30 -07:00
cmLinkItemGraphVisitor \
2016-10-19 14:19:41 -07:00
cmLinkLineComputer \
2019-05-09 06:13:39 -07:00
cmLinkLineDeviceComputer \
2016-10-19 13:30:58 -07:00
cmListCommand \
2016-10-19 14:19:41 -07:00
cmListFileCache \
cmLocalCommonGenerator \
cmLocalGenerator \
cmMSVC60LinkLineComputer \
2016-10-19 13:30:58 -07:00
cmMacroCommand \
cmMakeDirectoryCommand \
2016-10-19 14:19:41 -07:00
cmMakefile \
2016-10-19 13:30:58 -07:00
cmMarkAsAdvancedCommand \
cmMathCommand \
cmMessageCommand \
2016-10-19 14:19:41 -07:00
cmMessenger \
cmNewLineStyle \
cmOSXBundleGenerator \
2016-10-19 13:30:58 -07:00
cmOptionCommand \
2016-10-19 14:19:41 -07:00
cmOrderDirectories \
cmOutputConverter \
cmParseArgumentsCommand \
cmPathLabel \
cmPolicies \
2016-11-01 11:04:20 -07:00
cmProcessOutput \
2016-10-19 13:30:58 -07:00
cmProjectCommand \
2021-09-21 08:12:35 -07:00
cmValue \
2016-10-19 14:19:41 -07:00
cmPropertyDefinition \
cmPropertyMap \
2020-10-02 11:25:30 -07:00
cmGccDepfileLexerHelper \
cmGccDepfileReader \
2016-10-19 13:30:58 -07:00
cmReturnCommand \
2021-11-24 07:45:22 -08:00
cmPlaceholderExpander \
2023-05-17 10:50:32 -07:00
cmPlistParser \
2016-10-19 14:19:41 -07:00
cmRulePlaceholderExpander \
2019-03-14 08:58:34 -07:00
cmRuntimeDependencyArchive \
2016-10-19 14:19:41 -07:00
cmScriptGenerator \
cmSearchPath \
2016-10-19 13:30:58 -07:00
cmSeparateArgumentsCommand \
cmSetCommand \
cmSetDirectoryPropertiesCommand \
cmSetPropertyCommand \
cmSetSourceFilesPropertiesCommand \
cmSetTargetPropertiesCommand \
cmSetTestsPropertiesCommand \
cmSiteNameCommand \
2016-10-19 14:19:41 -07:00
cmSourceFile \
cmSourceFileLocation \
2020-06-22 14:11:56 -07:00
cmStandardLevelResolver \
2016-10-19 14:19:41 -07:00
cmState \
cmStateDirectory \
cmStateSnapshot \
2019-08-19 12:33:06 -07:00
cmString \
2019-07-29 08:34:54 -07:00
cmStringAlgorithms \
2018-04-03 06:09:53 -07:00
cmStringReplaceHelper \
2016-10-19 13:30:58 -07:00
cmStringCommand \
2019-04-07 13:14:52 -07:00
cmSubcommandTable \
2016-10-19 13:30:58 -07:00
cmSubdirCommand \
2016-10-19 14:19:41 -07:00
cmSystemTools \
cmTarget \
2017-08-18 12:48:14 -07:00
cmTargetCompileDefinitionsCommand \
cmTargetCompileFeaturesCommand \
cmTargetCompileOptionsCommand \
cmTargetIncludeDirectoriesCommand \
2016-10-19 13:30:58 -07:00
cmTargetLinkLibrariesCommand \
2019-12-09 03:48:00 -08:00
cmTargetLinkOptionsCommand \
2015-03-12 09:44:36 -07:00
cmTargetPrecompileHeadersCommand \
2017-08-18 12:48:14 -07:00
cmTargetPropCommandBase \
2016-10-19 14:19:41 -07:00
cmTargetPropertyComputer \
2017-08-18 12:48:14 -07:00
cmTargetSourcesCommand \
2024-05-16 12:47:25 -07:00
cmTargetTraceDependencies \
2016-10-19 14:19:41 -07:00
cmTest \
cmTestGenerator \
2016-10-19 13:30:58 -07:00
cmTimestamp \
2020-10-02 11:25:30 -07:00
cmTransformDepfile \
2016-10-19 13:30:58 -07:00
cmTryCompileCommand \
cmTryRunCommand \
cmUnsetCommand \
2017-11-30 08:11:54 -08:00
cmUVHandlePtr \
2019-04-30 08:29:30 -07:00
cmUVProcessChain \
2016-10-19 14:19:41 -07:00
cmVersion \
2016-10-19 13:30:58 -07:00
cmWhileCommand \
2022-04-16 01:57:30 -07:00
cmWindowsRegistry \
2017-03-01 10:40:22 -08:00
cmWorkingDirectory \
2023-05-17 10:50:32 -07:00
cmXcFramework \
2016-10-19 14:19:41 -07:00
cmake \
cmakemain \
cmcmd \
2023-06-01 15:00:53 -07:00
cm_fileno \
2006-03-22 06:58:11 -08:00
"
2003-03-27 12:29:38 -08:00
2006-01-31 15:50:16 -08:00
if ${cmake_system_mingw}; then
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
cmGlobalMSYSMakefileGenerator \
2019-03-14 08:58:34 -07:00
cmGlobalMinGWMakefileGenerator \
cmVSSetupHelper \
"
2006-01-31 15:50:16 -08:00
fi
2019-08-04 01:49:16 -07:00
CMAKE_STD_CXX_HEADERS="\
2020-06-21 05:28:37 -07:00
filesystem \
2019-08-04 01:49:16 -07:00
memory \
optional \
shared_mutex \
string_view \
utility \
"
CMAKE_STD_CXX_SOURCES="\
2020-06-21 05:28:37 -07:00
fs_path \
2019-08-04 01:49:16 -07:00
string_view \
"
2017-05-11 12:53:14 -07:00
LexerParser_CXX_SOURCES="\
cmCommandArgumentLexer \
cmCommandArgumentParser \
cmExprLexer \
cmExprParser \
2020-10-02 11:25:30 -07:00
cmGccDepfileLexer \
2017-05-11 12:53:14 -07:00
"
LexerParser_C_SOURCES="\
cmListFileLexer \
"
2003-12-08 11:11:58 -08:00
2006-01-31 15:50:16 -08:00
if ${cmake_system_mingw}; then
KWSYS_C_SOURCES="\
2013-11-25 08:30:52 -08:00
EncodingC \
2006-09-21 10:47:54 -07:00
ProcessWin32 \
2008-01-17 07:35:32 -08:00
String \
2015-02-05 13:29:59 -08:00
System \
Terminal"
2006-01-31 15:50:16 -08:00
else
KWSYS_C_SOURCES="\
2013-11-25 08:30:52 -08:00
EncodingC \
2006-09-21 10:47:54 -07:00
ProcessUNIX \
2008-01-17 07:35:32 -08:00
String \
2015-02-05 13:29:59 -08:00
System \
Terminal"
2006-01-31 15:50:16 -08:00
fi
2003-07-07 14:52:53 -07:00
KWSYS_CXX_SOURCES="\
2003-06-23 05:58:58 -07:00
Directory \
2013-11-25 08:30:52 -08:00
EncodingCXX \
2014-03-06 21:55:07 -08:00
FStream \
2005-10-18 11:08:55 -07:00
Glob \
2003-06-23 05:58:58 -07:00
RegularExpression \
2021-04-14 09:15:54 -07:00
Status \
2003-06-23 05:58:58 -07:00
SystemTools"
KWSYS_FILES="\
Directory.hxx \
2013-11-25 08:30:52 -08:00
Encoding.h \
Encoding.hxx \
FStream.hxx \
2005-10-18 11:08:55 -07:00
Glob.hxx \
2003-06-23 05:58:58 -07:00
Process.h \
RegularExpression.hxx \
2021-04-14 09:15:54 -07:00
Status.hxx \
2008-01-17 07:35:32 -08:00
String.h \
2006-09-21 10:47:54 -07:00
System.h \
2015-02-05 13:29:59 -08:00
SystemTools.hxx \
Terminal.h"
2003-06-23 05:58:58 -07:00
2020-10-05 09:15:17 -07:00
LIBRHASH_C_SOURCES="\
librhash/algorithms.c \
librhash/byte_order.c \
librhash/hex.c \
librhash/md5.c \
librhash/rhash.c \
librhash/sha1.c \
librhash/sha256.c \
librhash/sha3.c \
librhash/sha512.c \
2023-11-28 14:49:47 -08:00
librhash/util.c \
2020-10-05 09:15:17 -07:00
"
2023-07-21 09:01:01 -07:00
JSONCPP_CXX_SOURCES="\
src/lib_json/json_reader.cpp \
src/lib_json/json_value.cpp \
src/lib_json/json_writer.cpp \
"
2017-09-13 11:33:38 -07:00
if ${cmake_system_mingw}; then
LIBUV_C_SOURCES="\
src/fs-poll.c \
2019-01-17 07:21:14 -08:00
src/idna.c
2017-09-13 11:33:38 -07:00
src/inet.c \
src/threadpool.c \
2019-01-17 07:21:14 -08:00
src/strscpy.c \
2022-09-22 11:16:31 -07:00
src/strtok.c \
2019-01-17 07:21:14 -08:00
src/timer.c \
2017-09-13 11:33:38 -07:00
src/uv-common.c \
src/win/async.c \
src/win/core.c \
src/win/detect-wakeup.c \
src/win/dl.c \
src/win/error.c \
src/win/fs-event.c \
src/win/fs.c \
src/win/getaddrinfo.c \
src/win/getnameinfo.c \
src/win/handle.c \
src/win/loop-watcher.c \
src/win/pipe.c \
src/win/poll.c \
src/win/process-stdio.c \
src/win/process.c \
src/win/signal.c \
src/win/stream.c \
src/win/tcp.c \
src/win/thread.c \
src/win/tty.c \
src/win/udp.c \
src/win/util.c \
src/win/winapi.c \
src/win/winsock.c \
"
else
LIBUV_C_SOURCES="\
2019-01-17 07:21:14 -08:00
src/strscpy.c \
2022-09-22 11:16:31 -07:00
src/strtok.c \
2019-01-17 07:21:14 -08:00
src/timer.c \
2017-09-13 11:33:38 -07:00
src/uv-common.c \
src/unix/cmake-bootstrap.c \
src/unix/core.c \
src/unix/fs.c \
src/unix/loop.c \
src/unix/loop-watcher.c \
src/unix/no-fsevents.c \
src/unix/pipe.c \
src/unix/poll.c \
src/unix/posix-hrtime.c \
src/unix/posix-poll.c \
src/unix/process.c \
src/unix/signal.c \
src/unix/stream.c \
2021-11-16 09:20:30 -08:00
src/unix/tcp.c \
2022-09-22 11:16:31 -07:00
src/unix/tty.c \
2017-09-13 11:33:38 -07:00
"
fi
2003-05-15 06:35:16 -07:00
# Display CMake bootstrap usage
2003-03-27 12:29:38 -08:00
cmake_usage()
{
2009-06-10 10:04:25 -07:00
echo '
2011-12-16 08:29:26 -08:00
Usage: '"$0"' [<options>...] [-- <cmake-options>...]
2003-03-27 12:29:38 -08:00
Options: [defaults in brackets after descriptions]
Configuration:
--help print this message
2003-05-15 06:35:16 -07:00
--version only print version information
2003-03-27 12:29:38 -08:00
--verbose display more information
2003-05-15 06:35:16 -07:00
--parallel=n bootstrap cmake in parallel, where n is
number of nodes [1]
2020-08-10 11:40:17 -07:00
--generator=<generator> generator to use (MSYS Makefiles, Unix Makefiles,
or Ninja)
2011-01-17 05:57:38 -08:00
--enable-ccache Enable ccache when building cmake
2011-01-10 06:38:42 -08:00
--init=FILE load FILE as script to populate cache
2011-01-10 06:32:09 -08:00
--system-libs use all system-installed third-party libraries
2006-10-19 12:17:58 -07:00
(for use only by package maintainers)
2011-01-10 06:32:09 -08:00
--no-system-libs use all cmake-provided third-party libraries
2006-10-19 12:17:58 -07:00
(default)
2023-06-08 11:44:46 -07:00
--system-cppdap use system-installed cppdap library
--no-system-cppdap use cmake-provided cppdap library (default)
2024-05-09 06:01:46 -07:00
--system-curl use system-installed curl library (default on macOS)
--no-system-curl use cmake-provided curl library (default elsewhere)
2011-01-10 06:32:09 -08:00
--system-expat use system-installed expat library
--no-system-expat use cmake-provided expat library (default)
2015-02-20 05:28:03 -08:00
--system-jsoncpp use system-installed jsoncpp library
--no-system-jsoncpp use cmake-provided jsoncpp library (default)
2011-01-10 06:32:09 -08:00
--system-zlib use system-installed zlib library
--no-system-zlib use cmake-provided zlib library (default)
--system-bzip2 use system-installed bzip2 library
--no-system-bzip2 use cmake-provided bzip2 library (default)
2016-01-13 11:27:02 -08:00
--system-liblzma use system-installed liblzma library
--no-system-liblzma use cmake-provided liblzma library (default)
2020-07-20 07:12:46 -07:00
--system-nghttp2 use system-installed nghttp2 library
--no-system-nghttp2 use cmake-provided nghttp2 library (default)
2019-03-12 10:54:44 -07:00
--system-zstd use system-installed zstd library
--no-system-zstd use cmake-provided zstd library (default)
2011-01-10 06:32:09 -08:00
--system-libarchive use system-installed libarchive library
--no-system-libarchive use cmake-provided libarchive library (default)
2016-11-03 10:31:33 -07:00
--system-librhash use system-installed librhash library
--no-system-librhash use cmake-provided librhash library (default)
2018-04-16 22:56:14 -07:00
--system-libuv use system-installed libuv library
--no-system-libuv use cmake-provided libuv library (default)
2011-01-10 06:32:09 -08:00
Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme
The following command was used:
```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-21 14:35:14 -07:00
--bootstrap-system-libuv use system-installed libuv library for bootstrap
2020-08-10 11:40:17 -07:00
--bootstrap-system-jsoncpp use system-installed jsoncpp library for bootstrap
--bootstrap-system-librhash use system-installed librhash library for bootstrap
2020-07-06 08:31:52 -07:00
2008-02-13 11:47:03 -08:00
--qt-gui build the Qt-based GUI (requires Qt >= 4.2)
--no-qt-gui do not build the Qt-based GUI (default)
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
2003-05-15 06:35:16 -07:00
2023-03-15 17:50:08 -07:00
--debugger enable debugger support (default if supported)
--no-debugger disable debugger support
2018-06-11 18:14:10 -07:00
--sphinx-info build Info manual with Sphinx
2013-09-17 13:08:05 -07:00
--sphinx-man build man pages with Sphinx
--sphinx-html build html help with Sphinx
2015-02-07 14:23:28 -08:00
--sphinx-qthelp build qch help with Sphinx
2021-02-19 04:39:28 -08:00
--sphinx-latexpdf build PDF with Sphinx using LaTeX
2013-09-17 13:08:05 -07:00
--sphinx-build=<sb> use <sb> as the sphinx-build executable
2015-04-30 06:30:14 -07:00
--sphinx-flags=<flags> pass <flags> to sphinx-build executable
2013-09-17 13:08:05 -07:00
2003-03-27 12:29:38 -08:00
Directory and file names:
2003-07-21 13:38:53 -07:00
--prefix=PREFIX install files in tree rooted at PREFIX
2013-08-26 08:50:08 -07:00
['"${cmake_default_prefix}"']
2016-05-27 07:03:43 -07:00
--bindir=DIR install binaries in PREFIX/DIR
['"${cmake_bin_dir_default}"']
2003-07-21 13:38:53 -07:00
--datadir=DIR install data files in PREFIX/DIR
2013-09-26 11:13:38 -07:00
['"${cmake_data_dir_default}"']
2003-07-21 13:38:53 -07:00
--docdir=DIR install documentation files in PREFIX/DIR
2013-09-26 11:13:38 -07:00
['"${cmake_doc_dir_default}"']
2003-07-21 13:38:53 -07:00
--mandir=DIR install man pages files in PREFIX/DIR/manN
2013-09-26 11:13:38 -07:00
['"${cmake_man_dir_default}"']
2015-12-21 07:02:11 -08:00
--xdgdatadir=DIR install XDG specific files in PREFIX/DIR
['"${cmake_xdgdata_dir_default}"']
2009-06-10 10:04:25 -07:00
'
2003-03-27 12:29:38 -08:00
exit 10
}
2003-05-15 06:35:16 -07:00
# Display CMake bootstrap usage
2008-01-23 14:43:08 -08:00
cmake_version_display()
2003-05-15 06:35:16 -07:00
{
2013-11-12 12:56:36 -08:00
echo "CMake ${cmake_version}, ${cmake_copyright}"
2003-05-15 06:35:16 -07:00
}
# Display CMake bootstrap error, display the log file and exit
2003-05-14 06:19:12 -07:00
cmake_error()
{
2003-12-23 08:03:38 -08:00
res=$1
shift 1
2003-03-27 12:29:38 -08:00
echo "---------------------------------------------"
2012-07-07 10:57:40 -07:00
echo "Error when bootstrapping CMake:"
2003-05-14 06:19:12 -07:00
echo "$*"
echo "---------------------------------------------"
2020-05-02 14:42:13 -07:00
if test -f cmake_bootstrap.log; then
2003-12-23 08:03:38 -08:00
echo "Log of errors: `pwd`/cmake_bootstrap.log"
#cat cmake_bootstrap.log
2003-05-14 06:19:12 -07:00
echo "---------------------------------------------"
fi
2003-12-23 08:03:38 -08:00
exit ${res}
2003-05-14 06:19:12 -07:00
}
2003-03-27 12:29:38 -08:00
2020-08-10 11:40:17 -07:00
cmake_generate_file_tmp ()
{
OUTFILE="$1"
TMPFILE="$2"
if "${_diff}" "$TMPFILE" "$OUTFILE" > /dev/null 2> /dev/null ; then
rm -f "$TMPFILE"
else
mv -f "$TMPFILE" "$OUTFILE"
fi
}
2015-12-18 06:57:55 -08:00
cmake_generate_file ()
{
OUTFILE="$1"
CONTENT="$2"
echo "$CONTENT" > "$OUTFILE.tmp"
2020-08-10 11:40:17 -07:00
cmake_generate_file_tmp "$OUTFILE" "$OUTFILE.tmp"
2015-12-18 06:57:55 -08:00
}
2003-06-21 08:57:13 -07:00
# Replace KWSYS_NAMESPACE with cmsys
cmake_replace_string ()
{
INFILE="$1"
OUTFILE="$2"
SEARCHFOR="$3"
REPLACEWITH="$4"
2020-05-02 14:42:13 -07:00
if test -f "${INFILE}" || ${cmake_system_openvms}; then
2017-06-07 10:16:42 -07:00
sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
2020-05-02 14:42:13 -07:00
if test -f "${OUTFILE}${_tmp}"; then
2009-06-10 10:04:25 -07:00
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
2003-06-21 08:57:13 -07:00
#echo "Files are the same"
2009-06-10 10:04:25 -07:00
rm -f "${OUTFILE}${_tmp}"
2003-06-21 08:57:13 -07:00
else
2009-06-10 10:04:25 -07:00
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
2003-06-21 08:57:13 -07:00
fi
fi
2003-06-23 05:58:58 -07:00
else
2003-12-23 08:03:38 -08:00
cmake_error 1 "Cannot find file ${INFILE}"
2003-06-21 08:57:13 -07:00
fi
}
2003-12-23 08:03:38 -08:00
cmake_kwsys_config_replace_string ()
{
INFILE="$1"
OUTFILE="$2"
shift 2
APPEND="$*"
2020-05-02 14:42:13 -07:00
if test -f "${INFILE}" || ${cmake_system_openvms}; then
2009-06-10 10:04:25 -07:00
echo "${APPEND}" > "${OUTFILE}${_tmp}"
2017-06-07 10:16:42 -07:00
sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
2019-04-17 07:13:19 -07:00
s/@KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP@/${KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP}/g;
2017-06-07 10:16:42 -07:00
}" "${INFILE}" >> "${OUTFILE}${_tmp}"
2020-05-02 14:42:13 -07:00
if test -f "${OUTFILE}${_tmp}"; then
2009-06-10 10:04:25 -07:00
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
2003-12-23 08:03:38 -08:00
#echo "Files are the same"
2009-06-10 10:04:25 -07:00
rm -f "${OUTFILE}${_tmp}"
2003-12-23 08:03:38 -08:00
else
2009-06-10 10:04:25 -07:00
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
2003-12-23 08:03:38 -08:00
fi
fi
else
cmake_error 2 "Cannot find file ${INFILE}"
fi
}
2003-05-15 06:35:16 -07:00
# Write string into a file
2003-03-27 12:29:38 -08:00
cmake_report ()
{
FILE=$1
shift
echo "$*" >> ${FILE}
}
2020-08-10 11:40:17 -07:00
# Escape spaces in strings for artifacts
cmake_escape_artifact ()
{
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo $1 | sed "s/ /$ /g"
else
echo $1 | sed "s/ /\\\\ /g"
fi
}
# Escape spaces in strings for shell
cmake_escape_shell ()
2003-03-27 12:29:38 -08:00
{
echo $1 | sed "s/ /\\\\ /g"
}
2017-09-13 11:33:38 -07:00
# Encode object file names.
cmake_obj ()
{
echo $1 | sed 's/\//-/g' | sed 's/$/\.o/'
}
2012-05-08 06:43:19 -07:00
# Strip prefix from argument
cmake_arg ()
{
echo "$1" | sed "s/^${2-[^=]*=}//"
}
2003-05-15 06:35:16 -07:00
# Write message to the log
2003-03-27 12:29:38 -08:00
cmake_log ()
{
echo "$*" >> cmake_bootstrap.log
}
2003-05-15 06:35:16 -07:00
# Return temp file
2003-03-27 12:29:38 -08:00
cmake_tmp_file ()
{
2009-06-10 10:04:25 -07:00
echo "cmake_bootstrap_$$_test"
2003-03-27 12:29:38 -08:00
}
2003-05-15 06:35:16 -07:00
# Run a compiler test. First argument is compiler, second one are compiler
# flags, third one is test source file to be compiled
2003-03-27 12:29:38 -08:00
cmake_try_run ()
{
COMPILER=$1
FLAGS=$2
TESTFILE=$3
2020-05-02 14:42:13 -07:00
if test ! -f "${TESTFILE}"; then
2003-03-27 12:29:38 -08:00
echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
exit 4
fi
TMPFILE=`cmake_tmp_file`
echo "Try: ${COMPILER}"
2003-06-30 06:56:33 -07:00
echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
echo "---------- file -----------------------"
2005-04-13 11:13:35 -07:00
cat "${TESTFILE}"
2003-06-30 06:56:33 -07:00
echo "------------------------------------------"
2023-04-07 11:01:31 -07:00
${COMPILER} ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
2003-03-27 12:29:38 -08:00
RES=$?
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2003-12-23 08:03:38 -08:00
echo "Test failed to compile"
return 1
2003-03-27 12:29:38 -08:00
fi
2020-05-02 14:42:13 -07:00
if test ! -f "${TMPFILE}" && test ! -f "${TMPFILE}.exe"; then
2003-12-23 08:03:38 -08:00
echo "Test failed to produce executable"
2003-03-27 12:29:38 -08:00
return 2
fi
./${TMPFILE}
RES=$?
rm -f "${TMPFILE}"
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2003-12-23 08:03:38 -08:00
echo "Test produced non-zero return code"
2003-03-27 12:29:38 -08:00
return 3
fi
2015-10-05 18:42:19 -07:00
echo "Test succeeded"
2003-03-27 12:29:38 -08:00
return 0
}
2003-05-15 06:35:16 -07:00
# Run a make test. First argument is the make interpreter.
2003-03-27 12:29:38 -08:00
cmake_try_make ()
{
2003-08-22 06:52:05 -07:00
MAKE_PROC="$1"
MAKE_FLAGS="$2"
2003-03-27 12:29:38 -08:00
echo "Try: ${MAKE_PROC}"
2003-08-22 06:52:05 -07:00
"${MAKE_PROC}" ${MAKE_FLAGS}
2003-03-27 12:29:38 -08:00
RES=$?
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2003-08-22 06:52:05 -07:00
echo "${MAKE_PROC} does not work"
return 1
2003-03-27 12:29:38 -08:00
fi
2020-05-02 14:42:13 -07:00
if test ! -f "test" && test ! -f "test.exe"; then
2003-03-27 12:29:38 -08:00
echo "${COMPILER} does not produce output"
return 2
fi
./test
RES=$?
rm -f "test"
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2003-03-27 12:29:38 -08:00
echo "${MAKE_PROC} produces strange executable"
return 3
fi
echo "${MAKE_PROC} works"
return 0
}
2003-05-15 06:35:16 -07:00
# Parse arguments
2003-05-14 06:19:12 -07:00
cmake_verbose=
2003-05-14 06:27:39 -07:00
cmake_parallel_make=
2011-01-17 05:57:38 -08:00
cmake_ccache_enabled=
2006-02-16 17:13:54 -08:00
cmake_prefix_dir="${cmake_default_prefix}"
2020-07-06 08:31:52 -07:00
bootstrap_system_libuv=
2020-08-10 11:40:17 -07:00
bootstrap_system_jsoncpp=
bootstrap_system_librhash=
2011-12-16 07:56:47 -08:00
while test $# != 0; do
case "$1" in
2012-05-08 06:43:19 -07:00
--prefix=*) dir=`cmake_arg "$1"`
cmake_prefix_dir=`cmake_fix_slashes "$dir"` ;;
--parallel=*) cmake_parallel_make=`cmake_arg "$1"` ;;
2020-08-10 11:40:17 -07:00
--generator=*) cmake_bootstrap_generator=`cmake_arg "$1"` ;;
2016-05-27 07:03:43 -07:00
--bindir=*) cmake_bin_dir=`cmake_arg "$1"` ;;
2012-05-08 06:43:19 -07:00
--datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
--docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
--mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
2015-12-21 07:02:11 -08:00
--xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
2012-05-08 06:43:19 -07:00
--init=*) cmake_init_file=`cmake_arg "$1"` ;;
2011-12-16 07:56:47 -08:00
--system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
--no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
2023-06-08 11:44:46 -07:00
--system-bzip2|--system-cppdap|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma|--system-nghttp2|--system-zstd|--system-libuv)
2012-05-08 06:43:19 -07:00
lib=`cmake_arg "$1" "--system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;;
2023-06-08 11:44:46 -07:00
--no-system-bzip2|--no-system-cppdap|--no-system-curl|--no-system-expat|--no-system-jsoncpp|--no-system-libarchive|--no-system-librhash|--no-system-zlib|--no-system-liblzma|--no-system-nghttp2|--no-system-zstd|--no-system-libuv)
2012-05-08 06:43:19 -07:00
lib=`cmake_arg "$1" "--no-system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
2020-07-06 08:31:52 -07:00
--bootstrap-system-libuv) bootstrap_system_libuv="1" ;;
2020-08-10 11:40:17 -07:00
--bootstrap-system-jsoncpp) bootstrap_system_jsoncpp="1" ;;
--bootstrap-system-librhash) bootstrap_system_librhash="1" ;;
2011-12-16 07:56:47 -08:00
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
2012-05-08 06:43:19 -07:00
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
2023-03-15 17:50:08 -07:00
--debugger) cmake_bootstrap_debugger="1" ;;
--no-debugger) cmake_bootstrap_debugger="0" ;;
2018-06-11 18:14:10 -07:00
--sphinx-info) cmake_sphinx_info="1" ;;
2013-09-17 13:08:05 -07:00
--sphinx-man) cmake_sphinx_man="1" ;;
--sphinx-html) cmake_sphinx_html="1" ;;
2015-02-07 14:23:28 -08:00
--sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
2021-02-19 04:39:28 -08:00
--sphinx-latexpdf) cmake_sphinx_latexpdf="1" ;;
2013-09-17 13:08:05 -07:00
--sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
2015-04-30 06:30:14 -07:00
--sphinx-flags=*) cmake_sphinx_flags=`cmake_arg "$1"` ;;
2011-12-16 07:56:47 -08:00
--help) cmake_usage ;;
--version) cmake_version_display ; exit 2 ;;
--verbose) cmake_verbose=TRUE ;;
--enable-ccache) cmake_ccache_enabled=TRUE ;;
2018-03-19 22:34:42 -07:00
CC=*) CC=`cmake_arg "$1"` ;;
CXX=*) CXX=`cmake_arg "$1"` ;;
CFLAGS=*) CFLAGS=`cmake_arg "$1"` ;;
CXXFLAGS=*) CXXFLAGS=`cmake_arg "$1"` ;;
LDFLAGS=*) LDFLAGS=`cmake_arg "$1"` ;;
2011-12-16 08:29:26 -08:00
--) shift; break ;;
2011-12-16 07:56:47 -08:00
*) die "Unknown option: $1" ;;
esac
shift
2003-05-14 06:19:12 -07:00
done
2020-08-10 11:40:17 -07:00
# Make sure the generator is valid
2020-12-23 10:27:33 -08:00
case "${cmake_bootstrap_generator}" in
'MSYS Makefiles'|'Unix Makefiles'|'Ninja') ;;
*) cmake_error 10 "Invalid generator: ${cmake_bootstrap_generator}"
esac
2020-08-10 11:40:17 -07:00
2003-05-15 06:35:16 -07:00
# If verbose, display some information about bootstrap
2020-05-02 14:42:13 -07:00
if test -n "${cmake_verbose}"; then
2003-05-14 06:19:12 -07:00
echo "---------------------------------------------"
echo "Source directory: ${cmake_source_dir}"
echo "Binary directory: ${cmake_binary_dir}"
echo "Prefix directory: ${cmake_prefix_dir}"
echo "System: ${cmake_system}"
2020-08-10 11:40:17 -07:00
echo "Generator: ${cmake_bootstrap_generator}"
2020-05-02 14:42:13 -07:00
if test "x${cmake_parallel_make}" != "x"; then
2003-05-14 06:27:39 -07:00
echo "Doing parallel make: ${cmake_parallel_make}"
fi
echo ""
2003-05-14 06:19:12 -07:00
fi
echo "---------------------------------------------"
2003-05-15 06:35:16 -07:00
# Get CMake version
2008-01-23 14:43:08 -08:00
echo "`cmake_version_display`"
2003-05-14 06:19:12 -07:00
2004-10-18 08:34:02 -07:00
# Check for in-source build
cmake_in_source_build=
2020-05-02 14:49:36 -07:00
if test -f "${cmake_binary_dir}/Source/cmake.cxx" &&
test -f "${cmake_binary_dir}/Source/cmake.h"; then
2020-05-02 14:42:13 -07:00
if test -n "${cmake_verbose}"; then
2004-10-18 08:34:02 -07:00
echo "Warning: This is an in-source build"
fi
cmake_in_source_build=TRUE
fi
# If this is not an in-source build, then Bootstrap stuff should not exist.
2020-05-02 14:42:13 -07:00
if test -z "${cmake_in_source_build}"; then
2004-10-18 08:34:02 -07:00
# Did somebody bootstrap in the source tree?
2020-05-02 14:42:13 -07:00
if test -d "${cmake_source_dir}/Bootstrap${_cmk}"; then
2009-06-10 10:04:25 -07:00
cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
2004-10-18 08:34:02 -07:00
Looks like somebody did bootstrap CMake in the source tree, but now you are
2009-06-10 10:04:25 -07:00
trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
2004-10-18 08:34:02 -07:00
directory from the source tree."
fi
# Is there a cache in the source tree?
for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
2020-05-02 14:42:13 -07:00
if test -f "${cmake_source_dir}/${cmake_problematic_file}"; then
2004-10-18 08:34:02 -07:00
cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
Looks like somebody tried to build CMake in the source tree, but now you are
trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
from the source tree."
fi
done
fi
2003-05-15 06:35:16 -07:00
# Make bootstrap directory
2020-05-02 14:42:13 -07:00
test -d "${cmake_bootstrap_dir}" || mkdir "${cmake_bootstrap_dir}"
if test ! -d "${cmake_bootstrap_dir}"; then
2003-12-23 08:03:38 -08:00
cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
2003-05-14 06:19:12 -07:00
fi
cd "${cmake_bootstrap_dir}"
2020-05-02 14:42:13 -07:00
test -d "cmsys" || mkdir "cmsys"
if test ! -d "cmsys"; then
2003-12-23 08:03:38 -08:00
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
2003-06-23 05:58:58 -07:00
fi
2003-05-15 06:35:16 -07:00
# Delete all the bootstrap files
2003-05-14 06:19:12 -07:00
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
2009-06-10 10:04:25 -07:00
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
2003-05-14 06:19:12 -07:00
2017-09-13 07:32:56 -07:00
# If building in-source, remove any cmConfigure.h that may
# have been created by a previous run of the bootstrap cmake.
2020-05-02 14:42:13 -07:00
if test -n "${cmake_in_source_build}"; then
2017-09-13 07:32:56 -07:00
rm -f "${cmake_source_dir}/Source/cmConfigure.h"
fi
2003-05-15 06:35:16 -07:00
# If exist compiler flags, set them
2003-03-27 12:29:38 -08:00
cmake_c_flags=${CFLAGS}
cmake_cxx_flags=${CXXFLAGS}
2006-12-05 05:47:06 -08:00
cmake_ld_flags=${LDFLAGS}
2003-03-27 12:29:38 -08:00
2020-08-10 11:40:17 -07:00
# Add generator-specific files
if test "${cmake_bootstrap_generator}" = "Ninja"; then
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
cmFortranParserImpl \
cmGlobalNinjaGenerator \
cmLocalNinjaGenerator \
cmNinjaLinkLineComputer \
cmNinjaLinkLineDeviceComputer \
cmNinjaNormalTargetGenerator \
cmNinjaTargetGenerator \
cmNinjaUtilityTargetGenerator \
"
LexerParser_CXX_SOURCES="${LexerParser_CXX_SOURCES} \
cmFortranLexer \
cmFortranParser \
"
else
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
cmDepends \
cmDependsC \
2020-10-18 07:11:27 -07:00
cmDependsCompiler \
2020-08-10 11:40:17 -07:00
cmGlobalUnixMakefileGenerator3 \
cmLocalUnixMakefileGenerator3 \
cmMakefileExecutableTargetGenerator \
cmMakefileLibraryTargetGenerator \
cmMakefileTargetGenerator \
cmMakefileUtilityTargetGenerator \
2020-10-18 07:11:27 -07:00
cmProcessTools \
2020-08-10 11:40:17 -07:00
"
fi
2009-05-27 08:33:37 -07:00
# Add Cygwin-specific flags
2021-04-01 10:03:52 -07:00
if ${cmake_system_cygwin} || ${cmake_system_msys}; then
2009-05-27 08:33:37 -07:00
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
fi
2010-08-17 13:11:33 -07:00
# Add CoreFoundation framework on Darwin
2006-04-13 08:00:52 -07:00
if ${cmake_system_darwin}; then
2010-08-17 13:11:33 -07:00
cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
2006-04-13 08:00:52 -07:00
fi
2006-12-04 14:26:41 -08:00
# Add BeOS toolkits...
if ${cmake_system_beos}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
2008-09-15 14:53:28 -07:00
# Add Haiku toolkits...
if ${cmake_system_haiku}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
2022-01-27 06:58:10 -08:00
# Add AIX arch-specific link flags.
if ${cmake_system_aix}; then
if uname -p | grep powerpc >/dev/null 2>&1; then
cmake_ld_flags="${LDFLAGS} -Wl,-bbigtoc"
fi
fi
2010-06-30 07:50:28 -07:00
#-----------------------------------------------------------------------------
# Detect known toolchains on some platforms.
cmake_toolchains=''
case "${cmake_system}" in
*AIX*) cmake_toolchains='XL GNU' ;;
*CYGWIN*) cmake_toolchains='GNU' ;;
2021-04-01 10:03:52 -07:00
*MSYS*) cmake_toolchains='GNU' ;;
2017-05-18 09:29:29 -07:00
*Darwin*) cmake_toolchains='Clang GNU' ;;
2010-06-30 07:50:28 -07:00
*Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
*MINGW*) cmake_toolchains='GNU' ;;
esac
# Toolchain compiler name table.
cmake_toolchain_Clang_CC='clang'
cmake_toolchain_Clang_CXX='clang++'
cmake_toolchain_GNU_CC='gcc'
cmake_toolchain_GNU_CXX='g++'
cmake_toolchain_PGI_CC='pgcc'
cmake_toolchain_PGI_CXX='pgCC'
cmake_toolchain_PathScale_CC='pathcc'
cmake_toolchain_PathScale_CXX='pathCC'
cmake_toolchain_XL_CC='xlc'
cmake_toolchain_XL_CXX='xlC'
cmake_toolchain_try()
{
tc="$1"
TMPFILE=`cmake_tmp_file`
eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
echo 'int main() { return 0; }' > "${TMPFILE}.c"
cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
tc_result_CC="$?"
rm -f "${TMPFILE}.c"
test "${tc_result_CC}" = "0" || return 1
eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
tc_result_CXX="$?"
rm -f "${TMPFILE}.cpp"
test "${tc_result_CXX}" = "0" || return 1
cmake_toolchain="$tc"
}
cmake_toolchain_detect()
{
cmake_toolchain=
for tc in ${cmake_toolchains}; do
echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
cmake_toolchain_try "$tc" &&
echo "Found $tc toolchain" &&
break
done
}
2020-05-02 14:49:36 -07:00
if test -z "${CC}" && test -z "${CXX}"; then
2010-06-30 07:50:28 -07:00
cmake_toolchain_detect
fi
2017-11-28 08:22:46 -08:00
thread_flags=''
2017-11-28 08:24:26 -08:00
case "${cmake_system}" in
*AIX*) thread_flags='-pthread' ;;
esac
2017-11-28 08:22:46 -08:00
2010-06-30 07:50:28 -07:00
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test C compiler
cmake_c_compiler=
2003-05-15 06:35:16 -07:00
# If CC is set, use that for compiler, otherwise use list of known compilers
2020-05-02 14:42:13 -07:00
if test -n "${cmake_toolchain}"; then
2010-06-30 07:50:28 -07:00
eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
2003-03-27 12:29:38 -08:00
else
cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
fi
2023-05-08 11:22:59 -07:00
cmake_c_compiler_try_set()
{
test_compiler="$1"
test_thread_flags="$2"
# Check if C compiler works
TMPFILE=`cmake_tmp_file`
echo '
2006-07-26 11:10:14 -07:00
#ifdef __cplusplus
# error "The CMAKE_C_COMPILER is set to a C++ compiler"
2006-07-26 08:46:22 -07:00
#endif
2017-11-28 08:24:26 -08:00
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif
2017-09-17 08:06:13 -07:00
#if defined(__sun) && __STDC_VERSION__ < 199901L
#error "On Solaris we need C99."
#endif
2019-09-20 07:15:23 -07:00
#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif
2017-08-15 12:59:06 -07:00
#include <stdio.h>
2006-07-26 11:10:14 -07:00
2006-07-25 08:00:10 -07:00
int main(int argc, char* argv[])
2003-03-27 12:29:38 -08:00
{
2009-06-10 10:39:40 -07:00
printf("%d%c", (argv != 0), (char)0x0a);
2017-08-15 12:59:06 -07:00
return argc - 1;
2003-03-27 12:29:38 -08:00
}
2009-06-10 10:04:25 -07:00
' > "${TMPFILE}.c"
2023-05-08 11:22:59 -07:00
for std in 11 99 90; do
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
2017-11-28 08:22:46 -08:00
for std_flag in '' $std_flags; do
2023-05-08 11:22:59 -07:00
for thread_flag in '' $test_thread_flags; do
echo "Checking whether '${test_compiler} ${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
if cmake_try_run "${test_compiler}" "${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \
2017-11-28 08:22:46 -08:00
"${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
2023-05-08 11:22:59 -07:00
cmake_c_compiler="${test_compiler}"
2017-11-28 08:22:46 -08:00
cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}"
2023-05-08 11:22:59 -07:00
rm -f "${TMPFILE}.c"
return 0
2017-11-28 08:22:46 -08:00
fi
done
2017-08-15 12:59:06 -07:00
done
2017-05-14 10:41:55 -07:00
done
2023-05-08 11:22:59 -07:00
rm -f "${TMPFILE}.c"
return 1
}
if test -n "${CC}"; then
cmake_c_compiler_try_set "${CC}" "${thread_flags}"
else
for compiler in ${cmake_c_compilers}; do
if cmake_c_compiler_try_set "${compiler}" "${thread_flags}"; then
break
fi
done
fi
2003-03-27 12:29:38 -08:00
2020-05-02 14:42:13 -07:00
if test -z "${cmake_c_compiler}"; then
2003-12-23 08:03:38 -08:00
cmake_error 6 "Cannot find appropriate C compiler on this system.
2004-10-12 07:57:24 -07:00
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.
"
2003-03-27 12:29:38 -08:00
fi
echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
2010-06-30 07:50:28 -07:00
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test CXX compiler
cmake_cxx_compiler=
2003-05-15 06:35:16 -07:00
2003-06-30 06:56:33 -07:00
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
2003-05-15 06:35:16 -07:00
# If CC is set, use that for compiler, otherwise use list of known compilers
2020-05-02 14:42:13 -07:00
if test -n "${cmake_toolchain}"; then
2010-06-30 07:50:28 -07:00
eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
2003-03-27 12:29:38 -08:00
else
cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
fi
2003-05-15 06:35:16 -07:00
# Check if C++ compiler works
2023-05-08 11:46:42 -07:00
cmake_cxx_compiler_try_set()
{
test_compiler="$1"
test_thread_flags="$2"
TMPFILE=`cmake_tmp_file`
2009-06-10 10:04:25 -07:00
echo '
2017-08-11 10:19:05 -07:00
#include <iostream>
#include <memory>
2017-11-30 10:57:12 -08:00
#include <unordered_map>
2003-12-23 08:03:38 -08:00
2017-08-28 12:15:30 -07:00
#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif
2017-11-28 08:24:26 -08:00
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif
2017-08-28 12:15:30 -07:00
#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
2017-05-14 10:41:55 -07:00
#endif
2019-09-20 07:15:23 -07:00
#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif
2019-07-15 04:58:18 -07:00
#if __cplusplus > 201103L
#include <iterator>
int check_cxx14()
{
int a[] = { 0, 1, 2 };
auto ai = std::cbegin(a);
int b[] = { 2, 1, 0 };
auto bi = std::cend(b);
return *ai + *(bi - 1);
}
#else
int check_cxx14()
{
return 0;
}
#endif
2020-07-24 05:48:02 -07:00
#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
2019-08-22 05:28:08 -07:00
#include <optional>
2019-12-14 10:28:22 -08:00
template <typename T,
typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
typename T::pointer get_ptr(T& item)
{
return item.get();
}
2019-08-22 05:28:08 -07:00
int check_cxx17()
{
2019-12-14 10:28:22 -08:00
// Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
std::unique_ptr<int> u(new int(0));
get_ptr(u);
2019-08-22 05:28:08 -07:00
std::optional<int> oi = 0;
return oi.value();
}
#else
int check_cxx17()
{
return 0;
}
#endif
2017-08-11 10:19:05 -07:00
class Class
2003-06-30 06:56:33 -07:00
{
public:
2017-08-11 10:19:05 -07:00
int Get() const { return this->Member; }
2003-06-30 06:56:33 -07:00
private:
2017-08-11 10:19:05 -07:00
int Member = 1;
2003-06-30 06:56:33 -07:00
};
2003-03-27 12:29:38 -08:00
int main()
{
2017-08-11 10:19:05 -07:00
auto const c = std::unique_ptr<Class>(new Class);
2019-08-22 05:28:08 -07:00
std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
2003-03-27 12:29:38 -08:00
return 0;
}
2009-06-10 10:04:25 -07:00
' > "${TMPFILE}.cxx"
2023-05-08 11:46:42 -07:00
for std in 17 14 11; do
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
2017-11-28 08:22:46 -08:00
for std_flag in '' $std_flags; do
2023-05-08 11:46:42 -07:00
for thread_flag in '' $test_thread_flags; do
echo "Checking whether '${test_compiler} ${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
if cmake_try_run "${test_compiler}" "${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \
2017-11-28 08:22:46 -08:00
"${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
2023-05-08 11:46:42 -07:00
cmake_cxx_compiler="${test_compiler}"
2017-11-28 08:22:46 -08:00
cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} "
2023-05-08 11:46:42 -07:00
rm -f "${TMPFILE}.cxx"
return 0
2017-11-28 08:22:46 -08:00
fi
done
2017-08-11 10:19:05 -07:00
done
2017-05-14 10:41:55 -07:00
done
2023-05-08 11:46:42 -07:00
rm -f "${TMPFILE}.cxx"
return 1
}
if test -n "${CXX}"; then
cmake_cxx_compiler_try_set "${CXX}" "${thread_flags}"
else
for compiler in ${cmake_cxx_compilers}; do
if cmake_cxx_compiler_try_set "${compiler}" "${thread_flags}"; then
break
fi
done
fi
2003-03-27 12:29:38 -08:00
2020-05-02 14:42:13 -07:00
if test -z "${cmake_cxx_compiler}"; then
2018-03-13 21:10:54 -07:00
cmake_error 7 "Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
2004-10-12 07:57:24 -07:00
Please specify one using environment variable CXX.
2018-03-13 21:10:54 -07:00
The C++ flags are \"$cmake_cxx_flags\".
They can be changed using the environment variable CXXFLAGS.
2004-10-12 07:57:24 -07:00
See cmake_bootstrap.log for compilers attempted."
2003-03-27 12:29:38 -08:00
fi
echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
2020-01-30 03:52:53 -08:00
#-----------------------------------------------------------------------------
# Test CXX features
2020-06-21 05:28:37 -07:00
cmake_cxx_features="make_unique filesystem"
2020-01-30 03:52:53 -08:00
for feature in ${cmake_cxx_features}; do
eval "cmake_have_cxx_${feature}=0"
2021-01-16 20:48:35 -08:00
echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags} ${cmake_ld_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1
if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags} ${cmake_ld_flags}" \
2020-01-30 03:52:53 -08:00
"${cmake_source_dir}/Source/Checks/cm_cxx_${feature}.cxx" >> cmake_bootstrap.log 2>&1; then
eval "cmake_have_cxx_${feature}=1"
fi
done
cmake_have_cxx_features=""
for feature in ${cmake_cxx_features}; do
feature_variable="cmake_have_cxx_${feature}"
eval "feature_value=\${${feature_variable}}"
2020-05-02 14:42:13 -07:00
if test "${feature_value}" -eq "1"; then
2020-01-30 03:52:53 -08:00
cmake_have_cxx_features="${cmake_have_cxx_features} -DCMake_HAVE_CXX_`cmake_toupper ${feature}`=${feature_value}"
fi
done
2020-06-25 05:23:25 -07:00
cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" ""
2010-06-30 07:50:28 -07:00
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test Make
cmake_make_processor=
2003-08-22 06:52:05 -07:00
cmake_make_flags=
2003-05-15 06:35:16 -07:00
# If MAKE is set, use that for make processor, otherwise use list of known make
2020-05-02 14:42:13 -07:00
if test -n "${MAKE}"; then
2003-03-27 12:29:38 -08:00
cmake_make_processors="${MAKE}"
2020-08-10 11:40:17 -07:00
elif test "${cmake_bootstrap_generator}" = "Ninja"; then
cmake_make_processors="${CMAKE_KNOWN_NINJA_PROCESSORS}"
2003-03-27 12:29:38 -08:00
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}"
2020-08-10 11:40:17 -07:00
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo '
rule cc
2023-04-07 11:01:31 -07:00
command = '"${cmake_c_compiler}"' '"${cmake_ld_flags} ${cmake_c_flags}"' -o $out $in
2020-08-10 11:40:17 -07:00
build test: cc test.c
'>"build.ninja"
else
echo '
2003-03-27 12:29:38 -08:00
test: test.c
2023-04-07 11:01:31 -07:00
'"${cmake_c_compiler}"' '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
2009-06-10 10:04:25 -07:00
'>"Makefile"
2020-08-10 11:40:17 -07:00
fi
2009-06-10 10:04:25 -07:00
echo '
2003-03-27 12:29:38 -08:00
#include <stdio.h>
2009-06-10 10:39:40 -07:00
int main(){ printf("1%c", (char)0x0a); return 0; }
2009-06-10 10:04:25 -07:00
' > "test.c"
2004-09-23 04:53:42 -07:00
cmake_original_make_flags="${cmake_make_flags}"
2020-05-02 14:42:13 -07:00
if test "x${cmake_parallel_make}" != "x"; then
2003-08-22 06:52:05 -07:00
cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
fi
2003-03-27 12:29:38 -08:00
for a in ${cmake_make_processors}; do
2020-05-02 14:42:13 -07:00
if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
2003-03-27 12:29:38 -08:00
cmake_make_processor="${a}"
fi
done
2004-09-23 04:53:42 -07:00
cmake_full_make_flags="${cmake_make_flags}"
2020-05-02 14:42:13 -07:00
if test "x${cmake_original_make_flags}" != "x${cmake_make_flags}"; then
if test -z "${cmake_make_processor}"; then
2004-09-23 04:53:42 -07:00
cmake_make_flags="${cmake_original_make_flags}"
for a in ${cmake_make_processors}; do
2020-05-02 14:42:13 -07:00
if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
2004-09-23 04:53:42 -07:00
cmake_make_processor="${a}"
fi
done
fi
fi
2003-03-27 12:29:38 -08:00
cd "${cmake_bootstrap_dir}"
2020-08-10 11:40:17 -07:00
if test "${cmake_bootstrap_generator}" = "Ninja"; then
mf_str=Ninja
else
mf_str=Makefile
fi
2020-05-02 14:42:13 -07:00
if test -z "${cmake_make_processor}"; then
2020-08-10 11:40:17 -07:00
cmake_error 8 "Cannot find appropriate ${mf_str} processor on this system.
2003-08-11 14:53:10 -07:00
Please specify one using environment variable MAKE."
fi
2010-04-13 06:28:16 -07:00
rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
2020-08-10 11:40:17 -07:00
echo "${mf_str} processor on this system is: ${cmake_make_processor}"
2020-05-02 14:42:13 -07:00
if test "x${cmake_full_make_flags}" != "x${cmake_make_flags}"; then
2004-09-23 04:53:42 -07:00
echo "---------------------------------------------"
2020-08-10 11:40:17 -07:00
echo "${mf_str} processor ${cmake_make_processor} does not support parallel build"
2004-09-23 04:53:42 -07:00
echo "---------------------------------------------"
fi
2003-03-27 12:29:38 -08:00
2003-12-23 08:03:38 -08:00
# Test for kwsys features
KWSYS_NAME_IS_KWSYS=0
KWSYS_BUILD_SHARED=0
2006-08-25 17:52:37 -07:00
KWSYS_LFS_AVAILABLE=0
KWSYS_LFS_REQUESTED=0
2013-11-25 08:30:52 -08:00
KWSYS_STL_HAS_WSTRING=0
2016-07-16 17:22:10 -07:00
KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0
2012-04-26 07:36:53 -07:00
KWSYS_CXX_HAS_SETENV=0
KWSYS_CXX_HAS_UNSETENV=0
KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
2013-06-03 07:34:35 -07:00
KWSYS_CXX_HAS_UTIMENSAT=0
KWSYS_CXX_HAS_UTIMES=0
2019-04-17 07:13:19 -07:00
KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP=1
2005-03-29 05:20:08 -08:00
2012-04-26 07:36:53 -07:00
if cmake_try_run "${cmake_cxx_compiler}" \
2021-02-03 10:34:04 -08:00
"${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
2012-04-26 07:36:53 -07:00
"${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}" \
2021-02-03 10:34:04 -08:00
"${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \
2012-04-26 07:36:53 -07:00
"${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}" \
2021-02-03 10:34:04 -08:00
"${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \
2012-04-26 07:36:53 -07:00
"${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
2003-12-23 08:03:38 -08:00
if cmake_try_run "${cmake_cxx_compiler}" \
2021-02-03 10:34:04 -08:00
"${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
2013-11-25 08:30:52 -08:00
"${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
2016-07-16 17:22:10 -07:00
if cmake_try_run "${cmake_cxx_compiler}" \
2021-02-03 10:34:04 -08:00
"${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H" \
2016-07-16 17:22:10 -07:00
"${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
2020-05-02 14:42:13 -07:00
if test -n "${cmake_ccache_enabled}"; then
2018-05-25 06:29:53 -07:00
echo "Building CMake with ccache"
cmake_c_compiler="ccache ${cmake_c_compiler}"
cmake_cxx_compiler="ccache ${cmake_cxx_compiler}"
fi
2003-06-21 08:57:13 -07:00
# Just to be safe, let us store compiler and flags to the header file
2003-12-23 08:03:38 -08:00
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}
2019-08-04 01:49:16 -07:00
* STD Sources:
* ${CMAKE_STD_CXX_HEADERS} ${CMAKE_STD_CXX_SOURCES}
2017-05-11 12:53:14 -07:00
* LexerParser Sources:
* ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES}
2003-12-23 08:03:38 -08:00
* kwSys Sources:
2012-12-19 06:00:55 -08:00
* ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
2017-09-13 11:33:38 -07:00
* libuv Sources:
* ${LIBUV_C_SOURCES}
2020-08-10 11:40:17 -07:00
* jsoncpp Sources:
* ${JSONCPP_CXX_SOURCES}
* librhash Sources:
* ${LIBRHASH_C_SOURCES}
2003-12-23 08:03:38 -08:00
*/
"
2009-06-10 10:04:25 -07:00
cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
2003-12-23 08:03:38 -08:00
2006-02-10 08:19:19 -08:00
# When bootstrapping on MinGW with MSYS we must convert the source
# directory to a windows path.
if ${cmake_system_mingw}; then
2014-06-25 10:32:48 -07:00
CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W`
2014-06-25 10:34:15 -07:00
CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W`
2006-02-10 08:19:19 -08:00
else
2014-06-25 10:32:48 -07:00
CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
2014-06-25 10:34:15 -07:00
CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
2006-02-10 08:19:19 -08:00
fi
2003-05-15 06:35:16 -07:00
# Write CMake version
2009-06-10 10:04:25 -07:00
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}"
2010-04-23 06:44:23 -07:00
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
2014-06-25 10:32:48 -07:00
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
2014-06-25 10:34:15 -07:00
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
2018-12-14 14:24:52 -08:00
cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
2016-05-27 07:03:43 -07:00
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
2013-09-26 11:13:38 -07:00
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
2017-06-02 11:32:58 -07:00
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
2003-06-21 08:57:13 -07:00
2020-08-10 11:40:17 -07:00
if test "${cmake_bootstrap_generator}" = "Ninja"; then
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_NINJA"
else
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_MAKEFILES"
fi
2019-08-19 12:39:02 -07:00
if ${cmake_system_mingw}; then
cmake_report cmConfigure.h${_tmp} "#if defined(_WIN32) && !defined(NOMINMAX)"
cmake_report cmConfigure.h${_tmp} "# define NOMINMAX"
cmake_report cmConfigure.h${_tmp} "#endif"
2022-04-16 01:57:30 -07:00
cmake_report cmConfigure.h${_tmp} "#if defined(_WIN32) && !defined(KWSYS_ENCODING_DEFAULT_CODEPAGE)"
cmake_report cmConfigure.h${_tmp} "# define KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8"
cmake_report cmConfigure.h${_tmp} "#endif"
2019-08-19 12:39:02 -07:00
fi
2009-03-05 12:17:07 -08:00
# Regenerate configured headers
for h in Configure VersionConfig; do
2009-06-10 10:04:25 -07:00
if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
rm -f cm${h}.h${_tmp}
2009-03-05 12:17:07 -08:00
else
2009-06-10 10:04:25 -07:00
mv -f cm${h}.h${_tmp} cm${h}.h
2009-03-05 12:17:07 -08:00
fi
done
2003-03-27 12:29:38 -08:00
2003-06-23 05:58:58 -07:00
# Prepare KWSYS
2020-08-10 11:40:17 -07:00
cmsys_header_files="cmsys/Configure.h cmsys/Configure.hxx"
2003-12-23 08:03:38 -08:00
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}"
2012-07-07 10:57:40 -07:00
for a in ${KWSYS_FILES}; do
2003-06-23 05:58:58 -07:00
cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
"${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
2020-08-10 11:40:17 -07:00
cmsys_header_files="${cmsys_header_files} cmsys/${a}"
2003-06-23 05:58:58 -07:00
done
2003-12-23 08:03:38 -08:00
2020-08-29 15:50:59 -07:00
echo "#pragma once" > "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
2020-08-10 11:40:17 -07:00
if test "x${bootstrap_system_libuv}" != "x"; then
echo "#define CMAKE_USE_SYSTEM_LIBUV" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
fi
if test "x${bootstrap_system_jsoncpp}" != "x"; then
echo "#define CMAKE_USE_SYSTEM_JSONCPP" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
fi
if test "x${bootstrap_system_librhash}" != "x"; then
echo "#define CMAKE_USE_SYSTEM_LIBRHASH" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
fi
cmake_generate_file_tmp "${cmake_bootstrap_dir}/cmThirdParty.h" "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
2015-12-18 06:57:55 -08:00
2003-03-27 12:29:38 -08:00
# Generate Makefile
2020-08-10 11:40:17 -07:00
dep="cmConfigure.h ${cmsys_header_files}"
for h in "${cmake_source_dir}"/Source/*.hxx; do
dep="${dep} `cmake_escape_artifact \"${h}\"`"
done
for h in "${cmake_source_dir}"/Source/*.h; do
dep="${dep} `cmake_escape_artifact \"${h}\"`"
done
2019-08-04 01:49:16 -07:00
for h in ${CMAKE_STD_CXX_HEADERS}; do
2020-08-10 11:40:17 -07:00
dep="${dep} `cmake_escape_artifact \"${cmake_source_dir}\"`/Utilities/std/cm/${h}"
2019-08-04 01:49:16 -07:00
done
2003-03-27 12:29:38 -08:00
objs=""
2019-08-04 01:49:16 -07:00
for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${CMAKE_STD_CXX_SOURCES} ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}; do
2003-03-27 12:29:38 -08:00
objs="${objs} ${a}.o"
done
2020-07-06 08:31:52 -07:00
if test "x${bootstrap_system_libuv}" = "x"; then
for a in ${LIBUV_C_SOURCES}; do
objs="${objs} uv-`cmake_obj ${a}`"
done
fi
2020-10-05 09:15:17 -07:00
if test "x${bootstrap_system_librhash}" = "x"; then
for a in ${LIBRHASH_C_SOURCES}; do
objs="${objs} rhash-`cmake_obj ${a}`"
done
fi
2023-07-21 09:01:01 -07:00
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
objs="${objs} jsoncpp-`cmake_obj ${a}`"
done
2020-08-10 11:40:17 -07:00
fi
2017-09-13 11:33:38 -07:00
libs=""
uv_c_flags=""
if ${cmake_system_mingw}; then
uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
2019-03-14 08:58:34 -07:00
libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lole32 -loleaut32"
2017-09-13 11:33:38 -07:00
else
case "${cmake_system}" in
*AIX*)
2017-11-28 08:24:26 -08:00
uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
2017-09-13 11:33:38 -07:00
libs="${libs} -lperfstat"
;;
*Darwin*)
uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
;;
2019-07-02 15:20:41 -07:00
*HP-UX*)
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE_EXTENDED"
;;
2017-09-13 11:33:38 -07:00
*Linux*)
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
libs="${libs} -ldl -lrt"
;;
2018-09-16 05:35:44 -07:00
*kFreeBSD*)
libs="${libs} -lkvm -lfreebsd-glue"
;;
2017-09-13 11:33:38 -07:00
*BSD*)
libs="${libs} -lkvm"
;;
*SunOS*)
uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
;;
2020-09-07 09:42:32 -07:00
*QNX*)
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE=700"
libs="${libs} -lsocket"
;;
2017-09-13 11:33:38 -07:00
esac
fi
2020-07-06 08:31:52 -07:00
if test "x${bootstrap_system_libuv}" = "x"; then
2020-08-10 11:40:17 -07:00
uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
2020-07-06 08:31:52 -07:00
if ${cmake_system_mingw}; then
2020-08-10 11:40:17 -07:00
uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
2020-07-06 08:31:52 -07:00
else
2020-08-10 11:40:17 -07:00
uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
2020-07-06 08:31:52 -07:00
fi
2020-08-10 11:40:17 -07:00
uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
2017-09-13 11:33:38 -07:00
else
2020-07-06 08:31:52 -07:00
if test `which pkg-config`; then
2020-08-10 11:40:17 -07:00
use_uv_flags="`pkg-config --cflags libuv`"
2024-03-03 23:02:36 -08:00
use_uv_ldflags="`pkg-config --libs libuv`"
2020-08-10 11:40:17 -07:00
cmake_c_flags="${cmake_c_flags} ${use_uv_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${use_uv_flags}"
2024-03-03 23:02:36 -08:00
else
use_librhash_ldflags="-luv"
2020-07-06 08:31:52 -07:00
fi
2024-03-03 23:02:36 -08:00
libs="${libs} ${use_uv_ldflags}"
2017-09-13 11:33:38 -07:00
fi
2020-08-10 11:40:17 -07:00
2023-11-28 14:49:47 -08:00
librhash_c_flags="-DNO_IMPORT_EXPORT"
2020-10-05 09:15:17 -07:00
if test "x${bootstrap_system_librhash}" != "x"; then
if test `which pkg-config`; then
use_librhash_flags="`pkg-config --cflags librhash`"
2024-03-03 23:02:36 -08:00
use_librhash_ldflags="`pkg-config --libs librhash`"
2020-10-05 09:15:17 -07:00
cmake_c_flags="${cmake_c_flags} ${use_librhash_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${use_librhash_flags}"
2024-03-03 23:02:36 -08:00
else
use_librhash_ldflags="-lrhash"
2020-10-05 09:15:17 -07:00
fi
2024-03-03 23:02:36 -08:00
libs="${libs} ${use_librhash_ldflags}"
2020-10-05 09:15:17 -07:00
fi
2023-07-21 09:01:01 -07:00
jsoncpp_cxx_flags=
if test "x${bootstrap_system_jsoncpp}" = "x"; then
jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`"
else
if test `which pkg-config`; then
use_jsoncpp_flags="`pkg-config --cflags jsoncpp`"
2024-03-03 23:02:36 -08:00
use_jsoncpp_ldflags="`pkg-config --libs jsoncpp`"
2023-07-21 09:01:01 -07:00
cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
2024-03-03 23:02:36 -08:00
else
use_librhash_ldflags="-ljsoncpp"
2020-08-10 11:40:17 -07:00
fi
2024-03-03 23:02:36 -08:00
libs="${libs} ${use_jsoncpp_ldflags}"
2020-08-10 11:40:17 -07:00
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_ansi_cxx_flags}" != "x"; then
2003-06-21 08:57:13 -07:00
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
fi
2021-06-23 09:41:07 -07:00
system_flags=''
case "${cmake_system}" in
# Ensure filesystem access uses 64-bit offsets even on 32-bit hosts.
*Linux*) system_flags='-D_FILE_OFFSET_BITS=64' ;;
esac
if test "x${system_flags}" != "x"; then
cmake_c_flags="${cmake_c_flags} ${system_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${system_flags}"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_c_flags}" != "x"; then
2003-09-02 10:27:58 -07:00
cmake_c_flags="${cmake_c_flags} "
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_cxx_flags}" != "x"; then
2003-06-21 08:57:13 -07:00
cmake_cxx_flags="${cmake_cxx_flags} "
fi
2020-08-10 11:40:17 -07:00
write_source_rule() {
lang="$1"
obj="$2"
src="$3"
src_flags="$4"
if test "${lang}" = "c"; then
ninja_rule=cc
compiler="${cmake_c_compiler}"
flags="${cmake_c_flags}"
elif test "${lang}" = "cxx"; then
ninja_rule=cxx
compiler="${cmake_cxx_compiler}"
flags="${cmake_cxx_flags}"
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo "build ${obj} : ${ninja_rule} ${src} | ${dep}" >> "${cmake_bootstrap_dir}/build.ninja"
echo " srcflags = ${src_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
else
echo "${obj} : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
echo " ${compiler} ${flags} ${src_flags} -c ${src} -o ${obj}" >> "${cmake_bootstrap_dir}/Makefile"
fi
}
2009-06-10 08:46:06 -07:00
cmake_c_flags_String="-DKWSYS_STRING_C"
2013-11-25 08:30:52 -08:00
if ${cmake_system_mingw}; then
cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
2017-05-13 12:14:55 -07:00
cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}"
2016-11-01 11:04:20 -07:00
cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}"
2013-11-25 08:30:52 -08:00
fi
2013-06-03 07:34:35 -07:00
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}
"
2017-04-28 11:26:55 -07:00
cmake_c_flags="${cmake_c_flags} \
2019-08-08 08:40:41 -07:00
-DCMAKE_BOOTSTRAP \
2020-08-10 11:40:17 -07:00
-I`cmake_escape_shell \"${cmake_bootstrap_dir}\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Source\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Source/LexerParser\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Utilities\"`"
2017-04-28 11:26:55 -07:00
cmake_cxx_flags="${cmake_cxx_flags} \
2019-08-08 08:40:41 -07:00
-DCMAKE_BOOTSTRAP \
2020-01-30 03:52:53 -08:00
${cmake_have_cxx_features} \
2020-08-10 11:40:17 -07:00
-I`cmake_escape_shell \"${cmake_bootstrap_dir}\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Source\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Source/LexerParser\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Utilities/std\"` \
-I`cmake_escape_shell \"${cmake_source_dir}/Utilities\"`"
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo "cc = ${cmake_c_compiler}" > "${cmake_bootstrap_dir}/build.ninja"
echo "cxx = ${cmake_cxx_compiler}" >> "${cmake_bootstrap_dir}/build.ninja"
echo "cflags = ${cmake_c_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
echo "cxxflags = ${cmake_cxx_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
echo "ldflags = ${cmake_ld_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
echo "rule cc" >> "${cmake_bootstrap_dir}/build.ninja"
echo " command = \$cc \$cflags \$srcflags -c \$in -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
echo "rule cxx" >> "${cmake_bootstrap_dir}/build.ninja"
echo " command = \$cxx \$cxxflags \$srcflags -c \$in -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
echo "rule link" >> "${cmake_bootstrap_dir}/build.ninja"
echo " command = \$cxx \$ldflags \$cxxflags \$in \$libs -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
echo "build cmake: link ${objs}" >> "${cmake_bootstrap_dir}/build.ninja"
echo " libs = ${libs}" >> "${cmake_bootstrap_dir}/build.ninja"
else
echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
echo " ${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} ${libs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
fi
2003-12-08 11:11:58 -08:00
for a in ${CMAKE_CXX_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/${a}.cxx"`
2016-11-01 11:04:20 -07:00
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
2020-08-10 11:40:17 -07:00
write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
2003-03-27 12:29:38 -08:00
done
2003-12-08 11:11:58 -08:00
for a in ${CMAKE_C_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/${a}.c"`
write_source_rule "c" "${a}.o" "${src}" ""
2017-05-11 12:53:14 -07:00
done
2019-08-04 01:49:16 -07:00
for a in ${CMAKE_STD_CXX_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/std/cm/bits/${a}.cxx"`
2019-08-04 01:49:16 -07:00
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
2020-08-10 11:40:17 -07:00
write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
2019-08-04 01:49:16 -07:00
done
2017-05-11 12:53:14 -07:00
for a in ${LexerParser_CXX_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/LexerParser/${a}.cxx"`
2017-05-11 12:53:14 -07:00
src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
2020-08-10 11:40:17 -07:00
write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
2017-05-11 12:53:14 -07:00
done
for a in ${LexerParser_C_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/LexerParser/${a}.c"`
write_source_rule "c" "${a}.o" "${src}" ""
2003-12-08 11:11:58 -08:00
done
2012-12-19 06:00:55 -08:00
for a in ${KWSYS_C_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/kwsys/${a}.c"`
src_flags="`eval echo \\${cmake_c_flags_\${a}}` -DKWSYS_NAMESPACE=cmsys"
write_source_rule "c" "${a}.o" "${src}" "${src_flags}"
2003-07-07 14:52:53 -07:00
done
for a in ${KWSYS_CXX_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
src_flags="`eval echo \\${cmake_cxx_flags_\${a}}` -DKWSYS_NAMESPACE=cmsys"
write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
2003-06-23 05:58:58 -07:00
done
2020-07-06 08:31:52 -07:00
if test "x${bootstrap_system_libuv}" = "x"; then
for a in ${LIBUV_C_SOURCES}; do
2020-08-10 11:40:17 -07:00
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
write_source_rule "c" "uv-`cmake_obj ${a}`" "${src}" "${uv_c_flags}"
2020-07-06 08:31:52 -07:00
done
fi
2020-10-05 09:15:17 -07:00
if test "x${bootstrap_system_librhash}" = "x"; then
for a in ${LIBRHASH_C_SOURCES}; do
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmlibrhash/${a}"`
2023-11-28 14:49:47 -08:00
write_source_rule "c" "rhash-`cmake_obj ${a}`" "${src}" "${librhash_c_flags}"
2020-10-05 09:15:17 -07:00
done
fi
2023-07-21 09:01:01 -07:00
if test "x${bootstrap_system_jsoncpp}" = "x"; then
for a in ${JSONCPP_CXX_SOURCES}; do
src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"`
write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}"
done
2020-08-10 11:40:17 -07:00
fi
if test "${cmake_bootstrap_generator}" = "Ninja"; then
echo "
rule rebuild_cache
command = cd \"${cmake_binary_dir}\" && \"${cmake_source_dir}/bootstrap\" --generator=\"${cmake_bootstrap_generator}\"
generator = 1
build build.ninja : rebuild_cache
" >> "${cmake_bootstrap_dir}/build.ninja"
else
echo "
2003-08-06 14:52:16 -07:00
rebuild_cache:
2020-08-10 11:40:17 -07:00
cd \"${cmake_binary_dir}\" && \"${cmake_source_dir}/bootstrap\" --generator=\"${cmake_bootstrap_generator}\"
" >> "${cmake_bootstrap_dir}/Makefile"
fi
2003-03-27 12:29:38 -08:00
2009-06-10 10:04:25 -07:00
# Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
echo '
# Generated by '"${cmake_source_dir}"'/bootstrap
2003-07-23 05:37:44 -07:00
# Default cmake settings. These may be overridden any settings below.
2020-01-09 11:49:47 -08:00
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build.") # not FORCE to preserve defaults specified elsewhere
2012-08-13 10:47:32 -07:00
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)
2016-05-27 07:03:43 -07:00
set (CMAKE_BIN_DIR "'"${cmake_bin_dir}"'" CACHE PATH "Install location for binaries (relative to prefix)." FORCE)
2012-08-13 10:47:32 -07:00
set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
2015-12-21 07:02:11 -08:00
set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
2009-06-10 10:04:25 -07:00
' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
2003-07-21 13:38:53 -07:00
2008-02-13 11:47:03 -08:00
# Add configuration settings given as command-line options.
2020-05-02 14:42:13 -07:00
if test "x${cmake_bootstrap_qt_gui}" != "x"; then
2009-06-10 10:04:25 -07:00
echo '
2012-08-13 10:47:32 -07:00
set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
2009-06-10 10:04:25 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
2008-02-13 11:47:03 -08:00
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_bootstrap_qt_qmake}" != "x"; then
2009-06-10 10:04:25 -07:00
echo '
2012-08-13 10:47:32 -07:00
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
2009-06-10 10:04:25 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
2008-02-13 11:47:03 -08:00
fi
2023-03-15 17:50:08 -07:00
if test "x${cmake_bootstrap_debugger}" != "x"; then
echo '
set (CMake_ENABLE_DEBUGGER '"${cmake_bootstrap_debugger}"' CACHE BOOL "Enable CMake debugger support" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_info}" != "x"; then
2018-06-11 18:14:10 -07:00
echo '
set (SPHINX_INFO "'"${cmake_sphinx_info}"'" CACHE BOOL "Build Info manual with Sphinx" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_man}" != "x"; then
2013-09-17 13:08:05 -07:00
echo '
2015-04-30 06:22:43 -07:00
set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
2013-09-17 13:08:05 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_html}" != "x"; then
2013-09-17 13:08:05 -07:00
echo '
2015-04-30 06:22:43 -07:00
set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
2013-09-17 13:08:05 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_qthelp}" != "x"; then
2015-02-07 14:23:28 -08:00
echo '
2015-04-30 06:22:43 -07:00
set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE BOOL "Build qch help with Sphinx" FORCE)
2015-02-07 14:23:28 -08:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
2021-02-19 04:39:28 -08:00
fi
if test "x${cmake_sphinx_latexpdf}" != "x"; then
echo '
set (SPHINX_LATEXPDF "'"${cmake_sphinx_latexpdf}"'" CACHE BOOL "Build PDF help with Sphinx using LaTeX" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
2015-02-07 14:23:28 -08:00
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_build}" != "x"; then
2013-09-17 13:08:05 -07:00
echo '
set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_sphinx_flags}" != "x"; then
2015-04-30 06:30:14 -07:00
echo '
set (SPHINX_FLAGS [==['"${cmake_sphinx_flags}"']==] CACHE STRING "Flags to pass to sphinx-build" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
2008-02-13 11:47:03 -08:00
2003-07-23 05:37:44 -07:00
# Add user-specified settings. Handle relative-path case for
2003-07-21 13:38:53 -07:00
# specification of cmake_init_file.
(
cd "${cmake_binary_dir}"
2020-05-02 14:42:13 -07:00
if test -f "${cmake_init_file}"; then
2003-07-21 13:38:53 -07:00
cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
)
2003-03-27 12:29:38 -08:00
echo "---------------------------------------------"
2003-05-15 06:35:16 -07:00
# Run make to build bootstrap cmake
2020-08-10 11:40:17 -07:00
if test "${cmake_bootstrap_generator}" = "Ninja"; then
ninja_v=-v
else
ninja_v=
fi
2020-05-02 14:42:13 -07:00
if test "x${cmake_parallel_make}" != "x"; then
2020-08-10 11:40:17 -07:00
${cmake_make_processor} ${cmake_make_flags} ${ninja_v}
2003-05-14 06:27:39 -07:00
else
2020-08-10 11:40:17 -07:00
${cmake_make_processor} ${ninja_v}
2003-05-14 06:27:39 -07:00
fi
2003-03-27 12:29:38 -08:00
RES=$?
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2003-12-23 08:03:38 -08:00
cmake_error 9 "Problem while running ${cmake_make_processor}"
2003-03-27 12:29:38 -08:00
fi
cd "${cmake_binary_dir}"
2003-05-15 06:35:16 -07:00
# 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}"
MAKE="${cmake_make_processor}"
export CC
export CXX
export MAKE
2018-03-19 22:34:42 -07:00
export CFLAGS
export CXXFLAGS
export LDFLAGS
2003-05-15 06:35:16 -07:00
# Run bootstrap CMake to configure real CMake
2011-01-17 05:44:04 -08:00
cmake_options="-DCMAKE_BOOTSTRAP=1"
2020-05-02 14:42:13 -07:00
if test -n "${cmake_verbose}"; then
2011-01-17 05:44:04 -08:00
cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
fi
2011-12-16 08:29:26 -08:00
"${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
2005-03-04 07:03:38 -08:00
RES=$?
2020-05-02 14:42:13 -07:00
if test "${RES}" -ne "0"; then
2005-03-04 07:03:38 -08:00
cmake_error 11 "Problem while running initial CMake"
fi
2003-03-27 12:29:38 -08:00
echo "---------------------------------------------"
2003-05-15 06:35:16 -07:00
# And we are done. Now just run make
2003-07-23 05:37:44 -07:00
echo "CMake has bootstrapped. Now run ${cmake_make_processor}."