Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
01cbab9
ci: Restore support for Windows 7 in official precompiled binaries
bradking Dec 8, 2025
1ad84c5
Tutorial: Fix path to file in exercise solution
tyler-yankee Dec 9, 2025
b78d490
Merge topic 'ci-package-msvc-14.44' into release-4.2
bradking Dec 10, 2025
363a199
Merge topic 'tutorial-fix-file' into release-4.2
bradking Dec 10, 2025
1bf4681
FindBLAS: Make find_package(nvpl) quiet
nickelpro Dec 10, 2025
93f5111
gitattributes: Do not export ast-grep infrastructure in source archives
bradking Dec 10, 2025
58fc663
Tutorial: Provide MSVC example to build Vendor library
tyler-yankee Dec 11, 2025
c32e21f
Merge topic 'export-ignore-ast-grep' into release-4.1
bradking Dec 11, 2025
6a5e9f2
Merge topic 'fix-nvpl' into release-4.1
bradking Dec 11, 2025
61909cc
Merge topic 'export-ignore-ast-grep' into release-4.2
bradking Dec 11, 2025
9d8da1c
Merge topic 'fix-nvpl' into release-4.2
bradking Dec 11, 2025
cfbd1b0
Merge branch 'release-4.1' into release-4.2
bradking Dec 11, 2025
c55dfbf
StdIo: Restore compilation on 32-bit MinGW
bradking Dec 11, 2025
16cc3e2
Utilities: Select bundled or external dependencies very early
bradking Dec 11, 2025
cea7f7f
Linux: Do not force 64-bit `time_t` on 32-bit archs with system libar…
bradking Dec 11, 2025
03f2b2b
Merge topic 'stdio-ctrl-c' into release-4.1
bradking Dec 12, 2025
9c0cb30
Merge topic 'backport-linux32-system-libarchive' into release-4.1
bradking Dec 12, 2025
1c3d9cd
Merge topic 'stdio-ctrl-c' into release-4.2
bradking Dec 12, 2025
5ffebf3
Merge topic 'linux32-system-libarchive' into release-4.2
bradking Dec 12, 2025
529c9b5
Merge branch 'release-4.1' into release-4.2
bradking Dec 12, 2025
1f3471d
Merge topic 'tutorial-vendor-msvc' into release-4.2
bradking Dec 12, 2025
ea35723
Help: Add 4.1 release note about VS link flag suppression
bradking Dec 17, 2025
91b9db9
VS: Restore subsystem link flag for DLLs
bradking Dec 17, 2025
b6defd9
VS: Restore subsystem link flag for DLLs
bradking Dec 17, 2025
46e59b5
Merge branch 'backport-vs-link-defaults' into vs-link-defaults
bradking Dec 17, 2025
ff98528
Merge topic 'backport-vs-link-defaults' into release-4.1
bradking Dec 18, 2025
625ce16
Merge topic 'vs-link-defaults' into release-4.2
bradking Dec 18, 2025
54810df
Merge topic 'doc-4.1-vs-flags' into release-4.1
bradking Dec 18, 2025
cfa1643
Merge topic 'doc-4.1-vs-flags' into release-4.2
bradking Dec 18, 2025
a9c13c4
Merge branch 'release-4.1' into release-4.2
bradking Dec 18, 2025
2eef2ba
cmake: Fix SARIF diagnostics output path encoding on Windows
bradking Dec 19, 2025
4c0c3d6
Merge topic 'backport-sarif-path-encoding' into release-4.0
bradking Dec 20, 2025
8039d1f
Merge topic 'backport-sarif-path-encoding' into release-4.1
bradking Dec 20, 2025
b713b72
Merge branch 'release-4.0' into release-4.1
bradking Dec 20, 2025
397d4b7
Merge topic 'sarif-path-encoding' into release-4.2
bradking Dec 20, 2025
68c8e0e
Merge branch 'release-4.1' into release-4.2
bradking Dec 20, 2025
e733079
Help: Fix minor grammar problems
craigscott-crascit Dec 20, 2025
a7fc57e
Help: Restore correct sort order for property and variable manuals
craigscott-crascit Dec 20, 2025
c6940b0
cmProcess: explicitly track the StopTimeout
mathstuf Dec 22, 2025
637da9c
Merge topic 'doc-cleanup-4.2' into release-4.2
craigscott-crascit Dec 24, 2025
cb86536
gitlab-ci: get the sccache server port from the runner
mathstuf Dec 29, 2025
af8771f
FASTBuild: set PlatformToolset in the generated .bff file
Noxybot Dec 25, 2025
416d86a
FASTBuild: fix configure for non-English MSVC
Noxybot Dec 27, 2025
b8c9c65
Help: Correct and expand AppImage CPack generator docs
craigscott-crascit Dec 21, 2025
af74276
cmProcess: compute the timeout when needed
mathstuf Dec 22, 2025
68beb2e
Tests/CTestTimeoutAfterMatch: add case for stop time bug
mathstuf Dec 22, 2025
3bf895d
Merge topic 'doc-expand-appimage-generator' into release-4.2
craigscott-crascit Jan 7, 2026
bd9d4d5
Merge topic 'ci-sccache-port-from-runner' into release-3.31
bradking Jan 7, 2026
61b443f
Merge topic 'ci-sccache-port-from-runner' into release-4.0
bradking Jan 7, 2026
4ae62b6
Merge branch 'release-3.31' into release-4.0
bradking Jan 7, 2026
1c031c8
Merge topic 'ci-sccache-port-from-runner' into release-4.1
bradking Jan 7, 2026
b87059c
Merge branch 'release-4.0' into release-4.1
bradking Jan 7, 2026
77371c0
Merge topic 'ci-sccache-port-from-runner' into release-4.2
bradking Jan 7, 2026
458dff0
Merge branch 'release-4.1' into release-4.2
bradking Jan 7, 2026
c11bbed
Merge topic 'fbuild_plat_toolset' into release-4.2
bradking Jan 7, 2026
ad66430
Merge topic 'fbuild_i18num_fix' into release-4.2
bradking Jan 7, 2026
bc18ef4
ci: update macOS jobs to use Xcode 26.2
bradking Jan 7, 2026
92d7543
Merge topic 'ci-xcode-26.2' into release-3.31
bradking Jan 8, 2026
2e00e77
Merge topic 'ci-xcode-26.2' into release-4.0
bradking Jan 8, 2026
297d8f2
Merge branch 'release-3.31' into release-4.0
bradking Jan 8, 2026
efed27c
Merge topic 'ci-xcode-26.2' into release-4.1
bradking Jan 8, 2026
95fb248
Merge branch 'release-4.0' into release-4.1
bradking Jan 8, 2026
d3759c8
Merge topic 'ci-xcode-26.2' into release-4.2
bradking Jan 8, 2026
884b86e
Merge branch 'release-4.1' into release-4.2
bradking Jan 8, 2026
4419bf1
VS: Restore unicode character set for custom targrets on WindowsStore
bradking Jan 8, 2026
c6a9407
fileapi: Handle unused imported libraries with missing IMPORTED_IMPLIB
craigscott-crascit Jan 9, 2026
078f28f
CPack/AppImage: Add support for a custom AppRun file
mathieuYellow Jan 8, 2026
92d6551
Merge topic 'vs-charset' into release-4.2
bradking Jan 9, 2026
7792c68
Merge topic 'timeout-after-match-stop-time-behavior' into release-4.2
bradking Jan 9, 2026
eba87f1
Merge topic 'cpack-appimage-user-apprun' into release-4.2
bradking Jan 12, 2026
a4a5690
CMake: Restore support for compiling as C++11 on Windows
MarkaPola Jan 10, 2026
35d5a4f
GenEx: Partially restore pre-CMP0199 behavior of $<CONFIG>
mwoehlke-kitware Jan 12, 2026
ba5b89a
ci: Fix CUDA tests on GPUs newer than the toolkit supports
bradking Jan 13, 2026
554f264
Merge topic 'Windows-compilation-c++11' into release-4.2
bradking Jan 13, 2026
acf4ea2
Merge topic 'fileapi-windows-implib-missing-error' into release-4.2
bradking Jan 13, 2026
0c2e4d8
Merge topic 'fix-cmp0199' into release-4.2
bradking Jan 13, 2026
cab0f6c
Merge topic 'ci-cuda-archs' into release-3.31
bradking Jan 14, 2026
b5ec125
Merge topic 'ci-cuda-archs' into release-4.0
bradking Jan 14, 2026
4f58ef8
Merge branch 'release-3.31' into release-4.0
bradking Jan 14, 2026
cd4c4f2
Merge topic 'ci-cuda-archs' into release-4.1
bradking Jan 14, 2026
5bc44d4
Merge branch 'release-4.0' into release-4.1
bradking Jan 14, 2026
79a6195
Merge topic 'ci-cuda-archs' into release-4.2
bradking Jan 14, 2026
048f292
Merge branch 'release-4.1' into release-4.2
bradking Jan 14, 2026
f51dd91
file(GET_RUNTIME_DEPENDENCIES): Support VS 2026 without VS 2022
clintonstimpson Jan 14, 2026
4d712cf
fileapi: Fix crash on cmake_file_api() call in initial cache
martinduffy1 Jan 14, 2026
8523e57
Merge branch 'backport-3.31-fileapi-initial-cache'
bradking Jan 15, 2026
bb23f65
instrumentation: Fix crash on cmake_instrumentation() call in initial…
martinduffy1 Jan 14, 2026
1bd6e70
Merge branch 'backport-4.0-fileapi-instrumentation-initial-cache'
bradking Jan 15, 2026
5b63ea9
instrumentation: Fix crash on cmake_instrumentation() call in initial…
martinduffy1 Jan 14, 2026
ed023e0
Merge branch 'backport-4.0-fileapi-instrumentation-initial-cache'
bradking Jan 15, 2026
88384f6
Merge topic 'vs2026-runtimedeps' into release-4.2
bradking Jan 16, 2026
351ad4c
Merge topic 'backport-3.31-fileapi-initial-cache' into release-3.31
bradking Jan 16, 2026
0ce1019
Merge topic 'backport-4.0-fileapi-instrumentation-initial-cache' into…
bradking Jan 16, 2026
59bbe83
Merge branch 'release-3.31' into release-4.0
bradking Jan 16, 2026
bad6ed0
Merge topic 'backport-4.0-fileapi-instrumentation-initial-cache' into…
bradking Jan 16, 2026
88db218
Merge branch 'release-4.0' into release-4.1
bradking Jan 16, 2026
cdbd7bf
Merge topic 'fileapi-instrumentation-initial-cache' into release-4.2
bradking Jan 16, 2026
57137c5
Merge branch 'release-4.1' into release-4.2
bradking Jan 16, 2026
f7669bb
ci: Clamp CUDA 'native' architecture in NVHPC job
bradking Jan 19, 2026
a2c9682
Merge topic 'ci-nvhpc' into release-3.31
bradking Jan 19, 2026
b9009be
Merge topic 'ci-nvhpc' into release-4.0
bradking Jan 19, 2026
01eedf3
Merge branch 'release-3.31' into release-4.0
bradking Jan 19, 2026
9eb65a6
Merge topic 'ci-nvhpc' into release-4.1
bradking Jan 19, 2026
24c3df7
Merge branch 'release-4.0' into release-4.1
bradking Jan 19, 2026
7943956
Merge topic 'ci-nvhpc' into release-4.2
bradking Jan 19, 2026
d6a62d1
Merge branch 'release-4.1' into release-4.2
bradking Jan 19, 2026
00db01d
Tests: Fix RunCMake.include_external_msproject .sln check failure
bradking Jan 19, 2026
ab2ef24
VS: Add include_external_msproject detection of `.njsproj` type
bradking Jan 19, 2026
7ce9185
VS: Add include_external_msproject GUIDs for more project types
bradking Jan 19, 2026
0c97912
VS: Fix SLNX generation so .NET Core projects build in the IDE
bradking Jan 19, 2026
2660f5f
Merge topic 'vs-slnx' into release-4.2
bradking Jan 20, 2026
3356d93
CMake 4.2.2
bradking Jan 20, 2026
c238f17
Tests: Remove invalid CUDA code from tests
robertmaynard Jan 16, 2026
9ff7341
Merge topic 'test-cuda-fix-result-pointers' into release-3.31
bradking Jan 22, 2026
59a8796
Merge topic 'test-cuda-fix-result-pointers' into release-4.0
bradking Jan 22, 2026
acefe25
Merge branch 'release-3.31' into release-4.0
bradking Jan 22, 2026
cc969b2
Merge topic 'test-cuda-fix-result-pointers' into release-4.1
bradking Jan 22, 2026
ff50e17
Merge branch 'release-4.0' into release-4.1
bradking Jan 22, 2026
cf19e65
Merge topic 'test-cuda-fix-result-pointers' into release-4.2
bradking Jan 22, 2026
19580e6
Merge branch 'release-4.1' into release-4.2
bradking Jan 22, 2026
f590010
libarchive: Restore tolerance of archives with non-OEM paths on Windows
bradking Jan 23, 2026
ab1152c
Merge topic 'libarchive-windows-encoding' into release-3.31
bradking Jan 24, 2026
8b19487
Merge topic 'libarchive-windows-encoding' into release-4.0
bradking Jan 24, 2026
449ffb2
Merge branch 'release-3.31' into release-4.0
bradking Jan 24, 2026
b907505
Merge topic 'libarchive-windows-encoding' into release-4.1
bradking Jan 24, 2026
08d6132
Merge branch 'release-4.0' into release-4.1
bradking Jan 24, 2026
0e4342e
Merge topic 'libarchive-windows-encoding' into release-4.2
bradking Jan 24, 2026
de10607
Merge branch 'release-4.1' into release-4.2
bradking Jan 24, 2026
cd51ca4
CMake 3.31.11
bradking Jan 26, 2026
eb7c151
Merge branch 'release-3.31' into release-4.0
bradking Jan 26, 2026
859f7ef
Merge branch 'release-4.0' into release-4.1
bradking Jan 26, 2026
3b78e2a
Merge branch 'release-4.1' into release-4.2
bradking Jan 26, 2026
fe1fed2
CMake 4.0.6
bradking Jan 27, 2026
74f60ba
Merge branch 'release-4.0' into release-4.1
bradking Jan 27, 2026
9ad49bd
Merge branch 'release-4.1' into release-4.2
bradking Jan 27, 2026
cc05acf
CMake 4.1.5
bradking Jan 27, 2026
10a9140
Merge branch 'release-4.1' into release-4.2
bradking Jan 27, 2026
53ae242
CMake 4.2.3
bradking Jan 27, 2026
e733867
Merge tag 'v4.2.3' into sync4.2.3
snehara99 Jan 29, 2026
59a2aa1
updated cgmanifest commithash
snehara99 Jan 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.editorconfig export-ignore
.pre-commit-config.yaml export-ignore
.typos.toml export-ignore
sgconfig.yml export-ignore

