You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2127 lines
65 KiB

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.
9 years ago
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.
15 years ago
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.
15 years ago
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.
15 years ago
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.
12 years ago
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.
12 years ago
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.
13 years ago
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,\ " ```
5 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
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.
15 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
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.
12 years ago
  1. #!/bin/sh
  2. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  3. # file LICENSE.rst or https://cmake.org/licensing for details.
  4. die() {
  5. echo "$@" 1>&2 ; exit 1
  6. }
  7. # Compile flag extraction function.
  8. cmake_extract_standard_flags()
  9. {
  10. id="${1:-*}"
  11. lang="${2}"
  12. ver="${3}"
  13. sed -n "s/ *set *( *CMAKE_${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
  14. "${cmake_source_dir}/Modules/Compiler/"${id}-${lang}.cmake \
  15. 2>/dev/null | tr ';' ' '
  16. # Clang's CXX compiler flags are in the common module.
  17. sed -n "s/ *set *( *CMAKE_\\\${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \
  18. "${cmake_source_dir}/Modules/Compiler/Clang.cmake" \
  19. 2>/dev/null | tr ';' ' '
  20. }
  21. # Version number extraction function.
  22. cmake_version_component()
  23. {
  24. sed -n "
  25. /^set(CMake_VERSION_${1}/ {s/set(CMake_VERSION_${1} *\([0-9]*\)).*/\1/;p;}
  26. " "${cmake_source_dir}/Source/CMakeVersion.cmake"
  27. }
  28. # Install destination extraction function.
  29. cmake_install_dest_default()
  30. {
  31. sed -n '
  32. /^ *set(CMAKE_'"${1}"'_DIR_DEFAULT.*) # '"${2}"'$/ {
  33. s/^ *set(CMAKE_'"${1}"'_DIR_DEFAULT *"\([^"]*\)").*$/\1/
  34. s/${CMake_VERSION_MAJOR}/'"${cmake_version_major}"'/
  35. s/${CMake_VERSION_MINOR}/'"${cmake_version_minor}"'/
  36. s/${CMake_VERSION_PATCH}/'"${cmake_version_patch}"'/
  37. p
  38. q
  39. }
  40. ' "${cmake_source_dir}/Source/CMakeInstallDestinations.cmake"
  41. }
  42. cmake_toupper()
  43. {
  44. echo "$1" | tr '[a-z]' '[A-Z]'
  45. }
  46. # Detect system and directory information.
  47. cmake_system=`uname`
  48. cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
  49. cmake_binary_dir=`pwd`
  50. # Load version information.
  51. cmake_version_major="`cmake_version_component MAJOR`"
  52. cmake_version_minor="`cmake_version_component MINOR`"
  53. cmake_version_patch="`cmake_version_component PATCH`"
  54. cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
  55. cmake_version_rc="`cmake_version_component RC`"
  56. if test "$cmake_version_rc" != ""; then
  57. cmake_version="${cmake_version}-rc${cmake_version_rc}"
  58. fi
  59. cmake_copyright="`grep '^Copyright .* Kitware' "${cmake_source_dir}/LICENSE.rst" |
  60. sed 's/\`Contributors.*\`_/Contributors/'`"
  61. cmake_bin_dir_keyword="OTHER"
  62. cmake_data_dir_keyword="OTHER"
  63. cmake_doc_dir_keyword="OTHER"
  64. cmake_man_dir_keyword="OTHER"
  65. cmake_xdgdata_dir_keyword="OTHER"
  66. cmake_bin_dir=""
  67. cmake_data_dir=""
  68. cmake_doc_dir=""
  69. cmake_man_dir=""
  70. cmake_xdgdata_dir=""
  71. cmake_init_file=""
  72. cmake_bootstrap_system_libs=""
  73. cmake_bootstrap_qt_gui=""
  74. cmake_bootstrap_qt_qmake=""
  75. cmake_bootstrap_debugger=""
  76. cmake_sphinx_info=""
  77. cmake_sphinx_man=""
  78. cmake_sphinx_html=""
  79. cmake_sphinx_qthelp=""
  80. cmake_sphinx_latexpdf=""
  81. cmake_sphinx_build=""
  82. cmake_sphinx_flags=""
  83. # Determine whether this is a Cygwin environment.
  84. if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
  85. cmake_system_cygwin=true
  86. cmake_doc_dir_keyword="CYGWIN"
  87. cmake_man_dir_keyword="CYGWIN"
  88. else
  89. cmake_system_cygwin=false
  90. fi
  91. # Determine whether this is a MSYS environment.
  92. if echo "${cmake_system}" | grep MSYS >/dev/null 2>&1; then
  93. cmake_system_msys=true
  94. cmake_doc_dir_keyword="MSYS"
  95. cmake_man_dir_keyword="MSYS"
  96. else
  97. cmake_system_msys=false
  98. fi
  99. # Determine whether this is a MinGW environment.
  100. if echo "${cmake_system}" | grep 'MINGW' >/dev/null 2>&1; then
  101. cmake_system_mingw=true
  102. else
  103. cmake_system_mingw=false
  104. fi
  105. # Determine whether this is OS X
  106. if echo "${cmake_system}" | grep Darwin >/dev/null 2>&1; then
  107. cmake_system_darwin=true
  108. else
  109. cmake_system_darwin=false
  110. fi
  111. # Determine whether this is BeOS
  112. if echo "${cmake_system}" | grep BeOS >/dev/null 2>&1; then
  113. cmake_system_beos=true
  114. cmake_doc_dir_keyword="HAIKU"
  115. cmake_man_dir_keyword="HAIKU"
  116. else
  117. cmake_system_beos=false
  118. fi
  119. # Determine whether this is Haiku
  120. if echo "${cmake_system}" | grep Haiku >/dev/null 2>&1; then
  121. cmake_system_haiku=true
  122. cmake_doc_dir_keyword="HAIKU"
  123. cmake_man_dir_keyword="HAIKU"
  124. else
  125. cmake_system_haiku=false
  126. fi
  127. # Determine whether this is OpenVMS
  128. if echo "${cmake_system}" | grep OpenVMS >/dev/null 2>&1; then
  129. cmake_system_openvms=true
  130. else
  131. cmake_system_openvms=false
  132. fi
  133. # Determine whether this is HP-UX
  134. if echo "${cmake_system}" | grep HP-UX >/dev/null 2>&1; then
  135. die 'CMake no longer compiles on HP-UX. See
  136. https://gitlab.kitware.com/cmake/cmake/-/issues/17137
  137. Use CMake 3.9 or lower instead.'
  138. cmake_system_hpux=true
  139. else
  140. cmake_system_hpux=false
  141. fi
  142. # Determine whether this is AIX
  143. if echo "${cmake_system}" | grep AIX >/dev/null 2>&1; then
  144. cmake_system_aix=true
  145. else
  146. cmake_system_aix=false
  147. fi
  148. # Determine whether this is Linux
  149. if echo "${cmake_system}" | grep Linux >/dev/null 2>&1; then
  150. cmake_system_linux=true
  151. else
  152. cmake_system_linux=false
  153. fi
  154. # Determine whether this is a PA-RISC machine
  155. # This only works for Linux or HP-UX, not other PA-RISC OSs (BSD maybe?). Also
  156. # may falsely detect parisc on HP-UX m68k
  157. cmake_machine_parisc=false
  158. if ${cmake_system_linux}; then
  159. if uname -m | grep parisc >/dev/null 2>&1; then
  160. cmake_machine_parisc=true
  161. fi
  162. elif ${cmake_system_hpux}; then
  163. if uname -m | grep ia64 >/dev/null 2>&1; then : ; else
  164. cmake_machine_parisc=true
  165. fi
  166. fi
  167. # Choose the generator to use for bootstrapping.
  168. if ${cmake_system_mingw}; then
  169. # Bootstrapping from an MSYS prompt.
  170. cmake_bootstrap_generator="MSYS Makefiles"
  171. else
  172. # Bootstrapping from a standard UNIX prompt.
  173. cmake_bootstrap_generator="Unix Makefiles"
  174. fi
  175. # Choose tools and extensions for this platform.
  176. if ${cmake_system_openvms}; then
  177. _tmp="_tmp"
  178. _cmk="_cmk"
  179. _diff=`which diff`
  180. else
  181. _tmp=".tmp"
  182. _cmk=".cmk"
  183. _diff="diff"
  184. fi
  185. # Construct bootstrap directory name.
  186. cmake_bootstrap_dir="${cmake_binary_dir}/Bootstrap${_cmk}"
  187. # Helper function to fix windows paths.
  188. case "${cmake_system}" in
  189. *MINGW*)
  190. cmake_fix_slashes()
  191. {
  192. cmd //c echo "$(echo "$1" | sed 's/\\/\//g')" | sed 's/^"//;s/" *$//'
  193. }
  194. ;;
  195. *)
  196. cmake_fix_slashes()
  197. {
  198. echo "$1" | sed 's/\\/\//g'
  199. }
  200. ;;
  201. esac
  202. # Choose the default install prefix.
  203. if ${cmake_system_mingw}; then
  204. if test "x${PROGRAMFILES}" != "x"; then
  205. cmake_default_prefix=`cmake_fix_slashes "${PROGRAMFILES}/CMake"`
  206. elif test "x${ProgramFiles}" != "x"; then
  207. cmake_default_prefix=`cmake_fix_slashes "${ProgramFiles}/CMake"`
  208. elif test "x${SYSTEMDRIVE}" != "x"; then
  209. cmake_default_prefix=`cmake_fix_slashes "${SYSTEMDRIVE}/Program Files/CMake"`
  210. elif test "x${SystemDrive}" != "x"; then
  211. cmake_default_prefix=`cmake_fix_slashes "${SystemDrive}/Program Files/CMake"`
  212. else
  213. cmake_default_prefix="c:/Program Files/CMake"
  214. fi
  215. elif ${cmake_system_haiku}; then
  216. cmake_default_prefix=`finddir B_COMMON_DIRECTORY`
  217. else
  218. cmake_default_prefix="/usr/local"
  219. fi
  220. # Lookup default install destinations.
  221. cmake_bin_dir_default="`cmake_install_dest_default BIN ${cmake_bin_dir_keyword}`"
  222. cmake_data_dir_default="`cmake_install_dest_default DATA ${cmake_data_dir_keyword}`"
  223. cmake_doc_dir_default="`cmake_install_dest_default DOC ${cmake_doc_dir_keyword}`"
  224. cmake_man_dir_default="`cmake_install_dest_default MAN ${cmake_man_dir_keyword}`"
  225. cmake_xdgdata_dir_default="`cmake_install_dest_default XDGDATA ${cmake_xdgdata_dir_keyword}`"
  226. CMAKE_KNOWN_C_COMPILERS="cc gcc clang xlc icx tcc"
  227. CMAKE_KNOWN_CXX_COMPILERS="aCC xlC CC g++ clang++ c++ icpx"
  228. CMAKE_KNOWN_MAKE_PROCESSORS="gmake make smake"
  229. CMAKE_KNOWN_NINJA_PROCESSORS="ninja-build ninja samu"
  230. CMAKE_PROBLEMATIC_FILES="\
  231. CMakeCache.txt \
  232. CMakeSystem.cmake \
  233. CMakeCCompiler.cmake \
  234. CMakeCXXCompiler.cmake \
  235. */CMakeSystem.cmake \
  236. */CMakeCCompiler.cmake \
  237. */CMakeCXXCompiler.cmake \
  238. Source/cmConfigure.h \
  239. Source/CTest/Curl/config.h \
  240. Utilities/cmThirdParty.h \
  241. Utilities/cmcurl/lib/curl_config.h \
  242. Utilities/cmlibarchive/config.h \
  243. Utilities/cmliblzma/config.h \
  244. Utilities/cmnghttp2/config.h \
  245. "
  246. CMAKE_UNUSED_SOURCES="\
  247. cmGlobalXCodeGenerator \
  248. cmLocalXCodeGenerator \
  249. cmXCodeObject \
  250. cmXCode21Object \
  251. cmSourceGroup \
  252. "
  253. CMAKE_CXX_SOURCES="\
  254. cmAddCompileDefinitionsCommand \
  255. cmAddCustomCommandCommand \
  256. cmAddCustomTargetCommand \
  257. cmAddDefinitionsCommand \
  258. cmAddDependenciesCommand \
  259. cmAddExecutableCommand \
  260. cmAddLibraryCommand \
  261. cmAddSubDirectoryCommand \
  262. cmAddTestCommand \
  263. cmArgumentParser \
  264. cmBinUtilsLinker \
  265. cmBinUtilsLinuxELFGetRuntimeDependenciesTool \
  266. cmBinUtilsLinuxELFLinker \
  267. cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool \
  268. cmBinUtilsMacOSMachOGetRuntimeDependenciesTool \
  269. cmBinUtilsMacOSMachOLinker \
  270. cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool \
  271. cmBinUtilsWindowsPEGetRuntimeDependenciesTool \
  272. cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool \
  273. cmBinUtilsWindowsPELinker \
  274. cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool \
  275. cmBlockCommand \
  276. cmBreakCommand \
  277. cmBuildCommand \
  278. cmBuildDatabase \
  279. cmCMakeLanguageCommand \
  280. cmCMakeMinimumRequired \
  281. cmList \
  282. cmCMakePath \
  283. cmCMakePathCommand \
  284. cmCMakePolicyCommand \
  285. cmCPackPropertiesGenerator \
  286. cmCacheManager \
  287. cmCommands \
  288. cmCommonTargetGenerator \
  289. cmComputeComponentGraph \
  290. cmComputeLinkDepends \
  291. cmComputeLinkInformation \
  292. cmComputeTargetDepends \
  293. cmConsoleBuf \
  294. cmConditionEvaluator \
  295. cmConfigureFileCommand \
  296. cmContinueCommand \
  297. cmCoreTryCompile \
  298. cmCreateTestSourceList \
  299. cmCryptoHash \
  300. cmCustomCommand \
  301. cmCustomCommandGenerator \
  302. cmCustomCommandLines \
  303. cmCxxModuleMapper \
  304. cmCxxModuleUsageEffects \
  305. cmDefinePropertyCommand \
  306. cmDefinitions \
  307. cmDocumentationFormatter \
  308. cmELF \
  309. cmEnableLanguageCommand \
  310. cmEnableTestingCommand \
  311. cmEvaluatedTargetProperty \
  312. cmExecProgramCommand \
  313. cmExecuteProcessCommand \
  314. cmExpandedCommandArgument \
  315. cmExperimental \
  316. cmExportBuildCMakeConfigGenerator \
  317. cmExportBuildFileGenerator \
  318. cmExportCMakeConfigGenerator \
  319. cmExportFileGenerator \
  320. cmExportInstallCMakeConfigGenerator \
  321. cmExportInstallFileGenerator \
  322. cmExportSet \
  323. cmExportTryCompileFileGenerator \
  324. cmExprParserHelper \
  325. cmExternalMakefileProjectGenerator \
  326. cmFileCommand \
  327. cmFileCommand_ReadMacho \
  328. cmFileCopier \
  329. cmFileInstaller \
  330. cmFileSet \
  331. cmFileTime \
  332. cmFileTimeCache \
  333. cmFileTimes \
  334. cmFindBase \
  335. cmFindCommon \
  336. cmFindFileCommand \
  337. cmFindLibraryCommand \
  338. cmFindPackageCommand \
  339. cmFindPackageStack \
  340. cmFindPathCommand \
  341. cmFindProgramCommand \
  342. cmForEachCommand \
  343. cmFunctionBlocker \
  344. cmFunctionCommand \
  345. cmFSPermissions \
  346. cmGeneratedFileStream \
  347. cmGeneratorExpression \
  348. cmGeneratorExpressionContext \
  349. cmGeneratorExpressionDAGChecker \
  350. cmGeneratorExpressionEvaluationFile \
  351. cmGeneratorExpressionEvaluator \
  352. cmGeneratorExpressionLexer \
  353. cmGeneratorExpressionNode \
  354. cmGeneratorExpressionParser \
  355. cmGeneratorTarget \
  356. cmGeneratorTarget_CompatibleInterface \
  357. cmGeneratorTarget_IncludeDirectories \
  358. cmGeneratorTarget_Link \
  359. cmGeneratorTarget_LinkDirectories \
  360. cmGeneratorTarget_Options \
  361. cmGeneratorTarget_Sources \
  362. cmGeneratorTarget_TargetPropertyEntry \
  363. cmGeneratorTarget_TransitiveProperty \
  364. cmGetCMakePropertyCommand \
  365. cmGetDirectoryPropertyCommand \
  366. cmGetFilenameComponentCommand \
  367. cmGetPipes \
  368. cmGetPropertyCommand \
  369. cmGetSourceFilePropertyCommand \
  370. cmGetTargetPropertyCommand \
  371. cmGetTestPropertyCommand \
  372. cmGlobalCommonGenerator \
  373. cmGlobalGenerator \
  374. cmGlobVerificationManager \
  375. cmHexFileConverter \
  376. cmIfCommand \
  377. cmImportedCxxModuleInfo \
  378. cmIncludeCommand \
  379. cmIncludeGuardCommand \
  380. cmIncludeDirectoryCommand \
  381. cmIncludeRegularExpressionCommand \
  382. cmInstallCMakeConfigExportGenerator \
  383. cmInstallCommand \
  384. cmInstallCommandArguments \
  385. cmInstallCxxModuleBmiGenerator \
  386. cmInstallDirectoryGenerator \
  387. cmInstallExportGenerator \
  388. cmInstallFileSetGenerator \
  389. cmInstallFilesCommand \
  390. cmInstallFilesGenerator \
  391. cmInstallGenerator \
  392. cmInstallGetRuntimeDependenciesGenerator \
  393. cmInstallImportedRuntimeArtifactsGenerator \
  394. cmInstallRuntimeDependencySet \
  395. cmInstallRuntimeDependencySetGenerator \
  396. cmInstallScriptGenerator \
  397. cmInstallSubdirectoryGenerator \
  398. cmInstallTargetGenerator \
  399. cmInstallTargetsCommand \
  400. cmInstalledFile \
  401. cmJSONHelpers \
  402. cmJSONState \
  403. cmLDConfigLDConfigTool \
  404. cmLDConfigTool \
  405. cmLinkDirectoriesCommand \
  406. cmLinkItem \
  407. cmLinkItemGraphVisitor \
  408. cmLinkLineComputer \
  409. cmLinkLineDeviceComputer \
  410. cmListCommand \
  411. cmListFileCache \
  412. cmLocalCommonGenerator \
  413. cmLocalGenerator \
  414. cmMSVC60LinkLineComputer \
  415. cmMacroCommand \
  416. cmMakeDirectoryCommand \
  417. cmMakefile \
  418. cmMarkAsAdvancedCommand \
  419. cmMathCommand \
  420. cmMessageCommand \
  421. cmMessenger \
  422. cmNewLineStyle \
  423. cmOSXBundleGenerator \
  424. cmOptionCommand \
  425. cmOrderDirectories \
  426. cmOutputConverter \
  427. cmParseArgumentsCommand \
  428. cmPathLabel \
  429. cmPathResolver \
  430. cmPolicies \
  431. cmProcessOutput \
  432. cmProjectCommand \
  433. cmValue \
  434. cmPropertyDefinition \
  435. cmPropertyMap \
  436. cmGccDepfileLexerHelper \
  437. cmGccDepfileReader \
  438. cmReturnCommand \
  439. cmPackageInfoReader \
  440. cmPlaceholderExpander \
  441. cmPlistParser \
  442. cmRulePlaceholderExpander \
  443. cmRuntimeDependencyArchive \
  444. cmScriptGenerator \
  445. cmSearchPath \
  446. cmSeparateArgumentsCommand \
  447. cmSetCommand \
  448. cmSetDirectoryPropertiesCommand \
  449. cmSetPropertyCommand \
  450. cmSetSourceFilesPropertiesCommand \
  451. cmSetTargetPropertiesCommand \
  452. cmSetTestsPropertiesCommand \
  453. cmSiteNameCommand \
  454. cmSourceFile \
  455. cmSourceFileLocation \
  456. cmStandardLevelResolver \
  457. cmState \
  458. cmStateDirectory \
  459. cmStateSnapshot \
  460. cmString \
  461. cmStringAlgorithms \
  462. cmStringReplaceHelper \
  463. cmStringCommand \
  464. cmSubcommandTable \
  465. cmSubdirCommand \
  466. cmSystemTools \
  467. cmTarget \
  468. cmTargetCompileDefinitionsCommand \
  469. cmTargetCompileFeaturesCommand \
  470. cmTargetCompileOptionsCommand \
  471. cmTargetIncludeDirectoriesCommand \
  472. cmTargetLinkLibrariesCommand \
  473. cmTargetLinkOptionsCommand \
  474. cmTargetPrecompileHeadersCommand \
  475. cmTargetPropCommandBase \
  476. cmTargetPropertyComputer \
  477. cmTargetSourcesCommand \
  478. cmTargetTraceDependencies \
  479. cmTest \
  480. cmTestGenerator \
  481. cmTimestamp \
  482. cmTransformDepfile \
  483. cmTryCompileCommand \
  484. cmTryRunCommand \
  485. cmUnsetCommand \
  486. cmUVHandlePtr \
  487. cmUVProcessChain \
  488. cmVersion \
  489. cmWhileCommand \
  490. cmWindowsRegistry \
  491. cmWorkingDirectory \
  492. cmXcFramework \
  493. cmake \
  494. cmakemain \
  495. cmcmd \
  496. cm_fileno \
  497. "
  498. if ${cmake_system_darwin}; then
  499. CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
  500. cmMachO \
  501. "
  502. fi
  503. if ${cmake_system_mingw}; then
  504. CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES}\
  505. cmGlobalMSYSMakefileGenerator \
  506. cmGlobalMinGWMakefileGenerator \
  507. cmVSSetupHelper \
  508. "
  509. fi
  510. CMAKE_STD_CXX_HEADERS="\
  511. filesystem \
  512. memory \
  513. optional \
  514. shared_mutex \
  515. string_view \
  516. utility \
  517. "
  518. CMAKE_STD_CXX_SOURCES="\
  519. fs_path \
  520. string_view \
  521. "
  522. LexerParser_CXX_SOURCES="\
  523. cmExprLexer \
  524. cmExprParser \
  525. cmGccDepfileLexer \
  526. "
  527. LexerParser_C_SOURCES="\
  528. cmListFileLexer \
  529. "
  530. if ${cmake_system_mingw}; then
  531. KWSYS_C_SOURCES="\
  532. EncodingC \
  533. ProcessWin32 \
  534. String \
  535. System \
  536. Terminal"
  537. else
  538. KWSYS_C_SOURCES="\
  539. EncodingC \
  540. ProcessUNIX \
  541. String \
  542. System \
  543. Terminal"
  544. fi
  545. KWSYS_CXX_SOURCES="\
  546. Directory \
  547. EncodingCXX \
  548. FStream \
  549. Glob \
  550. RegularExpression \
  551. Status \
  552. SystemTools"
  553. KWSYS_FILES="\
  554. Directory.hxx \
  555. Encoding.h \
  556. Encoding.hxx \
  557. FStream.hxx \
  558. Glob.hxx \
  559. Process.h \
  560. RegularExpression.hxx \
  561. Status.hxx \
  562. String.h \
  563. System.h \
  564. SystemTools.hxx \
  565. Terminal.h"
  566. LIBRHASH_C_SOURCES="\
  567. librhash/algorithms.c \
  568. librhash/byte_order.c \
  569. librhash/hex.c \
  570. librhash/md5.c \
  571. librhash/rhash.c \
  572. librhash/sha1.c \
  573. librhash/sha256.c \
  574. librhash/sha3.c \
  575. librhash/sha512.c \
  576. librhash/util.c \
  577. "
  578. JSONCPP_CXX_SOURCES="\
  579. src/lib_json/json_reader.cpp \
  580. src/lib_json/json_value.cpp \
  581. src/lib_json/json_writer.cpp \
  582. "
  583. if ${cmake_system_mingw}; then
  584. LIBUV_C_SOURCES="\
  585. src/fs-poll.c \
  586. src/idna.c
  587. src/inet.c \
  588. src/threadpool.c \
  589. src/strscpy.c \
  590. src/strtok.c \
  591. src/timer.c \
  592. src/uv-common.c \
  593. src/win/async.c \
  594. src/win/core.c \
  595. src/win/detect-wakeup.c \
  596. src/win/dl.c \
  597. src/win/error.c \
  598. src/win/fs-event.c \
  599. src/win/fs.c \
  600. src/win/getaddrinfo.c \
  601. src/win/getnameinfo.c \
  602. src/win/handle.c \
  603. src/win/loop-watcher.c \
  604. src/win/pipe.c \
  605. src/win/poll.c \
  606. src/win/process-stdio.c \
  607. src/win/process.c \
  608. src/win/signal.c \
  609. src/win/stream.c \
  610. src/win/tcp.c \
  611. src/win/thread.c \
  612. src/win/tty.c \
  613. src/win/udp.c \
  614. src/win/util.c \
  615. src/win/winapi.c \
  616. src/win/winsock.c \
  617. "
  618. else
  619. LIBUV_C_SOURCES="\
  620. src/strscpy.c \
  621. src/strtok.c \
  622. src/timer.c \
  623. src/uv-common.c \
  624. src/unix/cmake-bootstrap.c \
  625. src/unix/core.c \
  626. src/unix/fs.c \
  627. src/unix/loop.c \
  628. src/unix/loop-watcher.c \
  629. src/unix/no-fsevents.c \
  630. src/unix/pipe.c \
  631. src/unix/poll.c \
  632. src/unix/posix-hrtime.c \
  633. src/unix/posix-poll.c \
  634. src/unix/process.c \
  635. src/unix/signal.c \
  636. src/unix/stream.c \
  637. src/unix/tcp.c \
  638. src/unix/tty.c \
  639. "
  640. fi
  641. # Display CMake bootstrap usage
  642. cmake_usage()
  643. {
  644. echo '
  645. Usage: '"$0"' [<options>...] [-- <cmake-options>...]
  646. Options: [defaults in brackets after descriptions]
  647. Configuration:
  648. --help print this message
  649. --version only print version information
  650. --verbose display more information
  651. --parallel=n bootstrap cmake in parallel, where n is
  652. number of nodes [1]
  653. --generator=<generator> generator to use (MSYS Makefiles, Unix Makefiles,
  654. or Ninja)
  655. --enable-ccache Enable ccache when building cmake
  656. --init=FILE load FILE as script to populate cache
  657. --system-libs use all system-installed third-party libraries
  658. (for use only by package maintainers)
  659. --no-system-libs use all cmake-provided third-party libraries
  660. (default)
  661. --system-cppdap use system-installed cppdap library
  662. --no-system-cppdap use cmake-provided cppdap library (default)
  663. --system-curl use system-installed curl library (default on macOS)
  664. --no-system-curl use cmake-provided curl library (default elsewhere)
  665. --system-expat use system-installed expat library
  666. --no-system-expat use cmake-provided expat library (default)
  667. --system-jsoncpp use system-installed jsoncpp library
  668. --no-system-jsoncpp use cmake-provided jsoncpp library (default)
  669. --system-zlib use system-installed zlib library
  670. --no-system-zlib use cmake-provided zlib library (default)
  671. --system-bzip2 use system-installed bzip2 library
  672. --no-system-bzip2 use cmake-provided bzip2 library (default)
  673. --system-liblzma use system-installed liblzma library
  674. --no-system-liblzma use cmake-provided liblzma library (default)
  675. --system-nghttp2 use system-installed nghttp2 library
  676. --no-system-nghttp2 use cmake-provided nghttp2 library (default)
  677. --system-zstd use system-installed zstd library
  678. --no-system-zstd use cmake-provided zstd library (default)
  679. --system-libarchive use system-installed libarchive library
  680. --no-system-libarchive use cmake-provided libarchive library (default)
  681. --system-librhash use system-installed librhash library
  682. --no-system-librhash use cmake-provided librhash library (default)
  683. --system-libuv use system-installed libuv library
  684. --no-system-libuv use cmake-provided libuv library (default)
  685. --bootstrap-system-libuv use system-installed libuv library for bootstrap
  686. --bootstrap-system-jsoncpp use system-installed jsoncpp library for bootstrap
  687. --bootstrap-system-librhash use system-installed librhash library for bootstrap
  688. --qt-gui build the Qt-based GUI (requires Qt >= 4.2)
  689. --no-qt-gui do not build the Qt-based GUI (default)
  690. --qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
  691. --debugger enable debugger support (default if supported)
  692. --no-debugger disable debugger support
  693. --sphinx-info build Info manual with Sphinx
  694. --sphinx-man build man pages with Sphinx
  695. --sphinx-html build html help with Sphinx
  696. --sphinx-qthelp build qch help with Sphinx
  697. --sphinx-latexpdf build PDF with Sphinx using LaTeX
  698. --sphinx-build=<sb> use <sb> as the sphinx-build executable
  699. --sphinx-flags=<flags> pass <flags> to sphinx-build executable
  700. Directory and file names:
  701. --prefix=PREFIX install files in tree rooted at PREFIX
  702. ['"${cmake_default_prefix}"']
  703. --bindir=DIR install binaries in PREFIX/DIR
  704. ['"${cmake_bin_dir_default}"']
  705. --datadir=DIR install data files in PREFIX/DIR
  706. ['"${cmake_data_dir_default}"']
  707. --docdir=DIR install documentation files in PREFIX/DIR
  708. ['"${cmake_doc_dir_default}"']
  709. --mandir=DIR install man pages files in PREFIX/DIR/manN
  710. ['"${cmake_man_dir_default}"']
  711. --xdgdatadir=DIR install XDG specific files in PREFIX/DIR
  712. ['"${cmake_xdgdata_dir_default}"']
  713. '
  714. exit 10
  715. }
  716. # Display CMake bootstrap usage
  717. cmake_version_display()
  718. {
  719. echo "CMake ${cmake_version}, ${cmake_copyright}"
  720. }
  721. # Display CMake bootstrap error, display the log file and exit
  722. cmake_error()
  723. {
  724. res=$1
  725. shift 1
  726. echo "---------------------------------------------"
  727. echo "Error when bootstrapping CMake:"
  728. echo "$*"
  729. echo "---------------------------------------------"
  730. if test -f cmake_bootstrap.log; then
  731. echo "Log of errors: `pwd`/cmake_bootstrap.log"
  732. #cat cmake_bootstrap.log
  733. echo "---------------------------------------------"
  734. fi
  735. exit ${res}
  736. }
  737. cmake_generate_file_tmp ()
  738. {
  739. OUTFILE="$1"
  740. TMPFILE="$2"
  741. if "${_diff}" "$TMPFILE" "$OUTFILE" > /dev/null 2> /dev/null ; then
  742. rm -f "$TMPFILE"
  743. else
  744. mv -f "$TMPFILE" "$OUTFILE"
  745. fi
  746. }
  747. cmake_generate_file ()
  748. {
  749. OUTFILE="$1"
  750. CONTENT="$2"
  751. echo "$CONTENT" > "$OUTFILE.tmp"
  752. cmake_generate_file_tmp "$OUTFILE" "$OUTFILE.tmp"
  753. }
  754. # Replace KWSYS_NAMESPACE with cmsys
  755. cmake_replace_string ()
  756. {
  757. INFILE="$1"
  758. OUTFILE="$2"
  759. SEARCHFOR="$3"
  760. REPLACEWITH="$4"
  761. if test -f "${INFILE}" || ${cmake_system_openvms}; then
  762. sed "s/\@${SEARCHFOR}\@/${REPLACEWITH}/g" "${INFILE}" > "${OUTFILE}${_tmp}"
  763. if test -f "${OUTFILE}${_tmp}"; then
  764. if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
  765. #echo "Files are the same"
  766. rm -f "${OUTFILE}${_tmp}"
  767. else
  768. mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
  769. fi
  770. fi
  771. else
  772. cmake_error 1 "Cannot find file ${INFILE}"
  773. fi
  774. }
  775. cmake_kwsys_config_replace_string ()
  776. {
  777. INFILE="$1"
  778. OUTFILE="$2"
  779. shift 2
  780. APPEND="$*"
  781. if test -f "${INFILE}" || ${cmake_system_openvms}; then
  782. echo "${APPEND}" > "${OUTFILE}${_tmp}"
  783. sed "/./ {s/\@KWSYS_NAMESPACE\@/cmsys/g;
  784. s/@KWSYS_BUILD_SHARED@/${KWSYS_BUILD_SHARED}/g;
  785. s/@KWSYS_LFS_AVAILABLE@/${KWSYS_LFS_AVAILABLE}/g;
  786. s/@KWSYS_LFS_REQUESTED@/${KWSYS_LFS_REQUESTED}/g;
  787. s/@KWSYS_NAME_IS_KWSYS@/${KWSYS_NAME_IS_KWSYS}/g;
  788. s/@KWSYS_STL_HAS_WSTRING@/${KWSYS_STL_HAS_WSTRING}/g;
  789. s/@KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@/${KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H}/g;
  790. }" "${INFILE}" >> "${OUTFILE}${_tmp}"
  791. if test -f "${OUTFILE}${_tmp}"; then
  792. if "${_diff}" "${OUTFILE}" "${OUTFILE}${_tmp}" > /dev/null 2> /dev/null ; then
  793. #echo "Files are the same"
  794. rm -f "${OUTFILE}${_tmp}"
  795. else
  796. mv -f "${OUTFILE}${_tmp}" "${OUTFILE}"
  797. fi
  798. fi
  799. else
  800. cmake_error 2 "Cannot find file ${INFILE}"
  801. fi
  802. }
  803. # Write string into a file
  804. cmake_report ()
  805. {
  806. FILE=$1
  807. shift
  808. echo "$*" >> ${FILE}
  809. }
  810. # Escape spaces in strings for artifacts
  811. cmake_escape_artifact ()
  812. {
  813. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  814. echo $1 | sed "s/ /$ /g"
  815. else
  816. echo $1 | sed "s/ /\\\\ /g"
  817. fi
  818. }
  819. # Escape spaces in strings for shell
  820. cmake_escape_shell ()
  821. {
  822. echo $1 | sed "s/ /\\\\ /g"
  823. }
  824. # Encode object file names.
  825. cmake_obj ()
  826. {
  827. echo $1 | sed 's/\//-/g' | sed 's/$/\.o/'
  828. }
  829. # Strip prefix from argument
  830. cmake_arg ()
  831. {
  832. echo "$1" | sed "s/^${2-[^=]*=}//"
  833. }
  834. # Write message to the log
  835. cmake_log ()
  836. {
  837. echo "$*" >> cmake_bootstrap.log
  838. }
  839. # Return temp file
  840. cmake_tmp_file ()
  841. {
  842. echo "cmake_bootstrap_$$_test"
  843. }
  844. # Run a compiler test. First argument is compiler, second one are compiler
  845. # flags, third one is test source file to be compiled
  846. cmake_try_run ()
  847. {
  848. COMPILER=$1
  849. FLAGS=$2
  850. TESTFILE=$3
  851. if test ! -f "${TESTFILE}"; then
  852. echo "Test file ${TESTFILE} missing. Please verify your CMake source tree."
  853. exit 4
  854. fi
  855. TMPFILE=`cmake_tmp_file`
  856. echo "Try: ${COMPILER}"
  857. echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
  858. echo "---------- file -----------------------"
  859. cat "${TESTFILE}"
  860. echo "------------------------------------------"
  861. ${COMPILER} ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
  862. RES=$?
  863. if test "${RES}" -ne "0"; then
  864. echo "Test failed to compile"
  865. return 1
  866. fi
  867. if test ! -f "${TMPFILE}" && test ! -f "${TMPFILE}.exe"; then
  868. echo "Test failed to produce executable"
  869. return 2
  870. fi
  871. ./${TMPFILE}
  872. RES=$?
  873. rm -f "${TMPFILE}"
  874. if test "${RES}" -ne "0"; then
  875. echo "Test produced non-zero return code"
  876. return 3
  877. fi
  878. echo "Test succeeded"
  879. return 0
  880. }
  881. # Run a make test. First argument is the make interpreter.
  882. cmake_try_make ()
  883. {
  884. MAKE_PROC="$1"
  885. MAKE_FLAGS="$2"
  886. echo "Try: ${MAKE_PROC}"
  887. "${MAKE_PROC}" ${MAKE_FLAGS}
  888. RES=$?
  889. if test "${RES}" -ne "0"; then
  890. echo "${MAKE_PROC} does not work"
  891. return 1
  892. fi
  893. if test ! -f "test" && test ! -f "test.exe"; then
  894. echo "${COMPILER} does not produce output"
  895. return 2
  896. fi
  897. ./test
  898. RES=$?
  899. rm -f "test"
  900. if test "${RES}" -ne "0"; then
  901. echo "${MAKE_PROC} produces strange executable"
  902. return 3
  903. fi
  904. echo "${MAKE_PROC} works"
  905. return 0
  906. }
  907. # Parse arguments
  908. cmake_verbose=
  909. cmake_parallel_make=
  910. cmake_ccache_enabled=
  911. cmake_prefix_dir="${cmake_default_prefix}"
  912. bootstrap_system_libuv=
  913. bootstrap_system_jsoncpp=
  914. bootstrap_system_librhash=
  915. while test $# != 0; do
  916. case "$1" in
  917. --prefix=*) dir=`cmake_arg "$1"`
  918. cmake_prefix_dir=`cmake_fix_slashes "$dir"` ;;
  919. --parallel=*) cmake_parallel_make=`cmake_arg "$1"` ;;
  920. --generator=*) cmake_bootstrap_generator=`cmake_arg "$1"` ;;
  921. --bindir=*) cmake_bin_dir=`cmake_arg "$1"` ;;
  922. --datadir=*) cmake_data_dir=`cmake_arg "$1"` ;;
  923. --docdir=*) cmake_doc_dir=`cmake_arg "$1"` ;;
  924. --mandir=*) cmake_man_dir=`cmake_arg "$1"` ;;
  925. --xdgdatadir=*) cmake_xdgdata_dir=`cmake_arg "$1"` ;;
  926. --init=*) cmake_init_file=`cmake_arg "$1"` ;;
  927. --system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=1" ;;
  928. --no-system-libs) cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARIES=0" ;;
  929. --system-bzip2|--system-cppdap|--system-curl|--system-expat|--system-jsoncpp|--system-libarchive|--system-librhash|--system-zlib|--system-liblzma|--system-nghttp2|--system-zstd|--system-libuv)
  930. lib=`cmake_arg "$1" "--system-"`
  931. cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=1" ;;
  932. --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)
  933. lib=`cmake_arg "$1" "--no-system-"`
  934. cmake_bootstrap_system_libs="${cmake_bootstrap_system_libs} -DCMAKE_USE_SYSTEM_LIBRARY_`cmake_toupper $lib`=0" ;;
  935. --bootstrap-system-libuv) bootstrap_system_libuv="1" ;;
  936. --bootstrap-system-jsoncpp) bootstrap_system_jsoncpp="1" ;;
  937. --bootstrap-system-librhash) bootstrap_system_librhash="1" ;;
  938. --qt-gui) cmake_bootstrap_qt_gui="1" ;;
  939. --no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
  940. --qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
  941. --debugger) cmake_bootstrap_debugger="1" ;;
  942. --no-debugger) cmake_bootstrap_debugger="0" ;;
  943. --sphinx-info) cmake_sphinx_info="1" ;;
  944. --sphinx-man) cmake_sphinx_man="1" ;;
  945. --sphinx-html) cmake_sphinx_html="1" ;;
  946. --sphinx-qthelp) cmake_sphinx_qthelp="1" ;;
  947. --sphinx-latexpdf) cmake_sphinx_latexpdf="1" ;;
  948. --sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
  949. --sphinx-flags=*) cmake_sphinx_flags=`cmake_arg "$1"` ;;
  950. --help) cmake_usage ;;
  951. --version) cmake_version_display ; exit 2 ;;
  952. --verbose) cmake_verbose=TRUE ;;
  953. --enable-ccache) cmake_ccache_enabled=TRUE ;;
  954. CC=*) CC=`cmake_arg "$1"` ;;
  955. CXX=*) CXX=`cmake_arg "$1"` ;;
  956. CFLAGS=*) CFLAGS=`cmake_arg "$1"` ;;
  957. CXXFLAGS=*) CXXFLAGS=`cmake_arg "$1"` ;;
  958. LDFLAGS=*) LDFLAGS=`cmake_arg "$1"` ;;
  959. --) shift; break ;;
  960. *) die "Unknown option: $1" ;;
  961. esac
  962. shift
  963. done
  964. # Make sure the generator is valid
  965. case "${cmake_bootstrap_generator}" in
  966. 'MSYS Makefiles'|'Unix Makefiles'|'Ninja') ;;
  967. *) cmake_error 10 "Invalid generator: ${cmake_bootstrap_generator}"
  968. esac
  969. # If verbose, display some information about bootstrap
  970. if test -n "${cmake_verbose}"; then
  971. echo "---------------------------------------------"
  972. echo "Source directory: ${cmake_source_dir}"
  973. echo "Binary directory: ${cmake_binary_dir}"
  974. echo "Prefix directory: ${cmake_prefix_dir}"
  975. echo "System: ${cmake_system}"
  976. echo "Generator: ${cmake_bootstrap_generator}"
  977. if test "x${cmake_parallel_make}" != "x"; then
  978. echo "Doing parallel make: ${cmake_parallel_make}"
  979. fi
  980. echo ""
  981. fi
  982. echo "---------------------------------------------"
  983. # Get CMake version
  984. echo "`cmake_version_display`"
  985. # Check for in-source build
  986. cmake_in_source_build=
  987. if test -f "${cmake_binary_dir}/Source/cmake.cxx" &&
  988. test -f "${cmake_binary_dir}/Source/cmake.h"; then
  989. if test -n "${cmake_verbose}"; then
  990. echo "Warning: This is an in-source build"
  991. fi
  992. cmake_in_source_build=TRUE
  993. fi
  994. # If this is not an in-source build, then Bootstrap stuff should not exist.
  995. if test -z "${cmake_in_source_build}"; then
  996. # Did somebody bootstrap in the source tree?
  997. if test -d "${cmake_source_dir}/Bootstrap${_cmk}"; then
  998. cmake_error 10 "Found directory \"${cmake_source_dir}/Bootstrap${_cmk}\".
  999. Looks like somebody did bootstrap CMake in the source tree, but now you are
  1000. trying to do bootstrap in the binary tree. Please remove Bootstrap${_cmk}
  1001. directory from the source tree."
  1002. fi
  1003. # Is there a cache in the source tree?
  1004. for cmake_problematic_file in ${CMAKE_PROBLEMATIC_FILES}; do
  1005. if test -f "${cmake_source_dir}/${cmake_problematic_file}"; then
  1006. cmake_error 10 "Found \"${cmake_source_dir}/${cmake_problematic_file}\".
  1007. Looks like somebody tried to build CMake in the source tree, but now you are
  1008. trying to do bootstrap in the binary tree. Please remove \"${cmake_problematic_file}\"
  1009. from the source tree."
  1010. fi
  1011. done
  1012. fi
  1013. # Make bootstrap directory
  1014. test -d "${cmake_bootstrap_dir}" || mkdir "${cmake_bootstrap_dir}"
  1015. if test ! -d "${cmake_bootstrap_dir}"; then
  1016. cmake_error 3 "Cannot create directory ${cmake_bootstrap_dir} to bootstrap CMake."
  1017. fi
  1018. cd "${cmake_bootstrap_dir}"
  1019. test -d "cmsys" || mkdir "cmsys"
  1020. if test ! -d "cmsys"; then
  1021. cmake_error 4 "Cannot create directory ${cmake_bootstrap_dir}/cmsys"
  1022. fi
  1023. # Delete all the bootstrap files
  1024. rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
  1025. rm -f "${cmake_bootstrap_dir}/cmConfigure.h${_tmp}"
  1026. rm -f "${cmake_bootstrap_dir}/cmVersionConfig.h${_tmp}"
  1027. # If building in-source, remove any cmConfigure.h that may
  1028. # have been created by a previous run of the bootstrap cmake.
  1029. if test -n "${cmake_in_source_build}"; then
  1030. rm -f "${cmake_source_dir}/Source/cmConfigure.h"
  1031. fi
  1032. # If exist compiler flags, set them
  1033. cmake_c_flags=${CFLAGS}
  1034. cmake_cxx_flags=${CXXFLAGS}
  1035. cmake_ld_flags=${LDFLAGS}
  1036. # Add generator-specific files
  1037. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1038. CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
  1039. cmFortranParserImpl \
  1040. cmGlobalNinjaGenerator \
  1041. cmLocalNinjaGenerator \
  1042. cmNinjaLinkLineComputer \
  1043. cmNinjaLinkLineDeviceComputer \
  1044. cmNinjaNormalTargetGenerator \
  1045. cmNinjaTargetGenerator \
  1046. cmNinjaUtilityTargetGenerator \
  1047. "
  1048. LexerParser_CXX_SOURCES="${LexerParser_CXX_SOURCES} \
  1049. cmFortranLexer \
  1050. cmFortranParser \
  1051. "
  1052. else
  1053. CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
  1054. cmDepends \
  1055. cmDependsC \
  1056. cmDependsCompiler \
  1057. cmGlobalUnixMakefileGenerator3 \
  1058. cmLocalUnixMakefileGenerator3 \
  1059. cmMakefileExecutableTargetGenerator \
  1060. cmMakefileLibraryTargetGenerator \
  1061. cmMakefileTargetGenerator \
  1062. cmMakefileUtilityTargetGenerator \
  1063. cmProcessTools \
  1064. "
  1065. fi
  1066. # Add Cygwin-specific flags
  1067. if ${cmake_system_cygwin} || ${cmake_system_msys}; then
  1068. cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
  1069. fi
  1070. # Add CoreFoundation framework on Darwin
  1071. if ${cmake_system_darwin}; then
  1072. cmake_ld_flags="${LDFLAGS} -framework CoreFoundation"
  1073. fi
  1074. # Add BeOS toolkits...
  1075. if ${cmake_system_beos}; then
  1076. cmake_ld_flags="${LDFLAGS} -lroot -lbe"
  1077. fi
  1078. # Add Haiku toolkits...
  1079. if ${cmake_system_haiku}; then
  1080. cmake_ld_flags="${LDFLAGS} -lroot -lbe"
  1081. fi
  1082. # Add AIX arch-specific link flags.
  1083. if ${cmake_system_aix}; then
  1084. if uname -p | grep powerpc >/dev/null 2>&1; then
  1085. cmake_ld_flags="${LDFLAGS} -Wl,-bbigtoc"
  1086. fi
  1087. fi
  1088. #-----------------------------------------------------------------------------
  1089. # Detect known toolchains on some platforms.
  1090. cmake_toolchains=''
  1091. case "${cmake_system}" in
  1092. *AIX*) cmake_toolchains='XL GNU' ;;
  1093. *CYGWIN*) cmake_toolchains='GNU' ;;
  1094. *MSYS*) cmake_toolchains='GNU' ;;
  1095. *Darwin*) cmake_toolchains='Clang GNU' ;;
  1096. *Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
  1097. *MINGW*) cmake_toolchains='GNU' ;;
  1098. esac
  1099. # Toolchain compiler name table.
  1100. cmake_toolchain_Clang_CC='clang'
  1101. cmake_toolchain_Clang_CXX='clang++'
  1102. cmake_toolchain_GNU_CC='gcc'
  1103. cmake_toolchain_GNU_CXX='g++'
  1104. cmake_toolchain_PGI_CC='pgcc'
  1105. cmake_toolchain_PGI_CXX='pgCC'
  1106. cmake_toolchain_PathScale_CC='pathcc'
  1107. cmake_toolchain_PathScale_CXX='pathCC'
  1108. cmake_toolchain_XL_CC='xlc'
  1109. cmake_toolchain_XL_CXX='xlC'
  1110. cmake_toolchain_try()
  1111. {
  1112. tc="$1"
  1113. TMPFILE=`cmake_tmp_file`
  1114. eval "tc_CC=\${cmake_toolchain_${tc}_CC}"
  1115. echo 'int main() { return 0; }' > "${TMPFILE}.c"
  1116. cmake_try_run "$tc_CC" "" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1
  1117. tc_result_CC="$?"
  1118. rm -f "${TMPFILE}.c"
  1119. test "${tc_result_CC}" = "0" || return 1
  1120. eval "tc_CXX=\${cmake_toolchain_${tc}_CXX}"
  1121. echo 'int main() { return 0; }' > "${TMPFILE}.cpp"
  1122. cmake_try_run "$tc_CXX" "" "${TMPFILE}.cpp" >> cmake_bootstrap.log 2>&1
  1123. tc_result_CXX="$?"
  1124. rm -f "${TMPFILE}.cpp"
  1125. test "${tc_result_CXX}" = "0" || return 1
  1126. cmake_toolchain="$tc"
  1127. }
  1128. cmake_toolchain_detect()
  1129. {
  1130. cmake_toolchain=
  1131. for tc in ${cmake_toolchains}; do
  1132. echo "Checking for $tc toolchain" >> cmake_bootstrap.log 2>&1
  1133. cmake_toolchain_try "$tc" &&
  1134. echo "Found $tc toolchain" &&
  1135. break
  1136. done
  1137. }
  1138. if test -z "${CC}" && test -z "${CXX}"; then
  1139. cmake_toolchain_detect
  1140. fi
  1141. thread_flags=''
  1142. case "${cmake_system}" in
  1143. *AIX*) thread_flags='-pthread' ;;
  1144. esac
  1145. #-----------------------------------------------------------------------------
  1146. # Test C compiler
  1147. cmake_c_compiler=
  1148. # If CC is set, use that for compiler, otherwise use list of known compilers
  1149. if test -n "${cmake_toolchain}"; then
  1150. eval cmake_c_compilers="\${cmake_toolchain_${cmake_toolchain}_CC}"
  1151. else
  1152. cmake_c_compilers="${CMAKE_KNOWN_C_COMPILERS}"
  1153. fi
  1154. cmake_c_compiler_try_set()
  1155. {
  1156. test_compiler="$1"
  1157. test_thread_flags="$2"
  1158. # Check if C compiler works
  1159. TMPFILE=`cmake_tmp_file`
  1160. echo '
  1161. #ifdef __cplusplus
  1162. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  1163. #endif
  1164. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  1165. #error "On AIX with GNU we need the -pthread flag."
  1166. #endif
  1167. #if defined(__sun) && __STDC_VERSION__ < 199901L
  1168. #error "On Solaris we need C99."
  1169. #endif
  1170. #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
  1171. #error "On HP-UX we need GCC 4.9 or higher."
  1172. #endif
  1173. #include <stdio.h>
  1174. int main(int argc, char* argv[])
  1175. {
  1176. printf("%d%c", (argv != 0), (char)0x0a);
  1177. return argc - 1;
  1178. }
  1179. ' > "${TMPFILE}.c"
  1180. for std in 11 99 90; do
  1181. std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`"
  1182. for std_flag in '' $std_flags; do
  1183. for thread_flag in '' $test_thread_flags; do
  1184. echo "Checking whether '${test_compiler} ${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
  1185. if cmake_try_run "${test_compiler}" "${cmake_c_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \
  1186. "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then
  1187. cmake_c_compiler="${test_compiler}"
  1188. cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}"
  1189. rm -f "${TMPFILE}.c"
  1190. return 0
  1191. fi
  1192. done
  1193. done
  1194. done
  1195. rm -f "${TMPFILE}.c"
  1196. return 1
  1197. }
  1198. if test -n "${CC}"; then
  1199. cmake_c_compiler_try_set "${CC}" "${thread_flags}"
  1200. else
  1201. for compiler in ${cmake_c_compilers}; do
  1202. if cmake_c_compiler_try_set "${compiler}" "${thread_flags}"; then
  1203. break
  1204. fi
  1205. done
  1206. fi
  1207. if test -z "${cmake_c_compiler}"; then
  1208. cmake_error 6 "Cannot find appropriate C compiler on this system.
  1209. Please specify one using environment variable CC.
  1210. See cmake_bootstrap.log for compilers attempted.
  1211. "
  1212. fi
  1213. echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
  1214. #-----------------------------------------------------------------------------
  1215. # Test CXX compiler
  1216. cmake_cxx_compiler=
  1217. # On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
  1218. # If CC is set, use that for compiler, otherwise use list of known compilers
  1219. if test -n "${cmake_toolchain}"; then
  1220. eval cmake_cxx_compilers="\${cmake_toolchain_${cmake_toolchain}_CXX}"
  1221. else
  1222. cmake_cxx_compilers="${CMAKE_KNOWN_CXX_COMPILERS}"
  1223. fi
  1224. # Check if C++ compiler works
  1225. cmake_cxx_compiler_try_set()
  1226. {
  1227. test_compiler="$1"
  1228. test_thread_flags="$2"
  1229. TMPFILE=`cmake_tmp_file`
  1230. echo '
  1231. #include <iostream>
  1232. #include <memory>
  1233. #include <unordered_map>
  1234. #if __cplusplus < 201103L
  1235. #error "Compiler is not in a mode aware of C++11."
  1236. #endif
  1237. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  1238. #error "On AIX with GNU we need the -pthread flag."
  1239. #endif
  1240. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  1241. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  1242. #endif
  1243. #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
  1244. #error "On HP-UX we need GCC 4.9 or higher."
  1245. #endif
  1246. #if __cplusplus > 201103L
  1247. #include <iterator>
  1248. int check_cxx14()
  1249. {
  1250. int a[] = { 0, 1, 2 };
  1251. auto ai = std::cbegin(a);
  1252. int b[] = { 2, 1, 0 };
  1253. auto bi = std::cend(b);
  1254. return *ai + *(bi - 1);
  1255. }
  1256. #else
  1257. int check_cxx14()
  1258. {
  1259. return 0;
  1260. }
  1261. #endif
  1262. #if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
  1263. #include <optional>
  1264. template <typename T,
  1265. typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
  1266. typename T::pointer get_ptr(T& item)
  1267. {
  1268. return item.get();
  1269. }
  1270. int check_cxx17()
  1271. {
  1272. // Intel compiler do not handle correctly 'decltype' inside 'invoke_result'
  1273. std::unique_ptr<int> u(new int(0));
  1274. get_ptr(u);
  1275. std::optional<int> oi = 0;
  1276. return oi.value();
  1277. }
  1278. #else
  1279. int check_cxx17()
  1280. {
  1281. return 0;
  1282. }
  1283. #endif
  1284. class Class
  1285. {
  1286. public:
  1287. int Get() const { return this->Member; }
  1288. private:
  1289. int Member = 1;
  1290. };
  1291. int main()
  1292. {
  1293. auto const c = std::unique_ptr<Class>(new Class);
  1294. std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
  1295. return 0;
  1296. }
  1297. ' > "${TMPFILE}.cxx"
  1298. for std in 17 14 11; do
  1299. std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`"
  1300. for std_flag in '' $std_flags; do
  1301. for thread_flag in '' $test_thread_flags; do
  1302. echo "Checking whether '${test_compiler} ${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1
  1303. if cmake_try_run "${test_compiler}" "${cmake_cxx_flags} ${cmake_ld_flags} ${std_flag} ${thread_flag}" \
  1304. "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
  1305. cmake_cxx_compiler="${test_compiler}"
  1306. cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} "
  1307. rm -f "${TMPFILE}.cxx"
  1308. return 0
  1309. fi
  1310. done
  1311. done
  1312. done
  1313. rm -f "${TMPFILE}.cxx"
  1314. return 1
  1315. }
  1316. if test -n "${CXX}"; then
  1317. cmake_cxx_compiler_try_set "${CXX}" "${thread_flags}"
  1318. else
  1319. for compiler in ${cmake_cxx_compilers}; do
  1320. if cmake_cxx_compiler_try_set "${compiler}" "${thread_flags}"; then
  1321. break
  1322. fi
  1323. done
  1324. fi
  1325. if test -z "${cmake_cxx_compiler}"; then
  1326. cmake_error 7 "Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
  1327. Please specify one using environment variable CXX.
  1328. The C++ flags are \"$cmake_cxx_flags\".
  1329. They can be changed using the environment variable CXXFLAGS.
  1330. See cmake_bootstrap.log for compilers attempted."
  1331. fi
  1332. echo "C++ compiler on this system is: ${cmake_cxx_compiler} ${cmake_cxx_flags}"
  1333. #-----------------------------------------------------------------------------
  1334. # Test CXX features
  1335. cmake_cxx_features="make_unique filesystem"
  1336. for feature in ${cmake_cxx_features}; do
  1337. eval "cmake_have_cxx_${feature}=0"
  1338. echo "Checking whether '${cmake_cxx_compiler} ${cmake_cxx_flags} ${cmake_ld_flags}' supports '${feature}'." >> cmake_bootstrap.log 2>&1
  1339. if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags} ${cmake_ld_flags}" \
  1340. "${cmake_source_dir}/Source/Checks/cm_cxx_${feature}.cxx" >> cmake_bootstrap.log 2>&1; then
  1341. eval "cmake_have_cxx_${feature}=1"
  1342. fi
  1343. done
  1344. cmake_have_cxx_features=""
  1345. for feature in ${cmake_cxx_features}; do
  1346. feature_variable="cmake_have_cxx_${feature}"
  1347. eval "feature_value=\${${feature_variable}}"
  1348. if test "${feature_value}" -eq "1"; then
  1349. cmake_have_cxx_features="${cmake_have_cxx_features} -DCMake_HAVE_CXX_`cmake_toupper ${feature}`=${feature_value}"
  1350. fi
  1351. done
  1352. cmake_generate_file "${cmake_bootstrap_dir}/cmSTL.hxx" ""
  1353. #-----------------------------------------------------------------------------
  1354. # Test Make
  1355. cmake_make_processor=
  1356. cmake_make_flags=
  1357. # If MAKE is set, use that for make processor, otherwise use list of known make
  1358. if test -n "${MAKE}"; then
  1359. cmake_make_processors="${MAKE}"
  1360. elif test "${cmake_bootstrap_generator}" = "Ninja"; then
  1361. cmake_make_processors="${CMAKE_KNOWN_NINJA_PROCESSORS}"
  1362. else
  1363. cmake_make_processors="${CMAKE_KNOWN_MAKE_PROCESSORS}"
  1364. fi
  1365. tab="`printf '\t'`"
  1366. TMPFILE="`cmake_tmp_file`_dir"
  1367. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  1368. mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
  1369. cd "${cmake_bootstrap_dir}/${TMPFILE}"
  1370. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1371. echo '
  1372. rule cc
  1373. command = '"${cmake_c_compiler}"' '"${cmake_ld_flags} ${cmake_c_flags}"' -o $out $in
  1374. build test: cc test.c
  1375. '>"build.ninja"
  1376. else
  1377. echo '
  1378. test: test.c
  1379. '"${tab}${cmake_c_compiler}"' '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
  1380. '>"Makefile"
  1381. fi
  1382. echo '
  1383. #include <stdio.h>
  1384. int main(){ printf("1%c", (char)0x0a); return 0; }
  1385. ' > "test.c"
  1386. cmake_original_make_flags="${cmake_make_flags}"
  1387. if test "x${cmake_parallel_make}" != "x"; then
  1388. cmake_make_flags="${cmake_make_flags} -j ${cmake_parallel_make}"
  1389. fi
  1390. for a in ${cmake_make_processors}; do
  1391. if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
  1392. cmake_make_processor="${a}"
  1393. fi
  1394. done
  1395. cmake_full_make_flags="${cmake_make_flags}"
  1396. if test "x${cmake_original_make_flags}" != "x${cmake_make_flags}"; then
  1397. if test -z "${cmake_make_processor}"; then
  1398. cmake_make_flags="${cmake_original_make_flags}"
  1399. for a in ${cmake_make_processors}; do
  1400. if test -z "${cmake_make_processor}" && cmake_try_make "${a}" "${cmake_make_flags}" >> ../cmake_bootstrap.log 2>&1; then
  1401. cmake_make_processor="${a}"
  1402. fi
  1403. done
  1404. fi
  1405. fi
  1406. cd "${cmake_bootstrap_dir}"
  1407. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1408. mf_str=Ninja
  1409. else
  1410. mf_str=Makefile
  1411. fi
  1412. if test -z "${cmake_make_processor}"; then
  1413. cmake_error 8 "Cannot find appropriate ${mf_str} processor on this system.
  1414. Please specify one using environment variable MAKE."
  1415. fi
  1416. rm -rf "${cmake_bootstrap_dir}/${TMPFILE}"
  1417. echo "${mf_str} processor on this system is: ${cmake_make_processor}"
  1418. if test "x${cmake_full_make_flags}" != "x${cmake_make_flags}"; then
  1419. echo "---------------------------------------------"
  1420. echo "${mf_str} processor ${cmake_make_processor} does not support parallel build"
  1421. echo "---------------------------------------------"
  1422. fi
  1423. # Test for kwsys features
  1424. KWSYS_NAME_IS_KWSYS=0
  1425. KWSYS_BUILD_SHARED=0
  1426. KWSYS_LFS_AVAILABLE=0
  1427. KWSYS_LFS_REQUESTED=0
  1428. KWSYS_STL_HAS_WSTRING=0
  1429. KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0
  1430. KWSYS_CXX_HAS_SETENV=0
  1431. KWSYS_CXX_HAS_UNSETENV=0
  1432. KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=0
  1433. KWSYS_CXX_HAS_UTIMENSAT=0
  1434. KWSYS_CXX_HAS_UTIMES=0
  1435. if cmake_try_run "${cmake_cxx_compiler}" \
  1436. "${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_SETENV" \
  1437. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1438. KWSYS_CXX_HAS_SETENV=1
  1439. echo "${cmake_cxx_compiler} has setenv"
  1440. else
  1441. echo "${cmake_cxx_compiler} does not have setenv"
  1442. fi
  1443. if cmake_try_run "${cmake_cxx_compiler}" \
  1444. "${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_UNSETENV" \
  1445. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1446. KWSYS_CXX_HAS_UNSETENV=1
  1447. echo "${cmake_cxx_compiler} has unsetenv"
  1448. else
  1449. echo "${cmake_cxx_compiler} does not have unsetenv"
  1450. fi
  1451. if cmake_try_run "${cmake_cxx_compiler}" \
  1452. "${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H" \
  1453. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1454. KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=1
  1455. echo "${cmake_cxx_compiler} has environ in stdlib.h"
  1456. else
  1457. echo "${cmake_cxx_compiler} does not have environ in stdlib.h"
  1458. fi
  1459. if cmake_try_run "${cmake_cxx_compiler}" \
  1460. "${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_STL_HAS_WSTRING" \
  1461. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1462. KWSYS_STL_HAS_WSTRING=1
  1463. echo "${cmake_cxx_compiler} has stl wstring"
  1464. else
  1465. echo "${cmake_cxx_compiler} does not have stl wstring"
  1466. fi
  1467. if cmake_try_run "${cmake_cxx_compiler}" \
  1468. "${cmake_cxx_flags} ${cmake_ld_flags} -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H" \
  1469. "${cmake_source_dir}/Source/kwsys/kwsysPlatformTestsCXX.cxx" >> cmake_bootstrap.log 2>&1; then
  1470. KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=1
  1471. echo "${cmake_cxx_compiler} has <ext/stdio_filebuf.h>"
  1472. else
  1473. echo "${cmake_cxx_compiler} does not have <ext/stdio_filebuf.h>"
  1474. fi
  1475. if test -n "${cmake_ccache_enabled}"; then
  1476. echo "Building CMake with ccache"
  1477. cmake_c_compiler="ccache ${cmake_c_compiler}"
  1478. cmake_cxx_compiler="ccache ${cmake_cxx_compiler}"
  1479. fi
  1480. # Just to be safe, let us store compiler and flags to the header file
  1481. cmake_bootstrap_version='$Revision$'
  1482. cmake_compiler_settings_comment="/*
  1483. * Generated by ${cmake_source_dir}/bootstrap
  1484. * Version: ${cmake_bootstrap_version}
  1485. *
  1486. * Source directory: ${cmake_source_dir}
  1487. * Binary directory: ${cmake_bootstrap_dir}
  1488. *
  1489. * C compiler: ${cmake_c_compiler}
  1490. * C flags: ${cmake_c_flags}
  1491. *
  1492. * C++ compiler: ${cmake_cxx_compiler}
  1493. * C++ flags: ${cmake_cxx_flags}
  1494. *
  1495. * Make: ${cmake_make_processor}
  1496. *
  1497. * Sources:
  1498. * ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES}
  1499. * STD Sources:
  1500. * ${CMAKE_STD_CXX_HEADERS} ${CMAKE_STD_CXX_SOURCES}
  1501. * LexerParser Sources:
  1502. * ${LexerParser_CXX_SOURCES} ${LexerParser_C_SOURCES}
  1503. * kwSys Sources:
  1504. * ${KWSYS_CXX_SOURCES} ${KWSYS_C_SOURCES}
  1505. * libuv Sources:
  1506. * ${LIBUV_C_SOURCES}
  1507. * jsoncpp Sources:
  1508. * ${JSONCPP_CXX_SOURCES}
  1509. * librhash Sources:
  1510. * ${LIBRHASH_C_SOURCES}
  1511. */
  1512. "
  1513. cmake_report cmConfigure.h${_tmp} "${cmake_compiler_settings_comment}"
  1514. # When bootstrapping on MinGW with MSYS we must convert the source
  1515. # directory to a windows path.
  1516. if ${cmake_system_mingw}; then
  1517. CMAKE_BOOTSTRAP_SOURCE_DIR=`cd "${cmake_source_dir}"; pwd -W`
  1518. CMAKE_BOOTSTRAP_BINARY_DIR=`cd "${cmake_binary_dir}"; pwd -W`
  1519. else
  1520. CMAKE_BOOTSTRAP_SOURCE_DIR="${cmake_source_dir}"
  1521. CMAKE_BOOTSTRAP_BINARY_DIR="${cmake_binary_dir}"
  1522. fi
  1523. # Write CMake version
  1524. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
  1525. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
  1526. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
  1527. cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
  1528. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
  1529. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
  1530. cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
  1531. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-installed\""
  1532. cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-installed\""
  1533. cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
  1534. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1535. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_NINJA"
  1536. else
  1537. cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_MAKEFILES"
  1538. fi
  1539. if ${cmake_system_darwin}; then
  1540. cmake_report cmConfigure.h${_tmp} "#define CMake_USE_MACH_PARSER"
  1541. fi
  1542. if ${cmake_system_mingw}; then
  1543. cmake_report cmConfigure.h${_tmp} "#if defined(_WIN32) && !defined(NOMINMAX)"
  1544. cmake_report cmConfigure.h${_tmp} "# define NOMINMAX"
  1545. cmake_report cmConfigure.h${_tmp} "#endif"
  1546. cmake_report cmConfigure.h${_tmp} "#if defined(_WIN32) && !defined(KWSYS_ENCODING_DEFAULT_CODEPAGE)"
  1547. cmake_report cmConfigure.h${_tmp} "# define KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8"
  1548. cmake_report cmConfigure.h${_tmp} "#endif"
  1549. fi
  1550. # Regenerate configured headers
  1551. for h in Configure VersionConfig; do
  1552. if "${_diff}" cm${h}.h cm${h}.h${_tmp} > /dev/null 2> /dev/null; then
  1553. rm -f cm${h}.h${_tmp}
  1554. else
  1555. mv -f cm${h}.h${_tmp} cm${h}.h
  1556. fi
  1557. done
  1558. # Prepare KWSYS
  1559. cmsys_header_files="cmsys/Configure.h cmsys/Configure.hxx"
  1560. cmake_kwsys_config_replace_string \
  1561. "${cmake_source_dir}/Source/kwsys/Configure.hxx.in" \
  1562. "${cmake_bootstrap_dir}/cmsys/Configure.hxx" \
  1563. "${cmake_compiler_settings_comment}"
  1564. cmake_kwsys_config_replace_string \
  1565. "${cmake_source_dir}/Source/kwsys/Configure.h.in" \
  1566. "${cmake_bootstrap_dir}/cmsys/Configure.h" \
  1567. "${cmake_compiler_settings_comment}"
  1568. for a in ${KWSYS_FILES}; do
  1569. cmake_replace_string "${cmake_source_dir}/Source/kwsys/${a}.in" \
  1570. "${cmake_bootstrap_dir}/cmsys/${a}" KWSYS_NAMESPACE cmsys
  1571. cmsys_header_files="${cmsys_header_files} cmsys/${a}"
  1572. done
  1573. echo "#pragma once" > "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
  1574. if test "x${bootstrap_system_libuv}" != "x"; then
  1575. echo "#define CMAKE_USE_SYSTEM_LIBUV" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
  1576. fi
  1577. if test "x${bootstrap_system_jsoncpp}" != "x"; then
  1578. echo "#define CMAKE_USE_SYSTEM_JSONCPP" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
  1579. fi
  1580. if test "x${bootstrap_system_librhash}" != "x"; then
  1581. echo "#define CMAKE_USE_SYSTEM_LIBRHASH" >> "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
  1582. fi
  1583. cmake_generate_file_tmp "${cmake_bootstrap_dir}/cmThirdParty.h" "${cmake_bootstrap_dir}/cmThirdParty.h.tmp"
  1584. # Generate Makefile
  1585. dep="cmConfigure.h ${cmsys_header_files}"
  1586. for h in "${cmake_source_dir}"/Source/*.hxx; do
  1587. dep="${dep} `cmake_escape_artifact \"${h}\"`"
  1588. done
  1589. for h in "${cmake_source_dir}"/Source/*.h; do
  1590. dep="${dep} `cmake_escape_artifact \"${h}\"`"
  1591. done
  1592. for h in ${CMAKE_STD_CXX_HEADERS}; do
  1593. dep="${dep} `cmake_escape_artifact \"${cmake_source_dir}\"`/Utilities/std/cm/${h}"
  1594. done
  1595. objs=""
  1596. 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
  1597. objs="${objs} ${a}.o"
  1598. done
  1599. if test "x${bootstrap_system_libuv}" = "x"; then
  1600. for a in ${LIBUV_C_SOURCES}; do
  1601. objs="${objs} uv-`cmake_obj ${a}`"
  1602. done
  1603. fi
  1604. if test "x${bootstrap_system_librhash}" = "x"; then
  1605. for a in ${LIBRHASH_C_SOURCES}; do
  1606. objs="${objs} rhash-`cmake_obj ${a}`"
  1607. done
  1608. fi
  1609. if test "x${bootstrap_system_jsoncpp}" = "x"; then
  1610. for a in ${JSONCPP_CXX_SOURCES}; do
  1611. objs="${objs} jsoncpp-`cmake_obj ${a}`"
  1612. done
  1613. fi
  1614. libs=""
  1615. uv_c_flags=""
  1616. if ${cmake_system_mingw}; then
  1617. uv_c_flags="${uv_c_flags} -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0600"
  1618. libs="${libs} -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lole32 -loleaut32 -luuid"
  1619. else
  1620. case "${cmake_system}" in
  1621. *AIX*)
  1622. uv_c_flags="${uv_c_flags} -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT"
  1623. libs="${libs} -lperfstat"
  1624. ;;
  1625. *Darwin*)
  1626. uv_c_flags="${uv_c_flags} -D_DARWIN_USE_64_BIT_INODE=1 -D_DARWIN_UNLIMITED_SELECT=1"
  1627. ;;
  1628. *HP-UX*)
  1629. uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE_EXTENDED"
  1630. ;;
  1631. *Linux*)
  1632. uv_c_flags="${uv_c_flags} -D_GNU_SOURCE"
  1633. libs="${libs} -ldl -lrt"
  1634. ;;
  1635. *kFreeBSD*)
  1636. libs="${libs} -lfreebsd-glue"
  1637. ;;
  1638. *NetBSD*)
  1639. libs="${libs} -lkvm"
  1640. ;;
  1641. *BSD*)
  1642. ;;
  1643. *SunOS*)
  1644. uv_c_flags="${uv_c_flags} -D__EXTENSIONS__ -D_XOPEN_SOURCE=600"
  1645. libs="${libs} -lkstat -lnsl -lsendfile -lsocket -lrt"
  1646. ;;
  1647. *QNX*)
  1648. uv_c_flags="${uv_c_flags} -D_XOPEN_SOURCE=700"
  1649. libs="${libs} -lsocket"
  1650. ;;
  1651. esac
  1652. fi
  1653. if test "x${bootstrap_system_libuv}" = "x"; then
  1654. uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/include"`"
  1655. if ${cmake_system_mingw}; then
  1656. uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src/win"`"
  1657. else
  1658. uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src/unix"`"
  1659. fi
  1660. uv_c_flags="${uv_c_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmlibuv/src"`"
  1661. else
  1662. if test `which pkg-config`; then
  1663. use_uv_flags="`pkg-config --cflags libuv`"
  1664. use_uv_ldflags="`pkg-config --libs libuv`"
  1665. cmake_c_flags="${cmake_c_flags} ${use_uv_flags}"
  1666. cmake_cxx_flags="${cmake_cxx_flags} ${use_uv_flags}"
  1667. else
  1668. use_uv_ldflags="-luv"
  1669. fi
  1670. libs="${libs} ${use_uv_ldflags}"
  1671. fi
  1672. librhash_c_flags="-DNO_IMPORT_EXPORT"
  1673. if test "x${bootstrap_system_librhash}" != "x"; then
  1674. if test `which pkg-config`; then
  1675. use_librhash_flags="`pkg-config --cflags librhash`"
  1676. use_librhash_ldflags="`pkg-config --libs librhash`"
  1677. cmake_c_flags="${cmake_c_flags} ${use_librhash_flags}"
  1678. cmake_cxx_flags="${cmake_cxx_flags} ${use_librhash_flags}"
  1679. else
  1680. use_librhash_ldflags="-lrhash"
  1681. fi
  1682. libs="${libs} ${use_librhash_ldflags}"
  1683. fi
  1684. jsoncpp_cxx_flags=
  1685. if test "x${bootstrap_system_jsoncpp}" = "x"; then
  1686. jsoncpp_cxx_flags="${jsoncpp_cxx_flags} `cmake_escape_shell "-I${cmake_source_dir}/Utilities/cmjsoncpp/include"`"
  1687. else
  1688. if test `which pkg-config`; then
  1689. use_jsoncpp_flags="`pkg-config --cflags jsoncpp`"
  1690. use_jsoncpp_ldflags="`pkg-config --libs jsoncpp`"
  1691. cmake_cxx_flags="${cmake_cxx_flags} ${use_jsoncpp_flags}"
  1692. else
  1693. use_jsoncpp_ldflags="-ljsoncpp"
  1694. fi
  1695. libs="${libs} ${use_jsoncpp_ldflags}"
  1696. fi
  1697. if test "x${cmake_ansi_cxx_flags}" != "x"; then
  1698. cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
  1699. fi
  1700. system_flags=''
  1701. case "${cmake_system}" in
  1702. # Ensure filesystem access uses 64-bit offsets even on 32-bit hosts.
  1703. *Linux*) system_flags='-D_FILE_OFFSET_BITS=64' ;;
  1704. esac
  1705. if test "x${system_flags}" != "x"; then
  1706. cmake_c_flags="${cmake_c_flags} ${system_flags}"
  1707. cmake_cxx_flags="${cmake_cxx_flags} ${system_flags}"
  1708. fi
  1709. if test "x${cmake_c_flags}" != "x"; then
  1710. cmake_c_flags="${cmake_c_flags} "
  1711. fi
  1712. if test "x${cmake_cxx_flags}" != "x"; then
  1713. cmake_cxx_flags="${cmake_cxx_flags} "
  1714. fi
  1715. write_source_rule() {
  1716. lang="$1"
  1717. obj="$2"
  1718. src="$3"
  1719. src_flags="$4"
  1720. if test "${lang}" = "c"; then
  1721. ninja_rule=cc
  1722. compiler="${cmake_c_compiler}"
  1723. flags="${cmake_c_flags}"
  1724. elif test "${lang}" = "cxx"; then
  1725. ninja_rule=cxx
  1726. compiler="${cmake_cxx_compiler}"
  1727. flags="${cmake_cxx_flags}"
  1728. fi
  1729. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1730. echo "build ${obj} : ${ninja_rule} ${src} | ${dep}" >> "${cmake_bootstrap_dir}/build.ninja"
  1731. echo " srcflags = ${src_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
  1732. else
  1733. echo "${obj} : ${src} ${dep}" >> "${cmake_bootstrap_dir}/Makefile"
  1734. echo "${tab}${compiler} ${flags} ${src_flags} -c ${src} -o ${obj}" >> "${cmake_bootstrap_dir}/Makefile"
  1735. fi
  1736. }
  1737. cmake_c_flags_String="-DKWSYS_STRING_C"
  1738. if ${cmake_system_mingw}; then
  1739. cmake_c_flags_EncodingC="-DKWSYS_ENCODING_DEFAULT_CODEPAGE=CP_ACP"
  1740. cmake_cxx_flags_EncodingCXX="${cmake_c_flags_EncodingC}"
  1741. cmake_cxx_flags_cmProcessOutput="${cmake_c_flags_EncodingC}"
  1742. fi
  1743. cmake_cxx_flags_SystemTools="
  1744. -DKWSYS_CXX_HAS_SETENV=${KWSYS_CXX_HAS_SETENV}
  1745. -DKWSYS_CXX_HAS_UNSETENV=${KWSYS_CXX_HAS_UNSETENV}
  1746. -DKWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H=${KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H}
  1747. -DKWSYS_CXX_HAS_UTIMENSAT=${KWSYS_CXX_HAS_UTIMENSAT}
  1748. -DKWSYS_CXX_HAS_UTIMES=${KWSYS_CXX_HAS_UTIMES}
  1749. "
  1750. cmake_c_flags="${cmake_c_flags} \
  1751. -DCMAKE_BOOTSTRAP \
  1752. -I`cmake_escape_shell \"${cmake_bootstrap_dir}\"` \
  1753. -I`cmake_escape_shell \"${cmake_source_dir}/Source\"` \
  1754. -I`cmake_escape_shell \"${cmake_source_dir}/Source/LexerParser\"` \
  1755. -I`cmake_escape_shell \"${cmake_source_dir}/Utilities\"`"
  1756. cmake_cxx_flags="${cmake_cxx_flags} \
  1757. -DCMAKE_BOOTSTRAP \
  1758. ${cmake_have_cxx_features} \
  1759. -I`cmake_escape_shell \"${cmake_bootstrap_dir}\"` \
  1760. -I`cmake_escape_shell \"${cmake_source_dir}/Source\"` \
  1761. -I`cmake_escape_shell \"${cmake_source_dir}/Source/LexerParser\"` \
  1762. -I`cmake_escape_shell \"${cmake_source_dir}/Utilities/std\"` \
  1763. -I`cmake_escape_shell \"${cmake_source_dir}/Utilities\"`"
  1764. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1765. echo "cc = ${cmake_c_compiler}" > "${cmake_bootstrap_dir}/build.ninja"
  1766. echo "cxx = ${cmake_cxx_compiler}" >> "${cmake_bootstrap_dir}/build.ninja"
  1767. echo "cflags = ${cmake_c_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
  1768. echo "cxxflags = ${cmake_cxx_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
  1769. echo "ldflags = ${cmake_ld_flags}" >> "${cmake_bootstrap_dir}/build.ninja"
  1770. echo "rule cc" >> "${cmake_bootstrap_dir}/build.ninja"
  1771. echo " command = \$cc \$cflags \$srcflags -c \$in -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
  1772. echo "rule cxx" >> "${cmake_bootstrap_dir}/build.ninja"
  1773. echo " command = \$cxx \$cxxflags \$srcflags -c \$in -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
  1774. echo "rule link" >> "${cmake_bootstrap_dir}/build.ninja"
  1775. echo " command = \$cxx \$ldflags \$cxxflags \$in \$libs -o \$out" >> "${cmake_bootstrap_dir}/build.ninja"
  1776. echo "build cmake: link ${objs}" >> "${cmake_bootstrap_dir}/build.ninja"
  1777. echo " libs = ${libs}" >> "${cmake_bootstrap_dir}/build.ninja"
  1778. else
  1779. echo "cmake: ${objs}" > "${cmake_bootstrap_dir}/Makefile"
  1780. echo "${tab}${cmake_cxx_compiler} ${cmake_ld_flags} ${cmake_cxx_flags} ${objs} ${libs} -o cmake" >> "${cmake_bootstrap_dir}/Makefile"
  1781. fi
  1782. for a in ${CMAKE_CXX_SOURCES}; do
  1783. src=`cmake_escape_artifact "${cmake_source_dir}/Source/${a}.cxx"`
  1784. src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
  1785. write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
  1786. done
  1787. for a in ${CMAKE_C_SOURCES}; do
  1788. src=`cmake_escape_artifact "${cmake_source_dir}/Source/${a}.c"`
  1789. write_source_rule "c" "${a}.o" "${src}" ""
  1790. done
  1791. for a in ${CMAKE_STD_CXX_SOURCES}; do
  1792. src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/std/cm/bits/${a}.cxx"`
  1793. src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
  1794. write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
  1795. done
  1796. for a in ${LexerParser_CXX_SOURCES}; do
  1797. src=`cmake_escape_artifact "${cmake_source_dir}/Source/LexerParser/${a}.cxx"`
  1798. src_flags=`eval echo \\${cmake_cxx_flags_\${a}}`
  1799. write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
  1800. done
  1801. for a in ${LexerParser_C_SOURCES}; do
  1802. src=`cmake_escape_artifact "${cmake_source_dir}/Source/LexerParser/${a}.c"`
  1803. write_source_rule "c" "${a}.o" "${src}" ""
  1804. done
  1805. for a in ${KWSYS_C_SOURCES}; do
  1806. src=`cmake_escape_artifact "${cmake_source_dir}/Source/kwsys/${a}.c"`
  1807. src_flags="`eval echo \\${cmake_c_flags_\${a}}` -DKWSYS_NAMESPACE=cmsys"
  1808. write_source_rule "c" "${a}.o" "${src}" "${src_flags}"
  1809. done
  1810. for a in ${KWSYS_CXX_SOURCES}; do
  1811. src=`cmake_escape_artifact "${cmake_source_dir}/Source/kwsys/${a}.cxx"`
  1812. src_flags="`eval echo \\${cmake_cxx_flags_\${a}}` -DKWSYS_NAMESPACE=cmsys"
  1813. write_source_rule "cxx" "${a}.o" "${src}" "${src_flags}"
  1814. done
  1815. if test "x${bootstrap_system_libuv}" = "x"; then
  1816. for a in ${LIBUV_C_SOURCES}; do
  1817. src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmlibuv/${a}"`
  1818. write_source_rule "c" "uv-`cmake_obj ${a}`" "${src}" "${uv_c_flags}"
  1819. done
  1820. fi
  1821. if test "x${bootstrap_system_librhash}" = "x"; then
  1822. for a in ${LIBRHASH_C_SOURCES}; do
  1823. src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmlibrhash/${a}"`
  1824. write_source_rule "c" "rhash-`cmake_obj ${a}`" "${src}" "${librhash_c_flags}"
  1825. done
  1826. fi
  1827. if test "x${bootstrap_system_jsoncpp}" = "x"; then
  1828. for a in ${JSONCPP_CXX_SOURCES}; do
  1829. src=`cmake_escape_artifact "${cmake_source_dir}/Utilities/cmjsoncpp/${a}"`
  1830. write_source_rule "cxx" "jsoncpp-`cmake_obj ${a}`" "${src}" "${jsoncpp_cxx_flags}"
  1831. done
  1832. fi
  1833. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1834. echo "
  1835. rule rebuild_cache
  1836. command = cd \"${cmake_binary_dir}\" && \"${cmake_source_dir}/bootstrap\" --generator=\"${cmake_bootstrap_generator}\"
  1837. generator = 1
  1838. build build.ninja : rebuild_cache
  1839. " >> "${cmake_bootstrap_dir}/build.ninja"
  1840. else
  1841. echo "
  1842. rebuild_cache:
  1843. ${tab}cd \"${cmake_binary_dir}\" && \"${cmake_source_dir}/bootstrap\" --generator=\"${cmake_bootstrap_generator}\"
  1844. " >> "${cmake_bootstrap_dir}/Makefile"
  1845. fi
  1846. # Write our default settings to Bootstrap${_cmk}/InitialCacheFlags.cmake.
  1847. echo '
  1848. # Generated by '"${cmake_source_dir}"'/bootstrap
  1849. # Default cmake settings. These may be overridden any settings below.
  1850. set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build.") # not FORCE to preserve defaults specified elsewhere
  1851. set (CMAKE_INSTALL_PREFIX "'"${cmake_prefix_dir}"'" CACHE PATH "Install path prefix, prepended onto install directories." FORCE)
  1852. set (CMAKE_DOC_DIR "'"${cmake_doc_dir}"'" CACHE PATH "Install location for documentation (relative to prefix)." FORCE)
  1853. set (CMAKE_MAN_DIR "'"${cmake_man_dir}"'" CACHE PATH "Install location for man pages (relative to prefix)." FORCE)
  1854. set (CMAKE_BIN_DIR "'"${cmake_bin_dir}"'" CACHE PATH "Install location for binaries (relative to prefix)." FORCE)
  1855. set (CMAKE_DATA_DIR "'"${cmake_data_dir}"'" CACHE PATH "Install location for data (relative to prefix)." FORCE)
  1856. set (CMAKE_XDGDATA_DIR "'"${cmake_xdgdata_dir}"'" CACHE PATH "Install location for XDG specific files (relative to prefix)." FORCE)
  1857. ' > "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1858. # Add configuration settings given as command-line options.
  1859. if test "x${cmake_bootstrap_qt_gui}" != "x"; then
  1860. echo '
  1861. set (BUILD_QtDialog '"${cmake_bootstrap_qt_gui}"' CACHE BOOL "Build Qt dialog for CMake" FORCE)
  1862. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1863. fi
  1864. if test "x${cmake_bootstrap_qt_qmake}" != "x"; then
  1865. echo '
  1866. set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
  1867. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1868. fi
  1869. if test "x${cmake_bootstrap_debugger}" != "x"; then
  1870. echo '
  1871. set (CMake_ENABLE_DEBUGGER '"${cmake_bootstrap_debugger}"' CACHE BOOL "Enable CMake debugger support" FORCE)
  1872. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1873. fi
  1874. if test "x${cmake_sphinx_info}" != "x"; then
  1875. echo '
  1876. set (SPHINX_INFO "'"${cmake_sphinx_info}"'" CACHE BOOL "Build Info manual with Sphinx" FORCE)
  1877. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1878. fi
  1879. if test "x${cmake_sphinx_man}" != "x"; then
  1880. echo '
  1881. set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE BOOL "Build man pages with Sphinx" FORCE)
  1882. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1883. fi
  1884. if test "x${cmake_sphinx_html}" != "x"; then
  1885. echo '
  1886. set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE BOOL "Build html help with Sphinx" FORCE)
  1887. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1888. fi
  1889. if test "x${cmake_sphinx_qthelp}" != "x"; then
  1890. echo '
  1891. set (SPHINX_QTHELP "'"${cmake_sphinx_qthelp}"'" CACHE BOOL "Build qch help with Sphinx" FORCE)
  1892. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1893. fi
  1894. if test "x${cmake_sphinx_latexpdf}" != "x"; then
  1895. echo '
  1896. set (SPHINX_LATEXPDF "'"${cmake_sphinx_latexpdf}"'" CACHE BOOL "Build PDF help with Sphinx using LaTeX" FORCE)
  1897. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1898. fi
  1899. if test "x${cmake_sphinx_build}" != "x"; then
  1900. echo '
  1901. set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
  1902. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1903. fi
  1904. if test "x${cmake_sphinx_flags}" != "x"; then
  1905. echo '
  1906. set (SPHINX_FLAGS [==['"${cmake_sphinx_flags}"']==] CACHE STRING "Flags to pass to sphinx-build" FORCE)
  1907. ' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1908. fi
  1909. # Add user-specified settings. Handle relative-path case for
  1910. # specification of cmake_init_file.
  1911. (
  1912. cd "${cmake_binary_dir}"
  1913. if test -f "${cmake_init_file}"; then
  1914. cat "${cmake_init_file}" >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
  1915. fi
  1916. )
  1917. echo "---------------------------------------------"
  1918. # Run make to build bootstrap cmake
  1919. if test "${cmake_bootstrap_generator}" = "Ninja"; then
  1920. ninja_v=-v
  1921. else
  1922. ninja_v=
  1923. fi
  1924. if test "x${cmake_parallel_make}" != "x"; then
  1925. ${cmake_make_processor} ${cmake_make_flags} ${ninja_v}
  1926. else
  1927. ${cmake_make_processor} ${ninja_v}
  1928. fi
  1929. RES=$?
  1930. if test "${RES}" -ne "0"; then
  1931. cmake_error 9 "Problem while running ${cmake_make_processor}"
  1932. fi
  1933. cd "${cmake_binary_dir}"
  1934. # Set C, CXX, and MAKE environment variables, so that real real cmake will be
  1935. # build with same compiler and make
  1936. CC="${cmake_c_compiler}"
  1937. CXX="${cmake_cxx_compiler}"
  1938. MAKE="${cmake_make_processor}"
  1939. export CC
  1940. export CXX
  1941. export MAKE
  1942. export CFLAGS
  1943. export CXXFLAGS
  1944. export LDFLAGS
  1945. # Run bootstrap CMake to configure real CMake
  1946. cmake_options="-DCMAKE_BOOTSTRAP=1"
  1947. if test -n "${cmake_verbose}"; then
  1948. cmake_options="${cmake_options} -DCMAKE_VERBOSE_MAKEFILE=1"
  1949. fi
  1950. "${cmake_bootstrap_dir}/cmake" "${cmake_source_dir}" "-C${cmake_bootstrap_dir}/InitialCacheFlags.cmake" "-G${cmake_bootstrap_generator}" ${cmake_options} ${cmake_bootstrap_system_libs} "$@"
  1951. RES=$?
  1952. if test "${RES}" -ne "0"; then
  1953. cmake_error 11 "Problem while running initial CMake"
  1954. fi
  1955. echo "---------------------------------------------"
  1956. # And we are done. Now just run make
  1957. echo "CMake has bootstrapped. Now run ${cmake_make_processor}."