!1 CMake 3.20.5 update

Merge pull request !1 from fangting/master
This commit is contained in:
openharmony_ci
2023-06-15 11:29:33 +00:00
committed by Gitee
18851 changed files with 1238274 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
---
# This configuration requires clang-format version 6.0 exactly.
BasedOnStyle: Mozilla
AlignOperands: false
AllowShortFunctionsOnASingleLine: InlineOnly
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: true
AfterEnum: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
BreakBeforeBraces: Custom
ColumnLimit: 79
IndentPPDirectives: AfterHash
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"]cmSTL\.hxx'
Priority: -2
- Regex: '^[<"]cmConfigure\.h'
Priority: -1
- Regex: '^<queue>'
Priority: 1
- Regex: '^(<|")cm(ext)?/'
Priority: 2
- Regex: '^(<|")windows\.h'
Priority: 3
- Regex: '^<sys/'
Priority: 5
- Regex: '^(<|")Qt?[A-Z]'
Priority: 6
- Regex: '^<cmtp/'
Priority: 7
- Regex: '^(<|")cmsys/'
Priority: 8
- Regex: '^(<|")cm_'
Priority: 9
- Regex: '^(<|")cm[A-Z][^.]+\.h'
Priority: 10
- Regex: '^<[^.]+\.h'
Priority: 4
- Regex: '^<'
Priority: 1
- Regex: '.*'
Priority: 11
...
+39
View File
@@ -0,0 +1,39 @@
---
Checks: "-*,\
bugprone-*,\
-bugprone-macro-parentheses,\
-bugprone-misplaced-widening-cast,\
-bugprone-narrowing-conversions,\
-bugprone-too-small-loop-variable,\
google-readability-casting,\
misc-*,\
-misc-no-recursion,\
-misc-non-private-member-variables-in-classes,\
-misc-static-assert,\
modernize-*,\
-modernize-avoid-c-arrays,\
-modernize-use-nodiscard,\
-modernize-use-noexcept,\
-modernize-use-trailing-return-type,\
-modernize-use-transparent-functors,\
performance-*,\
readability-*,\
-readability-convert-member-functions-to-static,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-uppercase-literal-suffix,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: '1'
- key: modernize-use-equals-default.IgnoreMacros
value: '0'
- key: modernize-use-auto.MinTypeNameLength
value: '80'
...
+10
View File
@@ -0,0 +1,10 @@
root = true
[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[{CMakeLists.txt,*.cmake,*.rst}]
indent_size = 2
indent_style = space
+41
View File
@@ -0,0 +1,41 @@
.git* export-ignore
.hooks* export-ignore
.editorconfig export-ignore
# Custom attribute to mark sources as using our C code style.
[attr]our-c-style whitespace=tab-in-indent format.clang-format-6.0
# Custom attribute to mark sources as generated.
# Do not perform whitespace checks. Do not format.
[attr]generated whitespace=-tab-in-indent,-indent-with-non-tab -format.clang-format-6.0
bootstrap eol=lf
configure eol=lf
*.[1-9] eol=lf
*.bash eol=lf
*.sh eol=lf
*.sh.in eol=lf
*.bat eol=crlf
*.bat.in eol=crlf
*.sln eol=crlf
*.vcproj eol=crlf
*.pfx -text
*.png -text
*.png.in -text
*.c our-c-style
*.cc our-c-style
*.cpp our-c-style
*.cu our-c-style
*.cxx our-c-style
*.h our-c-style
*.hh our-c-style
*.hpp our-c-style
*.hxx our-c-style
*.notcu our-c-style
*.cmake whitespace=tab-in-indent
*.rst whitespace=tab-in-indent conflict-marker-size=79
*.txt whitespace=tab-in-indent
+7
View File
@@ -0,0 +1,7 @@
Thanks for your interest in contributing to CMake! The GitHub repository
is a mirror provided for convenience, but CMake does not use GitHub pull
requests for contribution. Please see
https://gitlab.kitware.com/cmake/cmake/-/tree/master/CONTRIBUTING.rst
for contribution instructions. GitHub OAuth may be used to sign in.
+14
View File
@@ -0,0 +1,14 @@
# Exclude MacOS Finder files.
.DS_Store
*.user*
*.pyc
Testing
CMakeUserPresets.json
# Visual Studio work directory
.vs/
# Visual Studio Code
.vscode/
+403
View File
@@ -0,0 +1,403 @@
include:
# Metadata shared my many jobs
- local: .gitlab/rules.yml
- local: .gitlab/artifacts.yml
# OS builds.
- local: .gitlab/os-linux.yml
- local: .gitlab/os-macos.yml
- local: .gitlab/os-windows.yml
# Post-build steps
- local: .gitlab/upload.yml
stages:
- prep
- build
- test
- test-ext
- upload
################################################################################
# Job declarations
#
# Each job must pull in each of the following keys:
#
# - a "base image"
# - a build script
# - tags for the jobs
# - rules for when to run the job
#
# Additionally, jobs may also contain:
#
# - artifacts
# - dependency/needs jobs for required jobs
################################################################################
# Prep jobs
prep:source-package:
extends:
- .linux_prep_source
- .cmake_prep_source_linux
- .linux_builder_tags
- .cmake_release_artifacts
- .run_only_for_package
prep:doc-package:
extends:
- .fedora33_sphinx_package
- .cmake_prep_doc_linux
- .linux_builder_tags_qt
- .cmake_doc_artifacts
- .run_only_for_package
.upload:source-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- prep:source-package
needs:
- prep:source-package
variables:
RSYNC_DESTINATION: dev
# Lint builds
build:debian10-iwyu:
extends:
- .debian10_iwyu
- .cmake_build_linux
- .linux_builder_tags
- .run_automatically
build:fedora33-tidy:
extends:
- .fedora33_tidy
- .cmake_build_linux
- .linux_builder_tags_qt
- .run_automatically
build:fedora33-sphinx:
extends:
- .fedora33_sphinx
- .cmake_build_linux
- .linux_builder_tags_qt
- .run_automatically
variables:
CMAKE_CI_JOB_CONTINUOUS: "true"
CMAKE_CI_JOB_HELP: "true"
# Linux builds
build:centos6-x86_64:
extends:
- .linux_release_x86_64
- .cmake_build_linux_release
- .cmake_release_artifacts
- .linux_builder_tags
- .run_manually
build:centos7-aarch64:
extends:
- .linux_release_aarch64
- .cmake_build_linux_release
- .cmake_release_artifacts
- .linux_builder_tags_aarch64
- .run_manually
variables:
CMAKE_CI_NO_MR: "true"
test:debian10-ninja:
extends:
- .debian10_ninja
- .cmake_test_linux_release
- .linux_builder_tags_qt
- .run_dependent
dependencies:
- build:centos6-x86_64
needs:
- build:centos6-x86_64
test:debian10-aarch64-ninja:
extends:
- .debian10_aarch64_ninja
- .cmake_test_linux_release
- .linux_builder_tags_aarch64_qt
- .run_dependent
dependencies:
- build:centos7-aarch64
needs:
- build:centos7-aarch64
variables:
CMAKE_CI_NO_MR: "true"
test:fedora33-makefiles:
extends:
- .fedora33_makefiles
- .cmake_test_linux_release
- .linux_builder_tags_qt
- .run_dependent
dependencies:
- build:centos6-x86_64
needs:
- build:centos6-x86_64
test:cuda10.2-nvidia:
extends:
- .cuda10.2_nvidia
- .cmake_test_linux_release
- .linux_builder_tags_cuda
- .run_dependent
dependencies:
- build:centos6-x86_64
needs:
- build:centos6-x86_64
build:fedora33-ninja:
extends:
- .fedora33_ninja
- .cmake_build_linux
- .cmake_build_artifacts
- .linux_builder_tags_qt
- .run_manually
test:fedora33-ninja:
extends:
- .fedora33_ninja
- .cmake_test_linux
- .linux_builder_tags_x11
- .cmake_test_artifacts
- .run_dependent
dependencies:
- build:fedora33-ninja
needs:
- build:fedora33-ninja
test:fedora33-ninja-multi:
extends:
- .fedora33_ninja_multi
- .cmake_test_linux_external
- .linux_builder_tags_qt
- .run_dependent
dependencies:
- test:fedora33-ninja
needs:
- test:fedora33-ninja
build:linux-x86_64-package:
extends:
- .linux_package
- .linux_release_x86_64
- .cmake_build_linux_release
- .cmake_release_artifacts
- .linux_builder_tags
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package
.upload:linux-x86_64-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- build:linux-x86_64-package
needs:
- build:linux-x86_64-package
variables:
RSYNC_DESTINATION: dev
build:linux-aarch64-package:
extends:
- .linux_package
- .linux_release_aarch64
- .cmake_build_linux_release
- .cmake_release_artifacts
- .linux_builder_tags_aarch64
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package
.upload:linux-aarch64-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- build:linux-aarch64-package
needs:
- build:linux-aarch64-package
variables:
RSYNC_DESTINATION: dev
# macOS builds
build:macos-x86_64-ninja:
extends:
- .macos_x86_64_ninja
- .cmake_build_macos
- .cmake_build_artifacts
- .macos_x86_64_builder_tags
- .run_manually
build:macos-arm64-ninja:
extends:
- .macos_arm64_ninja
- .cmake_build_macos
- .cmake_build_artifacts
- .macos_arm64_builder_tags
- .run_manually
variables:
CMAKE_CI_NO_MR: "true"
test:macos-x86_64-ninja:
extends:
- .macos_x86_64_ninja
- .cmake_test_macos
- .cmake_test_artifacts
- .macos_x86_64_builder_tags
- .run_dependent
dependencies:
- build:macos-x86_64-ninja
needs:
- build:macos-x86_64-ninja
test:macos-arm64-ninja:
extends:
- .macos_arm64_ninja
- .cmake_test_macos
- .cmake_test_artifacts
- .macos_arm64_builder_tags
- .run_dependent
dependencies:
- build:macos-arm64-ninja
needs:
- build:macos-arm64-ninja
variables:
CMAKE_CI_NO_MR: "true"
build:macos-x86_64-makefiles:
extends:
- .macos_x86_64_makefiles
- .cmake_build_macos
- .cmake_build_artifacts
- .macos_x86_64_builder_tags
- .run_manually
test:macos-x86_64-makefiles:
extends:
- .macos_x86_64_makefiles
- .cmake_test_macos
- .macos_x86_64_builder_tags
- .run_dependent
dependencies:
- build:macos-x86_64-makefiles
needs:
- build:macos-x86_64-makefiles
test:macos-x86_64-xcode:
extends:
- .macos_x86_64_xcode
- .cmake_test_macos_external
- .macos_x86_64_builder_ext_tags
- .run_dependent
dependencies:
- test:macos-x86_64-ninja
needs:
- test:macos-x86_64-ninja
test:macos-arm64-xcode:
extends:
- .macos_arm64_xcode
- .cmake_test_macos_external
- .macos_arm64_builder_ext_tags
- .run_dependent
dependencies:
- test:macos-arm64-ninja
needs:
- test:macos-arm64-ninja
variables:
CMAKE_CI_NO_MR: "true"
build:macos-package:
extends:
- .macos_package
- .cmake_build_macos_package
- .cmake_release_artifacts
- .macos_x86_64_builder_tags_package
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package
.upload:macos-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- build:macos-package
needs:
- build:macos-package
variables:
RSYNC_DESTINATION: dev
build:macos10.10-package:
extends:
- .macos10.10_package
- .cmake_build_macos_package
- .cmake_release_artifacts
- .macos_x86_64_builder_tags_package
- .run_only_for_package
dependencies:
- prep:doc-package
needs:
- prep:doc-package
.upload:macos10.10-package:
extends:
- .rsync_upload
- .run_only_for_package
dependencies:
- build:macos10.10-package
needs:
- build:macos10.10-package
variables:
RSYNC_DESTINATION: dev
# Windows builds
build:windows-vs2019-x64-ninja:
extends:
- .windows_vs2019_x64_ninja
- .cmake_build_windows
- .cmake_build_artifacts
- .windows_builder_tags
- .run_manually
test:windows-vs2019-x64-ninja:
extends:
- .windows_vs2019_x64_ninja
- .cmake_test_windows
- .windows_builder_tags
- .cmake_test_artifacts
- .run_dependent
dependencies:
- build:windows-vs2019-x64-ninja
needs:
- build:windows-vs2019-x64-ninja
test:windows-vs2019-x64:
extends:
- .windows_vs2019_x64
- .cmake_test_windows_external
- .windows_builder_ext_tags
- .run_dependent
dependencies:
- test:windows-vs2019-x64-ninja
needs:
- test:windows-vs2019-x64-ninja
+99
View File
@@ -0,0 +1,99 @@
# Lists of paths for artifacts of various stages.
.cmake_build_artifacts:
artifacts:
expire_in: 1d
paths:
# XXX(globbing): Can be simplified with support from
# https://gitlab.com/gitlab-org/gitlab-runner/issues/4840
- build/CTestTestfile.cmake
- build/*/CTestTestfile.cmake
- build/*/*/CTestTestfile.cmake
- build/*/*/*/CTestTestfile.cmake
- build/*/*/*/*/CTestTestfile.cmake
# Allow CMake to find CMAKE_ROOT.
- build/CMakeFiles/CMakeSourceDir.txt
# Take the install tree.
- build/install/
# We need the main binaries.
- build/bin/
# The cache is needed for the installation test.
- build/CMakeCache.txt
# Test binaries. Eventually these might be better under
# `Source/Tests` or the like.
- build/Tests/EnforceConfig.cmake
- build/Tests/CMakeBuildTest.cmake
- build/Tests/CMakeBuildDoubleProjectTest.cmake
- build/Tests/CMake*/runcompilecommands
- build/Tests/CMake*/runcompilecommands.exe
- build/Tests/CMake*/test*
- build/Tests/CMake*/PseudoMemcheck/valgrind
- build/Tests/CMake*/PseudoMemcheck/purify
- build/Tests/CMake*/PseudoMemcheck/memcheck_fail
- build/Tests/CMake*/PseudoMemcheck/BC
- build/Tests/CMake*/PseudoMemcheck/cuda-memcheck
- build/Tests/CMake*/PseudoMemcheck/valgrind.exe
- build/Tests/CMake*/PseudoMemcheck/purify.exe
- build/Tests/CMake*/PseudoMemcheck/memcheck_fail.exe
- build/Tests/CMake*/PseudoMemcheck/BC.exe
- build/Tests/CMake*/PseudoMemcheck/cuda-memcheck.exe
- build/Tests/CMake*/PseudoMemcheck/NoLog
- build/Tests/CMake*Lib/*LibTests
- build/Tests/CMake*Lib/*LibTests.exe
- build/Source/kwsys/cmsysTest*
- build/Source/kwsys/testConsoleBufChild.exe
- build/Utilities/cmcurl/curltest
- build/Utilities/cmcurl/curltest.exe
- build/Utilities/KWIML/test/kwiml_test
- build/Utilities/KWIML/test/kwiml_test.exe
- build/Source/kwsys/*cmsysTestDynload.*
- build/Source/kwsys/dynloaddir/cmsysTestDynloadImpl.dll
- build/Source/kwsys/dynloaddir/cmsysTestDynloadUse.dll
# Test directories.
- build/Tests/CTest*
- build/Tests/Find*
- build/Tests/Qt5*
- build/Tests/RunCMake/
- build/Tests/CMakeOnly/
- build/Tests/CMakeTests/
- build/Tests/CMakeGUI/
- build/Tests/FortranC/
# CTest/CDash information.
- build/Testing/
- build/DartConfiguation.tcl
- build/CTestCustom.cmake
.cmake_release_artifacts:
artifacts:
expire_in: 5d
# Release artifacts are of interest even for failed jobs.
when: always
paths:
# Any packages made.
- build/cmake-*-linux-x86_64.*
- build/cmake-*-linux-aarch64.*
- build/cmake-*-macos*-universal.*
# Any source packages made.
- build/cmake-*.tar.gz
- build/cmake-*.zip
.cmake_test_artifacts:
artifacts:
expire_in: 1d
# External testing can be useful even if test jobs fail.
when: always
paths:
# Take the install tree.
- build/install/
.cmake_doc_artifacts:
artifacts:
expire_in: 1d
paths:
# Take the install tree.
- build/install-doc/
+19
View File
@@ -0,0 +1,19 @@
$erroractionpreference = "stop"
$version = "3.19.7"
$sha256sum = "E6788D6E23B3026C37FCFA7658075D6B5F9113F26FAE17FE372AD4A7EE62D5FD"
$filename = "cmake-$version-win64-x64"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/Kitware/CMake/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
exit 1
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
Move-Item -Path "$outdir\$filename" -Destination "$outdir\cmake"
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh
set -e
readonly version="3.19.3"
case "$(uname -s)-$(uname -m)" in
Linux-x86_64)
shatool="sha256sum"
sha256sum="c18b65697e9679e5c88dccede08c323cd3d3730648e59048047bba82097e0ffc"
platform="Linux-x86_64"
;;
Linux-aarch64)
shatool="sha256sum"
sha256sum="66e507c97ffb586d7ca6567890808b792c8eb004b645706df6fbf27826a395a2"
platform="Linux-aarch64"
;;
Darwin-*)
shatool="shasum -a 256"
sha256sum="a6b79ad05f89241a05797510e650354d74ff72cc988981cdd1eb2b3b2bda66ac"
platform="macos-universal"
;;
*)
echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly sha256sum
readonly platform
readonly filename="cmake-$version-$platform"
readonly tarball="$filename.tar.gz"
cd .gitlab
echo "$sha256sum $tarball" > cmake.sha256sum
curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
$shatool --check cmake.sha256sum
tar xf "$tarball"
mv "$filename" cmake
if [ "$( uname -s )" = "Darwin" ]; then
ln -s CMake.app/Contents/bin cmake/bin
fi
+3
View File
@@ -0,0 +1,3 @@
get_filename_component(CMake_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
include("${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake")
message(STATUS ${CMake_VERSION})
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cmake -P "${BASH_SOURCE%/*}/cmake_version.cmake" | cut -d ' ' -f 2
+15
View File
@@ -0,0 +1,15 @@
set(CTEST_USE_LAUNCHERS "ON" CACHE BOOL "")
# We run the install right after the build. Avoid rerunning it when installing.
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "ON" CACHE BOOL "")
# Install CMake under the build tree.
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "")
set(CMake_TEST_INSTALL "OFF" CACHE BOOL "")
if (NOT "$ENV{CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "$ENV{CMAKE_BUILD_TYPE}" CACHE STRING "")
endif ()
if (NOT configure_no_sccache)
include("${CMAKE_CURRENT_LIST_DIR}/configure_sccache.cmake")
endif()
@@ -0,0 +1,3 @@
set(CMake_TEST_CUDA "NVIDIA" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
@@ -0,0 +1,66 @@
set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
set(CMake_TEST_FindBLAS "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
set(CMake_TEST_FindCups "ON" CACHE BOOL "")
set(CMake_TEST_FindCURL "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "")
set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "")
set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "")
set(CMake_TEST_FindFreetype "ON" CACHE BOOL "")
set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "")
set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
set(CMake_TEST_FindLAPACK "ON" CACHE BOOL "")
set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
set(CMake_TEST_FindLibUV "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "")
set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "")
set(CMake_TEST_FindPython "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "")
set(CMake_TEST_FindRuby "ON" CACHE BOOL "")
set(CMake_TEST_FindSDL "ON" CACHE BOOL "")
set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "")
set(CMake_TEST_FindTIFF "ON" CACHE BOOL "")
set(CMake_TEST_FindX11 "ON" CACHE BOOL "")
set(CMake_TEST_FindXalanC "ON" CACHE BOOL "")
set(CMake_TEST_FindXercesC "ON" CACHE BOOL "")
set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
+4
View File
@@ -0,0 +1,4 @@
set(CMake_RUN_IWYU ON CACHE BOOL "")
set(IWYU_COMMAND "/usr/bin/include-what-you-use-6.0" CACHE FILEPATH "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
+68
View File
@@ -0,0 +1,68 @@
set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
set(CMake_TEST_FindBLAS "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
set(CMake_TEST_FindCups "ON" CACHE BOOL "")
set(CMake_TEST_FindCURL "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "")
set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "")
set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "")
set(CMake_TEST_FindFreetype "ON" CACHE BOOL "")
set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "")
set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
set(CMake_TEST_FindLAPACK "ON" CACHE BOOL "")
set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
set(CMake_TEST_FindLibUV "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "")
set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "")
set(CMake_TEST_FindPython "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_IronPython "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "")
set(CMake_TEST_FindRuby "ON" CACHE BOOL "")
set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "")
set(CMake_TEST_FindSDL "ON" CACHE BOOL "")
set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "")
set(CMake_TEST_FindTIFF "ON" CACHE BOOL "")
set(CMake_TEST_FindX11 "ON" CACHE BOOL "")
set(CMake_TEST_FindXalanC "ON" CACHE BOOL "")
set(CMake_TEST_FindXercesC "ON" CACHE BOOL "")
set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
+3
View File
@@ -0,0 +1,3 @@
set(CMake_TEST_HOST_CMAKE "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,6 @@
set(BUILD_CursesDialog ON CACHE BOOL "")
set(BUILD_QtDialog ON CACHE BOOL "")
set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
set(CMake_TEST_JSON_SCHEMA ON CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,67 @@
set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
set(CMake_TEST_FindBLAS "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
set(CMake_TEST_FindCups "ON" CACHE BOOL "")
set(CMake_TEST_FindCURL "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "")
set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "")
set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "")
set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "")
set(CMake_TEST_FindFreetype "ON" CACHE BOOL "")
set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "")
set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
set(CMake_TEST_FindLAPACK "ON" CACHE BOOL "")
set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
set(CMake_TEST_FindLibUV "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "")
set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "")
set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "")
set(CMake_TEST_FindPython "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_NumPy "ON" CACHE BOOL "")
set(CMake_TEST_FindPython_PyPy "ON" CACHE BOOL "")
set(CMake_TEST_FindRuby "ON" CACHE BOOL "")
set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "")
set(CMake_TEST_FindSDL "ON" CACHE BOOL "")
set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "")
set(CMake_TEST_FindTIFF "ON" CACHE BOOL "")
set(CMake_TEST_FindX11 "ON" CACHE BOOL "")
set(CMake_TEST_FindXalanC "ON" CACHE BOOL "")
set(CMake_TEST_FindXercesC "ON" CACHE BOOL "")
set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
set(CMake_TEST_ISPC "ON" CACHE STRING "")
set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
@@ -0,0 +1,7 @@
set(CMake_TEST_ISPC "ON" CACHE STRING "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
# Cover compilation with C++11 only and not higher standards.
set(CMAKE_CXX_STANDARD "11" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora33_common.cmake")
@@ -0,0 +1,2 @@
set(CMake_TEST_ISPC "ON" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
@@ -0,0 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_sphinx.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,13 @@
# Disable formats not wanted in the package's documentation.
set(SPHINX_INFO OFF CACHE BOOL "")
set(SPHINX_SINGLEHTML OFF CACHE BOOL "")
set(SPHINX_TEXT OFF CACHE BOOL "")
# Set the destination directory for docs that packages expect.
set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "")
# Use a custom prefix to avoid conflicting with other builds.
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install-doc" CACHE PATH "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_sphinx.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
+3
View File
@@ -0,0 +1,3 @@
set(CMake_RUN_CLANG_TIDY ON CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora33_common.cmake")
@@ -0,0 +1,4 @@
set(CPACK_SYSTEM_NAME "macos10.10-universal" CACHE STRING "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake")
@@ -0,0 +1,3 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
+18
View File
@@ -0,0 +1,18 @@
# Our CI machines do not consistently have Java installed, so a build may
# detect that Java is available and working, but a test machine then not have a
# working Java installed. To work around this, just act as if Java is not
# available on any CI machine.
set(CMake_TEST_Java 0 CACHE FILEPATH "")
# Qt binaries get placed inside the source directory, which causes them to not
# be included in the install-time rpath, but we still want them in the
# build-time rpath. CMake sets CMAKE_BUILD_WITH_INSTALL_RPATH to ON by default,
# so set it to OFF.
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF CACHE BOOL "")
set(BUILD_QtDialog ON CACHE BOOL "")
# The "XCTest" test uses an explicit deployment target chosen
# when CMake itself is configured. Use a version that is not
# newer than the macOS version running on any CI host.
set(CMake_TEST_XCTest_DEPLOYMENT_TARGET "10.15" CACHE STRING "")
+4
View File
@@ -0,0 +1,4 @@
set(CPACK_SYSTEM_NAME "macos-universal" CACHE STRING "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_package_common.cmake")
@@ -0,0 +1,26 @@
set(CMake_DOC_ARTIFACT_PREFIX "$ENV{CI_PROJECT_DIR}/build/install-doc" CACHE PATH "")
# Set up install destinations as expected by the packaging scripts.
set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "")
set(CMAKE_DOC_DIR "doc/cmake" CACHE STRING "")
# Settings for CMake packages for macOS.
set(CPACK_DMG_FORMAT "UDBZ" CACHE STRING "")
set(CMAKE_CXX_FLAGS "-stdlib=libc++" CACHE STRING "")
set(CMAKE_C_STANDARD "11" CACHE STRING "")
set(CMAKE_CXX_STANDARD "14" CACHE STRING "")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
set(CMAKE_SKIP_BOOTSTRAP_TEST "TRUE" CACHE STRING "")
set(BUILD_CursesDialog "ON" CACHE BOOL "")
set(BUILD_QtDialog "TRUE" CACHE BOOL "")
set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "")
set(CMake_INSTALL_DEPENDENCIES "ON" CACHE BOOL "")
set(CMAKE_SKIP_RPATH "TRUE" CACHE BOOL "")
set(CMake_TEST_NO_FindPackageModeMakefileTest "TRUE" CACHE BOOL "")
# XXX(sccache): restore sccache when it works for multiple architectures:
# https://github.com/mozilla/sccache/issues/847
set(configure_no_sccache 1)
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,3 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,3 @@
set(CMake_TEST_GUI "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,2 @@
include("${CMAKE_CURRENT_LIST_DIR}/configure_macos_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
+2
View File
@@ -0,0 +1,2 @@
set(CMAKE_C_COMPILER_LAUNCHER "sccache" CACHE STRING "")
set(CMAKE_CXX_COMPILER_LAUNCHER "sccache" CACHE STRING "")
+6
View File
@@ -0,0 +1,6 @@
set(SPHINX_INFO ON CACHE BOOL "")
set(SPHINX_MAN ON CACHE BOOL "")
set(SPHINX_HTML ON CACHE BOOL "")
set(SPHINX_SINGLEHTML ON CACHE BOOL "")
set(SPHINX_QTHELP ON CACHE BOOL "")
set(SPHINX_TEXT ON CACHE BOOL "")
@@ -0,0 +1,4 @@
set(BUILD_QtDialog ON CACHE BOOL "")
set(CMAKE_PREFIX_PATH "$ENV{CI_PROJECT_DIR}/.gitlab/qt" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
@@ -0,0 +1,3 @@
set(CMake_TEST_WIX_NO_VERIFY "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
@@ -0,0 +1,4 @@
set(CMake_TEST_WIX_NO_VERIFY "ON" CACHE BOOL "")
set(CMake_TEST_GUI "ON" CACHE BOOL "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_common.cmake")
+49
View File
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
# Read the files from the build directory.
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
# Pick up from where the configure left off.
ctest_start(APPEND)
include(ProcessorCount)
ProcessorCount(nproc)
if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "")
if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}")
set(nproc "$ENV{CTEST_MAX_PARALLELISM}")
endif ()
endif ()
if (CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(CTEST_BUILD_FLAGS "-j${nproc} -l${nproc}")
elseif (CTEST_CMAKE_GENERATOR MATCHES "Ninja")
set(CTEST_BUILD_FLAGS "-l${nproc}")
endif ()
ctest_build(
NUMBER_WARNINGS num_warnings
RETURN_VALUE build_result)
ctest_submit(PARTS Build)
if (build_result)
message(FATAL_ERROR
"Failed to build")
endif ()
if ("$ENV{CTEST_NO_WARNINGS_ALLOWED}" AND num_warnings GREATER 0)
message(FATAL_ERROR
"Found ${num_warnings} warnings (treating as fatal).")
endif ()
if (NOT "$ENV{CMake_SKIP_INSTALL}")
ctest_build(APPEND
TARGET install
RETURN_VALUE install_result)
if (install_result)
message(FATAL_ERROR
"Failed to install")
endif ()
endif ()
+32
View File
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
set(cmake_args
-C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
# Create an entry in CDash.
ctest_start("${ctest_model}" GROUP "${ctest_group}")
# Gather update information.
find_package(Git)
set(CTEST_UPDATE_VERSION_ONLY ON)
set(CTEST_UPDATE_COMMAND "${GIT_EXECUTABLE}")
ctest_update()
# Configure the project.
ctest_configure(
OPTIONS "${cmake_args}"
RETURN_VALUE configure_result)
# Read the files from the build directory.
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
# We can now submit because we've configured. This is a cmb-superbuild-ism.
ctest_submit(PARTS Update)
ctest_submit(PARTS Configure)
if (configure_result)
message(FATAL_ERROR
"Failed to configure")
endif ()
+28
View File
@@ -0,0 +1,28 @@
set(test_exclusions
# This test hits global resources and can be handled by nightly testing.
# https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4769
"^BundleGeneratorTest$"
)
if (CTEST_CMAKE_GENERATOR MATCHES "Visual Studio")
list(APPEND test_exclusions
# This test takes around 5 minutes with Visual Studio.
# https://gitlab.kitware.com/cmake/cmake/-/issues/20733
"^ExternalProjectUpdate$"
# This test is a dependency of the above and is only required for it.
"^ExternalProjectUpdateSetup$")
endif ()
if (CMAKE_HOST_WIN32)
list(APPEND test_exclusions
# This test often fails with an undiagnosed subtle race due to the test
# re-using the same objects for many files. Some copy operations fail
# to open their input with ERROR_SHARING_VIOLATION.
"^Module.ExternalData$"
)
endif()
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
if (test_exclusions)
set(test_exclusions "(${test_exclusions})")
endif ()
+30
View File
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
# Read the files from the build directory.
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
# Pick up from where the configure left off.
ctest_start(APPEND)
include(ProcessorCount)
ProcessorCount(nproc)
if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "")
if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}")
set(nproc "$ENV{CTEST_MAX_PARALLELISM}")
endif ()
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
ctest_test(
PARALLEL_LEVEL "${nproc}"
TEST_LOAD "${nproc}"
RETURN_VALUE test_result
EXCLUDE "${test_exclusions}")
ctest_submit(PARTS Test)
if (test_result)
message(FATAL_ERROR
"Failed to test")
endif ()
+88
View File
@@ -0,0 +1,88 @@
cmake_minimum_required(VERSION 3.8)
include("${CMAKE_CURRENT_LIST_DIR}/gitlab_ci.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/env_$ENV{CMAKE_CONFIGURATION}.cmake" OPTIONAL)
set(cmake_args
-C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
# Create an entry in CDash.
ctest_start("${ctest_model}" GROUP "${ctest_group}")
# Gather update information.
find_package(Git)
set(CTEST_UPDATE_VERSION_ONLY ON)
set(CTEST_UPDATE_COMMAND "${GIT_EXECUTABLE}")
ctest_update()
# Configure the project.
ctest_configure(
OPTIONS "${cmake_args}"
RETURN_VALUE configure_result)
# Read the files from the build directory.
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
# We can now submit because we've configured. This is a cmb-superbuild-ism.
ctest_submit(PARTS Update)
ctest_submit(PARTS Configure)
if (configure_result)
ctest_submit(PARTS Done)
message(FATAL_ERROR
"Failed to configure")
endif ()
include(ProcessorCount)
ProcessorCount(nproc)
if (NOT "$ENV{CTEST_MAX_PARALLELISM}" STREQUAL "")
if (nproc GREATER "$ENV{CTEST_MAX_PARALLELISM}")
set(nproc "$ENV{CTEST_MAX_PARALLELISM}")
endif ()
endif ()
if (CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(CTEST_BUILD_FLAGS "-j${nproc} -l${nproc}")
elseif (CTEST_CMAKE_GENERATOR MATCHES "Ninja")
set(CTEST_BUILD_FLAGS "-l${nproc}")
endif ()
ctest_build(
NUMBER_WARNINGS num_warnings
RETURN_VALUE build_result)
ctest_submit(PARTS Build)
if (build_result)
ctest_submit(PARTS Done)
message(FATAL_ERROR
"Failed to build")
endif ()
if ("$ENV{CTEST_NO_WARNINGS_ALLOWED}" AND num_warnings GREATER 0)
ctest_submit(PARTS Done)
message(FATAL_ERROR
"Found ${num_warnings} warnings (treating as fatal).")
endif ()
set(ctest_label_args)
if (NOT "$ENV{CTEST_LABELS}" STREQUAL "")
list(APPEND ctest_label_args
INCLUDE_LABEL "$ENV{CTEST_LABELS}")
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/ctest_exclusions.cmake")
ctest_test(
PARALLEL_LEVEL "${nproc}"
TEST_LOAD "${nproc}"
RETURN_VALUE test_result
${ctest_label_args}
EXCLUDE "${test_exclusions}")
ctest_submit(PARTS Test)
if (test_result)
ctest_submit(PARTS Done)
message(FATAL_ERROR
"Failed to test")
endif ()
ctest_submit(PARTS Done)
+5
View File
@@ -0,0 +1,5 @@
FROM nvidia/cuda:10.2-devel-ubuntu18.04
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
apt-get update
# Install development tools.
apt-get install -y \
g++ \
curl \
git
apt-get clean
@@ -0,0 +1,5 @@
FROM arm64v8/debian:10
MAINTAINER Brad King <brad.king@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
+76
View File
@@ -0,0 +1,76 @@
#!/bin/sh
set -e
apt-get update
# Install build requirements.
apt-get install -y \
libssl-dev
# Install development tools.
apt-get install -y \
g++ \
curl \
git
# Install iwyu runtime deps.
apt-get install -y \
clang-6.0 \
libncurses6
# Tools needed for the test suite.
apt-get install -y \
jq
# Packages needed to test find modules.
apt-get install -y \
alsa-utils \
doxygen graphviz \
gnutls-dev \
libarchive-dev \
libblas-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-python-dev \
libboost-thread-dev \
libbz2-dev \
libcups2-dev \
libcurl4-gnutls-dev \
libdevil-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgdal-dev \
libgif-dev \
libgl1-mesa-dev \
libglew-dev \
libgsl-dev \
libgtest-dev \
libgtk2.0-dev \
libinput-dev \
libjpeg-dev \
libjsoncpp-dev \
liblapack-dev \
liblzma-dev \
libopenmpi-dev openmpi-bin \
libpng-dev \
libpq-dev postgresql-server-dev-11 \
libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler \
libsdl-dev \
libsqlite3-dev \
libtiff-dev \
libuv1-dev \
libx11-dev \
libxalan-c-dev \
libxerces-c-dev \
libxml2-dev libxml2-utils \
libxslt-dev xsltproc \
python2 python2-dev python-numpy pypy pypy-dev \
python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv \
qtbase5-dev qtbase5-dev-tools \
ruby ruby-dev \
swig \
unixodbc-dev
apt-get clean
+25
View File
@@ -0,0 +1,25 @@
FROM debian:10 as iwyu-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_iwyu.sh /root/install_iwyu.sh
RUN sh /root/install_iwyu.sh
FROM debian:10 as rvm-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_rvm.sh /root/install_rvm.sh
RUN sh /root/install_rvm.sh
FROM debian:10
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
COPY --from=iwyu-build /root/iwyu.tar.gz /root/iwyu.tar.gz
RUN tar -C / -xf /root/iwyu.tar.gz
RUN ln -s /usr/lib/llvm-6.0/bin/include-what-you-use /usr/bin/include-what-you-use-6.0
COPY --from=rvm-build /root/rvm.tar /root/rvm.tar
RUN tar -C /usr/local -xf /root/rvm.tar \
&& rm /root/rvm.tar
+83
View File
@@ -0,0 +1,83 @@
#!/bin/sh
set -e
apt-get update
# Install build requirements.
apt-get install -y \
libssl-dev
# Install development tools.
apt-get install -y \
g++ \
curl \
git
# Install iwyu runtime deps.
apt-get install -y \
clang-6.0 \
libncurses6
# Tools needed for the test suite.
apt-get install -y \
jq
# Packages needed to test find modules.
apt-get install -y \
alsa-utils \
doxygen graphviz \
gnutls-dev \
libarchive-dev \
libblas-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-python-dev \
libboost-thread-dev \
libbz2-dev \
libcups2-dev \
libcurl4-gnutls-dev \
libdevil-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgdal-dev \
libgif-dev \
libgl1-mesa-dev \
libglew-dev \
libgsl-dev \
libgtest-dev \
libgtk2.0-dev \
libinput-dev \
libjpeg-dev \
libjsoncpp-dev \
liblapack-dev \
liblzma-dev \
libopenmpi-dev openmpi-bin \
libpng-dev \
libpq-dev postgresql-server-dev-11 \
libprotobuf-dev libprotobuf-c-dev libprotoc-dev protobuf-compiler \
libsdl-dev \
libsqlite3-dev \
libtiff-dev \
libuv1-dev \
libx11-dev \
libxalan-c-dev \
libxerces-c-dev \
libxml2-dev libxml2-utils \
libxslt-dev xsltproc \
python2 python2-dev python-numpy pypy pypy-dev \
python3 python3-dev python3-numpy pypy3 pypy3-dev python3-venv \
qtbase5-dev qtbase5-dev-tools \
ruby ruby-dev \
swig \
unixodbc-dev
# CMake_TEST_FindPython_IronPython
apt-get install -y \
libmono-system-windows-forms4.0-cil
curl -L -O https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.10/ironpython_2.7.10.deb
dpkg -i ironpython_2.7.10.deb
rm ironpython_2.7.10.deb
apt-get clean
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
set -e
# Install development tools.
apt-get update
apt-get install -y \
clang-6.0 \
libclang-6.0-dev \
llvm-6.0-dev \
libz-dev \
g++ \
cmake \
ninja-build \
git
cd /root
git clone "https://github.com/include-what-you-use/include-what-you-use.git"
cd include-what-you-use
readonly llvm_version="$( clang-6.0 --version | head -n1 | cut -d' ' -f3 | cut -d. -f-2 )"
git checkout "clang_$llvm_version"
mkdir build
cd build
cmake -GNinja \
-DCMAKE_BUILD_TYPE=Release \
"-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$llvm_version" \
"-DIWYU_LLVM_ROOT_PATH=/usr/lib/llvm-$llvm_version" \
..
ninja
DESTDIR=/root/iwyu-destdir ninja install
tar -C /root/iwyu-destdir -cf /root/iwyu.tar.gz .
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -e
apt-get update
apt-get install -y \
curl \
gnupg2 \
procps
gpg2 --keyserver hkp://pool.sks-keyservers.net \
--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
/usr/local/rvm/bin/rvm install ruby-2.7.0
tar -C /usr/local -cf /root/rvm.tar rvm
+18
View File
@@ -0,0 +1,18 @@
FROM fedora:33 as rvm-build
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_rvm.sh /root/install_rvm.sh
RUN sh /root/install_rvm.sh
FROM fedora:33
MAINTAINER Ben Boeckel <ben.boeckel@kitware.com>
COPY install_deps.sh /root/install_deps.sh
RUN sh /root/install_deps.sh
COPY install_ispc.sh /root/install_ispc.sh
RUN sh /root/install_ispc.sh
COPY --from=rvm-build /root/rvm.tar /root/rvm.tar
RUN tar -C /usr/local -xf /root/rvm.tar \
&& rm /root/rvm.tar
+82
View File
@@ -0,0 +1,82 @@
#!/bin/sh
set -e
# Install build requirements.
dnf install --setopt=install_weak_deps=False -y \
ncurses-devel \
openssl-devel \
qt5-qtbase-devel
# Install development tools.
dnf install --setopt=install_weak_deps=False -y \
clang-tools-extra \
gcc-c++ \
git-core \
make
# Install documentation tools.
dnf install --setopt=install_weak_deps=False -y \
python3-sphinx \
texinfo \
qt5-qttools-devel
# Tools needed for the test suite.
dnf install --setopt=install_weak_deps=False -y \
findutils \
file \
jq \
which
# Packages needed to test find modules.
dnf install --setopt=install_weak_deps=False -y \
alsa-lib-devel \
blas-devel \
boost-devel boost-python3-devel \
bzip2-devel \
cups-devel \
DevIL-devel \
doxygen \
expat-devel \
fontconfig-devel \
freetype-devel \
gdal-devel \
gettext \
giflib-devel \
glew-devel \
gmock \
gnutls-devel \
gsl-devel \
gtest-devel \
gtk2-devel \
jsoncpp-devel \
lapack-devel \
libarchive-devel \
libcurl-devel \
libinput-devel systemd-devel \
libjpeg-turbo-devel \
libpng-devel \
libpq-devel postgresql-server-devel \
libtiff-devel \
libuv-devel \
libxml2-devel \
libxslt-devel \
openmpi-devel \
patch \
perl \
protobuf-devel protobuf-c-devel protobuf-lite-devel \
pypy2 pypy2-devel \
pypy3 pypy3-devel \
python2 python2-devel python2-numpy \
python3 python3-devel python3-numpy \
python3-jsmin python3-jsonschema \
ruby rubygems ruby-devel \
SDL-devel \
sqlite-devel \
swig \
unixODBC-devel \
xalan-c-devel \
xerces-c-devel \
xz-devel
dnf clean all
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
readonly version="1.13.0"
readonly sha256sum="8ab1189bd5db596b3eee9d9465d3528b6626a7250675d67102761bb0d284cd21"
readonly filename="ispc-v$version-linux"
readonly tarball="$filename.tar.gz"
echo "$sha256sum $tarball" > ispc.sha256sum
curl -OL "https://github.com/ispc/ispc/releases/download/v$version/$tarball"
sha256sum --check ispc.sha256sum
tar --strip-components=1 -C /usr/local -xf "$tarball" "$filename/bin/ispc"
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -e
gpg2 --keyserver hkp://pool.sks-keyservers.net \
--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
dnf install --setopt=install_weak_deps=False -y \
findutils \
procps \
which
curl -sSL https://get.rvm.io | bash -s stable
# This is intentionally an older version.
# If updating, the associated `env_fedora*_makefiles.cmake` file needs updated
# as well.
/usr/local/rvm/bin/rvm install ruby-2.7.0
tar -C /usr/local -cf /root/rvm.tar rvm
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
set -x
cleanup() {
docker container rm -fv "$build_container" >/dev/null 2>&1 || true
docker image rm -f "$build_image" >/dev/null 2>&1 || true
}
readonly suffix="-$(date -u +%Y-%m-%d)-${RANDOM}"
readonly build_container="ninja-build-linux-aarch64$suffix"
readonly build_image="ninja:build-linux-aarch64$suffix"
readonly git_tag="${1-v1.10.2}"
trap "cleanup" EXIT INT TERM
docker image build --build-arg GIT_TAG="$git_tag" --tag="$build_image" "${BASH_SOURCE%/*}/centos7-aarch64"
docker container create --name "$build_container" "$build_image"
docker cp "$build_container:/ninja/ninja" "ninja"
@@ -0,0 +1,7 @@
FROM kitware/cmake:build-linux-aarch64-base-2020-12-21
MAINTAINER Brad King <brad.king@kitware.com>
ARG GIT_TAG=v1.10.2
COPY build_ninja.sh /root/build_ninja.sh
RUN scl enable devtoolset-7 -- sh /root/build_ninja.sh $GIT_TAG
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -e
git clone https://github.com/ninja-build/ninja.git
cd ninja
git checkout "${1-v1.10.2}"
./configure.py --bootstrap
./ninja all
./ninja_test
strip ninja
+41
View File
@@ -0,0 +1,41 @@
cmake_minimum_required(VERSION 3.17)
set(version "3.8.6")
set(sha256sum "376e18eef7e3ea467f0e3af041b01fc7e2f12855506c2ab2653ceb5e0951212e")
set(dirname "python-${version}-embed-win-x86_64")
set(tarball "${dirname}.tar.xz")
# Download the file.
file(DOWNLOAD
"https://cmake.org/files/dependencies/${tarball}"
".gitlab/${tarball}"
STATUS download_status
EXPECTED_HASH "SHA256=${sha256sum}")
# Check the download status.
list(GET download_status 0 res)
if (res)
list(GET download_status 1 err)
message(FATAL_ERROR
"Failed to download ${tarball}: ${err}")
endif ()
# Extract the file.
execute_process(
COMMAND
"${CMAKE_COMMAND}"
-E tar
xzf "${tarball}"
WORKING_DIRECTORY ".gitlab"
RESULT_VARIABLE res
ERROR_VARIABLE err
ERROR_STRIP_TRAILING_WHITESPACE)
if (res)
message(FATAL_ERROR
"Failed to extract ${tarball}: ${err}")
endif ()
# Move to a predictable directory.
file(RENAME
".gitlab/${dirname}"
".gitlab/python3")
+135
View File
@@ -0,0 +1,135 @@
cmake_minimum_required(VERSION 3.12)
# Input variables.
set(qt_version_major "5")
set(qt_version_minor "15")
set(qt_version_patch "1")
# Combined version variables.
set(qt_version "${qt_version_major}.${qt_version_minor}.${qt_version_patch}")
set(qt_version_nodot "${qt_version_major}${qt_version_minor}${qt_version_patch}")
# Files needed to download.
set(qt_files)
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows")
# Determine the ABI to fetch for Qt.
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2015")
set(qt_platform "windows_x86")
set(msvc_year "2015")
set(qt_abi "win64_msvc${msvc_year}_64")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2017" OR
"$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2019")
set(qt_platform "windows_x86")
set(msvc_year "2019")
set(qt_abi "win64_msvc${msvc_year}_64")
else ()
message(FATAL_ERROR "Unknown ABI to use for Qt")
endif ()
set(qt_build_stamp "202009071110")
set(qt_file_name_prefix "${qt_version}-0-${qt_build_stamp}")
foreach (qt_component IN ITEMS qtbase qtwinextras)
list(APPEND qt_files
"${qt_file_name_prefix}${qt_component}-Windows-Windows_10-MSVC${msvc_year}-Windows-Windows_10-X86_64.7z")
endforeach ()
set(qt_subdir "${qt_version}/msvc${msvc_year}_64")
# This URL is only visible inside of Kitware's network.
# Please use your own Qt Account to obtain these files.
set(qt_url_root "https://paraview.org/files/dependencies/internal/qt")
set(qt_url_path "${qt_platform}/desktop/qt5_${qt_version_nodot}/qt.qt5.${qt_version_nodot}.${qt_abi}")
elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos")
if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos10.10_package")
list(APPEND qt_files "qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz")
set(qt_subdir "qt-5.9.9-macosx10.10-x86_64-arm64")
else ()
list(APPEND qt_files "qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz")
set(qt_subdir "qt-5.15.2-macosx10.13-x86_64-arm64")
endif()
set(qt_url_root "https://cmake.org/files/dependencies")
set(qt_url_path "")
else()
message(FATAL_ERROR "Unknown OS to use for Qt")
endif ()
# Verify that we know what directory will be extracted.
if (NOT qt_subdir)
message(FATAL_ERROR
"The extracted subdirectory is not set")
endif ()
# Build up the path to the file to download.
set(qt_url_prefix "${qt_url_root}/${qt_url_path}")
# Include the file containing the hashes of the files that matter.
include("${CMAKE_CURRENT_LIST_DIR}/download_qt_hashes.cmake")
# Download and extract each file.
foreach (qt_file IN LISTS qt_files)
# Ensure we have a hash to verify.
if (NOT DEFINED "${qt_file}_hash")
message(FATAL_ERROR
"Unknown hash for ${qt_file}")
endif ()
# Download the file.
file(DOWNLOAD
"${qt_url_prefix}/${qt_file}"
".gitlab/${qt_file}"
STATUS download_status
EXPECTED_HASH "SHA256=${${qt_file}_hash}")
# Check the download status.
list(GET download_status 0 res)
if (res)
list(GET download_status 1 err)
message(FATAL_ERROR
"Failed to download ${qt_file}: ${err}")
endif ()
# Extract the file.
execute_process(
COMMAND
"${CMAKE_COMMAND}"
-E tar
xf "${qt_file}"
WORKING_DIRECTORY ".gitlab"
RESULT_VARIABLE res
ERROR_VARIABLE err
ERROR_STRIP_TRAILING_WHITESPACE)
if (res)
message(FATAL_ERROR
"Failed to extract ${qt_file}: ${err}")
endif ()
endforeach ()
# The Windows tarballs have some unfortunate permissions in them that prevent
# deletion when `git clean -ffdx` tries to clean up the directory.
if (qt_platform STREQUAL "windows_x86")
# Fix permissions.
file(TO_NATIVE_PATH ".gitlab/${qt_subdir}/*.*" native_qt_dir)
execute_process(
# Remove any read-only flags that aren't affected by `icacls`.
COMMAND
attrib
-r # Remove readonly flag
"${native_qt_dir}"
/d # Treat as a directory
/s # Recursive
/l # Don't dereference symlinks
RESULT_VARIABLE res
ERROR_VARIABLE err
ERROR_STRIP_TRAILING_WHITESPACE)
if (res)
message(FATAL_ERROR
"Failed to fix remove read-only flags in ${qt_file}: ${err}")
endif ()
endif ()
# Move to a predictable prefix.
file(RENAME
".gitlab/${qt_subdir}"
".gitlab/qt")
+14
View File
@@ -0,0 +1,14 @@
# Lines can be generated by doing:
#
# sha256sum $files | awk '{ print "set(\"" $2 "_hash\" " $1 ")" }' >> $thisfile
set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" a5635124a135f383d9fb92bf628b018cff9f781addfd388926a367cda5b7cd38)
set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z_hash" 908947855b5d7a854886746365ac29e9296b5d64d4e18089641a6988167807d3)
set("5.15.1-0-202009071110qtbase-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 5d0d2e71e3b00cf88ac4c616b4b314a7e73871f325512821f53c464cdfee961f)
set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Windows_10-X86_64.7z_hash" 803e0234169464babb5305dedc21382e90c3266c6f9414ff0cff04be578681e1)
set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1)
set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1)
set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b)
+1
View File
@@ -0,0 +1 @@
set(ENV{MY_RUBY_HOME} "/usr/local/rvm/rubies/ruby-2.7.0")
+2
View File
@@ -0,0 +1,2 @@
set(ENV{MY_RUBY_HOME} "/usr/local/rvm/rubies/ruby-2.7.0")
set(ENV{PATH} "/usr/lib64/openmpi/bin:$ENV{PATH}")
+71
View File
@@ -0,0 +1,71 @@
if (NOT DEFINED "ENV{GITLAB_CI}")
message(FATAL_ERROR
"This script assumes it is being run inside of GitLab-CI")
endif ()
# Set up the source and build paths.
set(CTEST_SOURCE_DIRECTORY "$ENV{CI_PROJECT_DIR}")
set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build")
if (NOT "$ENV{CTEST_SOURCE_SUBDIRECTORY}" STREQUAL "")
string(APPEND CTEST_SOURCE_DIRECTORY "/$ENV{CTEST_SOURCE_SUBDIRECTORY}")
endif ()
if ("$ENV{CMAKE_CONFIGURATION}" STREQUAL "")
message(FATAL_ERROR
"The CMAKE_CONFIGURATION environment variable is required to know what "
"cache initialization file to use.")
endif ()
# Set the build metadata.
set(CTEST_BUILD_NAME "$ENV{CI_PROJECT_NAME}-$ENV{CMAKE_CONFIGURATION}")
set(CTEST_SITE "gitlab-ci")
set(ctest_model "Experimental")
# Default to Release builds.
if (NOT "$ENV{CMAKE_BUILD_TYPE}" STREQUAL "")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_BUILD_TYPE}")
endif ()
if (NOT CTEST_BUILD_CONFIGURATION)
set(CTEST_BUILD_CONFIGURATION "Release")
endif ()
set(CTEST_CONFIGURATION_TYPE "${CTEST_BUILD_CONFIGURATION}")
# Default to using Ninja.
if (NOT "$ENV{CMAKE_GENERATOR}" STREQUAL "")
set(CTEST_CMAKE_GENERATOR "$ENV{CMAKE_GENERATOR}")
endif ()
if (NOT CTEST_CMAKE_GENERATOR)
set(CTEST_CMAKE_GENERATOR "Ninja")
endif ()
# Set the toolset and platform if requested.
if (NOT "$ENV{CMAKE_GENERATOR_PLATFORM}" STREQUAL "")
set(CTEST_CMAKE_GENERATOR_PLATFORM "$ENV{CMAKE_GENERATOR_PLATFORM}")
endif ()
if (NOT "$ENV{CMAKE_GENERATOR_TOOLSET}" STREQUAL "")
set(CTEST_CMAKE_GENERATOR_TOOLSET "$ENV{CMAKE_GENERATOR_TOOLSET}")
endif ()
# Determine the group to submit to.
set(ctest_group "Experimental")
if (NOT "$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
set(ctest_group "merge-requests")
elseif (NOT "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "" AND "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "$ENV{CI_COMMIT_BRANCH}" AND NOT "$ENV{CMAKE_CI_JOB_CONTINUOUS}" STREQUAL "")
set(ctest_model "Continuous")
if (NOT "$ENV{CMAKE_CI_JOB_HELP}" STREQUAL "")
set(ctest_group "Continuous Help")
else()
set(ctest_group "Continuous")
endif()
string(PREPEND CTEST_BUILD_NAME "continuous-")
elseif (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
set(ctest_model "Nightly")
set(ctest_group "Nightly Expected")
string(PREPEND CTEST_BUILD_NAME "nightly-")
elseif ("$ENV{CI_PROJECT_PATH}" STREQUAL "cmake/cmake")
if ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "master")
set(ctest_group "master")
elseif ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "release")
set(ctest_group "release")
endif ()
endif ()
+18
View File
@@ -0,0 +1,18 @@
$erroractionpreference = "stop"
$version = "1.10.2"
$sha256sum = "BBDE850D247D2737C5764C927D1071CBB1F1957DCABDA4A130FA8547C12C695F"
$filename = "ninja-win"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v$version/$tarball" -OutFile "$outdir\$tarball"
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
exit 1
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
+41
View File
@@ -0,0 +1,41 @@
#!/bin/sh
set -e
readonly version="1.10.2"
baseurl="https://github.com/ninja-build/ninja/releases/download/v$version"
case "$(uname -s)-$(uname -m)" in
Linux-x86_64)
shatool="sha256sum"
sha256sum="763464859c7ef2ea3a0a10f4df40d2025d3bb9438fcb1228404640410c0ec22d"
filename="ninja-linux"
;;
Linux-aarch64)
shatool="sha256sum"
sha256sum="c0c29925fd7f0f24981b3b9d18353c7111c9af59eb6e6b0ffc0c4914cdc7999c"
# Use binary built by adjacent 'docker/ninja/centos7-aarch64.bash' script.
baseurl="https://cmake.org/files/dependencies"
filename="ninja-$version-1-linux-aarch64"
;;
Darwin-*)
shatool="shasum -a 256"
sha256sum="6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5"
filename="ninja-mac"
;;
*)
echo "Unrecognized platform $(uname -s)-$(uname -m)"
exit 1
;;
esac
readonly shatool
readonly sha256sum
readonly tarball="$filename.zip"
cd .gitlab
echo "$sha256sum $tarball" > ninja.sha256sum
curl -OL "$baseurl/$tarball"
$shatool --check ninja.sha256sum
./cmake/bin/cmake -E tar xf "$tarball"
+43
View File
@@ -0,0 +1,43 @@
#!/bin/sh
set -e
readonly version="0.2.15-background-init"
readonly build_date="20210602.0"
case "$( uname -s )-$(uname -m)" in
Linux-aarch64)
shatool="sha256sum"
sha256sum="28b9ad3f591874551a3f4c5c1ff32456d3328c15d7bd8bc63b4e5948a94f1def"
platform="aarch64-unknown-linux-musl"
;;
Linux-x86_64)
shatool="sha256sum"
sha256sum="34d62d30eae1a4145f00d62b01ad21c3456e28f11f8246c936b00cccf4855016"
platform="x86_64-unknown-linux-musl"
;;
Darwin-x86_64|Darwin-arm64)
shatool="shasum -a 256"
sha256sum="2fa396e98cc8d07e39429b187a77386db63d35409902251d462080bdd0087c22"
platform="universal-apple-darwin"
;;
*)
echo "Unrecognized platform $( uname -s )-$( uname -m )"
exit 1
;;
esac
readonly shatool
readonly sha256sum
readonly platform
readonly filename="sccache-v$version-$platform"
readonly url="https://gitlab.kitware.com/api/v4/projects/6955/packages/generic/sccache/v$version-$build_date/"
cd .gitlab
echo "$sha256sum $filename" > sccache.sha256sum
curl -OL "$url/$filename"
$shatool --check sccache.sha256sum
mv "$filename" sccache
chmod +x sccache
+9
View File
@@ -0,0 +1,9 @@
$erroractionpreference = "stop"
cmd /c "`"$env:VCVARSALL`" $VCVARSPLATFORM -vcvars_ver=$VCVARSVERSION & set" |
foreach {
if ($_ -match "=") {
$v = $_.split("=")
[Environment]::SetEnvironmentVariable($v[0], $v[1])
}
}
+18
View File
@@ -0,0 +1,18 @@
$erroractionpreference = "stop"
$release = "wix3112rtm"
$sha256sum = "2C1888D5D1DBA377FC7FA14444CF556963747FF9A0A289A3599CF09DA03B9E2E"
$filename = "wix311-binaries"
$tarball = "$filename.zip"
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/$release/$tarball" -OutFile "$outdir\$tarball"
$hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
exit 1
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir\wix\bin")
+315
View File
@@ -0,0 +1,315 @@
# Linux-specific builder configurations and build commands
## Base images
### Release
.linux_prep_source:
image: "fedora:33"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
.linux_release_x86_64:
image: "kitware/cmake:build-linux-x86_64-deps-2020-04-02@sha256:77e9ab183f34680990db9da5945473e288f0d6556bce79ecc1589670d656e157"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
LAUNCHER: "scl enable devtoolset-6 rh-python36 --"
CMAKE_ARCH: x86_64
.linux_release_aarch64:
image: "kitware/cmake:build-linux-aarch64-deps-2020-12-21@sha256:0bd7dfe4e45593b04e39cd21e44011034610cfd376900558c5ef959bb1af15af"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
LAUNCHER: "scl enable devtoolset-7 --"
CMAKE_ARCH: aarch64
.linux_package:
variables:
BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"'
### Debian
.debian10:
image: "kitware/cmake:ci-debian10-x86_64-2021-04-06"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
CMAKE_ARCH: x86_64
.debian10_iwyu:
extends: .debian10
variables:
CMAKE_CONFIGURATION: debian10_iwyu
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1
.debian10_aarch64:
image: "kitware/cmake:ci-debian10-aarch64-2021-04-06"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
CMAKE_ARCH: aarch64
### Fedora
.fedora33:
image: "kitware/cmake:ci-fedora33-x86_64-2021-04-06"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
CMAKE_ARCH: x86_64
#### Lint builds
.fedora33_tidy:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_tidy
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1
.fedora33_sphinx:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_sphinx
CTEST_NO_WARNINGS_ALLOWED: 1
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
CMake_SKIP_INSTALL: 1
.fedora33_sphinx_package:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_sphinx_package
CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
#### Build and test
.debian10_ninja:
extends: .debian10
variables:
CMAKE_CONFIGURATION: debian10_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.debian10_aarch64_ninja:
extends: .debian10_aarch64
variables:
CMAKE_CONFIGURATION: debian10_aarch64_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora33_ninja:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.fedora33_ninja_multi:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_ninja_multi
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Ninja Multi-Config"
.fedora33_makefiles:
extends: .fedora33
variables:
CMAKE_CONFIGURATION: fedora33_makefiles
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Unix Makefiles"
### CUDA builds
.cuda10.2:
image: "kitware/cmake:ci-cuda10.2-x86_64-2020-06-11"
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
CMAKE_ARCH: x86_64
CTEST_LABELS: "CUDA"
.cuda10.2_nvidia:
extends: .cuda10.2
variables:
CMAKE_CONFIGURATION: cuda10.2_nvidia
CTEST_NO_WARNINGS_ALLOWED: 1
## Tags
.linux_builder_tags:
tags:
- cmake
- build
- docker
- linux
.linux_builder_tags_qt:
tags:
- cmake
- build
- docker
- linux
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
.linux_builder_tags_x11:
tags:
- cmake
- docker
- linux
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
- x11
.linux_builder_tags_cuda:
tags:
- cmake
- cuda-rt
- docker
- linux
.linux_builder_tags_aarch64:
tags:
- cmake
- build
- docker
- linux-aarch64
.linux_builder_tags_aarch64_qt:
tags:
- cmake
- build
- docker
- linux-aarch64
- linux-3.17 # Needed to be able to load Fedora's Qt libraries.
## Linux-specific scripts
.before_script_linux: &before_script_linux
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
.cmake_prep_source_linux:
stage: prep
script:
- *before_script_linux
- dnf install --setopt=install_weak_deps=False -y git-core
- v="$(.gitlab/ci/cmake_version.sh)"
- mkdir -p build/
- git archive --format=tgz "--prefix=cmake-$v/" -o "build/cmake-$v.tar.gz" HEAD
- git -c core.autocrlf=true -c core.eol=crlf archive --format=zip --prefix="cmake-$v/" -o "build/cmake-$v.zip" HEAD
interruptible: true
.cmake_prep_doc_linux:
stage: prep
script:
- *before_script_linux
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
interruptible: true
.cmake_build_linux:
stage: build
script:
- *before_script_linux
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- "$LAUNCHER ctest -VV -S .gitlab/ci/ctest_build.cmake"
- sccache --show-stats
interruptible: true
.cmake_test_linux:
stage: test
script:
- *before_script_linux
- "$LAUNCHER ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake"
interruptible: true
.cmake_build_linux_release:
stage: build
script:
# Bootstrap.
- mkdir -p build/
# Exclude documentation. A job dependency provides it for packaging.
- sed '/^# Build doc/,/^$/d' Utilities/Release/linux/$CMAKE_ARCH/cache.txt > build/CMakeCache.txt
# Make sccache available.
- .gitlab/ci/sccache.sh
- export PATH=$PWD/.gitlab:$PATH
# Append sccache settings to the cache.
- echo "CMAKE_C_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
- echo "CMAKE_CXX_COMPILER_LAUNCHER:STRING=sccache" >> build/CMakeCache.txt
# CI settings.
- echo "CMake_TEST_INSTALL:BOOL=OFF" >> build/CMakeCache.txt
- echo "CMAKE_INSTALL_PREFIX:PATH=$PWD/build/install" >> build/CMakeCache.txt
- echo "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY:BOOL=ON" >> build/CMakeCache.txt
# Appease Git. The Git in this container is old (1.7) and doesn't
# understand some things. But, it doesn't need to, so make it blind.
- mkdir -p .git/info
- echo "* -crlf" >> .git/info/attributes
- git reset --hard
# Bootstrap
- cd build/
- '$LAUNCHER ../bootstrap --parallel=$(nproc) --docdir=doc/cmake $BOOTSTRAP_ARGS'
# FIXME: When CTest can drive an external CMake for the build as well,
# use the scripts here.
- "$LAUNCHER make -j$(nproc)"
# NOTE: This regex matches that used in the release build.
- "$LAUNCHER bin/ctest --output-on-failure -j$(nproc) -R '^(CMake\\.|CMakeLib\\.|CMakeServerLib\\.|RunCMake\\.ctest_memcheck)'"
# Make a package.
- bin/cpack -G TGZ
- bin/cpack -G STGZ
- sccache --show-stats
interruptible: true
.cmake_test_linux_release:
stage: test-ext
script:
- *before_script_linux
# Make the CMake package available.
- mkdir -p build/install
- tar -C build/install --strip-components=1 -xzf build/cmake-*-linux-$CMAKE_ARCH.tar.gz
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake"
- sccache --show-stats
interruptible: true
.cmake_test_linux_external:
stage: test-ext
script:
- *before_script_linux
- .gitlab/ci/sccache.sh
- sccache --start-server
- sccache --show-stats
- "$LAUNCHER build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake"
- sccache --show-stats
interruptible: true
+187
View File
@@ -0,0 +1,187 @@
# macOS-specific builder configurations and build commands
## Base configurations
.macos:
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
# TODO: Factor this out so that each job selects the Xcode version to
# use so that different versions can be tested in a single pipeline.
DEVELOPER_DIR: "/Applications/Xcode-12.5.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
### Build and test
.macos_build:
extends: .macos
variables:
# Note that shell runners only support runners with a single
# concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
# change between the build and test stages which CMake doesn't support.
# Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
.macos_x86_64_ninja:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_x86_64_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.macos_arm64_ninja:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_arm64_ninja
CTEST_NO_WARNINGS_ALLOWED: 1
.macos_x86_64_makefiles:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_x86_64_makefiles
CTEST_NO_WARNINGS_ALLOWED: 1
CMAKE_GENERATOR: "Unix Makefiles"
.macos_package:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos_package
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1
.macos10.10_package:
extends: .macos_build
variables:
CMAKE_CONFIGURATION: macos10.10_package
CTEST_NO_WARNINGS_ALLOWED: 1
CMake_SKIP_INSTALL: 1
### External testing
.macos_x86_64_xcode:
extends: .macos
variables:
CMAKE_CONFIGURATION: macos_x86_64_xcode
CMAKE_GENERATOR: Xcode
CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
.macos_arm64_xcode:
extends: .macos
variables:
CMAKE_CONFIGURATION: macos_arm64_xcode
CMAKE_GENERATOR: Xcode
CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
## Tags
.macos_x86_64_builder_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.5
- nonconcurrent
.macos_x86_64_builder_tags_package:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.5
- nonconcurrent
- finder
.macos_x86_64_builder_ext_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- xcode-12.5
- concurrent
.macos_arm64_builder_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-12.5
- nonconcurrent
.macos_arm64_builder_ext_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-12.5
- concurrent
## macOS-specific scripts
.before_script_macos: &before_script_macos
- .gitlab/ci/cmake.sh
- .gitlab/ci/ninja.sh
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
- cmake --version
- ninja --version
# Download Qt
- cmake -P .gitlab/ci/download_qt.cmake
- export CMAKE_PREFIX_PATH=$PWD/.gitlab/qt
.cmake_build_macos:
stage: build
script:
- *before_script_macos
- .gitlab/ci/sccache.sh
# Allow the server to already be running.
- "sccache --start-server || :"
- sccache --show-stats
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- sccache --show-stats
interruptible: true
.cmake_build_macos_package:
stage: build
script:
- *before_script_macos
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- cd build
- cpack -G TGZ
- cpack -G DragNDrop
interruptible: true
.cmake_test_macos:
stage: test
script:
- *before_script_macos
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
interruptible: true
.cmake_test_macos_external:
stage: test-ext
script:
- *before_script_macos
- .gitlab/ci/sccache.sh
# Allow the server to already be running.
- "sccache --start-server || :"
- sccache --show-stats
- "$LAUNCHER build/install/CMake.app/Contents/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake"
- sccache --show-stats
interruptible: true
+125
View File
@@ -0,0 +1,125 @@
# Windows-specific builder configurations and build commands
## Base configurations
.windows:
variables:
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci ext\\$CI_CONCURRENT_ID"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
### Build and test
.windows_build:
extends: .windows
variables:
# Note that shell runners only support runners with a single
# concurrency level. We can't use `$CI_CONCURRENCY_ID` because this may
# change between the build and test stages which CMake doesn't support.
# Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake ci"
.windows_ninja:
extends: .windows_build
variables:
# Debug and RelWithDebinfo build types use the `/Zi` which results in
# uncacheable compiations.
# https://github.com/mozilla/sccache/issues/242
CMAKE_BUILD_TYPE: Release
CTEST_NO_WARNINGS_ALLOWED: 1
.windows_vs2019_x64_ninja:
extends: .windows_ninja
variables:
CMAKE_CONFIGURATION: windows_vs2019_x64_ninja
VCVARSALL: "${VS160COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x64"
VCVARSVERSION: "14.29.30037"
### External testing
.windows_vs2019_x64:
extends: .windows
variables:
CMAKE_CONFIGURATION: windows_vs2019_x64
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_GENERATOR_PLATFORM: "x64"
CMAKE_GENERATOR_TOOLSET: "v142,version=14.29.30037"
CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true"
## Tags
.windows_builder_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- windows
- shell
- vs2019
- msvc-19.29-16.10
- nonconcurrent
.windows_builder_ext_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- windows
- shell
- vs2019
- msvc-19.29-16.10
- concurrent
## Windows-specific scripts
.before_script_windows: &before_script_windows
- Invoke-Expression -Command .gitlab/ci/wix.ps1
- Invoke-Expression -Command .gitlab/ci/cmake.ps1
- Invoke-Expression -Command .gitlab/ci/ninja.ps1
- $pwdpath = $pwd.Path
- Set-Item -Force -Path "env:WIX" -Value "$pwdpath\.gitlab\wix"
- (& "$env:WIX\bin\light.exe" -help) | Select -First 1
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$pwdpath\.gitlab\cmake\bin;$env:PATH"
- cmake --version
- ninja --version
- cmake -P .gitlab/ci/download_qt.cmake
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\qt\bin;$env:PATH"
- cmake -P .gitlab/ci/download_python3.cmake
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\python3;$env:PATH"
- python --version
.cmake_build_windows:
stage: build
script:
- *before_script_windows
- Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$env:SCCACHE_PATH"
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- sccache --start-server
- sccache --show-stats
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
- ctest -VV -S .gitlab/ci/ctest_build.cmake
- sccache --show-stats
- sccache --stop-server
interruptible: true
.cmake_test_windows:
stage: test
script:
- *before_script_windows
- Invoke-Expression -Command .gitlab/ci/vcvarsall.ps1
- ctest --output-on-failure -V -S .gitlab/ci/ctest_test.cmake
interruptible: true
.cmake_test_windows_external:
stage: test-ext
script:
- build/install/bin/ctest --output-on-failure -V -S .gitlab/ci/ctest_test_external.cmake
interruptible: true
+58
View File
@@ -0,0 +1,58 @@
# Rules for where jobs can run
.run_manually:
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: never
- if: '$CMAKE_CI_NIGHTLY == "true"'
when: on_success
- if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
when: delayed
start_in: 5 minutes
- if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)'
when: never
- if: '$CI_MERGE_REQUEST_ID'
when: manual
- if: '$CI_PROJECT_PATH == "cmake/cmake"'
when: delayed
start_in: 5 minutes
- when: never
.run_automatically:
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: never
- if: '$CMAKE_CI_NIGHTLY == "true"'
when: on_success
- if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
when: on_success
- if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)'
when: never
- if: '$CI_MERGE_REQUEST_ID'
when: on_success
- if: '$CI_PROJECT_PATH == "cmake/cmake"'
when: delayed
start_in: 5 minutes
- when: never
.run_dependent:
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: never
- if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_NIGHTLY_IGNORE_DEPS == "true")'
when: always
- if: '$CMAKE_CI_NIGHTLY == "true"'
when: on_success
- if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)'
when: never
- if: '$CI_MERGE_REQUEST_ID'
when: on_success
- if: '$CI_PROJECT_PATH == "cmake/cmake"'
when: on_success
- when: never
.run_only_for_package:
rules:
- if: '$CMAKE_CI_PACKAGE == "true"'
when: on_success
- when: never
+18
View File
@@ -0,0 +1,18 @@
# Steps for uploading artifacts
.rsync_upload:
image: "fedora:32"
stage: upload
tags:
- docker
- linux
- build
environment:
name: rsync-upload
script:
- ls build/
- dnf install -y --setopt=install_weak_deps=False rsync openssh-clients
- chmod 400 $RSYNC_BINARY_KEY
- ssh-keygen -y -f $RSYNC_BINARY_KEY > $RSYNC_BINARY_KEY.pub
- rsync -tv --recursive -e "ssh -i $RSYNC_BINARY_KEY -o StrictHostKeyChecking=no -o LogLevel=ERROR" build/ kitware@cmake.org:$RSYNC_DESTINATION/
+10
View File
@@ -0,0 +1,10 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# Loaded by .git/hooks/(pre-commit|commit-msg|prepare-commit-msg)
# during git commit after local hooks have been installed.
[hooks "chain"]
pre-commit = Utilities/Git/pre-commit
commit-msg = Utilities/Git/commit-msg
prepare-commit-msg = Utilities/Git/prepare-commit-msg
+16
View File
@@ -0,0 +1,16 @@
# Install Vim files to a typical system integration directory.
# Packagers can set CMake_INSTALL_VIMFILES_DIR to control this.
if(NOT CMake_INSTALL_VIMFILES_DIR)
set(CMake_INSTALL_VIMFILES_DIR ${CMAKE_XDGDATA_DIR}/vim/vimfiles)
endif()
install(DIRECTORY vim/indent vim/syntax DESTINATION ${CMake_INSTALL_VIMFILES_DIR})
# Install Emacs files to a typical system integration directory.
# Packagers can set CMake_INSTALL_EMACS_DIR to control this.
if(NOT CMake_INSTALL_EMACS_DIR)
set(CMake_INSTALL_EMACS_DIR ${CMAKE_XDGDATA_DIR}/emacs/site-lisp)
endif()
install(FILES cmake-mode.el DESTINATION ${CMake_INSTALL_EMACS_DIR})
install(FILES cmake.m4 DESTINATION ${CMAKE_XDGDATA_DIR}/aclocal)
add_subdirectory (bash-completion)
+21
View File
@@ -0,0 +1,21 @@
# We need to integrate into the system install, or this will silently fail to
# accomplish anything at all, and packagers won't even know it exists. Use the
# `<sharedir>/bash-completion/completions/` hierarchy by default, rooted in
# CMake's XDGDATA_DIR definition of the sharedir. This works with installation
# to `/usr` or `/usr/local` (or any prefix which bash-completion is configured
# with) as well as a simple installation by a local user into their home
# directory *if* the prefix is `$HOME/.local` since `.local/share/` is part of
# the bash-completion search path too.
# For more complex installations, packagers can set CMake_INSTALL_BASH_COMP_DIR
# to another system location.
if(NOT CMake_INSTALL_BASH_COMP_DIR)
if(CMAKE_BASH_COMP_DIR)
# Honor previous customization option.
set(CMake_INSTALL_BASH_COMP_DIR "${CMAKE_BASH_COMP_DIR}")
else()
# Default.
set(CMake_INSTALL_BASH_COMP_DIR ${CMAKE_XDGDATA_DIR}/bash-completion/completions)
endif()
endif()
install(FILES cmake cpack ctest DESTINATION ${CMake_INSTALL_BASH_COMP_DIR})
+166
View File
@@ -0,0 +1,166 @@
# bash completion for cmake(1) -*- shell-script -*-
_cmake()
{
local cur prev words cword split=false
if type -t _init_completion >/dev/null; then
_init_completion -n = || return
else
# manual initialization for older bash completion versions
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
fi
# Workaround for options like -DCMAKE_BUILD_TYPE=Release
local prefix=
if [[ $cur == -D* ]]; then
prev=-D
prefix=-D
cur="${cur#-D}"
elif [[ $cur == -U* ]]; then
prev=-U
prefix=-U
cur="${cur#-U}"
fi
case "$prev" in
-D)
if [[ $cur == *=* ]]; then
# complete values for variables
local var type value
var="${cur%%[:=]*}"
value="${cur#*=}"
if [[ $cur == CMAKE_BUILD_TYPE* ]]; then # most widely used case
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
MinSizeRel' -- "$value" ) )
return
fi
if [[ $cur == *:* ]]; then
type="${cur#*:}"
type="${type%%=*}"
else # get type from cache if it's not set explicitly
type=$( cmake -LA -N 2>/dev/null | grep "$var:" \
2>/dev/null )
type="${type#*:}"
type="${type%%=*}"
fi
case "$type" in
FILEPATH)
cur="$value"
_filedir
return
;;
PATH)
cur="$value"
_filedir -d
return
;;
BOOL)
COMPREPLY=( $( compgen -W 'ON OFF TRUE FALSE' -- \
"$value" ) )
return
;;
STRING|INTERNAL)
# no completion available
return
;;
esac
elif [[ $cur == *:* ]]; then
# complete types
local type="${cur#*:}"
COMPREPLY=( $( compgen -W 'FILEPATH PATH STRING BOOL INTERNAL'\
-S = -- "$type" ) )
compopt -o nospace
else
# complete variable names
COMPREPLY=( $( compgen -W '$( cmake -LA -N 2>/dev/null |
tail -n +2 | cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
compopt -o nospace
fi
return
;;
-U)
COMPREPLY=( $( compgen -W '$( cmake -LA -N | tail -n +2 |
cut -f1 -d: )' -P "$prefix" -- "$cur" ) )
return
;;
esac
_split_longopt && split=true
case "$prev" in
-C|-P|--graphviz|--system-information)
_filedir
return
;;
--build|--install|--open)
_filedir -d
return
;;
-E)
COMPREPLY=( $( compgen -W "$( cmake -E help |& sed -n \
'/^ [^ ]/{s|^ \([^ ]\{1,\}\) .*$|\1|;p}' 2>/dev/null )" \
-- "$cur" ) )
return
;;
-G)
local IFS=$'\n'
local quoted
printf -v quoted %q "$cur"
COMPREPLY=( $( compgen -W '$( cmake --help 2>/dev/null | sed -n \
-e "1,/^Generators/d" \
-e "/^ *[^ =]/{s|^ *\([^=]*[^ =]\).*$|\1|;s| |\\\\ |g;p}" \
2>/dev/null )' -- "$quoted" ) )
return
;;
--loglevel)
COMPREPLY=( $(compgen -W 'error warning notice status verbose debug trace' -- $cur ) )
;;
--help-command)
COMPREPLY=( $( compgen -W '$( cmake --help-command-list 2>/dev/null|
grep -v "^cmake version " )' -- "$cur" ) )
return
;;
--help-manual)
COMPREPLY=( $( compgen -W '$( cmake --help-manual-list 2>/dev/null|
grep -v "^cmake version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
return
;;
--help-module)
COMPREPLY=( $( compgen -W '$( cmake --help-module-list 2>/dev/null|
grep -v "^cmake version " )' -- "$cur" ) )
return
;;
--help-policy)
COMPREPLY=( $( compgen -W '$( cmake --help-policy-list 2>/dev/null |
grep -v "^cmake version " )' -- "$cur" ) )
return
;;
--help-property)
COMPREPLY=( $( compgen -W '$( cmake --help-property-list \
2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
return
;;
--help-variable)
COMPREPLY=( $( compgen -W '$( cmake --help-variable-list \
2>/dev/null | grep -v "^cmake version " )' -- "$cur" ) )
return
;;
esac
$split && return
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
[[ $COMPREPLY ]] && return
fi
_filedir
} &&
complete -F _cmake cmake
# ex: ts=4 sw=4 et filetype=sh
+88
View File
@@ -0,0 +1,88 @@
# bash completion for cpack(1) -*- shell-script -*-
_cpack()
{
local cur prev words cword
if type -t _init_completion >/dev/null; then
_init_completion -n = || return
else
# manual initialization for older bash completion versions
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
fi
case "$prev" in
-G)
COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
sed -e "1,/^Generators/d" -e "s|^ *\([^ ]*\) .*$|\1|" \
2>/dev/null )' -- "$cur" ) )
return
;;
-C)
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
MinSizeRel' -- "$cur" ) )
return
;;
-D)
[[ $cur == *=* ]] && return # no completion for values
COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
2>/dev/null | grep -v "^cpack version " )' -S = -- "$cur" ) )
compopt -o nospace
return
;;
-P|-R|--vendor)
# argument required but no completions available
return
;;
-B)
_filedir -d
return
;;
--config)
_filedir
return
;;
--help-command)
COMPREPLY=( $( compgen -W '$( cpack --help-command-list 2>/dev/null|
grep -v "^cpack version " )' -- "$cur" ) )
return
;;
--help-manual)
COMPREPLY=( $( compgen -W '$( cpack --help-manual-list 2>/dev/null|
grep -v "^cpack version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
return
;;
--help-module)
COMPREPLY=( $( compgen -W '$( cpack --help-module-list 2>/dev/null|
grep -v "^cpack version " )' -- "$cur" ) )
return
;;
--help-policy)
COMPREPLY=( $( compgen -W '$( cpack --help-policy-list 2>/dev/null |
grep -v "^cpack version " )' -- "$cur" ) )
return
;;
--help-property)
COMPREPLY=( $( compgen -W '$( cpack --help-property-list \
2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) )
return
;;
--help-variable)
COMPREPLY=( $( compgen -W '$( cpack --help-variable-list \
2>/dev/null | grep -v "^cpack version " )' -- "$cur" ) )
return
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
[[ $COMPREPLY ]] && return
fi
_filedir
} &&
complete -F _cpack cpack
# ex: ts=4 sw=4 et filetype=sh
+118
View File
@@ -0,0 +1,118 @@
# bash completion for ctest(1) -*- shell-script -*-
_ctest()
{
local cur prev words cword
if type -t _init_completion >/dev/null; then
_init_completion -n = || return
else
# manual initialization for older bash completion versions
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
fi
case "$prev" in
-C|--build-config)
COMPREPLY=( $( compgen -W 'Debug Release RelWithDebInfo
MinSizeRel' -- "$cur" ) )
return
;;
-j|--parallel)
COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) )
return
;;
-O|--output-log|-A|--add-notes|--extra-submit)
_filedir
return
;;
-L|--label-regex|-LE|--label-exclude)
COMPREPLY=( $( compgen -W '$( ctest --print-labels 2>/dev/null |
grep "^ " 2>/dev/null | cut -d" " -f 3 )' -- "$cur" ) )
return
;;
--track|-I|--tests-information|--max-width|--timeout|--stop-time)
# argument required but no completions available
return
;;
-R|--tests-regex|-E|--exclude-regex)
COMPREPLY=( $( compgen -W '$( ctest -N 2>/dev/null |
grep "^ Test" 2>/dev/null | cut -d: -f 2 )' -- "$cur" ) )
return
;;
-D|--dashboard)
if [[ $cur == @(Experimental|Nightly|Continuous)* ]]; then
local model action
action=${cur#@(Experimental|Nightly|Continuous)}
model=${cur%"$action"}
COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
Coverage Submit MemCheck' -P "$model" -- "$action" ) )
else
COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' \
-- "$cur" ) )
compopt -o nospace
fi
return
;;
-M|--test-model)
COMPREPLY=( $( compgen -W 'Experimental Nightly Continuous' -- \
"$cur" ) )
return
;;
-T|--test-action)
COMPREPLY=( $( compgen -W 'Start Update Configure Build Test
Coverage Submit MemCheck' -- "$cur" ) )
return
;;
-S|--script|-SP|--script-new-process)
_filedir '@(cmake|ctest)'
return
;;
--interactive-debug-mode)
COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
return
;;
--help-command)
COMPREPLY=( $( compgen -W '$( ctest --help-command-list 2>/dev/null|
grep -v "^ctest version " )' -- "$cur" ) )
return
;;
--help-manual)
COMPREPLY=( $( compgen -W '$( ctest --help-manual-list 2>/dev/null|
grep -v "^ctest version " | sed -e "s/([0-9])$//" )' -- "$cur" ) )
return
;;
--help-module)
COMPREPLY=( $( compgen -W '$( ctest --help-module-list 2>/dev/null|
grep -v "^ctest version " )' -- "$cur" ) )
return
;;
--help-policy)
COMPREPLY=( $( compgen -W '$( ctest --help-policy-list 2>/dev/null |
grep -v "^ctest version " )' -- "$cur" ) )
return
;;
--help-property)
COMPREPLY=( $( compgen -W '$( ctest --help-property-list \
2>/dev/null | grep -v "^ctest version " )' -- "$cur" ) )
return
;;
--help-variable)
COMPREPLY=( $( compgen -W '$( ctest --help-variable-list \
2>/dev/null | grep -v "^ctest version " )' -- "$cur" ) )
return
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W '$( _parse_help "$1" --help )' -- ${cur}) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
[[ $COMPREPLY ]] && return
fi
_filedir
} &&
complete -F _ctest ctest
# ex: ts=4 sw=4 et filetype=sh
+473
View File
@@ -0,0 +1,473 @@
;;; cmake-mode.el --- major-mode for editing CMake sources
;; Package-Requires: ((emacs "24.1"))
; Distributed under the OSI-approved BSD 3-Clause License. See accompanying
; file Copyright.txt or https://cmake.org/licensing for details.
;------------------------------------------------------------------------------
;;; Commentary:
;; Provides syntax highlighting and indentation for CMakeLists.txt and
;; *.cmake source files.
;;
;; Add this code to your .emacs file to use the mode:
;;
;; (setq load-path (cons (expand-file-name "/dir/with/cmake-mode") load-path))
;; (require 'cmake-mode)
;------------------------------------------------------------------------------
;;; Code:
;;
;; cmake executable variable used to run cmake --help-command
;; on commands in cmake-mode
;;
;; cmake-command-help Written by James Bigler
;;
(require 'rst)
(require 'rx)
(defcustom cmake-mode-cmake-executable "cmake"
"*The name of the cmake executable.
This can be either absolute or looked up in $PATH. You can also
set the path with these commands:
(setenv \"PATH\" (concat (getenv \"PATH\") \";C:\\\\Program Files\\\\CMake 2.8\\\\bin\"))
(setenv \"PATH\" (concat (getenv \"PATH\") \":/usr/local/cmake/bin\"))"
:type 'file
:group 'cmake)
;; Keywords
(defconst cmake-keywords-block-open '("IF" "MACRO" "FOREACH" "ELSE" "ELSEIF" "WHILE" "FUNCTION"))
(defconst cmake-keywords-block-close '("ENDIF" "ENDFOREACH" "ENDMACRO" "ELSE" "ELSEIF" "ENDWHILE" "ENDFUNCTION"))
(defconst cmake-keywords
(let ((kwds (append cmake-keywords-block-open cmake-keywords-block-close nil)))
(delete-dups kwds)))
;; Regular expressions used by line indentation function.
;;
(defconst cmake-regex-blank "^[ \t]*$")
(defconst cmake-regex-comment "#.*")
(defconst cmake-regex-paren-left "(")
(defconst cmake-regex-paren-right ")")
(defconst cmake-regex-argument-quoted
(rx ?\" (* (or (not (any ?\" ?\\)) (and ?\\ anything))) ?\"))
(defconst cmake-regex-argument-unquoted
(rx (or (not (any space "()#\"\\\n")) (and ?\\ nonl))
(* (or (not (any space "()#\\\n")) (and ?\\ nonl)))))
(defconst cmake-regex-token
(rx-to-string `(group (or (regexp ,cmake-regex-comment)
?\( ?\)
(regexp ,cmake-regex-argument-unquoted)
(regexp ,cmake-regex-argument-quoted)))))
(defconst cmake-regex-indented
(rx-to-string `(and bol (* (group (or (regexp ,cmake-regex-token) (any space ?\n)))))))
(defconst cmake-regex-block-open
(rx-to-string `(and symbol-start (or ,@(append cmake-keywords-block-open
(mapcar 'downcase cmake-keywords-block-open))) symbol-end)))
(defconst cmake-regex-block-close
(rx-to-string `(and symbol-start (or ,@(append cmake-keywords-block-close
(mapcar 'downcase cmake-keywords-block-close))) symbol-end)))
(defconst cmake-regex-close
(rx-to-string `(and bol (* space) (regexp ,cmake-regex-block-close)
(* space) (regexp ,cmake-regex-paren-left))))
;------------------------------------------------------------------------------
;; Line indentation helper functions
(defun cmake-line-starts-inside-string ()
"Determine whether the beginning of the current line is in a string."
(save-excursion
(beginning-of-line)
(let ((parse-end (point)))
(goto-char (point-min))
(nth 3 (parse-partial-sexp (point) parse-end))
)
)
)
(defun cmake-find-last-indented-line ()
"Move to the beginning of the last line that has meaningful indentation."
(let ((point-start (point))
region)
(forward-line -1)
(setq region (buffer-substring-no-properties (point) point-start))
(while (and (not (bobp))
(or (looking-at cmake-regex-blank)
(cmake-line-starts-inside-string)
(not (and (string-match cmake-regex-indented region)
(= (length region) (match-end 0))))))
(forward-line -1)
(setq region (buffer-substring-no-properties (point) point-start))
)
)
)
;------------------------------------------------------------------------------
;;
;; Indentation increment.
;;
(defcustom cmake-tab-width 2
"Number of columns to indent cmake blocks"
:type 'integer
:group 'cmake)
;;
;; Line indentation function.
;;
(defun cmake-indent ()
"Indent current line as CMake code."
(interactive)
(unless (cmake-line-starts-inside-string)
(if (bobp)
(cmake-indent-line-to 0)
(let (cur-indent)
(save-excursion
(beginning-of-line)
(let ((point-start (point))
(case-fold-search t) ;; case-insensitive
token)
; Search back for the last indented line.
(cmake-find-last-indented-line)
; Start with the indentation on this line.
(setq cur-indent (current-indentation))
; Search forward counting tokens that adjust indentation.
(while (re-search-forward cmake-regex-token point-start t)
(setq token (match-string 0))
(when (or (string-match (concat "^" cmake-regex-paren-left "$") token)
(and (string-match cmake-regex-block-open token)
(looking-at (concat "[ \t]*" cmake-regex-paren-left))))
(setq cur-indent (+ cur-indent cmake-tab-width)))
(when (string-match (concat "^" cmake-regex-paren-right "$") token)
(setq cur-indent (- cur-indent cmake-tab-width)))
)
(goto-char point-start)
;; If next token closes the block, decrease indentation
(when (looking-at cmake-regex-close)
(setq cur-indent (- cur-indent cmake-tab-width))
)
)
)
; Indent this line by the amount selected.
(cmake-indent-line-to (max cur-indent 0))
)
)
)
)
(defun cmake-point-in-indendation ()
(string-match "^[ \\t]*$" (buffer-substring (point-at-bol) (point))))
(defun cmake-indent-line-to (column)
"Indent the current line to COLUMN.
If point is within the existing indentation it is moved to the end of
the indentation. Otherwise it retains the same position on the line"
(if (cmake-point-in-indendation)
(indent-line-to column)
(save-excursion (indent-line-to column))))
;------------------------------------------------------------------------------
;;
;; Helper functions for buffer
;;
(defun cmake-unscreamify-buffer ()
"Convert all CMake commands to lowercase in buffer."
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "^\\([ \t]*\\)\\_<\\(\\(?:\\w\\|\\s_\\)+\\)\\_>\\([ \t]*(\\)" nil t)
(replace-match
(concat
(match-string 1)
(downcase (match-string 2))
(match-string 3))
t))
)
)
;------------------------------------------------------------------------------
;;
;; Navigation / marking by function or macro
;;
(defconst cmake--regex-defun-start
(rx line-start
(zero-or-more space)
(or "function" "macro")
(zero-or-more space)
"("))
(defconst cmake--regex-defun-end
(rx line-start
(zero-or-more space)
"end"
(or "function" "macro")
(zero-or-more space)
"(" (zero-or-more (not-char ")")) ")"))
(defun cmake-beginning-of-defun ()
"Move backward to the beginning of a CMake function or macro.
Return t unless search stops due to beginning of buffer."
(interactive)
(when (not (region-active-p))
(push-mark))
(let ((case-fold-search t))
(when (re-search-backward cmake--regex-defun-start nil 'move)
t)))
(defun cmake-end-of-defun ()
"Move forward to the end of a CMake function or macro.
Return t unless search stops due to end of buffer."
(interactive)
(when (not (region-active-p))
(push-mark))
(let ((case-fold-search t))
(when (re-search-forward cmake--regex-defun-end nil 'move)
(forward-line)
t)))
(defun cmake-mark-defun ()
"Mark the current CMake function or macro.
This puts the mark at the end, and point at the beginning."
(interactive)
(cmake-end-of-defun)
(push-mark nil :nomsg :activate)
(cmake-beginning-of-defun))
;------------------------------------------------------------------------------
;;
;; Keyword highlighting regex-to-face map.
;;
(defconst cmake-font-lock-keywords
`((,(rx-to-string `(and symbol-start
(or ,@cmake-keywords
,@(mapcar #'downcase cmake-keywords))
symbol-end))
. font-lock-keyword-face)
(,(rx symbol-start (group (+ (or word (syntax symbol)))) (* blank) ?\()
1 font-lock-function-name-face)
(,(rx "${" (group (+(any alnum "-_+/."))) "}")
1 font-lock-variable-name-face t)
)
"Highlighting expressions for CMake mode.")
;------------------------------------------------------------------------------
;; Syntax table for this mode.
(defvar cmake-mode-syntax-table nil
"Syntax table for CMake mode.")
(or cmake-mode-syntax-table
(setq cmake-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\( "()" table)
(modify-syntax-entry ?\) ")(" table)
(modify-syntax-entry ?# "<" table)
(modify-syntax-entry ?\n ">" table)
(modify-syntax-entry ?$ "'" table)
table)))
;;
;; User hook entry point.
;;
(defvar cmake-mode-hook nil)
;;------------------------------------------------------------------------------
;; Mode definition.
;;
;;;###autoload
(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
; Setup font-lock mode.
(set (make-local-variable 'font-lock-defaults) '(cmake-font-lock-keywords))
; Setup indentation function.
(set (make-local-variable 'indent-line-function) 'cmake-indent)
; Setup comment syntax.
(set (make-local-variable 'comment-start) "#"))
;; Default cmake-mode key bindings
(define-key cmake-mode-map "\e\C-a" #'cmake-beginning-of-defun)
(define-key cmake-mode-map "\e\C-e" #'cmake-end-of-defun)
(define-key cmake-mode-map "\e\C-h" #'cmake-mark-defun)
; Help mode starts here
;;;###autoload
(defun cmake-command-run (type &optional topic buffer)
"Runs the command cmake with the arguments specified. The
optional argument topic will be appended to the argument list."
(interactive "s")
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
(buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
(command (concat cmake-mode-cmake-executable " " type " " topic))
;; Turn of resizing of mini-windows for shell-command.
(resize-mini-windows nil)
)
(shell-command command buffer)
(save-selected-window
(select-window (display-buffer buffer 'not-this-window))
(cmake-mode)
(read-only-mode 1)
(view-mode 1))
)
)
;;;###autoload
(defun cmake-command-run-help (type &optional topic buffer)
"`cmake-command-run' but rendered in `rst-mode'."
(interactive "s")
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
(buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
(command (concat cmake-mode-cmake-executable " " type " " topic))
;; Turn of resizing of mini-windows for shell-command.
(resize-mini-windows nil)
)
(shell-command command buffer)
(save-selected-window
(select-window (display-buffer buffer 'not-this-window))
(rst-mode)
(read-only-mode 1)
(view-mode 1))
)
)
;;;###autoload
(defun cmake-help-list-commands ()
"Prints out a list of the cmake commands."
(interactive)
(cmake-command-run-help "--help-command-list")
)
(defvar cmake-commands '() "List of available topics for --help-command.")
(defvar cmake-help-command-history nil "Command read history.")
(defvar cmake-modules '() "List of available topics for --help-module.")
(defvar cmake-help-module-history nil "Module read history.")
(defvar cmake-variables '() "List of available topics for --help-variable.")
(defvar cmake-help-variable-history nil "Variable read history.")
(defvar cmake-properties '() "List of available topics for --help-property.")
(defvar cmake-help-property-history nil "Property read history.")
(defvar cmake-help-complete-history nil "Complete help read history.")
(defvar cmake-string-to-list-symbol
'(("command" cmake-commands cmake-help-command-history)
("module" cmake-modules cmake-help-module-history)
("variable" cmake-variables cmake-help-variable-history)
("property" cmake-properties cmake-help-property-history)
))
(defun cmake-get-list (listname)
"If the value of LISTVAR is nil, run cmake --help-LISTNAME-list
and store the result as a list in LISTVAR."
(let ((listvar (car (cdr (assoc listname cmake-string-to-list-symbol)))))
(if (not (symbol-value listvar))
(let ((temp-buffer-name "*CMake Temporary*"))
(save-window-excursion
(cmake-command-run-help (concat "--help-" listname "-list") nil temp-buffer-name)
(with-current-buffer temp-buffer-name
; FIXME: Ignore first line if it is "cmake version ..." from CMake < 3.0.
(set listvar (split-string (buffer-substring-no-properties (point-min) (point-max)) "\n" t)))))
(symbol-value listvar)
))
)
(require 'thingatpt)
(defun cmake-symbol-at-point ()
(let ((symbol (symbol-at-point)))
(and (not (null symbol))
(symbol-name symbol))))
(defun cmake-help-type (type)
(let* ((default-entry (cmake-symbol-at-point))
(history (car (cdr (cdr (assoc type cmake-string-to-list-symbol)))))
(input (completing-read
(format "CMake %s: " type) ; prompt
(cmake-get-list type) ; completions
nil ; predicate
t ; require-match
default-entry ; initial-input
history
)))
(if (string= input "")
(error "No argument given")
input))
)
;;;###autoload
(defun cmake-help-command ()
"Prints out the help message for the command the cursor is on."
(interactive)
(cmake-command-run-help "--help-command" (cmake-help-type "command") "*CMake Help*"))
;;;###autoload
(defun cmake-help-module ()
"Prints out the help message for the module the cursor is on."
(interactive)
(cmake-command-run-help "--help-module" (cmake-help-type "module") "*CMake Help*"))
;;;###autoload
(defun cmake-help-variable ()
"Prints out the help message for the variable the cursor is on."
(interactive)
(cmake-command-run-help "--help-variable" (cmake-help-type "variable") "*CMake Help*"))
;;;###autoload
(defun cmake-help-property ()
"Prints out the help message for the property the cursor is on."
(interactive)
(cmake-command-run-help "--help-property" (cmake-help-type "property") "*CMake Help*"))
;;;###autoload
(defun cmake-help ()
"Queries for any of the four available help topics and prints out the appropriate page."
(interactive)
(let* ((default-entry (cmake-symbol-at-point))
(command-list (cmake-get-list "command"))
(variable-list (cmake-get-list "variable"))
(module-list (cmake-get-list "module"))
(property-list (cmake-get-list "property"))
(all-words (append command-list variable-list module-list property-list))
(input (completing-read
"CMake command/module/variable/property: " ; prompt
all-words ; completions
nil ; predicate
t ; require-match
default-entry ; initial-input
'cmake-help-complete-history
)))
(if (string= input "")
(error "No argument given")
(if (member input command-list)
(cmake-command-run-help "--help-command" input "*CMake Help*")
(if (member input variable-list)
(cmake-command-run-help "--help-variable" input "*CMake Help*")
(if (member input module-list)
(cmake-command-run-help "--help-module" input "*CMake Help*")
(if (member input property-list)
(cmake-command-run-help "--help-property" input "*CMake Help*")
(error "Not a know help topic.") ; this really should not happen
))))))
)
;;;###autoload
(progn
(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode)))
; This file provides cmake-mode.
(provide 'cmake-mode)
;;; cmake-mode.el ends here
+44
View File
@@ -0,0 +1,44 @@
dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
dnl file Copyright.txt or https://cmake.org/licensing for details.
AC_DEFUN([CMAKE_FIND_BINARY],
[AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then
AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl
fi
])dnl
# $1: package name
# $2: language (e.g. C/CXX/Fortran)
# $3: The compiler ID, defaults to GNU.
# Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
# PathScale, Cray, SCO, MSVC
# $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
# $5: optional path to cmake binary
AC_DEFUN([CMAKE_FIND_PACKAGE], [
AC_REQUIRE([CMAKE_FIND_BINARY])dnl
AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl
failed=false
AC_MSG_CHECKING([for $1])
if test -z "${$1[]_$2[]FLAGS}"; then
$1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true
fi
if test -z "${$1[]_LIBS}"; then
$1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true
fi
if $failed; then
unset $1[]_$2[]FLAGS
unset $1[]_LIBS
AC_MSG_RESULT([no])
$6
else
AC_MSG_RESULT([yes])
$5
fi[]dnl
])
+130
View File
@@ -0,0 +1,130 @@
" Vim syntax file
" Program: CMake - Cross-Platform Makefile Generator
" Version: @VERSION@
" Language: CMake
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>,
" Nicholas Hutchinson <nshutchinson@gmail.com>,
" Patrick Boettcher <patrick.boettcher@posteo.de>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: @DATE@
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:current_syntax")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped
syn region cmakeGeneratorExpression start="$<" end=">" contained oneline contains=cmakeVariableValue,cmakeProperty,cmakeGeneratorExpressions,cmakeTodo
syn region cmakeString start='"' end='"' contained contains=cmakeTodo,cmakeVariableValue,cmakeEscaped
syn region cmakeVariableValue start="${" end="}" contained oneline contains=cmakeVariable,cmakeTodo,cmakeVariableValue
syn region cmakeEnvironment start="$ENV{" end="}" contained oneline contains=cmakeTodo
syn region cmakeArguments start="(" end=")" contains=ALLBUT,cmakeGeneratorExpressions,cmakeCommand,cmakeCommandConditional,cmakeCommandRepeat,cmakeCommandDeprecated,cmakeCommandManuallyAdded,cmakeArguments,cmakeTodo
syn case match
syn keyword cmakeProperty contained
@PROPERTIES@
syn keyword cmakeVariable contained
@VARIABLE_LIST@
syn keyword cmakeModule contained
@MODULES@
@KEYWORDS@
syn keyword cmakeGeneratorExpressions contained
@GENERATOR_EXPRESSIONS@
syn case ignore
syn keyword cmakeCommand
@COMMAND_LIST@
\ nextgroup=cmakeArguments
syn keyword cmakeCommandConditional
@CONDITIONALS@
\ nextgroup=cmakeArguments
syn keyword cmakeCommandRepeat
@LOOPS@
\ nextgroup=cmakeArguments
syn keyword cmakeCommandDeprecated
@DEPRECATED@
\ nextgroup=cmakeArguments
syn case match
syn keyword cmakeTodo
\ TODO FIXME XXX
\ contained
hi def link cmakeBracketArgument String
hi def link cmakeBracketComment Comment
hi def link cmakeCommand Function
hi def link cmakeCommandConditional Conditional
hi def link cmakeCommandDeprecated WarningMsg
hi def link cmakeCommandRepeat Repeat
hi def link cmakeComment Comment
hi def link cmakeEnvironment Special
hi def link cmakeEscaped Special
hi def link cmakeGeneratorExpression WarningMsg
hi def link cmakeGeneratorExpressions Constant
hi def link cmakeModule Include
hi def link cmakeProperty Constant
hi def link cmakeRegistry Underlined
hi def link cmakeString String
hi def link cmakeTodo TODO
hi def link cmakeVariableValue Type
hi def link cmakeVariable Identifier
@KEYWORDS_HIGHLIGHT@
" Manually added - difficult to parse out of documentation
syn case ignore
syn keyword cmakeCommandManuallyAdded
\ configure_package_config_file write_basic_package_version_file
\ nextgroup=cmakeArguments
syn case match
syn keyword cmakeKWconfigure_package_config_file contained
\ INSTALL_DESTINATION PATH_VARS NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO INSTALL_PREFIX
syn keyword cmakeKWconfigure_package_config_file_constants contained
\ AnyNewerVersion SameMajorVersion SameMinorVersion ExactVersion
syn keyword cmakeKWwrite_basic_package_version_file contained
\ VERSION COMPATIBILITY
hi def link cmakeCommandManuallyAdded Function
hi def link cmakeKWconfigure_package_config_file ModeMsg
hi def link cmakeKWwrite_basic_package_version_file ModeMsg
hi def link cmakeKWconfigure_package_config_file_constants Constant
let b:current_syntax = "cmake"
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: set nowrap:
+213
View File
@@ -0,0 +1,213 @@
#!/usr/bin/env perl
use strict;
use warnings;
use POSIX qw(strftime);
use JSON;
use File::Basename;
#my $cmake = "/home/pboettch/devel/upstream/cmake/build/bin/cmake";
my $cmake = "cmake";
my @variables;
my @commands;
my @properties;
my @modules;
my %keywords; # command => keyword-list
# find cmake/Modules/ | sed -rn 's/.*CMakeDetermine(.+)Compiler.cmake/\1/p' | sort
my @languages = qw(ASM ASM_MASM ASM_NASM C CSharp CUDA CXX Fortran Java RC Swift);
# unwanted upper-cases
my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR NEW);
# cannot remove ALL - exists for add_custom_command
# control-statements
my %conditional = map { $_ => 1 } qw(if else elseif endif);
my %loop = map { $_ => 1 } qw(foreach while endforeach endwhile);
# decrecated
my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file);
# add some (popular) modules
push @modules, "ExternalProject";
# variables
open(CMAKE, "$cmake --help-variable-list|") or die "could not run cmake";
while (<CMAKE>) {
chomp;
if (/<(.*?)>/) {
if ($1 eq 'LANG') {
foreach my $lang (@languages) {
(my $V = $_) =~ s/<.*>/$lang/;
push @variables, $V;
}
next
} else {
next; # skip if containing < or >
}
}
push @variables, $_;
}
close(CMAKE);
# transform all variables in a hash - to be able to use exists later on
my %variables = map { $_ => 1 } @variables;
# commands
open(CMAKE, "$cmake --help-command-list|");
while (my $cmd = <CMAKE>) {
chomp $cmd;
push @commands, $cmd;
}
close(CMAKE);
# now generate a keyword-list per command
foreach my $cmd (@commands) {
my @word = extract_upper("$cmake --help-command $cmd|");
next if scalar @word == 0;
$keywords{$cmd} = [ sort keys %{ { map { $_ => 1 } @word } } ];
}
# and now for modules
foreach my $mod (@modules) {
my @word = extract_upper("$cmake --help-module $mod|");
next if scalar @word == 0;
$keywords{$mod} = [ sort keys %{ { map { $_ => 1 } @word } } ];
}
# and now for generator-expressions
my @generator_expr = extract_upper("$cmake --help-manual cmake-generator-expressions |");
# properties
open(CMAKE, "$cmake --help-property-list|");
while (<CMAKE>) {
next if /\</; # skip if containing < or >
chomp;
push @properties, $_;
}
close(CMAKE);
# transform all properties in a hash
my %properties = map { $_ => 1 } @properties;
# read in manually written files
my $modules_dir = dirname(__FILE__) . "/modules";
opendir(DIR, $modules_dir) || die "can't opendir $modules_dir: $!";
my @json_files = grep { /\.json$/ && -f "$modules_dir/$_" } readdir(DIR);
closedir DIR;
foreach my $file (@json_files) {
local $/; # Enable 'slurp' mode
open my $fh, "<", $modules_dir."/".$file;
my $json = <$fh>;
close $fh;
my $mod = decode_json($json);
foreach my $var (@{$mod->{variables}}) {
$variables{$var} = 1;
}
while (my ($cmd, $keywords) = each %{$mod->{commands}}) {
$keywords{$cmd} = [ sort @{$keywords} ];
}
}
# version
open(CMAKE, "$cmake --version|");
my $version = 'unknown';
while (<CMAKE>) {
chomp;
$version = $_ if /cmake version/;
}
close(CMAKE);
# generate cmake.vim
open(IN, "<cmake.vim.in") or die "could not read cmake.vim.in";
open(OUT, ">syntax/cmake.vim") or die "could not write to syntax/cmake.vim";
my @keyword_hi;
while(<IN>)
{
if (m/\@([A-Z0-9_]+)\@/) { # match for @SOMETHING@
if ($1 eq "COMMAND_LIST") {
# do not include "special" commands in this list
my @tmp = grep { ! exists $conditional{$_} and
! exists $loop{$_} and
! exists $deprecated{$_} } @commands;
print_list(\*OUT, @tmp);
} elsif ($1 eq "VARIABLE_LIST") {
print_list(\*OUT, keys %variables);
} elsif ($1 eq "MODULES") {
print_list(\*OUT, @modules);
} elsif ($1 eq "GENERATOR_EXPRESSIONS") {
print_list(\*OUT, @generator_expr);
} elsif ($1 eq "CONDITIONALS") {
print_list(\*OUT, keys %conditional);
} elsif ($1 eq "LOOPS") {
print_list(\*OUT, keys %loop);
} elsif ($1 eq "DEPRECATED") {
print_list(\*OUT, keys %deprecated);
} elsif ($1 eq "PROPERTIES") {
print_list(\*OUT, keys %properties);
} elsif ($1 eq "KEYWORDS") {
foreach my $k (sort keys %keywords) {
print OUT "syn keyword cmakeKW$k contained\n";
print_list(\*OUT, @{$keywords{$k}});
print OUT "\n";
push @keyword_hi, "hi def link cmakeKW$k ModeMsg";
}
} elsif ($1 eq "KEYWORDS_HIGHLIGHT") {
print OUT join("\n", @keyword_hi), "\n";
} elsif ($1 eq "VERSION") {
$_ =~ s/\@VERSION\@/$version/;
print OUT $_;
} elsif ($1 eq "DATE") {
my $date = strftime "%Y %b %d", localtime;
$_ =~ s/\@DATE\@/$date/;
print OUT $_;
} else {
print "ERROR do not know how to replace $1\n";
}
} else {
print OUT $_;
}
}
close(IN);
close(OUT);
sub extract_upper
{
my $input = shift;
my @word;
open(KW, $input);
while (<KW>) {
foreach my $w (m/\b([A-Z_]{2,})\b/g) {
next
if exists $variables{$w} or # skip if it is a variable
exists $unwanted{$w} or # skip if not wanted
grep(/$w/, @word); # skip if already in array
push @word, $w;
}
}
close(KW);
return @word;
}
sub print_list
{
my $O = shift;
my $indent = " " x 12 . "\\ ";
print $O $indent, join("\n" . $indent, sort @_), "\n";
}
+89
View File
@@ -0,0 +1,89 @@
" Vim indent file
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: 2017 Aug 30
"
" Licence: The CMake license applies to this file. See
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
let s:keepcpo= &cpo
set cpo&vim
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
" Only define the function once.
if exists("*CMakeGetIndent")
finish
endif
fun! CMakeGetIndent(lnum)
let this_line = getline(a:lnum)
" Find a non-blank line above the current line.
let lnum = a:lnum
let lnum = prevnonblank(lnum - 1)
let previous_line = getline(lnum)
" Hit the start of the file, use zero indent.
if lnum == 0
return 0
endif
let ind = indent(lnum)
let or = '\|'
" Regular expressions used by line indentation function.
let cmake_regex_comment = '#.*'
let cmake_regex_identifier = '[A-Za-z][A-Za-z0-9_]*'
let cmake_regex_quoted = '"\([^"\\]\|\\.\)*"'
let cmake_regex_arguments = '\(' . cmake_regex_quoted .
\ or . '\$(' . cmake_regex_identifier . ')' .
\ or . '[^()\\#"]' . or . '\\.' . '\)*'
let cmake_indent_comment_line = '^\s*' . cmake_regex_comment
let cmake_indent_blank_regex = '^\s*$'
let cmake_indent_open_regex = '^\s*' . cmake_regex_identifier .
\ '\s*(' . cmake_regex_arguments .
\ '\(' . cmake_regex_comment . '\)\?$'
let cmake_indent_close_regex = '^' . cmake_regex_arguments .
\ ')\s*' .
\ '\(' . cmake_regex_comment . '\)\?$'
let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\|FUNCTION\)\s*('
let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\|ENDFUNCTION\)\s*('
" Add
if previous_line =~? cmake_indent_comment_line " Handle comments
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
let ind = ind + shiftwidth()
endif
if previous_line =~? cmake_indent_open_regex
let ind = ind + shiftwidth()
endif
endif
" Subtract
if this_line =~? cmake_indent_end_regex
let ind = ind - shiftwidth()
endif
if previous_line =~? cmake_indent_close_regex
let ind = ind - shiftwidth()
endif
return ind
endfun
let &cpo = s:keepcpo
unlet s:keepcpo
File diff suppressed because it is too large Load Diff
+264
View File
@@ -0,0 +1,264 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
option(CMAKE_INSTALL_DEBUG_LIBRARIES
"Install Microsoft runtime debug libraries with CMake." FALSE)
mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
# By default, do not warn when built on machines using only VS Express:
if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif()
if(CMake_INSTALL_DEPENDENCIES)
include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
endif()
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
set(CPACK_PACKAGE_VENDOR "Kitware")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Installers for 32- vs. 64-bit CMake:
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation
if(CMAKE_CL_64)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else()
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
endif()
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_NSIS_PACKAGE_NAME}")
if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
set(CPACK_SYSTEM_NAME Cygwin)
else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64-x64)
set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
else()
set(CPACK_SYSTEM_NAME win32-x86)
endif()
endif()
# Command for configure IFW script templates
include(${CMake_SOURCE_DIR}/Modules/CPackIFWConfigureFile.cmake)
# Advanced IFW configuration
set(_cpifwrc CPACK_IFW_COMPONENT_GROUP_CMAKE_)
set(_cpifwrcconf _CPACK_IFW_COMPONENT_GROUP_CMAKE)
set(${_cpifwrcconf} "# CMake IFW configuration\n")
macro(_cmifwarg DESCRIPTION TYPE NAME DEFAULT)
set(_var CMake_IFW_ROOT_COMPONENT_${NAME})
if(DEFINED ${_var})
set(${_var} ${${_var}} CACHE ${TYPE} ${DESCRIPTION})
mark_as_advanced(${_var})
elseif(NOT "${DEFAULT}" STREQUAL "")
set(${_var} ${DEFAULT})
endif()
if(DEFINED ${_var})
set(${_cpifwrcconf}
"${${_cpifwrcconf}} set(${_cpifwrc}${NAME}\n \"${${_var}}\")\n")
endif()
endmacro()
_cmifwarg("Package <Name> tag (domen-like)"
STRING NAME "")
_cmifwarg("Package <DisplayName> tag"
STRING DISPLAY_NAME "")
_cmifwarg("Package <Description> tag"
STRING DESCRIPTION "")
_cmifwarg("Package <ReleaseDate> tag (keep empty to auto generate)"
STRING RELEASE_DATE "")
_cmifwarg("Package <Default> tag (values: TRUE, FALSE, SCRIPT)"
STRING DEFAULT "")
_cmifwarg("Package <Version> tag"
STRING VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
_cmifwarg("Package <SortingPriority> tag"
STRING PRIORITY "100")
_cmifwarg("Package <ForsedInstallation> tag"
STRING FORCED_INSTALLATION "")
set(${_cpifwrc}LICENSES_DEFAULT
"${CPACK_PACKAGE_NAME} Copyright;${CPACK_RESOURCE_FILE_LICENSE}")
# Components
if(CMake_INSTALL_COMPONENTS)
set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack)
if(WIN32 AND NOT CYGWIN)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmcldeps)
endif()
if(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME)
set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME
${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
else()
set(_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME Unspecified)
endif()
list(APPEND _CPACK_IFW_COMPONENTS_ALL ${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME})
string(TOUPPER "${_CPACK_IFW_COMPONENT_UNSPECIFIED_NAME}"
_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME)
if(BUILD_CursesDialog)
list(APPEND _CPACK_IFW_COMPONENTS_ALL ccmake)
endif()
if(BUILD_QtDialog)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-gui)
if(USE_LGPL)
set(_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES "set(CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES
\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\")")
endif()
endif()
if(SPHINX_MAN)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-man)
endif()
if(SPHINX_HTML)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-html)
endif()
if(SPHINX_SINGLEHTML)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-singlehtml)
endif()
if(SPHINX_QTHELP)
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp)
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-html)
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP)
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-qthelp)
endif()
endif()
set(_CPACK_IFW_COMPONENTS_CONFIGURATION "
# Components
set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\")
set(CPACK_COMPONENTS_GROUPING IGNORE)
")
_cmifwarg("Package <Script> template"
FILEPATH SCRIPT_TEMPLATE "${CMake_SOURCE_DIR}/Source/QtIFW/CMake.qs.in")
else()
if(BUILD_QtDialog AND USE_LGPL)
set(${_cpifwrc}LICENSES_DEFAULT
"${${_cpifwrc}LICENSES_DEFAULT};LGPLv${USE_LGPL};${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt")
endif()
_cmifwarg("Package <Script> template"
FILEPATH SCRIPT_TEMPLATE "${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in")
endif()
_cmifwarg("Package <Script> generated"
FILEPATH SCRIPT_GENERATED "${CMake_BINARY_DIR}/CMake.qs")
_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)"
STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}")
if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
set(_CPACK_IFW_PACKAGE_ICON
"set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
if(BUILD_QtDialog)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/bin/cmake-gui.exe\", \"@StartMenuDir@/CMake (cmake-gui).lnk\");\n")
endif()
if(SPHINX_HTML)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/html/index.html\", \"@StartMenuDir@/CMake Documentation.lnk\");\n")
endif()
if(CMake_BUILD_DEVELOPER_REFERENCE)
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n")
endif()
endif()
install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html"
DESTINATION "${CMAKE_DOC_DIR}"
)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
endif()
# Components scripts configuration
if((EXISTS "${CMake_IFW_ROOT_COMPONENT_SCRIPT_TEMPLATE}")
AND (NOT "${CMake_IFW_ROOT_COMPONENT_SCRIPT_GENERATED}" STREQUAL "")
AND (NOT "${CMake_IFW_ROOT_COMPONENT_SCRIPT}"))
cpack_ifw_configure_file("${CMake_IFW_ROOT_COMPONENT_SCRIPT_TEMPLATE}"
"${CMake_IFW_ROOT_COMPONENT_SCRIPT_GENERATED}")
_cmifwarg("Package <Script> tag"
FILEPATH SCRIPT "${CMake_IFW_ROOT_COMPONENT_SCRIPT_GENERATED}")
endif()
foreach(_script
CMake.Dialogs.QtGUI
CMake.Documentation.SphinxHTML
CMake.DeveloperReference.HTML)
cpack_ifw_configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in"
"${CMake_BINARY_DIR}/${_script}.qs")
endforeach()
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not
# needed
if(CYGWIN)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
else()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
endif()
endif()
set(CPACK_PACKAGE_CONTACT "cmake+development@discourse.cmake.org")
if(UNIX)
set(CPACK_STRIP_FILES "${CMAKE_BIN_DIR}/ccmake;${CMAKE_BIN_DIR}/cmake;${CMAKE_BIN_DIR}/cpack;${CMAKE_BIN_DIR}/ctest")
set(CPACK_SOURCE_STRIP_FILES "")
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
endif()
set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991")
if(MSVC AND NOT "$ENV{WIX}" STREQUAL "")
set(WIX_CUSTOM_ACTION_ENABLED TRUE)
if(CMAKE_CONFIGURATION_TYPES)
set(WIX_CUSTOM_ACTION_MULTI_CONFIG TRUE)
else()
set(WIX_CUSTOM_ACTION_MULTI_CONFIG FALSE)
endif()
else()
set(WIX_CUSTOM_ACTION_ENABLED FALSE)
endif()
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
set(CPACK_SOURCE_IGNORE_FILES
# Files specific to version control.
"/\\\\.git/"
"/\\\\.gitattributes$"
"/\\\\.github/"
"/\\\\.gitignore$"
"/\\\\.hooks-config$"
# Cygwin package build.
"/\\\\.build/"
# Temporary files.
"\\\\.swp$"
"\\\\.#"
"/#"
"~$"
)
# include CPack model once all variables are set
include(CPack)
+313
View File
@@ -0,0 +1,313 @@
# This file is configured at cmake time, and loaded at cpack time.
# To pass variables to cpack from cmake, they must be configured
# in this file.
if(CPACK_GENERATOR MATCHES "NSIS")
set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
# set the install/unistall icon used for the installer itself
# There is a bug in NSI that does not handle full unix paths properly.
set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
# set the package header icon for MUI
set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
# tell cpack to create links to the doc files
set(CPACK_NSIS_MENU_LINKS
"@CMAKE_DOC_DIR@/html/index.html" "CMake Documentation"
"https://cmake.org" "CMake Web Site"
)
# Use the icon from cmake-gui for add-remove programs
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
set(CPACK_NSIS_HELP_LINK "https://cmake.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON)
endif()
# include the cpack options for qt dialog if they exist
# they might not if qt was not enabled for the build
include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "IFW")
# Installer configuration
set(CPACK_IFW_PACKAGE_TITLE "CMake Build Tool")
set(CPACK_IFW_PRODUCT_URL "https://cmake.org")
@_CPACK_IFW_PACKAGE_ICON@
set(CPACK_IFW_PACKAGE_WINDOW_ICON
"@CMake_SOURCE_DIR@/Source/QtDialog/CMakeSetup128.png")
set(CPACK_IFW_PACKAGE_CONTROL_SCRIPT
"@CMake_SOURCE_DIR@/Source/QtIFW/controlscript.qs")
# Uninstaller configuration
set(CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME "cmake-maintenance")
@_CPACK_IFW_COMPONENTS_CONFIGURATION@
# Unspecified
set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Package configuration group
set(CPACK_IFW_PACKAGE_GROUP CMake)
# Group configuration
# CMake
set(CPACK_COMPONENT_GROUP_CMAKE_DISPLAY_NAME
"@CPACK_PACKAGE_NAME@")
set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION
"@CPACK_PACKAGE_DESCRIPTION_SUMMARY@")
@_CPACK_IFW_COMPONENT_GROUP_CMAKE@
# Tools
set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools")
set(CPACK_COMPONENT_GROUP_TOOLS_DESCRIPTION
"Command-Line Tools: cmake, ctest and cpack")
set(CPACK_COMPONENT_GROUP_TOOLS_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_TOOLS_PRIORITY 90)
set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake")
set(CPACK_COMPONENT_CMAKE_DESCRIPTION
"The \"cmake\" executable is the CMake command-line interface")
set(CPACK_COMPONENT_CMAKE_REQUIRED TRUE)
set(CPACK_COMPONENT_CMAKE_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMAKE_NAME "CMake")
set(CPACK_IFW_COMPONENT_CMAKE_PRIORITY 89)
set(CPACK_IFW_COMPONENT_CMAKE_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest")
set(CPACK_COMPONENT_CTEST_DESCRIPTION
"The \"ctest\" executable is the CMake test driver program")
set(CPACK_COMPONENT_CTEST_REQUIRED TRUE)
set(CPACK_COMPONENT_CTEST_GROUP Tools)
set(CPACK_IFW_COMPONENT_CTEST_NAME "CTest")
set(CPACK_IFW_COMPONENT_CTEST_PRIORITY 88)
set(CPACK_IFW_COMPONENT_CTEST_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack")
set(CPACK_COMPONENT_CPACK_DESCRIPTION
"The \"cpack\" executable is the CMake packaging program")
set(CPACK_COMPONENT_CPACK_REQUIRED TRUE)
set(CPACK_COMPONENT_CPACK_GROUP Tools)
set(CPACK_IFW_COMPONENT_CPACK_NAME "CPack")
set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87)
set(CPACK_IFW_COMPONENT_CPACK_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMCLDEPS_DISPLAY_NAME "cmcldeps")
set(CPACK_COMPONENT_CMCLDEPS_DESCRIPTION
"The \"cmcldeps\" executable is wrapper around \"cl\" program")
set(CPACK_COMPONENT_CMCLDEPS_GROUP Tools)
set(CPACK_IFW_COMPONENT_CMCLDEPS_NAME "CMClDeps")
set(CPACK_IFW_COMPONENT_CMCLDEPS_PRIORITY 86)
set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Dialogs
set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs")
set(CPACK_COMPONENT_GROUP_DIALOGS_DESCRIPTION
"Interactive Dialogs with Console and GUI interfaces")
set(CPACK_COMPONENT_GROUP_DIALOGS_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_PRIORITY 80)
set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE-GUI_DISPLAY_NAME "cmake-gui")
set(CPACK_COMPONENT_CMAKE-GUI_GROUP Dialogs)
set(CPACK_IFW_COMPONENT_CMAKE-GUI_NAME "QtGUI")
set(CPACK_IFW_COMPONENT_CMAKE-GUI_SCRIPT
"@CMake_BINARY_DIR@/CMake.Dialogs.QtGUI.qs")
set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
@_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES@
set(CPACK_COMPONENT_CCMAKE_DISPLAY_NAME "ccmake")
set(CPACK_COMPONENT_CCMAKE_GROUP Dialogs)
set(CPACK_IFW_COMPONENT_CCMAKE_NAME "CursesGUI")
set(CPACK_IFW_COMPONENT_CCMAKE_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Documentation
set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation")
set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION
"CMake Documentation in different formats (html, man, qch)")
set(CPACK_COMPONENT_GROUP_DOCUMENTATION_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_PRIORITY 60)
set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_SPHINX-MAN_DISPLAY_NAME "man")
set(CPACK_COMPONENT_SPHINX-MAN_GROUP Documentation)
set(CPACK_COMPONENT_SPHINX-MAN_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_SPHINX-MAN_NAME "SphinxMan")
set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_SPHINX-HTML_DISPLAY_NAME "HTML")
set(CPACK_COMPONENT_SPHINX-HTML_GROUP Documentation)
set(CPACK_IFW_COMPONENT_SPHINX-HTML_NAME "SphinxHTML")
set(CPACK_IFW_COMPONENT_SPHINX-HTML_SCRIPT
"@CMake_BINARY_DIR@/CMake.Documentation.SphinxHTML.qs")
set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISPLAY_NAME "Single HTML")
set(CPACK_COMPONENT_SPHINX-SINGLEHTML_GROUP Documentation)
set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_NAME "SphinxSingleHTML")
set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_SPHINX-QTHELP_DISPLAY_NAME "Qt Compressed Help")
set(CPACK_COMPONENT_SPHINX-QTHELP_GROUP Documentation)
set(CPACK_COMPONENT_SPHINX-QTHELP_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp")
set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
# Developer Reference
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DISPLAY_NAME "Developer Reference")
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DESCRIPTION
"CMake Reference in different formats (html, qch)")
set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_PARENT_GROUP CMake)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_PRIORITY 50)
set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISPLAY_NAME "HTML")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_GROUP DeveloperReference)
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_NAME "HTML")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_SCRIPT
"@CMake_BINARY_DIR@/CMake.DeveloperReference.HTML.qs")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISPLAY_NAME "Qt Compressed Help")
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_GROUP DeveloperReference)
set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISABLED TRUE)
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_NAME "QtHelp")
set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION
"@CMake_IFW_ROOT_COMPONENT_VERSION@")
endif()
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
if(CMAKE_PACKAGE_QTGUI)
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
else()
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
endif()
endif()
if("${CPACK_GENERATOR}" STREQUAL "DragNDrop")
set(CPACK_DMG_BACKGROUND_IMAGE
"@CMake_SOURCE_DIR@/Packaging/CMakeDMGBackground.tif")
set(CPACK_DMG_DS_STORE_SETUP_SCRIPT
"@CMake_SOURCE_DIR@/Packaging/CMakeDMGSetup.scpt")
endif()
if("${CPACK_GENERATOR}" STREQUAL "WIX")
# Reset CPACK_PACKAGE_VERSION to deal with WiX restriction.
# But the file names still use the full CMake_VERSION value:
set(CPACK_PACKAGE_FILE_NAME
"cmake-@CMake_VERSION@-${CPACK_SYSTEM_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"cmake-@CMake_VERSION@")
if(NOT CPACK_WIX_SIZEOF_VOID_P)
set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
endif()
set(CPACK_PACKAGE_VERSION
"@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@")
# WIX installers require at most a 4 component version number, where
# each component is an integer between 0 and 65534 inclusive
set(patch "@CMake_VERSION_PATCH@")
if(patch MATCHES "^[0-9]+$" AND patch LESS 65535)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${patch}")
endif()
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "https://cmake.org")
set(CPACK_WIX_PROPERTY_ARPCONTACT "@CPACK_PACKAGE_CONTACT@")
set(CPACK_WIX_PROPERTY_ARPCOMMENTS
"CMake is a cross-platform, open-source build system."
)
set(CPACK_WIX_PRODUCT_ICON
"@CMake_SOURCE_DIR@/Utilities/Release/CMakeLogo.ico"
)
set_property(INSTALL "@CMAKE_DOC_DIR@/html/index.html" PROPERTY
CPACK_START_MENU_SHORTCUTS "CMake Documentation"
)
set_property(INSTALL "cmake.org.html" PROPERTY
CPACK_START_MENU_SHORTCUTS "CMake Web Site"
)
set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high")
set(CPACK_WIX_UI_BANNER
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_banner.jpg"
)
set(CPACK_WIX_UI_DIALOG
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/ui_dialog.jpg"
)
set(CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/install_dir.wxs"
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_extra_dialog.wxs"
)
set(_WIX_CUSTOM_ACTION_ENABLED "@WIX_CUSTOM_ACTION_ENABLED@")
if(_WIX_CUSTOM_ACTION_ENABLED)
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/cmake_nsis_overwrite_dialog.wxs"
)
list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dCHECK_NSIS=1)
set(_WIX_CUSTOM_ACTION_MULTI_CONFIG "@WIX_CUSTOM_ACTION_MULTI_CONFIG@")
if(_WIX_CUSTOM_ACTION_MULTI_CONFIG)
if(CPACK_BUILD_CONFIG)
set(_WIX_CUSTOM_ACTION_CONFIG "${CPACK_BUILD_CONFIG}")
else()
set(_WIX_CUSTOM_ACTION_CONFIG "Release")
endif()
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll-${_WIX_CUSTOM_ACTION_CONFIG}.wxs")
else()
list(APPEND CPACK_WIX_EXTRA_SOURCES
"@CMake_BINARY_DIR@/Utilities/Release/WiX/custom_action_dll.wxs")
endif()
endif()
set(CPACK_WIX_UI_REF "CMakeUI_InstallDir")
set(CPACK_WIX_PATCH_FILE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_path_env.xml"
)
set(CPACK_WIX_TEMPLATE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/WIX.template.in"
)
set(BUILD_QtDialog "@BUILD_QtDialog@")
if(BUILD_QtDialog)
list(APPEND CPACK_WIX_PATCH_FILE
"@CMake_SOURCE_DIR@/Utilities/Release/WiX/patch_desktop_shortcut.xml"
)
list(APPEND CPACK_WIX_CANDLE_EXTRA_FLAGS -dBUILD_QtDialog=1)
endif()
endif()
+1
View File
@@ -0,0 +1 @@
set(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo")
+887
View File
@@ -0,0 +1,887 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_minimum_required(VERSION 3.1...3.18 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
project(CMake)
unset(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
unset(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
# FIXME: This block should go away after a transition period.
if(MSVC AND NOT CMAKE_VERSION VERSION_LESS 3.15)
# Filter out MSVC runtime library flags that may have come from
# the cache of an existing build tree or from scripts.
foreach(l C CXX)
foreach(c DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
string(REGEX REPLACE "[-/]M[DT]d?( |$)" "" "CMAKE_${l}_FLAGS_${c}" "${CMAKE_${l}_FLAGS_${c}}")
endforeach()
endforeach()
endif()
# Make sure we can find internal find_package modules only used for
# building CMake and not for shipping externally
list(INSERT CMAKE_MODULE_PATH 0 ${CMake_SOURCE_DIR}/Source/Modules)
if(CMAKE_BOOTSTRAP)
# Running from bootstrap script. Set local variable and remove from cache.
set(CMAKE_BOOTSTRAP 1)
unset(CMAKE_BOOTSTRAP CACHE)
endif()
if(CMake_TEST_HOST_CMAKE)
get_filename_component(CMake_TEST_EXTERNAL_CMAKE "${CMAKE_COMMAND}" DIRECTORY)
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
message(FATAL_ERROR
"CMake no longer compiles on HP-UX. See\n"
" https://gitlab.kitware.com/cmake/cmake/-/issues/17137\n"
"Use CMake 3.9 or lower instead."
)
endif()
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
endif()
if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL MATCHES "^3|2\\.1$")
set(USE_LGPL "${CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL}")
else()
set(USE_LGPL "2.1")
endif()
else()
set(USE_LGPL "")
endif()
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host.
macro(TRY_RUN)
if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
else()
_TRY_RUN(${ARGV})
endif()
endmacro()
endif()
# Use most-recent available language dialects with GNU and Clang
if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
if(NOT CMake_C11_THREAD_LOCAL_BROKEN)
set(CMAKE_C_STANDARD 11)
else()
set(CMAKE_C_STANDARD 99)
endif()
endif()
if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
set(CMAKE_CXX_STANDARD 98)
else()
if(NOT CMAKE_VERSION VERSION_LESS 3.8)
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx17_check.cmake)
else()
set(CMake_CXX17_BROKEN 1)
endif()
if(NOT CMake_CXX17_BROKEN)
set(CMAKE_CXX_STANDARD 17)
else()
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_check.cmake)
if(NOT CMake_CXX14_BROKEN)
set(CMAKE_CXX_STANDARD 14)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
endif()
endif()
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# include special compile flags for some compilers
include(CompileFlags.cmake)
# check for available C++ features
include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
endif()
endif()
# Inform STL library header wrappers whether to use system versions.
configure_file(${CMake_SOURCE_DIR}/Utilities/std/cmSTL.hxx.in
${CMake_BINARY_DIR}/Utilities/cmSTL.hxx
@ONLY)
# set the internal encoding of CMake to UTF-8
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
# option to use COMPONENT with install command
option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF)
mark_as_advanced(CMake_INSTALL_COMPONENTS)
macro(CMake_OPTIONAL_COMPONENT NAME)
if(CMake_INSTALL_COMPONENTS)
set(COMPONENT COMPONENT ${NAME})
else()
set(COMPONENT)
endif()
endmacro()
# option to disable installing 3rd-party dependencies
option(CMake_INSTALL_DEPENDENCIES
"Whether to install 3rd-party runtime dependencies" OFF)
mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
# option to build reference for CMake developers
option(CMake_BUILD_DEVELOPER_REFERENCE
"Build CMake Developer Reference" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
# option to build using interprocedural optimizations (IPO/LTO)
if (NOT CMAKE_VERSION VERSION_LESS 3.12.2)
option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
if(CMake_BUILD_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT HAVE_IPO)
if(HAVE_IPO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
endif()
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
#-----------------------------------------------------------------------
macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies.
include(CMakeDependentOption)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV NGHTTP2 ZLIB ZSTD)
foreach(util ${UTILITIES})
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
endif()
if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
if(CMAKE_USE_SYSTEM_LIBRARY_${util})
set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
else()
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
endif()
if(CMAKE_BOOTSTRAP)
unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
endif()
string(TOLOWER "${util}" lutil)
set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
CACHE BOOL "Use system-installed ${lutil}" FORCE)
else()
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
endif()
endforeach()
if(CMAKE_BOOTSTRAP)
unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
endif()
# Optionally use system utility libraries.
option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}")
option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
"${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
"${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZSTD "Use system-installed zstd"
"${CMAKE_USE_SYSTEM_LIBRARY_ZSTD}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_LIBLZMA "Use system-installed liblzma"
"${CMAKE_USE_SYSTEM_LIBRARY_LIBLZMA}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_NGHTTP2 "Use system-installed nghttp2"
"${CMAKE_USE_SYSTEM_LIBRARY_NGHTTP2}" "NOT CMAKE_USE_SYSTEM_CURL" ON)
option(CMAKE_USE_SYSTEM_FORM "Use system-installed libform" "${CMAKE_USE_SYSTEM_LIBRARY_FORM}")
option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp" "${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}")
option(CMAKE_USE_SYSTEM_LIBRHASH "Use system-installed librhash" "${CMAKE_USE_SYSTEM_LIBRARY_LIBRHASH}")
option(CMAKE_USE_SYSTEM_LIBUV "Use system-installed libuv" "${CMAKE_USE_SYSTEM_LIBRARY_LIBUV}")
# For now use system KWIML only if explicitly requested rather
# than activating via the general system libs options.
option(CMAKE_USE_SYSTEM_KWIML "Use system-installed KWIML" OFF)
mark_as_advanced(CMAKE_USE_SYSTEM_KWIML)
# Mention to the user what system libraries are being used.
foreach(util ${UTILITIES} KWIML)
if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}")
endif()
endforeach()
# Inform utility library header wrappers whether to use system versions.
configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
@ONLY)
endmacro()
#-----------------------------------------------------------------------
# a macro to determine the generator and ctest executable to use
# for testing. Simply to improve readability of the main script.
#-----------------------------------------------------------------------
macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING)
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
foreach(util CURL EXPAT ZLIB)
if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif()
endforeach()
# This variable is set by cmake, however to
# test cmake we want to make sure that
# the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing
# cmake.
if(CMake_TEST_EXTERNAL_CMAKE)
set(CMAKE_CTEST_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_TEST_EXTERNAL_CMAKE}/cpack")
foreach(exe cmake ctest cpack)
add_executable(${exe} IMPORTED)
set_property(TARGET ${exe} PROPERTY IMPORTED_LOCATION ${CMake_TEST_EXTERNAL_CMAKE}/${exe})
endforeach()
else()
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
endif()
endif()
# configure some files for testing
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
@ONLY)
configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
if(BUILD_TESTING AND DART_ROOT)
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
endif()
mark_as_advanced(DART_ROOT)
endmacro()
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build CMake in the Express IDE...
#
option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
mark_as_advanced(CMAKE_USE_FOLDERS)
option(CMake_RUN_CLANG_TIDY "Run clang-tidy with the compiler." OFF)
if(CMake_RUN_CLANG_TIDY)
if(CMake_SOURCE_DIR STREQUAL CMake_BINARY_DIR)
message(FATAL_ERROR "CMake_RUN_CLANG_TIDY requires an out-of-source build!")
endif()
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
if(NOT CLANG_TIDY_COMMAND)
message(FATAL_ERROR "CMake_RUN_CLANG_TIDY is ON but clang-tidy is not found!")
endif()
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
# Create a preprocessor definition that depends on .clang-tidy content so
# the compile command will change when .clang-tidy changes. This ensures
# that a subsequent build re-runs clang-tidy on all sources even if they
# do not otherwise need to be recompiled. Nothing actually uses this
# definition. We add it to targets on which we run clang-tidy just to
# get the build dependency on the .clang-tidy file.
file(SHA1 ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy clang_tidy_sha1)
set(CLANG_TIDY_DEFINITIONS "CLANG_TIDY_SHA1=${clang_tidy_sha1}")
unset(clang_tidy_sha1)
endif()
configure_file(.clang-tidy .clang-tidy COPYONLY)
option(CMake_RUN_IWYU "Run include-what-you-use with the compiler." OFF)
if(CMake_RUN_IWYU)
find_program(IWYU_COMMAND NAMES include-what-you-use iwyu)
if(NOT IWYU_COMMAND)
message(FATAL_ERROR "CMake_RUN_IWYU is ON but include-what-you-use is not found!")
endif()
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
"${IWYU_COMMAND};-Xiwyu;--mapping_file=${CMake_SOURCE_DIR}/Utilities/IWYU/mapping.imp;-w")
list(APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${CMake_IWYU_OPTIONS})
endif()
#-----------------------------------------------------------------------
# a macro that only sets the FOLDER target property if it's
# "appropriate"
#-----------------------------------------------------------------------
macro(CMAKE_SET_TARGET_FOLDER tgt folder)
if(CMAKE_USE_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(MSVC AND TARGET ${tgt})
set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
endif()
else()
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
endif()
endmacro()
#-----------------------------------------------------------------------
# a macro to build the utilities used by CMake
# Simply to improve readability of the main script.
#-----------------------------------------------------------------------
macro (CMAKE_BUILD_UTILITIES)
find_package(Threads)
# Suppress unnecessary checks in third-party code.
include(Utilities/cmThirdPartyChecks.cmake)
#---------------------------------------------------------------------
# Create the kwsys library for CMake.
set(KWSYS_NAMESPACE cmsys)
set(KWSYS_USE_SystemTools 1)
set(KWSYS_USE_Directory 1)
set(KWSYS_USE_RegularExpression 1)
set(KWSYS_USE_Base64 1)
set(KWSYS_USE_MD5 1)
set(KWSYS_USE_Process 1)
set(KWSYS_USE_CommandLineArguments 1)
set(KWSYS_USE_ConsoleBuf 1)
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
if(CMake_NO_CXX_STANDARD)
set(KWSYS_CXX_STANDARD "")
endif()
if(WIN32)
# FIXME: Teach KWSys to hard-code these checks on Windows.
set(KWSYS_C_HAS_CLOCK_GETTIME_MONOTONIC_COMPILED 0)
set(KWSYS_C_HAS_PTRDIFF_T_COMPILED 1)
set(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H_COMPILED 1)
set(KWSYS_CXX_HAS_RLIMIT64_COMPILED 0)
set(KWSYS_CXX_HAS_SETENV_COMPILED 0)
set(KWSYS_CXX_HAS_UNSETENV_COMPILED 0)
set(KWSYS_CXX_HAS_UTIMENSAT_COMPILED 0)
set(KWSYS_CXX_HAS_UTIMES_COMPILED 0)
set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0)
set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0)
set(KWSYS_STL_HAS_WSTRING_COMPILED 1)
set(KWSYS_SYS_HAS_IFADDRS_H 0)
endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
endif()
#---------------------------------------------------------------------
# Setup third-party libraries.
# Everything in the tree should be able to include files from the
# Utilities directory.
if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using -isystem option generate error "template with C linkage"
include_directories("${CMake_SOURCE_DIR}/Utilities/std")
else()
include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities/std")
endif()
include_directories("${CMake_BINARY_DIR}/Utilities")
if ((CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using -isystem option generate error "template with C linkage"
include_directories("${CMake_SOURCE_DIR}/Utilities")
else()
include_directories(SYSTEM "${CMake_SOURCE_DIR}/Utilities")
endif()
#---------------------------------------------------------------------
# Build CMake std library for CMake and CTest.
set(CMAKE_STD_LIBRARY cmstd)
add_subdirectory(Utilities/std)
CMAKE_SET_TARGET_FOLDER(cmstd "Utilities/std")
# check for the use of system libraries versus builtin ones
# (a macro defined in this file)
CMAKE_HANDLE_SYSTEM_LIBRARIES()
if(CMAKE_USE_SYSTEM_KWIML)
find_package(KWIML 1.0)
if(NOT KWIML_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_KWIML is ON but KWIML is not found!")
endif()
set(CMake_KWIML_LIBRARIES kwiml::kwiml)
else()
set(CMake_KWIML_LIBRARIES "")
if(BUILD_TESTING)
set(KWIML_TEST_ENABLE 1)
endif()
add_subdirectory(Utilities/KWIML)
endif()
if(CMAKE_USE_SYSTEM_LIBRHASH)
find_package(LibRHash)
if(NOT LibRHash_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBRHASH is ON but LibRHash is not found!")
endif()
set(CMAKE_LIBRHASH_LIBRARIES LibRHash::LibRHash)
else()
set(CMAKE_LIBRHASH_LIBRARIES cmlibrhash)
add_subdirectory(Utilities/cmlibrhash)
CMAKE_SET_TARGET_FOLDER(cmlibrhash "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest.
set(CMAKE_ZLIB_HEADER "cm_zlib.h")
if(CMAKE_USE_SYSTEM_ZLIB)
find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
endif()
set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
else()
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
set(CMAKE_ZLIB_LIBRARIES cmzlib)
set(WITHOUT_ZLIB_DLL "")
set(WITHOUT_ZLIB_DLL_WITH_LIB cmzlib)
set(ZLIB_DLL "")
set(ZLIB_DLL_WITH_LIB cmzlib)
set(ZLIB_WINAPI "")
set(ZLIB_WINAPI_COMPILED 0)
set(ZLIB_WINAPI_WITH_LIB cmzlib)
add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build Curl library for CTest.
if(CMAKE_USE_SYSTEM_CURL)
find_package(CURL)
if(NOT CURL_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
endif()
set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
else()
set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
set(CMAKE_CURL_INCLUDES)
set(CMAKE_CURL_LIBRARIES cmcurl)
if(CMAKE_TESTS_CDASH_SERVER)
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
endif()
set(_CMAKE_USE_OPENSSL_DEFAULT OFF)
if(NOT DEFINED CMAKE_USE_OPENSSL AND NOT WIN32 AND NOT APPLE
AND CMAKE_SYSTEM_NAME MATCHES "(Linux|FreeBSD)")
set(_CMAKE_USE_OPENSSL_DEFAULT ON)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL." ${_CMAKE_USE_OPENSSL_DEFAULT})
mark_as_advanced(CMAKE_USE_OPENSSL)
if(CMAKE_USE_OPENSSL)
set(CURL_CA_BUNDLE "" CACHE FILEPATH "Path to SSL CA Certificate Bundle")
set(CURL_CA_PATH "" CACHE PATH "Path to SSL CA Certificate Directory")
mark_as_advanced(CURL_CA_BUNDLE CURL_CA_PATH)
endif()
if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
# Tell curl's FindNGHTTP2 module to use our library.
set(NGHTTP2_LIBRARY cmnghttp2)
set(NGHTTP2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmnghttp2/lib/includes)
endif()
add_subdirectory(Utilities/cmcurl)
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
# Configure after curl to re-use some check results.
add_subdirectory(Utilities/cmnghttp2)
CMAKE_SET_TARGET_FOLDER(cmnghttp2 "Utilities/3rdParty")
endif()
endif()
#---------------------------------------------------------------------
# Build expat library for CMake, CTest, and libarchive.
if(CMAKE_USE_SYSTEM_EXPAT)
find_package(EXPAT)
if(NOT EXPAT_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
endif()
set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
else()
set(CMAKE_EXPAT_INCLUDES)
set(CMAKE_EXPAT_LIBRARIES cmexpat)
add_subdirectory(Utilities/cmexpat)
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build or use system libbz2 for libarchive.
if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
if(CMAKE_USE_SYSTEM_BZIP2)
find_package(BZip2)
else()
set(BZIP2_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
set(BZIP2_LIBRARIES cmbzip2)
set(BZIP2_NEED_PREFIX "")
set(USE_BZIP2_DLL "")
set(USE_BZIP2_DLL_WITH_LIB cmbzip2)
set(USE_BZIP2_STATIC "")
set(USE_BZIP2_STATIC_WITH_LIB cmbzip2)
add_subdirectory(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
endif()
endif()
#---------------------------------------------------------------------
# Build or use system zstd for libarchive.
if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
if(NOT CMAKE_USE_SYSTEM_ZSTD)
set(ZSTD_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmzstd")
set(ZSTD_LIBRARY cmzstd)
add_subdirectory(Utilities/cmzstd)
CMAKE_SET_TARGET_FOLDER(cmzstd "Utilities/3rdParty")
endif()
endif()
#---------------------------------------------------------------------
# Build or use system liblzma for libarchive.
if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
if(CMAKE_USE_SYSTEM_LIBLZMA)
find_package(LibLZMA)
if(NOT LIBLZMA_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
endif()
else()
add_subdirectory(Utilities/cmliblzma)
CMAKE_SET_TARGET_FOLDER(cmliblzma "Utilities/3rdParty")
set(LIBLZMA_HAS_AUTO_DECODER 1)
set(LIBLZMA_HAS_EASY_ENCODER 1)
set(LIBLZMA_HAS_LZMA_PRESET 1)
set(LIBLZMA_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
set(LIBLZMA_LIBRARY cmliblzma)
endif()
endif()
#---------------------------------------------------------------------
# Build or use system libarchive for CMake and CTest.
if(CMAKE_USE_SYSTEM_LIBARCHIVE)
find_package(LibArchive 3.3.3)
if(NOT LibArchive_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
endif()
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
else()
set(EXPAT_INCLUDE_DIR ${CMAKE_EXPAT_INCLUDES})
set(EXPAT_LIBRARY ${CMAKE_EXPAT_LIBRARIES})
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
add_definitions(-DLIBARCHIVE_STATIC)
set(ENABLE_MBEDTLS OFF CACHE INTERNAL "Enable use of mbed TLS")
set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
set(ENABLE_LIBB2 OFF CACHE INTERNAL "Enable the use of the system LIBB2 library if found")
set(ENABLE_LZMA ON CACHE INTERNAL "Enable the use of the system LZMA library if found")
set(ENABLE_LZ4 OFF CACHE INTERNAL "Enable the use of the system LZ4 library if found")
set(ENABLE_LZO OFF CACHE INTERNAL "Enable the use of the system LZO library if found")
set(ENABLE_ZLIB ON CACHE INTERNAL "Enable the use of the system ZLIB library if found")
set(ENABLE_BZip2 ON CACHE INTERNAL "Enable the use of the system BZip2 library if found")
set(ENABLE_ZSTD ON CACHE INTERNAL "Enable the use of the system zstd library if found")
set(ENABLE_LIBXML2 OFF CACHE INTERNAL "Enable the use of the system libxml2 library if found")
set(ENABLE_EXPAT OFF CACHE INTERNAL "Enable the use of the system EXPAT library if found")
set(ENABLE_PCREPOSIX OFF CACHE INTERNAL "Enable the use of the system PCREPOSIX library if found")
set(ENABLE_LibGCC OFF CACHE INTERNAL "Enable the use of the system LibGCC library if found")
set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
set(ENABLE_CNG OFF CACHE INTERNAL "Enable the use of CNG(Crypto Next Generation)")
SET(POSIX_REGEX_LIB "" CACHE INTERNAL "Choose what library should provide POSIX regular expression support")
add_subdirectory(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
endif()
#---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
find_package(JsonCpp 1.4.1)
if(NOT JsonCpp_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set_property(TARGET JsonCpp::JsonCpp APPEND PROPERTY
INTERFACE_COMPILE_OPTIONS -Wno-deprecated-declarations)
endif()
set(CMAKE_JSONCPP_LIBRARIES JsonCpp::JsonCpp)
else()
set(CMAKE_JSONCPP_LIBRARIES cmjsoncpp)
add_subdirectory(Utilities/cmjsoncpp)
CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build libuv library.
if(CMAKE_USE_SYSTEM_LIBUV)
find_package(LibUV 1.10.0)
if(NOT LIBUV_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_LIBUV is ON but a libuv is not found!")
endif()
set(CMAKE_LIBUV_LIBRARIES LibUV::LibUV)
else()
set(CMAKE_LIBUV_LIBRARIES cmlibuv)
add_subdirectory(Utilities/cmlibuv)
CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Use curses?
if (UNIX)
if(NOT DEFINED BUILD_CursesDialog)
include(${CMake_SOURCE_DIR}/Source/Checks/Curses.cmake)
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" "${CMakeCheckCurses_COMPILED}")
endif()
else ()
set(BUILD_CursesDialog 0)
endif ()
if(BUILD_CursesDialog)
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses)
if(NOT CURSES_FOUND)
message(WARNING
"'ccmake' will not be built because Curses was not found.\n"
"Turn off BUILD_CursesDialog to suppress this message."
)
set(BUILD_CursesDialog 0)
endif()
endif()
if(BUILD_CursesDialog)
if(NOT CMAKE_USE_SYSTEM_FORM)
add_subdirectory(Source/CursesDialog/form)
elseif(NOT CURSES_FORM_LIBRARY)
message( FATAL_ERROR "CMAKE_USE_SYSTEM_FORM in ON but CURSES_FORM_LIBRARY is not set!" )
endif()
endif()
endmacro ()
#-----------------------------------------------------------------------
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _GXX_VERSION
)
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
_GXX_VERSION_SHORT ${_GXX_VERSION})
if(_GXX_VERSION_SHORT EQUAL 33)
message(FATAL_ERROR
"GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
endif()
endif()
endif()
#-----------------------------------------------------------------------
# The main section of the CMakeLists file
#
#-----------------------------------------------------------------------
include(Source/CMakeVersion.cmake)
# Include the standard Dart testing module
enable_testing()
include (${CMAKE_ROOT}/Modules/Dart.cmake)
# Set up test-time configuration.
set_directory_properties(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# where to write the resulting executables and libraries
set(BUILD_SHARED_LIBS OFF)
set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake")
# Load install destinations.
include(Source/CMakeInstallDestinations.cmake)
if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
# Checks for cmSystemTools.
if(WIN32)
set(HAVE_UNSETENV 0)
set(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE 1)
else()
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
endif()
endif()
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.
#
# If not defined or "", this variable defaults to the server at
# "http://open.cdash.org".
#
# If set explicitly to "NOTFOUND", curl tests and ctest tests that use
# the network are skipped.
#
# If set to something starting with "http://localhost/", the CDash is
# expected to be an instance of CDash used for CDash testing, pointing
# to a cdash4simpletest database. In these cases, the CDash dashboards
# should be run first.
#
if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x" AND NOT CMake_TEST_NO_NETWORK)
set(CMAKE_TESTS_CDASH_SERVER "http://open.cdash.org")
endif()
if(CMake_TEST_EXTERNAL_CMAKE)
set(KWIML_TEST_ENABLE 1)
add_subdirectory(Utilities/KWIML)
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES()
if(BUILD_QtDialog)
if(APPLE)
set(CMAKE_BUNDLE_VERSION
"${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in /
if(NOT CMAKE_INSTALL_PREFIX MATCHES "/$")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif()
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}CMake.app/Contents")
endif()
endif()
if(UNIX)
# Install executables with the RPATH set for libraries outside the build tree.
# This is also suitable for binaries in the build tree. Avoid re-link on install.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON CACHE BOOL "Install with RPATH set to find custom-built libraries.")
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "Build with RPATH set to match install-tree RPATH.")
mark_as_advanced(CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_BUILD_WITH_INSTALL_RPATH)
endif()
# add the uninstall support
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
include (CMakeCPack.cmake)
endif()
# setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMake_VERSION_IS_RELEASE)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
-Wmissing-format-attribute -fno-common -Wundef
)
set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W
-Wshadow -Wpointer-arith -Wformat-security -Wundef
)
foreach(FLAG_LANG C CXX)
foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
endif()
endforeach()
endforeach()
unset(C_FLAGS_LIST)
unset(CXX_FLAGS_LIST)
endif()
endif()
# build the remaining subdirectories
add_subdirectory(Source)
add_subdirectory(Utilities)
endif()
add_subdirectory(Tests)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
IF(TARGET CMakeServerLibTests)
CMAKE_SET_TARGET_FOLDER(CMakeServerLibTests "Tests")
ENDIF()
endif()
if(TARGET documentation)
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
endif()
endif()
if(BUILD_TESTING)
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_GENERATOR}" )
endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# Install license file as it requires.
install(FILES Copyright.txt DESTINATION ${CMAKE_DOC_DIR})
# Install script directories.
install(
DIRECTORY Help Modules Templates
DESTINATION ${CMAKE_DATA_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
PATTERN "*.sh*" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
REGEX "/(ExportImportList|cpp)$"
PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
REGEX "Help/(dev|guide)($|/)" EXCLUDE
)
# Install auxiliary files integrating with other tools.
add_subdirectory(Auxiliary)
# Optionally sign installed binaries.
if(CMake_INSTALL_SIGNTOOL)
configure_file(Source/CMakeInstallSignTool.cmake.in Source/CMakeInstallSignTool.cmake @ONLY)
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/Source/CMakeInstallSignTool.cmake)
endif()
endif()
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

+77
View File
@@ -0,0 +1,77 @@
Contributing to CMake
*********************
The following summarizes the process for contributing changes.
See documentation on `CMake Development`_ for more information.
.. _`CMake Development`: Help/dev/README.rst
Community
=========
CMake is maintained and supported by `Kitware`_ and developed in
collaboration with a productive community of contributors.
Please post to the ``Development`` category of the `CMake Forum`_ to raise
discussion of development topics.
.. _`Kitware`: http://www.kitware.com/cmake
.. _`CMake Forum`: https://discourse.cmake.org
Patches
=======
CMake uses `Kitware's GitLab Instance`_ to manage development and code review.
To contribute patches:
#. Fork the upstream `CMake Repository`_ into a personal account.
#. Run `Utilities/SetupForDevelopment.sh`_ for local git configuration.
#. See `Building CMake`_ for building CMake locally.
#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Create a topic branch named suitably for your work.
Base all new work on the upstream ``master`` branch.
Base work on the upstream ``release`` branch only if it fixes a
regression or bug in a feature new to that release.
If in doubt, prefer ``master``. Reviewers may simply ask for
a rebase if deemed appropriate in particular cases.
#. Create commits making incremental, distinct, logically complete changes
with appropriate `commit messages`_.
#. Push the topic branch to a personal repository fork on GitLab.
#. Create a GitLab Merge Request targeting the upstream ``master`` branch
(even if the change is intended for merge to the ``release`` branch).
Check the box labelled "Allow commits from members who can merge to the
target branch". This will allow maintainers to make minor edits on your
behalf.
The merge request will enter the `CMake Review Process`_ for consideration.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
.. _`Building CMake`: README.rst#building-cmake
.. _`CMake Source Code Guide`: Help/dev/source.rst
.. _`commit messages`: Help/dev/review.rst#commit-messages
.. _`CMake Review Process`: Help/dev/review.rst
CMake Dashboard Client
======================
The *integration testing* step of the `CMake Review Process`_ uses a set of
testing machines that follow an integration branch on their own schedule to
drive testing and submit results to the `CMake CDash Page`_. Anyone is
welcome to provide testing machines in order to help keep support for their
platforms working.
See documentation on `CMake Testing Process`_ for more information.
.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake
.. _`CMake Testing Process`: Help/dev/testing.rst
License
=======
We do not require any formal copyright assignment or contributor license
agreement. Any contributions intentionally sent upstream are presumed
to be offered under terms of the OSI-approved BSD 3-clause License.
See `Copyright.txt`_ for details.
.. _`Copyright.txt`: Copyright.txt
+16
View File
@@ -0,0 +1,16 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
# If changing this file, also update Utilities/Sphinx/CTestConfig.cmake
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
if(NOT CTEST_DROP_METHOD STREQUAL "https")
set(CTEST_DROP_METHOD "http")
endif()
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CDASH_VERSION "1.6")
set(CTEST_CDASH_QUERY_VERSION TRUE)
+129
View File
@@ -0,0 +1,129 @@
list(APPEND CTEST_CUSTOM_ERROR_MATCH
"ERROR:")
list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"warning: cast from 'char\\*' to 'cmCursesWidget\\*' increases required alignment of target type" # Occurs when using Solaris's system libform
"xtree.[0-9]+. : warning C4702: unreachable code"
"warning LNK4221"
"warning LNK4204" # Occurs by race condition with objects in small libs
"variable .var_args[2]*. is used before its value is set"
"jobserver unavailable"
"warning: \\(Long double usage is reported only once for each file"
"warning: To disable this warning use"
"could not be inlined"
"libcmexpat.*has no symbols"
"libcmcurl.*has no symbols"
"not sorted slower link editing will result"
"stl_deque.h:479"
"Utilities.cmzlib."
"Utilities.cmbzip2."
"Source.CTest.Curl"
"Source.CursesDialog.form"
"Utilities.cmcurl"
"Utilities.cmexpat."
"Utilities.cmlibarchive"
"warning: declaration of .single. shadows a global declaration"
"/usr/include.*(warning|note).*shadowed declaration is here"
"/usr/bin/ld.*warning.*-..*directory.name.*bin.*does not exist"
"Redeclaration of .send..... with a different storage class specifier"
"is not used for resolving any symbol"
"Clock skew detected"
"remark\\(1209"
"remark: .*LOOP WAS VECTORIZED"
"warning .980: wrong number of actual arguments to intrinsic function .std::basic_"
"LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*CRYPT32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*PSAPI.DLL.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*RPCRT4.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*SHELL32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*ole32.dll.*discarded by /OPT:REF"
"Warning.*: .*/Utilities/KWIML/test/test_int_format.h.* # Redundant preprocessing concatenation"
"Warning: library was too large for page size.*"
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
"Warning: public.*BZ2_bz.*in module.*bzlib.*clashes with prior module.*bzlib.*"
"Warning: public.*_archive.*clashes with prior module.*"
"Warning: LINN32: Last line.*is less.*"
"Warning: Olimit was exceeded on function.*"
"Warning: To override Olimit for all functions in file.*"
"Warning: Function .* can throw only the exceptions thrown by the function .* it overrides\\."
"WarningMessagesDialog\\.cxx"
"warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*"
"stl_deque.h:1051"
"Tests/CMakeLib/testCTestResourceSpec.cxx:.*warning: missing initializer for member.*cmCTestResourceSpec::.*" # GCC 4.8 disagrees with later compilers on C++11 initializer list conversion
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"(Lexer|Parser).*warning.*variable.*was set but never used"
"LexerParser.*warning.*empty expression statement has no effect; remove unnecessary"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value"
"warning:.*is.*very unsafe.*consider using.*"
"warning:.*is.*misused, please use.*"
"cmake.version.manifest.*manifest authoring warning.*Unrecognized Element"
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)"
"ld: warning .*/libgcc.a archive's cputype"
"ld: warning: ignoring file .*/libgcc.a, file was built for archive which is not the architecture being linked"
"ld: warning: in .*/libgcc.a, file is not of required architecture"
"ld: warning: symbol .(deflate|inflate)_copyright. has differing sizes" # system libz and QtCore disagree
"warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
"note: in expansion of macro" # diagnostic context note
"note: expanded from macro" # diagnostic context note
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*may return deterministic values"
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto
"cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto
"IPA warning: function.*multiply defined in"
"LICENSE WARNING" # PGI license expiry. Not useful in nightly testing.
# Ignore compiler summary warning, assuming prior text has matched some
# other warning expression:
"[0-9,]+ warnings? generated." # Clang
"compilation completed with warnings" # PGI
"[0-9]+ Warning\\(s\\) detected" # SunPro
# scanbuild exceptions
"char_traits.h:.*: warning: Null pointer argument in call to string length function"
"stl_construct.h:.*: warning: Forming reference to null pointer"
".*stl_uninitialized.h:75:19: warning: Forming reference to null pointer.*"
".*stl_vector.h:.*: warning: Returning null reference.*"
"warning: Value stored to 'yymsg' is never read"
"warning: Value stored to 'yytoken' is never read"
"index_encoder.c.241.2. warning: Value stored to .out_start. is never read"
"index.c.*warning: Access to field.*results in a dereference of a null pointer.*loaded from variable.*"
"cmCommandArgumentLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"cmDependsJavaLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"cmExprLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"cmListFileLexer.c:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"cmFortranLexer.cxx:[0-9]+:[0-9]+: warning: Call to 'realloc' has an allocation size of 0 bytes"
"testProcess.*warning: Dereference of null pointer .loaded from variable .invalidAddress.."
"liblzma/simple/x86.c:[0-9]+:[0-9]+: warning: The result of the '<<' expression is undefined"
"liblzma/common/index_encoder.c:[0-9]+:[0-9]+: warning: Value stored to .* during its initialization is never read"
"libuv/src/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer"
"libuv/src/.*:[0-9]+:[0-9]+: warning: The left operand of '==' is a garbage value"
"libuv/src/.*:[0-9]+:[0-9]+: warning: 1st function call argument is an uninitialized value"
"nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Dereference of null pointer"
"nghttp2/lib/.*:[0-9]+:[0-9]+: warning: Value stored to .* is never read"
)
if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
"XCode"
)
endif ()
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
# Exclude kwsys files from coverage results. They are reported
# (with better coverage results) on kwsys dashboards...
"/Source/(cm|kw)sys/"
# Exclude try_compile sources from coverage results:
"/CMakeFiles/CMakeTmp/"
# Exclude Qt source files from coverage results:
"[A-Za-z]./[Qq]t/qt-.+-opensource-src"
)
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
kwsys.testProcess-10 # See Source/kwsys/CTestCustom.cmake.in
)
+138
View File
@@ -0,0 +1,138 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#-----------------------------------------------------------------------------
# set some special flags for different compilers
#
if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel")
set(_INTEL_WINDOWS 1)
endif()
if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Clang"
AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
set(_CLANG_MSVC_WINDOWS 1)
endif()
# Disable deprecation warnings for standard C functions.
# really only needed for newer versions of VS, but should
# not hurt other versions, and this will work into the
# future
if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
else()
endif()
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000")
endif()
# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it.
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105")
endif()
if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000")
endif()
#silence duplicate symbol warnings on AIX
if(CMAKE_SYSTEM_NAME MATCHES "AIX")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
endif()
endif()
if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
endif()
endif()
# Workaround for short jump tables on PA-RISC
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-calls")
endif()
endif()
# Use 64-bit off_t on 32-bit Linux
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# ensure 64bit offsets are used for filesystem accesses for 32bit compilation
add_definitions(-D_FILE_OFFSET_BITS=64)
endif()
# Workaround for TOC Overflow on ppc64
set(bigTocFlag "")
if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND
CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
set(bigTocFlag "-Wl,-bbigtoc")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
set(bigTocFlag "-Wl,--no-multi-toc")
endif()
if(bigTocFlag)
include(CheckCXXLinkerFlag)
check_cxx_linker_flag(${bigTocFlag} BIG_TOC_FLAG_SUPPORTED)
if(BIG_TOC_FLAG_SUPPORTED)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${bigTocFlag}")
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND
NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13)
if (NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD EQUAL 98)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
elseif(CMAKE_VERSION VERSION_LESS 3.8.20170502)
# CMake knows how to add this flag for compilation as C++11,
# but has not been taught that SunPro needs it for linking too.
# Add it in a place that will be used for both.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
endif()
endif()
foreach(lang C CXX)
# Suppress warnings from PGI compiler.
if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI")
set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
endif()
endforeach()
# use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
endif ()
if (CMAKE_ANSI_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
endif ()
# Allow per-translation-unit parallel builds when using MSVC
if(CMAKE_GENERATOR MATCHES "Visual Studio" AND
(CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel" OR
CMAKE_CXX_COMPILER_ID MATCHES "MSVC|Intel"))
set(CMake_MSVC_PARALLEL ON CACHE STRING "\
Enables /MP flag for parallel builds using MSVC. Specify an \
integer value to control the number of threads used (Only \
works on some older versions of Visual Studio). Setting to \
ON lets the toolchain decide how many threads to use. Set to \
OFF to disable /MP completely." )
if(CMake_MSVC_PARALLEL)
if(CMake_MSVC_PARALLEL GREATER 0)
string(APPEND CMAKE_C_FLAGS " /MP${CMake_MSVC_PARALLEL}")
string(APPEND CMAKE_CXX_FLAGS " /MP${CMake_MSVC_PARALLEL}")
else()
string(APPEND CMAKE_C_FLAGS " /MP")
string(APPEND CMAKE_CXX_FLAGS " /MP")
endif()
endif()
endif()
+132
View File
@@ -0,0 +1,132 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2021 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Kitware, Inc. nor the names of Contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
The following individuals and institutions are among the Contributors:
* Aaron C. Meadows <cmake@shadowguarddev.com>
* Adriaan de Groot <groot@kde.org>
* Aleksey Avdeev <solo@altlinux.ru>
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
* Alexey Sokolov <sokolov@google.com>
* Alex Merry <alex.merry@kde.org>
* Alex Turbov <i.zaufi@gmail.com>
* Andreas Pakulat <apaku@gmx.de>
* Andreas Schneider <asn@cryptomilk.org>
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
* Benjamin Eikel
* Bjoern Ricks <bjoern.ricks@gmail.com>
* Brad Hards <bradh@kde.org>
* Christopher Harvey
* Christoph Grüninger <foss@grueninger.de>
* Clement Creusot <creusot@cs.york.ac.uk>
* Daniel Blezek <blezek@gmail.com>
* Daniel Pfeifer <daniel@pfeifer-mail.de>
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
* Eran Ifrah <eran.ifrah@gmail.com>
* Esben Mose Hansen, Ange Optimization ApS
* Geoffrey Viola <geoffrey.viola@asirobots.com>
* Google Inc
* Gregor Jasny
* Helio Chissini de Castro <helio@kde.org>
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
* Insight Software Consortium <insightsoftwareconsortium.org>
* Jan Woetzel
* Julien Schueller
* Kelly Thompson <kgt@lanl.gov>
* Konstantin Podsvirov <konstantin@podsvirov.pro>
* Laurent Montel <montel@kde.org>
* Mario Bensi <mbensi@ipsquad.net>
* Martin Gräßlin <mgraesslin@kde.org>
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
* Matthaeus G. Chajdas
* Matthias Kretz <kretz@kde.org>
* Matthias Maennich <matthias@maennich.net>
* Michael Hirsch, Ph.D. <www.scivision.co>
* Michael Stürmer
* Miguel A. Figueroa-Villanueva
* Mike Jackson
* Mike McQuaid <mike@mikemcquaid.com>
* Nicolas Bock <nicolasbock@gmail.com>
* Nicolas Despres <nicolas.despres@gmail.com>
* Nikita Krupen'ko <krnekit@gmail.com>
* NVIDIA Corporation <www.nvidia.com>
* OpenGamma Ltd. <opengamma.com>
* Patrick Stotko <stotko@cs.uni-bonn.de>
* Per Øyvind Karlsen <peroyvind@mandriva.org>
* Peter Collingbourne <peter@pcc.me.uk>
* Petr Gotthard <gotthard@honeywell.com>
* Philip Lowman <philip@yhbt.com>
* Philippe Proulx <pproulx@efficios.com>
* Raffi Enficiaud, Max Planck Society
* Raumfeld <raumfeld.com>
* Roger Leigh <rleigh@codelibre.net>
* Rolf Eike Beer <eike@sf-mail.de>
* Roman Donchenko <roman.donchenko@itseez.com>
* Roman Kharitonov <roman.kharitonov@itseez.com>
* Ruslan Baratov
* Sebastian Holtermann <sebholt@xwmw.org>
* Stephen Kelly <steveire@gmail.com>
* Sylvain Joubert <joubert.sy@gmail.com>
* The Qt Company Ltd.
* Thomas Sondergaard <ts@medical-insight.com>
* Tobias Hunger <tobias.hunger@qt.io>
* Todd Gamblin <tgamblin@llnl.gov>
* Tristan Carel
* University of Dundee
* Vadim Zhukov
* Will Dicharry <wdicharry@stellarscience.com>
See version control history for details of individual contributions.
The above copyright and license notice applies to distributions of
CMake in source and binary form. Third-party software packages supplied
with CMake under compatible licenses provide their own copyright notices
documented in corresponding subdirectories or source files.
------------------------------------------------------------------------------
CMake was initially developed by Kitware with the following sponsorship:
* National Library of Medicine at the National Institutes of Health
as part of the Insight Segmentation and Registration Toolkit (ITK).
* US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
Visualization Initiative.
* National Alliance for Medical Image Computing (NAMIC) is funded by the
National Institutes of Health through the NIH Roadmap for Medical Research,
Grant U54 EB005149.
* Kitware, Inc.
+10
View File
@@ -0,0 +1,10 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
set(CTEST_PROJECT_NAME "CMake")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
+12
View File
@@ -0,0 +1,12 @@
.. versionadded:: 3.18
When a device link step is involved, which is controlled by
:prop_tgt:`CUDA_SEPARABLE_COMPILATION` and
:prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` properties and policy :policy:`CMP0105`,
the raw options will be delivered to the host and device link steps (wrapped in
``-Xcompiler`` or equivalent for device link). Options wrapped with
``$<DEVICE_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the device link step. Options wrapped with ``$<HOST_LINK:...>``
:manual:`generator expression <cmake-generator-expressions(7)>` will be used
only for the host link step.
+167
View File
@@ -0,0 +1,167 @@
A short-hand signature is:
.. parsed-literal::
|FIND_XXX| (<VAR> name1 [path1 path2 ...])
The general signature is:
.. parsed-literal::
|FIND_XXX| (
<VAR>
name | |NAMES|
[HINTS path1 [path2 ... ENV var]]
[PATHS path1 [path2 ... ENV var]]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[REQUIRED]
[NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
This command is used to find a |SEARCH_XXX_DESC|.
A cache entry named by ``<VAR>`` is created to store the result
of this command.
If the |SEARCH_XXX| is found the result is stored in the variable
and the search will not be repeated unless the variable is cleared.
If nothing is found, the result will be ``<VAR>-NOTFOUND``.
Options include:
``NAMES``
Specify one or more possible names for the |SEARCH_XXX|.
When using this to specify names with and without a version
suffix, we recommend specifying the unversioned name first
so that locally-built packages can be found before those
provided by distributions.
``HINTS``, ``PATHS``
Specify directories to search in addition to the default locations.
The ``ENV var`` sub-option reads paths from a system environment
variable.
``PATH_SUFFIXES``
Specify additional subdirectories to check below each directory
location otherwise considered.
``DOC``
Specify the documentation string for the ``<VAR>`` cache entry.
``REQUIRED``
.. versionadded:: 3.18
Stop processing with an error message if nothing is found, otherwise
the search will be attempted again the next time |FIND_XXX| is invoked
with the same variable.
If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
added to the search.
If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| replace::
|prefix_XXX_SUBDIR| for each ``<prefix>`` in the
:variable:`<PackageName>_ROOT` CMake variable and the
:envvar:`<PackageName>_ROOT` environment variable if
called from within a find module loaded by
:command:`find_package(<PackageName>)`
.. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
|prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_PREFIX_PATH`
.. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR| replace::
|prefix_XXX_SUBDIR| for each ``<prefix>/[s]bin`` in ``PATH``, and
|entry_XXX_SUBDIR| for other entries in ``PATH``
.. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
|prefix_XXX_SUBDIR| for each ``<prefix>`` in
:variable:`CMAKE_SYSTEM_PREFIX_PATH`
1. .. versionadded:: 3.12
If called from within a find module or any other script loaded by a call to
:command:`find_package(<PackageName>)`, search prefixes unique to the
current package being found. Specifically, look in the
:variable:`<PackageName>_ROOT` CMake variable and the
:envvar:`<PackageName>_ROOT` environment variable.
The package root variables are maintained as a stack, so if called from
nested find modules or config packages, root paths from the parent's find
module or config package will be searched after paths from the current
module or package. In other words, the search order would be
``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
See policy :policy:`CMP0074`.
* |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
2. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a ``-DVAR=value``.
The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
:variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
* |CMAKE_XXX_MAC_PATH|
3. Search paths specified in cmake-specific environment variables.
These are intended to be set in the user's shell configuration,
and therefore use the host's native path separator
(``;`` on Windows and ``:`` on UNIX).
This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or
by setting the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``.
* |CMAKE_PREFIX_PATH_XXX|
* |CMAKE_XXX_PATH|
* |CMAKE_XXX_MAC_PATH|
4. Search the paths specified by the ``HINTS`` option.
These should be paths computed by system introspection, such as a
hint provided by the location of another item already found.
Hard-coded guesses should be specified with the ``PATHS`` option.
5. Search the standard system environment variables.
This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by
setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``.
* |SYSTEM_ENVIRONMENT_PATH_XXX|
* |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX|
6. Search cmake variables defined in the Platform files
for the current system. This can be skipped if ``NO_CMAKE_SYSTEM_PATH``
is passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`
to ``FALSE``.
* |CMAKE_SYSTEM_PREFIX_PATH_XXX|
* |CMAKE_SYSTEM_XXX_PATH|
* |CMAKE_SYSTEM_XXX_MAC_PATH|
The platform paths that these variables contain are locations that
typically include installed software. An example being ``/usr/local`` for
UNIX based platforms.
7. Search the paths specified by the PATHS option
or in the short-hand version of the command.
These are typically hard-coded guesses.
.. versionadded:: 3.16
Added ``CMAKE_FIND_USE_<CATEGORY>_PATH`` variables to globally disable
various search locations.
.. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
On macOS the :variable:`CMAKE_FIND_FRAMEWORK` and
:variable:`CMAKE_FIND_APPBUNDLE` variables determine the order of
preference between Apple-style and unix-style package components.
.. include:: FIND_XXX_ROOT.txt
.. include:: FIND_XXX_ORDER.txt

Some files were not shown because too many files have changed in this diff Show More