# Custom attribute to mark sources as using our C code style.
[attr]our-c-style whitespace=tab-in-indent format.clang-format=18
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ b:windows-x86_64-package:
- .windows_x86_64_package
- .cmake_build_windows
- .cmake_build_package_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2026
- .windows_x86_64_tags_nonconcurrent_vs2022_msvc14.44
- .run_only_for_package
needs:
- p:doc-package
Expand Down Expand Up @@ -1656,7 +1656,7 @@ b:windows-i386-package:
- .windows_i386_package
- .cmake_build_windows
- .cmake_build_package_artifacts
- .windows_x86_64_tags_nonconcurrent_vs2026
- .windows_x86_64_tags_nonconcurrent_vs2022_msvc14.44
- .run_only_for_package
needs:
- p:doc-package
Expand Down
1 change: 1 addition & 0 deletions .gitlab/os-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
image: "kitware/cmake:ci-nvhpc24.9-x86_64-2024-09-27"
variables:
CMAKE_ARCH: x86_64
CMAKE_CUDA_ARCHITECTURES_NATIVE_CLAMP: 1

.nvhpc_ninja:
extends: .nvhpc
Expand Down
14 changes: 6 additions & 8 deletions .gitlab/os-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
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-26.1.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
DEVELOPER_DIR: "/Applications/Xcode-26.2.app/Contents/Developer"

