cmake/bootstrap

2112 lines
65 KiB
Plaintext
Raw Permalink Normal View History

2003-03-27 12:29:38 -08:00
#!/bin/sh
Simplify CMake per-source license notices Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
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.
die() {
echo "$@" 1>&2 ; exit 1
}
# Compile flag extraction function.
cmake_extract_standard_flags()
{
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 ';' ' '
}
# Version number extraction function.
cmake_version_component()
{
sed -n "
/^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\)).*/\1/;p;}
" "${cmake_source_dir}/Source/CMakeVersion.cmake"
}
# Install destination extraction function.
cmake_install_dest_default()
{
sed -n '
/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
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
}
' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
}
cmake_toupper()
{
echo "$1" | tr '[a-z]' '[A-Z]'
}
# Detect system and directory information.
cmake_system=`uname`
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
cmake_binary_dir=`pwd`
New version scheme to support branchy workflow Prepare to switch to the workflow described by "git help workflows". In this workflow, the "master" branch is always used to integrate topics ready for release. Brand new work merges into a "next" branch instead. We need a new versioning scheme to work this way because the version on "master" must always increase. We no longer use an even/odd minor number to distinguish releases from development versions. Since we still support cvs checkout of our source tree we cannot depend on "git describe" to compute a version number based on the history graph. We can use the CCYYMMDD nightly date stamp to get a monotonically increasing version component. The new version format is "major.minor.patch.(tweak|date)". Releases use a tweak level in the half-open range [0,20000000), which is smaller than any current or future date. For tweak=0 we do not show the tweak component, leaving the format "major.minor.patch" for most releases. Development versions use date=CCYYMMDD for the tweak level. The major.minor.patch part of development versions on "master" always matches the most recent release. For example, a first-parent traversal of "master" might see v2.8.1 2.8.1.20100422 v2.8.2 | | | ----o----o----o----o----o----o----o----o---- Since the date appears in the tweak component, the next release can increment the patch level (or any more significant component) to be greater than any version leading to it. Topic branches not ready for release are published only on "next" so we know that all versions on master lead between two releases.
2010-04-23 06:44:23 -07:00
# Load version information.
cmake_version_major="`cmake_version_component MAJOR`"
cmake_version_minor="`cmake_version_component MINOR`"
New version scheme to support branchy workflow Prepare to switch to the workflow described by "git help workflows". In this workflow, the "master" branch is always used to integrate topics ready for release. Brand new work merges into a "next" branch instead. We need a new versioning scheme to work this way because the version on "master" must always increase. We no longer use an even/odd minor number to distinguish releases from development versions. Since we still support cvs checkout of our source tree we cannot depend on "git describe" to compute a version number based on the history graph. We can use the CCYYMMDD nightly date stamp to get a monotonically increasing version component. The new version format is "major.minor.patch.(tweak|date)". Releases use a tweak level in the half-open range [0,20000000), which is smaller than any current or future date. For tweak=0 we do not show the tweak component, leaving the format "major.minor.patch" for most releases. Development versions use date=CCYYMMDD for the tweak level. The major.minor.patch part of development versions on "master" always matches the most recent release. For example, a first-parent traversal of "master" might see v2.8.1 2.8.1.20100422 v2.8.2 | | | ----o----o----o----o----o----o----o----o---- Since the date appears in the tweak component, the next release can increment the patch level (or any more significant component) to be greater than any version leading to it. Topic branches not ready for release are published only on "next" so we know that all versions on master lead between two releases.
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}"
cmake_version_rc="`cmake_version_component RC`"
if test "$cmake_version_rc" != ""; then
cmake_version="${cmake_version}-rc${cmake_version_rc}"
fi
New version scheme to support branchy workflow Prepare to switch to the workflow described by "git help workflows". In this workflow, the "master" branch is always used to integrate topics ready for release. Brand new work merges into a "next" branch instead. We need a new versioning scheme to work this way because the version on "master" must always increase. We no longer use an even/odd minor number to distinguish releases from development versions. Since we still support cvs checkout of our source tree we cannot depend on "git describe" to compute a version number based on the history graph. We can use the CCYYMMDD nightly date stamp to get a monotonically increasing version component. The new version format is "major.minor.patch.(tweak|date)". Releases use a tweak level in the half-open range [0,20000000), which is smaller than any current or future date. For tweak=0 we do not show the tweak component, leaving the format "major.minor.patch" for most releases. Development versions use date=CCYYMMDD for the tweak level. The major.minor.patch part of development versions on "master" always matches the most recent release. For example, a first-parent traversal of "master" might see v2.8.1 2.8.1.20100422 v2.8.2 | | | ----o----o----o----o----o----o----o----o---- Since the date appears in the tweak component, the next release can increment the patch level (or any more significant component) to be greater than any version leading to it. Topic branches not ready for release are published only on "next" so we know that all versions on master lead between two releases.
2010-04-23 06:44:23 -07:00
cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/Copyright.txt"`"
cmake_bin_dir_keyword="OTHER"
cmake_data_dir_keyword="OTHER"
cmake_doc_dir_keyword="OTHER"
cmake_man_dir_keyword="OTHER"
cmake_xdgdata_dir_keyword="OTHER"
cmake_bin_dir=""
cmake_data_dir=""
cmake_doc_dir=""
cmake_man_dir=""
cmake_xdgdata_dir=""
cmake_init_file=""
cmake_bootstrap_system_libs=""
cmake_bootstrap_qt_gui=""
cmake_bootstrap_qt_qmake=""
cmake_bootstrap_debugger=""
cmake_sphinx_info=""
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
cmake_sphinx_man=""
cmake_sphinx_html=""
cmake_sphinx_qthelp=""
cmake_sphinx_latexpdf=""
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
cmake_sphinx_build=""
cmake_sphinx_flags=""
# Determine whether this is a Cygwin environment.
if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
cmake_system_cygwin=true
cmake_doc_dir_keyword="CYGWIN"
cmake_man_dir_keyword="CYGWIN"
else
cmake_system_cygwin=false
fi
# 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
# Determine whether this is a MinGW environment.
if echo "${cmake_system}" | grep 'MINGW' >/dev/null 2>&1; then
cmake_system_mingw=true
else
cmake_system_mingw=false
fi
# Determine whether this is OS X
if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
cmake_system_darwin=true
else
cmake_system_darwin=false
fi
2012-07-07 10:57:40 -07:00
# Determine whether this is BeOS
if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
2006-12-04 14:26:41 -08:00
cmake_system_beos=true
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
if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
cmake_system_haiku=true
cmake_doc_dir_keyword="HAIKU"
cmake_man_dir_keyword="HAIKU"
else
cmake_system_haiku=false
fi
# Determine whether this is OpenVMS
if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
cmake_system_openvms=true
else
cmake_system_openvms=false
fi
# Determine whether this is HP-UX
if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
die 'CMake no longer compiles on HP-UX. See
https://gitlab.kitware.com/cmake/cmake/-/issues/17137
Use CMake 3.9 or lower instead.'
cmake_system_hpux=true
else
cmake_system_hpux=false
fi
# 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
# Determine whether this is Linux
if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
cmake_system_linux=true
else
cmake_system_linux=false
2022-01-27 06:57:33 -08:00
fi
# 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
if uname -m | grep parisc >/dev/null 2>&1; then
cmake_machine_parisc=true
fi
elif ${cmake_system_hpux}; then
if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
cmake_machine_parisc=true
fi
fi
# 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
# 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}"
# Helper function to fix windows paths.
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
# Choose the default install prefix.
if ${cmake_system_mingw}; then
if test "x${PROGRAMFILES}" != "x"; then
cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
elif test "x${ProgramFiles}" != "x"; then
cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
elif test "x${SYSTEMDRIVE}" != "x"; then
cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
elif test "x${SystemDrive}" != "x"; then
cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
else
cmake_default_prefix="c:/Program Files/CMake"
fi
elif ${cmake_system_haiku}; then
cmake_default_prefix=`finddir B_COMMON_DIRECTORY`
else
cmake_default_prefix="/usr/local"
fi
# Lookup default install destinations.
cmake_bin_dir_default="`cmake_install_dest_default BIN ${cmake_bin_dir_keyword}`"
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}`"
cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
CMAKE_KNOWN_C_COMPILERS="cc gcc clang xlc icx tcc"
CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ clang++ c++ icpx"
CMAKE_KNOWN_MAKE_PROCESSORS="gmake make smake"
CMAKE_KNOWN_NINJA_PROCESSORS="ninja-build ninja samu"
2003-03-27 12:29:38 -08:00
CMAKE_PROBLEMATIC_FILES="\
CMakeCache.txt \
CMakeSystem.cmake \
CMakeCCompiler.cmake \
CMakeCXXCompiler.cmake \
Make platform information files specific to the CMake version At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
2012-08-24 05:48:59 -07:00
*/CMakeSystem.cmake \
*/CMakeCCompiler.cmake \
*/CMakeCXXCompiler.cmake \
Source/cmConfigure.h \
Source/CTest/Curl/config.h \
Utilities/cmThirdParty.h \
Utilities/cmcurl/lib/curl_config.h \
Utilities/cmlibarchive/config.h \
Utilities/cmliblzma/config.h \
Utilities/cmnghttp2/config.h \
"
2006-03-22 06:58:11 -08:00
CMAKE_UNUSED_SOURCES="\
cmGlobalXCodeGenerator \
cmLocalXCodeGenerator \
cmXCodeObject \
cmXCode21Object \
cmSourceGroup \
"
CMAKE_CXX_SOURCES="\
cmAddCompileDefinitionsCommand \
cmAddCustomCommandCommand \
cmAddCustomTargetCommand \
cmAddDefinitionsCommand \
cmAddDependenciesCommand \
cmAddExecutableCommand \
cmAddLibraryCommand \
cmAddSubDirectoryCommand \
cmAddTestCommand \
2019-03-23 14:45:41 -07:00
cmArgumentParser \
cmBinUtilsLinker \
cmBinUtilsLinuxELFGetRuntimeDependenciesTool \
cmBinUtilsLinuxELFLinker \
cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool \
cmBinUtilsMacOSMachOGetRuntimeDependenciesTool \
cmBinUtilsMacOSMachOLinker \
cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool \
cmBinUtilsWindowsPEGetRuntimeDependenciesTool \
cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool \
cmBinUtilsWindowsPELinker \
cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool \
cmBlockCommand \
cmBreakCommand \
cmBuildCommand \
cmCMakeLanguageCommand \
cmCMakeMinimumRequired \
cmList \
2020-07-23 07:52:39 -07:00
cmCMakePath \
cmCMakePathCommand \
cmCMakePolicyCommand \
cmCPackPropertiesGenerator \
cmCacheManager \
cmCommand \
cmCommandArgumentParserHelper \
cmCommands \
cmCommonTargetGenerator \
cmComputeComponentGraph \
cmComputeLinkDepends \
cmComputeLinkInformation \
cmComputeTargetDepends \
cmConsoleBuf \
cmConditionEvaluator \
cmConfigureFileCommand \
cmContinueCommand \
cmCoreTryCompile \
cmCreateTestSourceList \
cmCryptoHash \
cmCustomCommand \
cmCustomCommandGenerator \
cmCustomCommandLines \
cmCxxModuleMapper \
cmCxxModuleUsageEffects \
cmDefinePropertyCommand \
cmDefinitions \
cmDocumentationFormatter \
cmELF \
cmEnableLanguageCommand \
cmEnableTestingCommand \
cmEvaluatedTargetProperty \
cmExecProgramCommand \
cmExecuteProcessCommand \
cmExpandedCommandArgument \
cmExperimental \
cmExportBuildFileGenerator \
cmExportFileGenerator \
cmExportInstallFileGenerator \
cmExportSet \
cmExportTryCompileFileGenerator \
cmExprParserHelper \
cmExternalMakefileProjectGenerator \
cmFileCommand \
cmFileCopier \
cmFileInstaller \
cmFileSet \
cmFileTime \
cmFileTimeCache \
cmFileTimes \
cmFindBase \
cmFindCommon \
cmFindFileCommand \
cmFindLibraryCommand \
cmFindPackageCommand \
cmFindPackageStack \
cmFindPathCommand \
cmFindProgramCommand \
cmForEachCommand \
cmFunctionBlocker \
cmFunctionCommand \
cmFSPermissions \
cmGeneratedFileStream \
cmGeneratorExpression \
cmGeneratorExpressionContext \
cmGeneratorExpressionDAGChecker \
cmGeneratorExpressionEvaluationFile \
cmGeneratorExpressionEvaluator \
cmGeneratorExpressionLexer \
cmGeneratorExpressionNode \
cmGeneratorExpressionParser \
cmGeneratorTarget \
cmGeneratorTarget_CompatibleInterface \
cmGeneratorTarget_IncludeDirectories \
cmGeneratorTarget_Link \
cmGeneratorTarget_LinkDirectories \
cmGeneratorTarget_Options \
cmGeneratorTarget_Sources \
cmGeneratorTarget_TargetPropertyEntry \
cmGeneratorTarget_TransitiveProperty \
cmGetCMakePropertyCommand \
cmGetDirectoryPropertyCommand \
cmGetFilenameComponentCommand \
cmGetPipes \
cmGetPropertyCommand \
cmGetSourceFilePropertyCommand \
cmGetTargetPropertyCommand \
cmGetTestPropertyCommand \
cmGlobalCommonGenerator \
cmGlobalGenerator \
cmGlobVerificationManager \
cmHexFileConverter \
cmIfCommand \
cmImportedCxxModuleInfo \
cmIncludeCommand \
2017-06-22 00:53:42 -07:00
cmIncludeGuardCommand \
cmIncludeDirectoryCommand \
cmIncludeRegularExpressionCommand \
cmInstallCommand \
cmInstallCommandArguments \
cmInstallCxxModuleBmiGenerator \
cmInstallDirectoryGenerator \
cmInstallExportGenerator \
2021-06-17 14:01:28 -07:00
cmInstallFileSetGenerator \
cmInstallFilesCommand \
cmInstallFilesGenerator \
cmInstallGenerator \
cmInstallGetRuntimeDependenciesGenerator \
cmInstallImportedRuntimeArtifactsGenerator \
cmInstallRuntimeDependencySet \
cmInstallRuntimeDependencySetGenerator \
cmInstallScriptGenerator \
cmInstallSubdirectoryGenerator \
cmInstallTargetGenerator \
cmInstallTargetsCommand \
cmInstalledFile \
cmJSONHelpers \
cmJSONState \
cmLDConfigLDConfigTool \
cmLDConfigTool \
cmLinkDirectoriesCommand \
cmLinkItem \
cmLinkItemGraphVisitor \
cmLinkLineComputer \
cmLinkLineDeviceComputer \
cmListCommand \
cmListFileCache \
cmLocalCommonGenerator \
cmLocalGenerator \
cmMSVC60LinkLineComputer \
cmMacroCommand \
cmMakeDirectoryCommand \
cmMakefile \
cmMarkAsAdvancedCommand \
cmMathCommand \
cmMessageCommand \
cmMessenger \
cmNewLineStyle \
cmOSXBundleGenerator \
cmOptionCommand \
cmOrderDirectories \
cmOutputConverter \
cmParseArgumentsCommand \
cmPathLabel \
cmPolicies \
cmProcessOutput \
cmProjectCommand \
2021-09-21 08:12:35 -07:00
cmValue \
cmPropertyDefinition \
cmPropertyMap \
cmGccDepfileLexerHelper \
cmGccDepfileReader \
cmReturnCommand \
cmPlaceholderExpander \
cmPlistParser \
cmRulePlaceholderExpander \
cmRuntimeDependencyArchive \
cmScriptGenerator \
cmSearchPath \
cmSeparateArgumentsCommand \
cmSetCommand \
cmSetDirectoryPropertiesCommand \
cmSetPropertyCommand \
cmSetSourceFilesPropertiesCommand \
cmSetTargetPropertiesCommand \
cmSetTestsPropertiesCommand \
cmSiteNameCommand \
cmSourceFile \
cmSourceFileLocation \
cmStandardLevelResolver \
cmState \
cmStateDirectory \
cmStateSnapshot \
2019-08-19 12:33:06 -07:00
cmString \
cmStringAlgorithms \
cmStringReplaceHelper \
cmStringCommand \
2019-04-07 13:14:52 -07:00
cmSubcommandTable \
cmSubdirCommand \
cmSystemTools \
cmTarget \
cmTargetCompileDefinitionsCommand \
cmTargetCompileFeaturesCommand \
cmTargetCompileOptionsCommand \
cmTargetIncludeDirectoriesCommand \
cmTargetLinkLibrariesCommand \
cmTargetLinkOptionsCommand \
cmTargetPrecompileHeadersCommand \
cmTargetPropCommandBase \
cmTargetPropertyComputer \
cmTargetSourcesCommand \
cmTargetTraceDependencies \
cmTest \
cmTestGenerator \
cmTimestamp \
cmTransformDepfile \
cmTryCompileCommand \
cmTryRunCommand \
cmUnsetCommand \
cmUVHandlePtr \
cmUVProcessChain \
cmVersion \
cmWhileCommand \
cmWindowsRegistry \
cmWorkingDirectory \
cmXcFramework \
cmake \
cmakemain \
cmcmd \
cm_fileno \
2006-03-22 06:58:11 -08:00
"
2003-03-27 12:29:38 -08:00
if ${cmake_system_mingw}; then
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
cmGlobalMSYSMakefileGenerator \
cmGlobalMinGWMakefileGenerator \
cmVSSetupHelper \
"
fi
CMAKE_STD_CXX_HEADERS="\
filesystem \
memory \
optional \
shared_mutex \
string_view \
utility \
"
CMAKE_STD_CXX_SOURCES="\
fs_path \
string_view \
"
2017-05-11 12:53:14 -07:00
LexerParser_CXX_SOURCES="\
cmCommandArgumentLexer \
cmCommandArgumentParser \
cmExprLexer \
cmExprParser \
cmGccDepfileLexer \
2017-05-11 12:53:14 -07:00
"
LexerParser_C_SOURCES="\
cmListFileLexer \
"
if ${cmake_system_mingw}; then
KWSYS_C_SOURCES="\
EncodingC \
2006-09-21 10:47:54 -07:00
ProcessWin32 \
String \
System \
Terminal"
else
KWSYS_C_SOURCES="\
EncodingC \
2006-09-21 10:47:54 -07:00
ProcessUNIX \
String \
System \
Terminal"
fi
KWSYS_CXX_SOURCES="\
2003-06-23 05:58:58 -07:00
Directory \
EncodingCXX \
FStream \
2005-10-18 11:08:55 -07:00
Glob \
2003-06-23 05:58:58 -07:00
RegularExpression \
Status \
2003-06-23 05:58:58 -07:00
SystemTools"
KWSYS_FILES="\
Directory.hxx \
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 \
Status.hxx \
String.h \
2006-09-21 10:47:54 -07:00
System.h \
SystemTools.hxx \
Terminal.h"
2003-06-23 05:58:58 -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 \
librhash/util.c \
"
JSONCPP_CXX_SOURCES="\
src/lib_json/json_reader.cpp \
src/lib_json/json_value.cpp \
src/lib_json/json_writer.cpp \
"
if ${cmake_system_mingw}; then
LIBUV_C_SOURCES="\
src/fs-poll.c \
src/idna.c
src/inet.c \
src/threadpool.c \
src/strscpy.c \
src/strtok.c \
src/timer.c \
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="\
src/strscpy.c \
src/strtok.c \
src/timer.c \
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 \
src/unix/tcp.c \
src/unix/tty.c \
"
fi
# Display CMake bootstrap usage
2003-03-27 12:29:38 -08:00
cmake_usage()
{
echo '
Usage: '"$0"' [<options>...] [-- <cmake-options>...]
2003-03-27 12:29:38 -08:00
Options: [defaults in brackets after descriptions]
Configuration:
--help print this message
--version only print version information
2003-03-27 12:29:38 -08:00
--verbose display more information
--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)
--enable-ccache Enable ccache when building cmake
--init=FILE load FILE as script to populate cache
--system-libs use all system-installed third-party libraries
(for use only by package maintainers)
--no-system-libs use all cmake-provided third-party libraries
(default)
--system-cppdap use system-installed cppdap library
--no-system-cppdap use cmake-provided cppdap library (default)
--system-curl use system-installed curl library (default on macOS)
--no-system-curl use cmake-provided curl library (default elsewhere)
--system-expat use system-installed expat library
--no-system-expat use cmake-provided expat library (default)
--system-jsoncpp use system-installed jsoncpp library
--no-system-jsoncpp use cmake-provided jsoncpp library (default)
--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)
--system-liblzma use system-installed liblzma library
--no-system-liblzma use cmake-provided liblzma library (default)
--system-nghttp2 use system-installed nghttp2 library
--no-system-nghttp2 use cmake-provided nghttp2 library (default)
--system-zstd use system-installed zstd library
--no-system-zstd use cmake-provided zstd library (default)
--system-libarchive use system-installed libarchive library
--no-system-libarchive use cmake-provided libarchive library (default)
--system-librhash use system-installed librhash library
--no-system-librhash use cmake-provided librhash library (default)
--system-libuv use system-installed libuv library
--no-system-libuv use cmake-provided libuv library (default)
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
--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
--debugger enable debugger support (default if supported)
--no-debugger disable debugger support
--sphinx-info build Info manual with Sphinx
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
--sphinx-man build man pages with Sphinx
--sphinx-html build html help with Sphinx
--sphinx-qthelp build qch help with Sphinx
--sphinx-latexpdf build PDF with Sphinx using LaTeX
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
--sphinx-build=<sb> use <sb> as the sphinx-build executable
--sphinx-flags=<flags> pass <flags> to sphinx-build executable
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
2003-03-27 12:29:38 -08:00
Directory and file names:
--prefix=PREFIX install files in tree rooted at PREFIX
['"${cmake_default_prefix}"']
--bindir=DIR install binaries in PREFIX/DIR
['"${cmake_bin_dir_default}"']
--datadir=DIR install data files in PREFIX/DIR
['"${cmake_data_dir_default}"']
--docdir=DIR install documentation files in PREFIX/DIR
['"${cmake_doc_dir_default}"']
--mandir=DIR install man pages files in PREFIX/DIR/manN
['"${cmake_man_dir_default}"']
--xdgdatadir=DIR install XDG specific files in PREFIX/DIR
['"${cmake_xdgdata_dir_default}"']
'
2003-03-27 12:29:38 -08:00
exit 10
}
# Display CMake bootstrap usage
cmake_version_display()
{
echo "CMake ${cmake_version}, ${cmake_copyright}"
}
# Display CMake bootstrap error, display the log file and exit
2003-05-14 06:19:12 -07:00
cmake_error()
{
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 "---------------------------------------------"
if test -f cmake_bootstrap.log; then
echo "Log of errors: `pwd`/cmake_bootstrap.log"
#cat cmake_bootstrap.log
2003-05-14 06:19:12 -07:00
echo "---------------------------------------------"
fi
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
}
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"
}
# Replace KWSYS_NAMESPACE with cmsys
cmake_replace_string ()
{
INFILE="$1"
OUTFILE="$2"
SEARCHFOR="$3"
REPLACEWITH="$4"
if test -f "${INFILE}" || ${cmake_system_openvms}; then
sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
if test -f "${OUTFILE}${_tmp}"; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
#echo "Files are the same"
rm -f "${OUTFILE}${_tmp}"
else
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
fi
fi
2003-06-23 05:58:58 -07:00
else
cmake_error 1 "Cannot find file ${INFILE}"
fi
}
cmake_kwsys_config_replace_string ()
{
INFILE="$1"
OUTFILE="$2"
shift 2
APPEND="$*"
if test -f "${INFILE}" || ${cmake_system_openvms}; then
echo "${APPEND}" > "${OUTFILE}${_tmp}"
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;
s/@KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP@/${KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP}/g;
}" "${INFILE}" >> "${OUTFILE}${_tmp}"
if test -f "${OUTFILE}${_tmp}"; then
if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
#echo "Files are the same"
rm -f "${OUTFILE}${_tmp}"
else
mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
fi
fi
else
cmake_error 2 "Cannot find file ${INFILE}"
fi
}
# 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"
}
# Encode object file names.
cmake_obj ()
{
echo $1 | sed 's/\//-/g' | sed 's/$/\.o/'
}
# Strip prefix from argument
cmake_arg ()
{
echo "$1" | sed "s/^${2-[^=]*=}//"
}
# Write message to the log
2003-03-27 12:29:38 -08:00
cmake_log ()
{
echo "$*" >> cmake_bootstrap.log
}
# Return temp file
2003-03-27 12:29:38 -08:00
cmake_tmp_file ()
{
echo "cmake_bootstrap_$$_test"
2003-03-27 12:29:38 -08: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
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}"
echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
echo "---------- file -----------------------"
cat "${TESTFILE}"
echo "------------------------------------------"
${COMPILER} ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
2003-03-27 12:29:38 -08:00
RES=$?
if test "${RES}" -ne "0"; then
echo "Test failed to compile"
return 1
2003-03-27 12:29:38 -08:00
fi
if test ! -f "${TMPFILE}" && test ! -f "${TMPFILE}.exe"; then
echo "Test failed to produce executable"
2003-03-27 12:29:38 -08:00
return 2
fi
./${TMPFILE}
RES=$?
rm -f "${TMPFILE}"
if test "${RES}" -ne "0"; then
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
}
# Run a make test. First argument is the make interpreter.
2003-03-27 12:29:38 -08:00
cmake_try_make ()
{
MAKE_PROC="$1"
MAKE_FLAGS="$2"
2003-03-27 12:29:38 -08:00
echo "Try: ${MAKE_PROC}"
"${MAKE_PROC}" ${MAKE_FLAGS}
2003-03-27 12:29:38 -08:00
RES=$?
if test "${RES}" -ne "0"; then
echo "${MAKE_PROC} does not work"
return 1
2003-03-27 12:29:38 -08:00
fi
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"
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
}
# Parse arguments
2003-05-14 06:19:12 -07:00
cmake_verbose=
cmake_parallel_make=
cmake_ccache_enabled=
cmake_prefix_dir="${cmake_default_prefix}"
bootstrap_system_libuv=
2020-08-10 11:40:17 -07:00
bootstrap_system_jsoncpp=
bootstrap_system_librhash=
while test $# != 0; do
case "$1" in
--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"` ;;
--bindir=*) cmake_bin_dir=`cmake_arg "$1"` ;;
--datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
--docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
--mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
--xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
--init=*) cmake_init_file=`cmake_arg "$1"` ;;
--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" ;;
--system-bzip2|--system-cppdap|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma|--system-nghttp2|--system-zstd|--system-libuv)
lib=`cmake_arg "$1" "--system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;;
--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)
lib=`cmake_arg "$1" "--no-system-"`
cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
--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" ;;
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
--debugger) cmake_bootstrap_debugger="1" ;;
--no-debugger) cmake_bootstrap_debugger="0" ;;
--sphinx-info) cmake_sphinx_info="1" ;;
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
--sphinx-man) cmake_sphinx_man="1" ;;
--sphinx-html) cmake_sphinx_html="1" ;;
--sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
--sphinx-latexpdf) cmake_sphinx_latexpdf="1" ;;
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
--sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
--sphinx-flags=*) cmake_sphinx_flags=`cmake_arg "$1"` ;;
--help) cmake_usage ;;
--version) cmake_version_display ; exit 2 ;;
--verbose) cmake_verbose=TRUE ;;
--enable-ccache) cmake_ccache_enabled=TRUE ;;
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"` ;;
--) shift; break ;;
*) 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
# If verbose, display some information about bootstrap
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}"
if test "x${cmake_parallel_make}" != "x"; then
echo "Doing parallel make: ${cmake_parallel_make}"
fi
echo ""
2003-05-14 06:19:12 -07:00
fi
echo "---------------------------------------------"
# Get CMake version
echo "`cmake_version_display`"
2003-05-14 06:19:12 -07:00
# Check for in-source build
cmake_in_source_build=
if test -f "${cmake_binary_dir}/Source/cmake.cxx" &&
test -f "${cmake_binary_dir}/Source/cmake.h"; then
if test -n "${cmake_verbose}"; then
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.
if test -z "${cmake_in_source_build}"; then
# Did somebody bootstrap in the source tree?
if test -d "${cmake_source_dir}/Bootstrap${_cmk}"; then
cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
Looks like somebody did bootstrap CMake in the source tree, but now you are
trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
directory from the source tree."
fi
# Is there a cache in the source tree?
for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
if test -f "${cmake_source_dir}/${cmake_problematic_file}"; then
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
# Make bootstrap directory
test -d "${cmake_bootstrap_dir}" || mkdir "${cmake_bootstrap_dir}"
if test ! -d "${cmake_bootstrap_dir}"; then
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}"
test -d "cmsys" || mkdir "cmsys"
if test ! -d "cmsys"; then
cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
2003-06-23 05:58:58 -07:00
fi
# Delete all the bootstrap files
2003-05-14 06:19:12 -07:00
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
2003-05-14 06:19:12 -07:00
# If building in-source, remove any cmConfigure.h that may
# have been created by a previous run of the bootstrap cmake.
if test -n "${cmake_in_source_build}"; then
rm -f "${cmake_source_dir}/Source/cmConfigure.h"
fi
# 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 \
cmDependsCompiler \
2020-08-10 11:40:17 -07:00
cmGlobalUnixMakefileGenerator3 \
cmLocalUnixMakefileGenerator3 \
cmMakefileExecutableTargetGenerator \
cmMakefileLibraryTargetGenerator \
cmMakefileTargetGenerator \
cmMakefileUtilityTargetGenerator \
cmProcessTools \
2020-08-10 11:40:17 -07:00
"
fi
# Add Cygwin-specific flags
if ${cmake_system_cygwin} || ${cmake_system_msys}; then
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
fi
# Add CoreFoundation framework on Darwin
if ${cmake_system_darwin}; then
cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
fi
2006-12-04 14:26:41 -08:00
# Add BeOS toolkits...
if ${cmake_system_beos}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
# Add Haiku toolkits...
if ${cmake_system_haiku}; then
cmake_ld_flags="${LDFLAGS} -lroot -lbe"
fi
# 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
#-----------------------------------------------------------------------------
# Detect known toolchains on some platforms.
cmake_toolchains=''
case "${cmake_system}" in
*AIX*) cmake_toolchains='XL GNU' ;;
*CYGWIN*) cmake_toolchains='GNU' ;;
*MSYS*) cmake_toolchains='GNU' ;;
*Darwin*) cmake_toolchains='Clang GNU' ;;
*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
}
if test -z "${CC}" && test -z "${CXX}"; then
cmake_toolchain_detect
fi
thread_flags=''
case "${cmake_system}" in
*AIX*) thread_flags='-pthread' ;;
esac
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test C compiler
cmake_c_compiler=
# If CC is set, use that for compiler, otherwise use list of known compilers
if test -n "${cmake_toolchain}"; then
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
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
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif
#if defined(__sun) && __STDC_VERSION__ < 199901L
#error "On Solaris we need C99."
#endif
#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif
#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
{
printf("%d%c", (argv != 0), (char)0x0a);
return argc - 1;
2003-03-27 12:29:38 -08:00
}
' > "${TMPFILE}.c"
for std in 11 99 90; do
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
for std_flag in '' $std_flags; do
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}" \
"${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
cmake_c_compiler="${test_compiler}"
cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}"
rm -f "${TMPFILE}.c"
return 0
fi
done
done
done
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
if test -z "${cmake_c_compiler}"; then
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}"
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test CXX compiler
cmake_cxx_compiler=
# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
# If CC is set, use that for compiler, otherwise use list of known compilers
if test -n "${cmake_toolchain}"; then
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
# Check if C++ compiler works
cmake_cxx_compiler_try_set()
{
test_compiler="$1"
test_thread_flags="$2"
TMPFILE=`cmake_tmp_file`
echo '
#include <iostream>
#include <memory>
#include <unordered_map>
#if __cplusplus < 201103L
#error "Compiler is not in a mode aware of C++11."
#endif
#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
#error "On AIX with GNU we need the -pthread flag."
#endif
#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
#endif
#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
#error "On HP-UX we need GCC 4.9 or higher."
#endif
#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
#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
#include <optional>
template <typename T,
typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
typename T::pointer get_ptr(T& item)
{
return item.get();
}
int check_cxx17()
{
// Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
std::unique_ptr<int> u(new int(0));
get_ptr(u);
std::optional<int> oi = 0;
return oi.value();
}
#else
int check_cxx17()
{
return 0;
}
#endif
class Class
{
public:
int Get() const { return this->Member; }
private:
int Member = 1;
};
2003-03-27 12:29:38 -08:00
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
2003-03-27 12:29:38 -08:00
return 0;
}
' > "${TMPFILE}.cxx"
for std in 17 14 11; do
std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
for std_flag in '' $std_flags; do
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}" \
"${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
cmake_cxx_compiler="${test_compiler}"
cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} "
rm -f "${TMPFILE}.cxx"
return 0
fi
done
done
done
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
if test -z "${cmake_cxx_compiler}"; then
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.
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}"
#-----------------------------------------------------------------------------
# Test CXX features
cmake_cxx_features="make_unique filesystem"
for feature in ${cmake_cxx_features}; do
eval "cmake_have_cxx_${feature}=0"
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}" \
"${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}}"
if test "${feature_value}" -eq "1"; then
cmake_have_cxx_features="${cmake_have_cxx_features} -DCMake_HAVE_CXX_`cmake_toupper ${feature}`=${feature_value}"
fi
done
cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" ""
#-----------------------------------------------------------------------------
2003-03-27 12:29:38 -08:00
# Test Make
cmake_make_processor=
cmake_make_flags=
# If MAKE is set, use that for make processor, otherwise use list of known make
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
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
'"${cmake_c_compiler}"' '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
'>"Makefile"
2020-08-10 11:40:17 -07:00
fi
echo '
2003-03-27 12:29:38 -08:00
#include <stdio.h>
int main(){ printf("1%c", (char)0x0a); return 0; }
' > "test.c"
cmake_original_make_flags="${cmake_make_flags}"
if test "x${cmake_parallel_make}" != "x"; then
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
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
cmake_full_make_flags="${cmake_make_flags}"
if test "x${cmake_original_make_flags}" != "x${cmake_make_flags}"; then
if test -z "${cmake_make_processor}"; then
cmake_make_flags="${cmake_original_make_flags}"
for a in ${cmake_make_processors}; do
if test -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
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
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.
Please specify one using environment variable MAKE."
fi
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}"
if test "x${cmake_full_make_flags}" != "x${cmake_make_flags}"; then
echo "---------------------------------------------"
2020-08-10 11:40:17 -07:00
echo "${mf_str} processor ${cmake_make_processor} does not support parallel build"
echo "---------------------------------------------"
fi
2003-03-27 12:29:38 -08:00
# 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
KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP=1
if cmake_try_run "${cmake_cxx_compiler}" \
"${cmake_cxx_flags} ${cmake_ld_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} ${cmake_ld_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} ${cmake_ld_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} ${cmake_ld_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} ${cmake_ld_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
if test -n "${cmake_ccache_enabled}"; then
echo "Building CMake with ccache"
cmake_c_compiler="ccache ${cmake_c_compiler}"
cmake_cxx_compiler="ccache ${cmake_cxx_compiler}"
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}
* 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}
* kwSys Sources:
* ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
* libuv Sources:
* ${LIBUV_C_SOURCES}
2020-08-10 11:40:17 -07:00
* jsoncpp Sources:
* ${JSONCPP_CXX_SOURCES}
* librhash Sources:
* ${LIBRHASH_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`
else
CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
fi
# Write CMake version
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}"
New version scheme to support branchy workflow Prepare to switch to the workflow described by "git help workflows". In this workflow, the "master" branch is always used to integrate topics ready for release. Brand new work merges into a "next" branch instead. We need a new versioning scheme to work this way because the version on "master" must always increase. We no longer use an even/odd minor number to distinguish releases from development versions. Since we still support cvs checkout of our source tree we cannot depend on "git describe" to compute a version number based on the history graph. We can use the CCYYMMDD nightly date stamp to get a monotonically increasing version component. The new version format is "major.minor.patch.(tweak|date)". Releases use a tweak level in the half-open range [0,20000000), which is smaller than any current or future date. For tweak=0 we do not show the tweak component, leaving the format "major.minor.patch" for most releases. Development versions use date=CCYYMMDD for the tweak level. The major.minor.patch part of development versions on "master" always matches the most recent release. For example, a first-parent traversal of "master" might see v2.8.1 2.8.1.20100422 v2.8.2 | | | ----o----o----o----o----o----o----o----o---- Since the date appears in the tweak component, the next release can increment the patch level (or any more significant component) to be greater than any version leading to it. Topic branches not ready for release are published only on "next" so we know that all versions on master lead between two releases.
2010-04-23 06:44:23 -07:00
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_DEFAULT_RECURSION_LIMIT 400"
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
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"
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
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"
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"
fi
# 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}
else
mv -f cm${h}.h${_tmp} cm${h}.h
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"
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
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"
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
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}"
done
2003-03-27 12:29:38 -08:00
objs=""
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
if test "x${bootstrap_system_libuv}" = "x"; then
for a in ${LIBUV_C_SOURCES}; do
objs="${objs} uv-`cmake_obj ${a}`"
done
fi
if test "x${bootstrap_system_librhash}" = "x"; then
for a in ${LIBRHASH_C_SOURCES}; do
objs="${objs} rhash-`cmake_obj ${a}`"
done
fi
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
libs=""
uv_c_flags=""
if ${cmake_system_mingw}; then
uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lole32 -loleaut32"
else
case "${cmake_system}" in
*AIX*)
uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
libs="${libs} -lperfstat"
;;
*Darwin*)
uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
;;
*HP-UX*)
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE_EXTENDED"
;;
*Linux*)
uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
libs="${libs} -ldl -lrt"
;;
*kFreeBSD*)
libs="${libs} -lkvm -lfreebsd-glue"
;;
*BSD*)
libs="${libs} -lkvm"
;;
*SunOS*)
uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
;;
*QNX*)
uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE=700"
libs="${libs} -lsocket"
;;
esac
fi
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"`"
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"`"
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"`"
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"`"
else
if test `which pkg-config`; then
2020-08-10 11:40:17 -07:00
use_uv_flags="`pkg-config --cflags libuv`"
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}"
else
use_librhash_ldflags="-luv"
fi
libs="${libs} ${use_uv_ldflags}"
fi
2020-08-10 11:40:17 -07:00
librhash_c_flags="-DNO_IMPORT_EXPORT"
if test "x${bootstrap_system_librhash}" != "x"; then
if test `which pkg-config`; then
use_librhash_flags="`pkg-config --cflags librhash`"
use_librhash_ldflags="`pkg-config --libs librhash`"
cmake_c_flags="${cmake_c_flags} ${use_librhash_flags}"
cmake_cxx_flags="${cmake_cxx_flags} ${use_librhash_flags}"
else
use_librhash_ldflags="-lrhash"
fi
libs="${libs} ${use_librhash_ldflags}"
fi
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`"
use_jsoncpp_ldflags="`pkg-config --libs jsoncpp`"
cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
else
use_librhash_ldflags="-ljsoncpp"
2020-08-10 11:40:17 -07:00
fi
libs="${libs} ${use_jsoncpp_ldflags}"
2020-08-10 11:40:17 -07:00
fi
if test "x${cmake_ansi_cxx_flags}" != "x"; then
cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
fi
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
if test "x${cmake_c_flags}" != "x"; then
cmake_c_flags="${cmake_c_flags} "
fi
if test "x${cmake_cxx_flags}" != "x"; then
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
}
cmake_c_flags_String="-DKWSYS_STRING_C"
if ${cmake_system_mingw}; then
cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}"
cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}"
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}
"
2017-04-28 11:26:55 -07:00
cmake_c_flags="${cmake_c_flags} \
-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} \
-DCMAKE_BOOTSTRAP \
${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
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"`
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
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
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"`
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}"
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}" ""
done
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}"
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
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}"
done
fi
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}"`
write_source_rule "c" "rhash-`cmake_obj ${a}`" "${src}" "${librhash_c_flags}"
done
fi
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
# 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_BUILD_TYPE "Release" CACHE STRING "Choose the type of build.") # not FORCE to preserve defaults specified elsewhere
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 test "x${cmake_bootstrap_qt_gui}" != "x"; then
echo '
set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if test "x${cmake_bootstrap_qt_qmake}" != "x"; then
echo '
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
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
if test "x${cmake_sphinx_info}" != "x"; then
echo '
set (SPHINX_INFO "'"${cmake_sphinx_info}"'" CACHE BOOL "Build Info manual with Sphinx" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if test "x${cmake_sphinx_man}" != "x"; then
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
echo '
set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if test "x${cmake_sphinx_html}" != "x"; then
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
echo '
set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
2013-09-17 13:08:05 -07:00
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
if test "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 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"
fi
if test "x${cmake_sphinx_build}" != "x"; then
Build Help documentation during CMake build using Sphinx Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
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
if test "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 test -f "${cmake_init_file}"; then
cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
)
2003-03-27 12:29:38 -08:00
echo "---------------------------------------------"
# 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
if test "x${cmake_parallel_make}" != "x"; then
2020-08-10 11:40:17 -07:00
${cmake_make_processor} ${cmake_make_flags} ${ninja_v}
else
2020-08-10 11:40:17 -07:00
${cmake_make_processor} ${ninja_v}
fi
2003-03-27 12:29:38 -08:00
RES=$?
if test "${RES}" -ne "0"; then
cmake_error 9 "Problem while running ${cmake_make_processor}"
2003-03-27 12:29:38 -08:00
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}"
MAKE="${cmake_make_processor}"
export CC
export CXX
export MAKE
export CFLAGS
export CXXFLAGS
export LDFLAGS
# Run bootstrap CMake to configure real CMake
cmake_options="-DCMAKE_BOOTSTRAP=1"
if test -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} "$@"
2005-03-04 07:03:38 -08:00
RES=$?
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 "---------------------------------------------"
# And we are done. Now just run make
echo "CMake has bootstrapped. Now run ${cmake_make_processor}."