### Build and test

Expand Down Expand Up @@ -145,39 +143,39 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-x86_64
- shell
- xcode-26.1
- xcode-26.2
- nonconcurrent

.macos_x86_64_tags_ext:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-x86_64
- shell
- xcode-26.1
- xcode-26.2
- concurrent

.macos_arm64_tags:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-26.1
- xcode-26.2
- nonconcurrent

.macos_arm64_tags_ext:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-26.1
- xcode-26.2
- concurrent

.macos_arm64_tags_package:
tags:
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- xcode-26.1
- xcode-26.2
- nonconcurrent
- finder

Expand Down
21 changes: 17 additions & 4 deletions .gitlab/os-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
.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

Expand Down Expand Up @@ -43,6 +41,12 @@
VCVARSPLATFORM: "x64"
VCVARSVERSION: "14.44.35207"

.windows_vcvarsall_vs2022_x86_msvc14.44:
variables:
VCVARSALL: "${VS170COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
VCVARSPLATFORM: "x86"
VCVARSVERSION: "14.44.35207"

.windows_vcvarsall_vs2026_x64:
variables:
VCVARSALL: "${VS180COMNTOOLS}\\..\\..\\VC\\Auxiliary\\Build\\vcvarsall.bat"
Expand Down Expand Up @@ -101,15 +105,15 @@
.windows_x86_64_package:
extends:
- .windows_package
- .windows_vcvarsall_vs2026_x64
- .windows_vcvarsall_vs2022_x64_msvc14.44

variables:
CMAKE_CONFIGURATION: windows_x86_64_package

.windows_i386_package:
extends:
- .windows_package
- .windows_vcvarsall_vs2026_x86
- .windows_vcvarsall_vs2022_x86_msvc14.44

variables:
CMAKE_CONFIGURATION: windows_i386_package
Expand Down Expand Up @@ -403,6 +407,15 @@
- msvc-14.50
- concurrent

.windows_x86_64_tags_nonconcurrent_vs2022_msvc14.44:
tags:
- cmake # Since this is a bare runner, pin to a project.
- windows-x86_64
- shell
- vs2022
- msvc-14.44
- nonconcurrent

.windows_x86_64_tags_concurrent_vs2022_msvc14.44:
tags:
- cmake # Since this is a bare runner, pin to a project.
Expand Down
157 changes: 75 additions & 82 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,81 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()

set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)

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 CPPDAP CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV NGHTTP2 ZLIB ZSTD)
foreach(util IN LISTS 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)
elseif(util STREQUAL "CURL" AND APPLE)
# macOS provides a curl with backends configured by Apple.
set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
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}")
if(CMake_ENABLE_DEBUGGER)
option(CMAKE_USE_SYSTEM_CPPDAP "Use system-installed cppdap" "${CMAKE_USE_SYSTEM_LIBRARY_CPPDAP}")
endif()
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}")
cmake_dependent_option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp"
"${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}" "NOT CMAKE_USE_SYSTEM_CPPDAP" ON)
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.
if(CMAKE_USE_SYSTEM_CURL)
# Avoid messaging about curl-only dependencies.
list(REMOVE_ITEM UTILITIES NGHTTP2)
endif()
foreach(util IN LISTS UTILITIES ITEMS 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(Utilities/cmThirdParty.h.in Utilities/cmThirdParty.h @ONLY)
endif()

if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
Expand Down Expand Up @@ -154,88 +229,6 @@ else()
set(CMake_ENABLE_DEBUGGER 0)
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)
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 CPPDAP CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV NGHTTP2 ZLIB ZSTD)
foreach(util IN LISTS 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)
elseif(util STREQUAL "CURL" AND APPLE)
# macOS provides a curl with backends configured by Apple.
set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
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}")
if(CMake_ENABLE_DEBUGGER)
option(CMAKE_USE_SYSTEM_CPPDAP "Use system-installed cppdap" "${CMAKE_USE_SYSTEM_LIBRARY_CPPDAP}")
endif()
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}")
cmake_dependent_option(CMAKE_USE_SYSTEM_JSONCPP "Use system-installed jsoncpp"
"${CMAKE_USE_SYSTEM_LIBRARY_JSONCPP}" "NOT CMAKE_USE_SYSTEM_CPPDAP" ON)
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.
if(CMAKE_USE_SYSTEM_CURL)
# Avoid messaging about curl-only dependencies.
list(REMOVE_ITEM UTILITIES NGHTTP2)
endif()
foreach(util IN LISTS UTILITIES ITEMS 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(Utilities/cmThirdParty.h.in 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.
Expand Down
10 changes: 8 additions & 2 deletions CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ 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_compile_definitions(_FILE_OFFSET_BITS=64 _TIME_BITS=64)
# Use 64-bit off_t even in 32-bit builds.
add_compile_definitions(_FILE_OFFSET_BITS=64)

# Use 64-bit time_t even in 32-bit builds. Skip this with
# system libarchive because its ABI uses the default time_t.
if (NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
add_compile_definitions(_TIME_BITS=64)
endif()
endif()

# Workaround for TOC Overflow on ppc64
Expand Down
Loading