mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
Merge branch 'master' into nsis-branding-trim-position
This commit is contained in:
233
.gitlab-ci.yml
233
.gitlab-ci.yml
@@ -52,7 +52,7 @@ prep:doc-package:
|
||||
- .cmake_doc_artifacts
|
||||
- .run_only_for_package
|
||||
|
||||
.upload:source-package:
|
||||
upload:source-package:
|
||||
extends:
|
||||
- .rsync_upload
|
||||
- .run_only_for_package
|
||||
@@ -115,10 +115,7 @@ test:debian10-ninja:
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_qt
|
||||
- .run_dependent
|
||||
dependencies:
|
||||
- build:centos6-x86_64
|
||||
needs:
|
||||
- build:centos6-x86_64
|
||||
- .needs_centos6_x86_64
|
||||
|
||||
test:debian10-aarch64-ninja:
|
||||
extends:
|
||||
@@ -126,10 +123,7 @@ test:debian10-aarch64-ninja:
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_aarch64_qt
|
||||
- .run_dependent
|
||||
dependencies:
|
||||
- build:centos7-aarch64
|
||||
needs:
|
||||
- build:centos7-aarch64
|
||||
- .needs_centos7_aarch64
|
||||
variables:
|
||||
CMAKE_CI_NO_MR: "true"
|
||||
|
||||
@@ -139,10 +133,7 @@ test:fedora33-makefiles:
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_qt
|
||||
- .run_dependent
|
||||
dependencies:
|
||||
- build:centos6-x86_64
|
||||
needs:
|
||||
- build:centos6-x86_64
|
||||
- .needs_centos6_x86_64
|
||||
|
||||
test:cuda10.2-nvidia:
|
||||
extends:
|
||||
@@ -150,10 +141,7 @@ test:cuda10.2-nvidia:
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_cuda
|
||||
- .run_dependent
|
||||
dependencies:
|
||||
- build:centos6-x86_64
|
||||
needs:
|
||||
- build:centos6-x86_64
|
||||
- .needs_centos6_x86_64
|
||||
|
||||
build:fedora33-ninja:
|
||||
extends:
|
||||
@@ -186,6 +174,209 @@ test:fedora33-ninja-multi:
|
||||
needs:
|
||||
- test:fedora33-ninja
|
||||
|
||||
test:intel2016-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2016_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016-centos7
|
||||
|
||||
test:intel2016u1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2016u1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u1-centos7
|
||||
|
||||
test:intel2016u2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2016u2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2016u2-centos7
|
||||
|
||||
test:intel2017-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017-centos7
|
||||
|
||||
test:intel2017u1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u1-centos7
|
||||
|
||||
test:intel2017u2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u2-centos7
|
||||
|
||||
test:intel2017u3-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u3_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u3-centos7
|
||||
|
||||
test:intel2017u4-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u4_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u4-centos7
|
||||
|
||||
test:intel2017u5-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u5_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u5-centos7
|
||||
|
||||
test:intel2017u6-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u6_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u6-centos7
|
||||
|
||||
test:intel2017u7-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u7_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u7-centos7
|
||||
|
||||
test:intel2017u8-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2017u8_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2017u8-centos7
|
||||
|
||||
test:intel2018-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2018_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018-centos7
|
||||
|
||||
test:intel2018u1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2018u1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u1-centos7
|
||||
|
||||
test:intel2018u2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2018u2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u2-centos7
|
||||
|
||||
test:intel2018u3-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2018u3_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u3-centos7
|
||||
|
||||
test:intel2018u4-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2018u4_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2018u4-centos7
|
||||
|
||||
test:intel2019-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2019_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019-centos7
|
||||
|
||||
test:intel2019u1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2019u1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u1-centos7
|
||||
|
||||
test:intel2019u2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2019u2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u2-centos7
|
||||
|
||||
test:intel2019u3-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2019u3_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u3-centos7
|
||||
|
||||
test:intel2019u4-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2019u4_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2019u4-centos7
|
||||
|
||||
test:intel2020-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2020_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020-rhel8
|
||||
|
||||
test:intel2020u2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2020u2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020u2-rhel8
|
||||
|
||||
test:intel2020u4-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2020u4_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2020u4-rhel8
|
||||
|
||||
test:intel2021.1.1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2021.1.1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.1-rhel8
|
||||
|
||||
test:intel2021.1.2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_intelclassic_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: intel2021.1.2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.2-rhel8
|
||||
|
||||
test:oneapi2021.1.1-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_inteloneapi_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: oneapi2021.1.1_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.1-rhel8
|
||||
|
||||
test:oneapi2021.1.2-makefiles:
|
||||
extends:
|
||||
- .cmake_test_linux_inteloneapi_makefiles
|
||||
variables:
|
||||
CMAKE_CI_BUILD_NAME: oneapi2021.1.2_makefiles
|
||||
CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2021.1.2-rhel8
|
||||
|
||||
build:linux-x86_64-package:
|
||||
extends:
|
||||
- .linux_package
|
||||
@@ -199,7 +390,7 @@ build:linux-x86_64-package:
|
||||
needs:
|
||||
- prep:doc-package
|
||||
|
||||
.upload:linux-x86_64-package:
|
||||
upload:linux-x86_64-package:
|
||||
extends:
|
||||
- .rsync_upload
|
||||
- .run_only_for_package
|
||||
@@ -223,7 +414,7 @@ build:linux-aarch64-package:
|
||||
needs:
|
||||
- prep:doc-package
|
||||
|
||||
.upload:linux-aarch64-package:
|
||||
upload:linux-aarch64-package:
|
||||
extends:
|
||||
- .rsync_upload
|
||||
- .run_only_for_package
|
||||
@@ -335,7 +526,7 @@ build:macos-package:
|
||||
needs:
|
||||
- prep:doc-package
|
||||
|
||||
.upload:macos-package:
|
||||
upload:macos-package:
|
||||
extends:
|
||||
- .rsync_upload
|
||||
- .run_only_for_package
|
||||
@@ -358,7 +549,7 @@ build:macos10.10-package:
|
||||
needs:
|
||||
- prep:doc-package
|
||||
|
||||
.upload:macos10.10-package:
|
||||
upload:macos10.10-package:
|
||||
extends:
|
||||
- .rsync_upload
|
||||
- .run_only_for_package
|
||||
|
||||
1
.gitlab/ci/configure_intelclassic_makefiles.cmake
Normal file
1
.gitlab/ci/configure_intelclassic_makefiles.cmake
Normal file
@@ -0,0 +1 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
|
||||
1
.gitlab/ci/configure_inteloneapi_makefiles.cmake
Normal file
1
.gitlab/ci/configure_inteloneapi_makefiles.cmake
Normal file
@@ -0,0 +1 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
|
||||
@@ -1,4 +1,7 @@
|
||||
set(CMake_TEST_WIX_NO_VERIFY "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_GUI "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_common.cmake")
|
||||
|
||||
@@ -13,15 +13,6 @@ if (CTEST_CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
"^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})")
|
||||
|
||||
14
.gitlab/ci/env.sh
Normal file
14
.gitlab/ci/env.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
quietly() {
|
||||
readonly log="/tmp/quietly-$RANDOM.log"
|
||||
if ! "$@" >"$log" 2>&1; then
|
||||
ret=$?
|
||||
cat "$log"
|
||||
rm -f "$log"
|
||||
exit $ret
|
||||
fi
|
||||
rm -f "$log"
|
||||
}
|
||||
|
||||
if test -r ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"; then
|
||||
source ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"
|
||||
fi
|
||||
9
.gitlab/ci/env_intelclassic_common.sh
Normal file
9
.gitlab/ci/env_intelclassic_common.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
source .gitlab/ci/env_intelcompiler_license.sh
|
||||
|
||||
if test -r /opt/intel/oneapi/setvars.sh; then
|
||||
source /opt/intel/oneapi/setvars.sh
|
||||
elif test -r /opt/intel/bin/compilervars.sh; then
|
||||
source /opt/intel/bin/compilervars.sh intel64
|
||||
fi
|
||||
|
||||
export CC=icc CXX=icpc FC=ifort
|
||||
1
.gitlab/ci/env_intelclassic_makefiles.sh
Normal file
1
.gitlab/ci/env_intelclassic_makefiles.sh
Normal file
@@ -0,0 +1 @@
|
||||
source .gitlab/ci/env_intelclassic_common.sh
|
||||
8
.gitlab/ci/env_intelcompiler_license.sh
Normal file
8
.gitlab/ci/env_intelcompiler_license.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
if test -n "$CMAKE_CI_INTELCOMPILER_LICENSE"; then
|
||||
if test -d /opt/intel/licenses; then
|
||||
mv "$CMAKE_CI_INTELCOMPILER_LICENSE" /opt/intel/licenses/ci.lic
|
||||
else
|
||||
rm "$CMAKE_CI_INTELCOMPILER_LICENSE"
|
||||
fi
|
||||
unset CMAKE_CI_INTELCOMPILER_LICENSE
|
||||
fi
|
||||
7
.gitlab/ci/env_inteloneapi_common.sh
Normal file
7
.gitlab/ci/env_inteloneapi_common.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
source .gitlab/ci/env_intelcompiler_license.sh
|
||||
|
||||
if test -r /opt/intel/oneapi/setvars.sh; then
|
||||
source /opt/intel/oneapi/setvars.sh
|
||||
fi
|
||||
|
||||
export CC=icx CXX=icpx FC=ifx
|
||||
1
.gitlab/ci/env_inteloneapi_makefiles.sh
Normal file
1
.gitlab/ci/env_inteloneapi_makefiles.sh
Normal file
@@ -0,0 +1 @@
|
||||
source .gitlab/ci/env_inteloneapi_common.sh
|
||||
@@ -17,7 +17,11 @@ if ("$ENV{CMAKE_CONFIGURATION}" STREQUAL "")
|
||||
endif ()
|
||||
|
||||
# Set the build metadata.
|
||||
set(CTEST_BUILD_NAME "$ENV{CI_PROJECT_NAME}-$ENV{CMAKE_CONFIGURATION}")
|
||||
if(NOT "$ENV{CMAKE_CI_BUILD_NAME}" STREQUAL "")
|
||||
set(CTEST_BUILD_NAME "$ENV{CI_PROJECT_NAME}-$ENV{CMAKE_CI_BUILD_NAME}")
|
||||
else()
|
||||
set(CTEST_BUILD_NAME "$ENV{CI_PROJECT_NAME}-$ENV{CMAKE_CONFIGURATION}")
|
||||
endif()
|
||||
set(CTEST_SITE "gitlab-ci")
|
||||
set(ctest_model "Experimental")
|
||||
|
||||
|
||||
@@ -30,6 +30,18 @@
|
||||
variables:
|
||||
BOOTSTRAP_ARGS: '-- "-DCMake_DOC_ARTIFACT_PREFIX=$CI_PROJECT_DIR/build/install-doc"'
|
||||
|
||||
.needs_centos6_x86_64:
|
||||
dependencies:
|
||||
- build:centos6-x86_64
|
||||
needs:
|
||||
- build:centos6-x86_64
|
||||
|
||||
.needs_centos7_aarch64:
|
||||
dependencies:
|
||||
- build:centos7-aarch64
|
||||
needs:
|
||||
- build:centos7-aarch64
|
||||
|
||||
### Debian
|
||||
|
||||
.debian10:
|
||||
@@ -128,6 +140,27 @@
|
||||
CTEST_NO_WARNINGS_ALLOWED: 1
|
||||
CMAKE_GENERATOR: "Unix Makefiles"
|
||||
|
||||
### Intel Compiler
|
||||
|
||||
.intelcompiler:
|
||||
image: "kitware/intelcompiler:$CMAKE_CI_INTELCOMPILER_IMAGE_TAG"
|
||||
environment:
|
||||
name: intel-compiler
|
||||
variables:
|
||||
CMAKE_ARCH: x86_64
|
||||
|
||||
.intelclassic_makefiles:
|
||||
extends: .intelcompiler
|
||||
variables:
|
||||
CMAKE_CONFIGURATION: intelclassic_makefiles
|
||||
CMAKE_GENERATOR: "Unix Makefiles"
|
||||
|
||||
.inteloneapi_makefiles:
|
||||
extends: .intelcompiler
|
||||
variables:
|
||||
CMAKE_CONFIGURATION: inteloneapi_makefiles
|
||||
CMAKE_GENERATOR: "Unix Makefiles"
|
||||
|
||||
### CUDA builds
|
||||
|
||||
.cuda10.2:
|
||||
@@ -195,6 +228,7 @@
|
||||
## Linux-specific scripts
|
||||
|
||||
.before_script_linux: &before_script_linux
|
||||
- source .gitlab/ci/env.sh
|
||||
- .gitlab/ci/cmake.sh
|
||||
- .gitlab/ci/ninja.sh
|
||||
- export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PATH
|
||||
@@ -251,6 +285,7 @@
|
||||
stage: build
|
||||
|
||||
script:
|
||||
- source .gitlab/ci/env.sh
|
||||
# Bootstrap.
|
||||
- mkdir -p build/
|
||||
# Exclude documentation. A job dependency provides it for packaging.
|
||||
@@ -313,3 +348,23 @@
|
||||
- sccache --show-stats
|
||||
|
||||
interruptible: true
|
||||
|
||||
.cmake_test_linux_intelclassic_makefiles:
|
||||
extends:
|
||||
- .intelclassic_makefiles
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_qt
|
||||
- .run_manually
|
||||
- .needs_centos6_x86_64
|
||||
variables:
|
||||
CMAKE_CI_JOB_NIGHTLY: "true"
|
||||
|
||||
.cmake_test_linux_inteloneapi_makefiles:
|
||||
extends:
|
||||
- .inteloneapi_makefiles
|
||||
- .cmake_test_linux_release
|
||||
- .linux_builder_tags_qt
|
||||
- .run_manually
|
||||
- .needs_centos6_x86_64
|
||||
variables:
|
||||
CMAKE_CI_JOB_NIGHTLY: "true"
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
when: never
|
||||
- if: '$CMAKE_CI_NIGHTLY == "true"'
|
||||
when: on_success
|
||||
- if: '$CMAKE_CI_JOB_NIGHTLY == "true"'
|
||||
when: never
|
||||
- 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
|
||||
@@ -24,6 +26,8 @@
|
||||
when: never
|
||||
- if: '$CMAKE_CI_NIGHTLY == "true"'
|
||||
when: on_success
|
||||
- if: '$CMAKE_CI_JOB_NIGHTLY == "true"'
|
||||
when: never
|
||||
- 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)'
|
||||
@@ -42,6 +46,8 @@
|
||||
when: always
|
||||
- if: '$CMAKE_CI_NIGHTLY == "true"'
|
||||
when: on_success
|
||||
- if: '$CMAKE_CI_JOB_NIGHTLY == "true"'
|
||||
when: never
|
||||
- if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)'
|
||||
when: never
|
||||
- if: '$CI_MERGE_REQUEST_ID'
|
||||
|
||||
@@ -133,6 +133,9 @@ if(CMake_INSTALL_COMPONENTS)
|
||||
if(SPHINX_QTHELP)
|
||||
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-qthelp)
|
||||
endif()
|
||||
if(SPHINX_LATEXPDF)
|
||||
list(APPEND _CPACK_IFW_COMPONENTS_ALL sphinx-latexpdf)
|
||||
endif()
|
||||
if(CMake_BUILD_DEVELOPER_REFERENCE)
|
||||
if(CMake_BUILD_DEVELOPER_REFERENCE_HTML)
|
||||
list(APPEND _CPACK_IFW_COMPONENTS_ALL cmake-developer-reference-html)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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)
|
||||
cmake_minimum_required(VERSION 3.1...3.19 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)
|
||||
|
||||
@@ -11,8 +11,8 @@ The general signature is:
|
||||
|FIND_XXX| (
|
||||
<VAR>
|
||||
name | |NAMES|
|
||||
[HINTS path1 [path2 ... ENV var]]
|
||||
[PATHS path1 [path2 ... ENV var]]
|
||||
[HINTS [path | ENV var]... ]
|
||||
[PATHS [path | ENV var]... ]
|
||||
[PATH_SUFFIXES suffix1 [suffix2 ...]]
|
||||
[DOC "cache documentation string"]
|
||||
[REQUIRED]
|
||||
|
||||
@@ -36,8 +36,30 @@ or
|
||||
depending on whether ``VAR`` is set in CMake to any value not considered
|
||||
a false constant by the :command:`if` command. The "..." content on the
|
||||
line after the variable name, if any, is processed as above.
|
||||
Input file lines of the form ``#cmakedefine01 VAR`` will be replaced with
|
||||
either ``#define VAR 1`` or ``#define VAR 0`` similarly.
|
||||
|
||||
Unlike lines of the form ``#cmakedefine VAR ...``, in lines of the form
|
||||
``#cmakedefine01 VAR``, ``VAR`` itself will expand to ``VAR 0`` or ``VAR 1``
|
||||
rather than being assigned the value ``...``. Therefore, input lines of the form
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#cmakedefine01 VAR
|
||||
|
||||
will be replaced with either
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#define VAR 0
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
#define VAR 1
|
||||
|
||||
Input lines of the form ``#cmakedefine01 VAR ...`` will expand
|
||||
as ``#cmakedefine01 VAR ... 0`` or ``#cmakedefine01 VAR ... 0``,
|
||||
which may lead to undefined behavior.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
The result lines (with the exception of the ``#undef`` comments) can be
|
||||
|
||||
@@ -38,7 +38,8 @@ Synopsis
|
||||
|
||||
`Filesystem`_
|
||||
file({`GLOB`_ | `GLOB_RECURSE`_} <out-var> [...] [<globbing-expr>...])
|
||||
file(`RENAME`_ <oldname> <newname>)
|
||||
file(`RENAME`_ <oldname> <newname> [...])
|
||||
file(`COPY_FILE`_ <oldname> <newname> [...])
|
||||
file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
|
||||
file(`MAKE_DIRECTORY`_ [<dir>...])
|
||||
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
|
||||
@@ -665,11 +666,46 @@ Examples of recursive globbing include::
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
file(RENAME <oldname> <newname>)
|
||||
file(RENAME <oldname> <newname>
|
||||
[RESULT <result>]
|
||||
[NO_REPLACE])
|
||||
|
||||
Move a file or directory within a filesystem from ``<oldname>`` to
|
||||
``<newname>``, replacing the destination atomically.
|
||||
|
||||
The options are:
|
||||
|
||||
``RESULT <result>``
|
||||
Set ``<result>`` variable to ``0`` on success or an error message otherwise.
|
||||
If ``RESULT`` is not specified and the operation fails, an error is emitted.
|
||||
|
||||
``NO_REPLACE``
|
||||
If the ``<newname>`` path already exists, do not replace it.
|
||||
If ``RESULT <result>`` is used, the result variable will be
|
||||
set to ``NO_REPLACE``. Otherwise, an error is emitted.
|
||||
|
||||
.. _COPY_FILE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
file(COPY_FILE <oldname> <newname>
|
||||
[RESULT <result>]
|
||||
[ONLY_IF_DIFFERENT])
|
||||
|
||||
Copy a file from ``<oldname>`` to ``<newname>``. Directories are not
|
||||
supported. Symlinks are ignored and ``<oldfile>``'s content is read and
|
||||
written to ``<newname>`` as a new file.
|
||||
|
||||
The options are:
|
||||
|
||||
``RESULT <result>``
|
||||
Set ``<result>`` variable to ``0`` on success or an error message otherwise.
|
||||
If ``RESULT`` is not specified and the operation fails, an error is emitted.
|
||||
|
||||
``ONLY_IF_DIFFERENT``
|
||||
If the ``<newname>`` path already exists, do not replace it if it is the
|
||||
same as ``<oldname>``. Otherwise, an error is emitted.
|
||||
|
||||
.. _REMOVE:
|
||||
.. _REMOVE_RECURSE:
|
||||
|
||||
|
||||
@@ -103,6 +103,12 @@ on macOS:
|
||||
|
||||
- Default: ``CPACK_PACKAGE_FILE_NAME-<component>``
|
||||
|
||||
.. variable:: CPACK_DMG_FILESYSTEM
|
||||
|
||||
The filesystem format. Common values are ``APFS`` and ``HFS+``.
|
||||
See ``man hdiutil`` for a full list of supported formats.
|
||||
Defaults to ``HFS+``.
|
||||
|
||||
.. variable:: CPACK_COMMAND_HDIUTIL
|
||||
|
||||
Path to the ``hdiutil(1)`` command used to operate on disk image files on
|
||||
|
||||
@@ -195,3 +195,9 @@ on Windows Nullsoft Scriptable Install System.
|
||||
If set, trim down the size of the control to the size of the branding text string.
|
||||
Allowed values for this variable are ``LEFT``, ``CENTER`` or ``RIGHT``.
|
||||
If not specified, the default behavior is ``LEFT``.
|
||||
|
||||
.. variable:: CPACK_NSIS_EXECUTABLE
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
If set, specify the name of the NSIS executable. Default is ``makensis``.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(MathFunctions)
|
||||
|
||||
# make cache variables for install destinations
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# specify the C++ standard
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
@@ -12,26 +15,26 @@ add_library(MathFunctions STATIC MathFunctions.cxx)
|
||||
target_include_directories(MathFunctions
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
"$<INSTALL_INTERFACE:include>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||
)
|
||||
|
||||
# install the target and create export-set
|
||||
install(TARGETS MathFunctions
|
||||
EXPORT MathFunctionsTargets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
# install header file
|
||||
install(FILES MathFunctions.h DESTINATION include)
|
||||
install(FILES MathFunctions.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# generate and install export file
|
||||
install(EXPORT MathFunctionsTargets
|
||||
FILE MathFunctionsTargets.cmake
|
||||
NAMESPACE MathFunctions::
|
||||
DESTINATION lib/cmake/MathFunctions
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
# include CMakePackageConfigHelpers macro
|
||||
@@ -58,14 +61,14 @@ write_basic_package_version_file(
|
||||
# create config file
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
|
||||
INSTALL_DESTINATION lib/cmake/MathFunctions
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
# install config files
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/MathFunctions
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
# generate the export targets for the build tree
|
||||
|
||||
@@ -7,24 +7,24 @@ add_library(MathFunctions::Addition ALIAS Addition)
|
||||
target_include_directories(Addition
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
# install the target and create export-set
|
||||
install(TARGETS Addition
|
||||
EXPORT AdditionTargets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
# install header file
|
||||
install(FILES Addition.h DESTINATION include)
|
||||
install(FILES Addition.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# generate and install export file
|
||||
install(EXPORT AdditionTargets
|
||||
FILE MathFunctionsAdditionTargets.cmake
|
||||
NAMESPACE MathFunctions::
|
||||
DESTINATION lib/cmake/MathFunctions
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(MathFunctionsComponents)
|
||||
|
||||
# make cache variables for install destinations
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# specify the C++ standard
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
@@ -24,7 +27,7 @@ write_basic_package_version_file(
|
||||
# create config file
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
|
||||
INSTALL_DESTINATION lib/cmake/MathFunctions
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
||||
)
|
||||
|
||||
@@ -32,5 +35,5 @@ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/MathFunctions
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
@@ -7,24 +7,24 @@ add_library(MathFunctions::SquareRoot ALIAS SquareRoot)
|
||||
target_include_directories(SquareRoot
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
"$<INSTALL_INTERFACE:include>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||
)
|
||||
|
||||
# install the target and create export-set
|
||||
install(TARGETS SquareRoot
|
||||
EXPORT SquareRootTargets
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
INCLUDES DESTINATION include
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
# install header file
|
||||
install(FILES SquareRoot.h DESTINATION include)
|
||||
install(FILES SquareRoot.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# generate and install export file
|
||||
install(EXPORT SquareRootTargets
|
||||
FILE MathFunctionsSquareRootTargets.cmake
|
||||
NAMESPACE MathFunctions::
|
||||
DESTINATION lib/cmake/MathFunctions
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MathFunctions
|
||||
)
|
||||
|
||||
@@ -202,6 +202,10 @@ project. Start by specifying the :command:`cmake_minimum_required` version and
|
||||
:language: cmake
|
||||
:end-before: # create library
|
||||
|
||||
The :module:`GNUInstallDirs` module is included in order to provide the
|
||||
project with the flexibility to install into different platform layouts by
|
||||
making the directories available as cache variables.
|
||||
|
||||
Create a library called ``MathFunctions`` with the :command:`add_library`
|
||||
command:
|
||||
|
||||
|
||||
@@ -76,6 +76,10 @@
|
||||
native build system to choose a compiler or SDK. See the
|
||||
:variable:`CMAKE_GENERATOR_PLATFORM` variable for details.
|
||||
|
||||
``--install-prefix <directory>``
|
||||
Specify the installation directory, used by the
|
||||
:variable:`CMAKE_INSTALL_PREFIX` variable. Must be an absolute path.
|
||||
|
||||
``-Wno-dev``
|
||||
Suppress developer warnings.
|
||||
|
||||
|
||||
@@ -350,6 +350,24 @@ look.
|
||||
PATHS ${PC_Foo_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
Alternatively, if the library is available with multiple configurations, you can
|
||||
use :module:`SelectLibraryConfigurations` to automatically set the
|
||||
``Foo_LIBRARY`` variable instead:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_library(Foo_LIBRARY_RELEASE
|
||||
NAMES foo
|
||||
PATHS ${PC_Foo_LIBRARY_DIRS}/Release
|
||||
)
|
||||
find_library(Foo_LIBRARY_DEBUG
|
||||
NAMES foo
|
||||
PATHS ${PC_Foo_LIBRARY_DIRS}/Debug
|
||||
)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(Foo)
|
||||
|
||||
If you have a good way of getting the version (from a header file, for
|
||||
example), you can use that information to set ``Foo_VERSION`` (although
|
||||
note that find modules have traditionally used ``Foo_VERSION_STRING``,
|
||||
|
||||
@@ -443,7 +443,8 @@ Version 1 does not exist to avoid confusion with that from
|
||||
"hasInstallRule": true,
|
||||
"minimumCMakeVersion": {
|
||||
"string": "3.14"
|
||||
}
|
||||
},
|
||||
"jsonFile": "<file>"
|
||||
},
|
||||
{
|
||||
"source": "sub",
|
||||
@@ -453,7 +454,8 @@ Version 1 does not exist to avoid confusion with that from
|
||||
"targetIndexes": [ 1 ],
|
||||
"minimumCMakeVersion": {
|
||||
"string": "3.14"
|
||||
}
|
||||
},
|
||||
"jsonFile": "<file>"
|
||||
}
|
||||
],
|
||||
"projects": [
|
||||
@@ -569,6 +571,13 @@ The members specific to ``codemodel`` objects are:
|
||||
:command:`install` rules, i.e. whether a ``make install``
|
||||
or equivalent rule is available.
|
||||
|
||||
``jsonFile``
|
||||
A JSON string specifying a path relative to the codemodel file
|
||||
to another JSON file containing a
|
||||
`"codemodel" version 2 "directory" object`_.
|
||||
|
||||
This field was added in codemodel version 2.3.
|
||||
|
||||
``projects``
|
||||
A JSON array of entries corresponding to the top-level project
|
||||
and sub-projects defined in the build system. Each (sub-)project
|
||||
@@ -633,6 +642,182 @@ The members specific to ``codemodel`` objects are:
|
||||
to another JSON file containing a
|
||||
`"codemodel" version 2 "target" object`_.
|
||||
|
||||
"codemodel" version 2 "directory" object
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A codemodel "directory" object is referenced by a `"codemodel" version 2`_
|
||||
object's ``directories`` array. Each "directory" object is a JSON object
|
||||
with members:
|
||||
|
||||
``paths``
|
||||
A JSON object containing members:
|
||||
|
||||
``source``
|
||||
A string specifying the path to the source directory, represented
|
||||
with forward slashes. If the directory is inside the top-level
|
||||
source directory then the path is specified relative to that
|
||||
directory (with ``.`` for the top-level source directory itself).
|
||||
Otherwise the path is absolute.
|
||||
|
||||
``build``
|
||||
A string specifying the path to the build directory, represented
|
||||
with forward slashes. If the directory is inside the top-level
|
||||
build directory then the path is specified relative to that
|
||||
directory (with ``.`` for the top-level build directory itself).
|
||||
Otherwise the path is absolute.
|
||||
|
||||
``installers``
|
||||
A JSON array of entries corresponding to :command:`install` rules.
|
||||
Each entry is a JSON object containing members:
|
||||
|
||||
``component``
|
||||
A string specifying the component selected by the corresponding
|
||||
:command:`install` command invocation.
|
||||
|
||||
``destination``
|
||||
Optional member that is present for specific ``type`` values below.
|
||||
The value is a string specifying the install destination path.
|
||||
The path may be absolute or relative to the install prefix.
|
||||
|
||||
``paths``
|
||||
Optional member that is present for specific ``type`` values below.
|
||||
The value is a JSON array of entries corresponding to the paths
|
||||
(files or directories) to be installed. Each entry is one of:
|
||||
|
||||
* A string specifying the path from which a file or directory
|
||||
is to be installed. The portion of the path not preceded by
|
||||
a ``/`` also specifies the path (name) to which the file
|
||||
or directory is to be installed under the destination.
|
||||
|
||||
* A JSON object with members:
|
||||
|
||||
``from``
|
||||
A string specifying the path from which a file or directory
|
||||
is to be installed.
|
||||
|
||||
``to``
|
||||
A string specifying the path to which the file or directory
|
||||
is to be installed under the destination.
|
||||
|
||||
In both cases the paths are represented with forward slashes. If
|
||||
the "from" path is inside the top-level directory documented by the
|
||||
corresponding ``type`` value, then the path is specified relative
|
||||
to that directory. Otherwise the path is absolute.
|
||||
|
||||
``type``
|
||||
A string specifying the type of installation rule. The value is one
|
||||
of the following, with some variants providing additional members:
|
||||
|
||||
``file``
|
||||
An :command:`install(FILES)` or :command:`install(PROGRAMS)` call.
|
||||
The ``destination`` and ``paths`` members are populated, with paths
|
||||
under the top-level *source* directory expressed relative to it.
|
||||
The ``isOptional`` member may exist.
|
||||
This type has no additional members.
|
||||
|
||||
``directory``
|
||||
An :command:`install(DIRECTORY)` call.
|
||||
The ``destination`` and ``paths`` members are populated, with paths
|
||||
under the top-level *source* directory expressed relative to it.
|
||||
The ``isOptional`` member may exist.
|
||||
This type has no additional members.
|
||||
|
||||
``target``
|
||||
An :command:`install(TARGETS)` call.
|
||||
The ``destination`` and ``paths`` members are populated, with paths
|
||||
under the top-level *build* directory expressed relative to it.
|
||||
The ``isOptional`` member may exist.
|
||||
This type has additional members ``targetId``, ``targetIndex``,
|
||||
``targetIsImportLibrary``, and ``targetInstallNamelink``.
|
||||
|
||||
``export``
|
||||
An :command:`install(EXPORT)` call.
|
||||
The ``destination`` and ``paths`` members are populated, with paths
|
||||
under the top-level *build* directory expressed relative to it.
|
||||
The ``paths`` entries refer to files generated automatically by
|
||||
CMake for installation, and their actual values are considered
|
||||
private implementation details.
|
||||
This type has additional members ``exportName`` and ``exportTargets``.
|
||||
|
||||
``script``
|
||||
An :command:`install(SCRIPT)` call.
|
||||
This type has additional member ``scriptFile``.
|
||||
|
||||
``code``
|
||||
An :command:`install(CODE)` call.
|
||||
This type has no additional members.
|
||||
|
||||
``isExcludeFromAll``
|
||||
Optional member that is present with boolean value ``true`` when
|
||||
:command:`install` is called with the ``EXCLUDE_FROM_ALL`` option.
|
||||
|
||||
``isOptional``
|
||||
Optional member that is present with boolean value ``true`` when
|
||||
:command:`install` is called with the ``OPTIONAL`` option.
|
||||
This is allowed when ``type`` is ``file``, ``directory``, or ``target``.
|
||||
|
||||
``targetId``
|
||||
Optional member that is present when ``type`` is ``target``.
|
||||
The value is a string uniquely identifying the target to be installed.
|
||||
This matches the ``id`` member of the target in the main
|
||||
"codemodel" object's ``targets`` array.
|
||||
|
||||
``targetIndex``
|
||||
Optional member that is present when ``type`` is ``target``.
|
||||
The value is an unsigned integer 0-based index into the main "codemodel"
|
||||
object's ``targets`` array for the target to be installed.
|
||||
|
||||
``targetIsImportLibrary``
|
||||
Optional member that is present when ``type`` is ``target`` and
|
||||
the installer is for a Windows DLL import library file or for an
|
||||
AIX linker import file. If present, it has boolean value ``true``.
|
||||
|
||||
``targetInstallNamelink``
|
||||
Optional member that is present when ``type`` is ``target`` and
|
||||
the installer corresponds to a target that may use symbolic links
|
||||
to implement the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION`
|
||||
target properties.
|
||||
The value is a string indicating how the installer is supposed to
|
||||
handle the symlinks: ``skip`` means the installer should skip the
|
||||
symlinks and install only the real file, and ``only`` means the
|
||||
installer should install only the symlinks and not the real file.
|
||||
In all cases the ``paths`` member lists what it actually installs.
|
||||
|
||||
``exportName``
|
||||
Optional member that is present when ``type`` is ``export``.
|
||||
The value is a string specifying the name of the export.
|
||||
|
||||
``exportTargets``
|
||||
Optional member that is present when ``type`` is ``export``.
|
||||
The value is a JSON array of entries corresponding to the targets
|
||||
included in the export. Each entry is a JSON object with members:
|
||||
|
||||
``id``
|
||||
A string uniquely identifying the target. This matches
|
||||
the ``id`` member of the target in the main "codemodel"
|
||||
object's ``targets`` array.
|
||||
|
||||
``index``
|
||||
An unsigned integer 0-based index into the main "codemodel"
|
||||
object's ``targets`` array for the target.
|
||||
|
||||
``scriptFile``
|
||||
Optional member that is present when ``type`` is ``script``.
|
||||
The value is a string specifying the path to the script file on disk,
|
||||
represented with forward slashes. If the file is inside the top-level
|
||||
source directory then the path is specified relative to that directory.
|
||||
Otherwise the path is absolute.
|
||||
|
||||
``backtrace``
|
||||
Optional member that is present when a CMake language backtrace to
|
||||
the :command:`install` or other command invocation that added this
|
||||
installer is available. The value is an unsigned integer 0-based
|
||||
index into the ``backtraceGraph`` member's ``nodes`` array.
|
||||
|
||||
``backtraceGraph``
|
||||
A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
|
||||
from ``backtrace`` members elsewhere in this "directory" object.
|
||||
|
||||
"codemodel" version 2 "target" object
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -964,40 +1149,48 @@ with members:
|
||||
with forward slashes.
|
||||
|
||||
``backtraceGraph``
|
||||
A JSON object describing the graph of backtraces whose nodes are
|
||||
referenced from ``backtrace`` members elsewhere. The members are:
|
||||
A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
|
||||
from ``backtrace`` members elsewhere in this "target" object.
|
||||
|
||||
``nodes``
|
||||
A JSON array listing nodes in the backtrace graph. Each entry
|
||||
is a JSON object with members:
|
||||
"codemodel" version 2 "backtrace graph"
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
``file``
|
||||
An unsigned integer 0-based index into the backtrace ``files`` array.
|
||||
The ``backtraceGraph`` member of a `"codemodel" version 2 "directory" object`_,
|
||||
or `"codemodel" version 2 "target" object`_ is a JSON object describing a
|
||||
graph of backtraces. Its nodes are referenced from ``backtrace`` members
|
||||
elsewhere in the containing object. The backtrace graph object members are:
|
||||
|
||||
``line``
|
||||
An optional member present when the node represents a line within
|
||||
the file. The value is an unsigned integer 1-based line number.
|
||||
``nodes``
|
||||
A JSON array listing nodes in the backtrace graph. Each entry
|
||||
is a JSON object with members:
|
||||
|
||||
``command``
|
||||
An optional member present when the node represents a command
|
||||
invocation within the file. The value is an unsigned integer
|
||||
0-based index into the backtrace ``commands`` array.
|
||||
``file``
|
||||
An unsigned integer 0-based index into the backtrace ``files`` array.
|
||||
|
||||
``parent``
|
||||
An optional member present when the node is not the bottom of
|
||||
the call stack. The value is an unsigned integer 0-based index
|
||||
of another entry in the backtrace ``nodes`` array.
|
||||
``line``
|
||||
An optional member present when the node represents a line within
|
||||
the file. The value is an unsigned integer 1-based line number.
|
||||
|
||||
``commands``
|
||||
A JSON array listing command names referenced by backtrace nodes.
|
||||
Each entry is a string specifying a command name.
|
||||
``command``
|
||||
An optional member present when the node represents a command
|
||||
invocation within the file. The value is an unsigned integer
|
||||
0-based index into the backtrace ``commands`` array.
|
||||
|
||||
``files``
|
||||
A JSON array listing CMake language files referenced by backtrace nodes.
|
||||
Each entry is a string specifying the path to a file, represented
|
||||
with forward slashes. If the file is inside the top-level source
|
||||
directory then the path is specified relative to that directory.
|
||||
Otherwise the path is absolute.
|
||||
``parent``
|
||||
An optional member present when the node is not the bottom of
|
||||
the call stack. The value is an unsigned integer 0-based index
|
||||
of another entry in the backtrace ``nodes`` array.
|
||||
|
||||
``commands``
|
||||
A JSON array listing command names referenced by backtrace nodes.
|
||||
Each entry is a string specifying a command name.
|
||||
|
||||
``files``
|
||||
A JSON array listing CMake language files referenced by backtrace nodes.
|
||||
Each entry is a string specifying the path to a file, represented
|
||||
with forward slashes. If the file is inside the top-level source
|
||||
directory then the path is specified relative to that directory.
|
||||
Otherwise the path is absolute.
|
||||
|
||||
Object Kind "cache"
|
||||
-------------------
|
||||
|
||||
@@ -938,6 +938,29 @@ which is just the string ``tgt``.
|
||||
:ref:`Target Usage Requirements` this is the consuming target rather
|
||||
than the target specifying the requirement.
|
||||
|
||||
.. genex:: $<TARGET_RUNTIME_DLLS:tgt>
|
||||
|
||||
List of DLLs that the target depends on at runtime. This is determined by
|
||||
the locations of all the ``SHARED`` and ``MODULE`` targets in the target's
|
||||
transitive dependencies. Using this generator expression on targets other
|
||||
than executables, ``SHARED`` libraries, and ``MODULE`` libraries is an error.
|
||||
On non-DLL platforms, it evaluates to an empty string.
|
||||
|
||||
This generator expression can be used to copy all of the DLLs that a target
|
||||
depends on into its output directory in a ``POST_BUILD`` custom command. For
|
||||
example:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(foo REQUIRED)
|
||||
|
||||
add_executable(exe main.c)
|
||||
target_link_libraries(exe PRIVATE foo::foo foo::bar)
|
||||
add_custom_command(TARGET exe POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:exe> $<TARGET_FILE_DIR:exe>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
|
||||
.. genex:: $<INSTALL_PREFIX>
|
||||
|
||||
Content of the install prefix when the target is exported via
|
||||
|
||||
@@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
|
||||
to determine whether to report an error on use of deprecated macros or
|
||||
functions.
|
||||
|
||||
Policies Introduced by CMake 3.21
|
||||
=================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
CMP0121: The list command detects invalid indicies </policy/CMP0121>
|
||||
|
||||
Policies Introduced by CMake 3.20
|
||||
=================================
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ The root object recognizes the following fields:
|
||||
``version``
|
||||
|
||||
A required integer representing the version of the JSON schema.
|
||||
The supported versions are ``1`` and ``2``.
|
||||
The supported versions are ``1``, ``2``, and ``3``.
|
||||
|
||||
``cmakeMinimumRequired``
|
||||
|
||||
@@ -70,17 +70,17 @@ The root object recognizes the following fields:
|
||||
``configurePresets``
|
||||
|
||||
An optional array of `Configure Preset`_ objects.
|
||||
This is allowed in preset files specifying version 1 or above.
|
||||
This is allowed in preset files specifying version ``1`` or above.
|
||||
|
||||
``buildPresets``
|
||||
|
||||
An optional array of `Build Preset`_ objects.
|
||||
This is allowed in preset files specifying version 2 or above.
|
||||
This is allowed in preset files specifying version ``2`` or above.
|
||||
|
||||
``testPresets``
|
||||
|
||||
An optional array of `Test Preset`_ objects.
|
||||
This is allowed in preset files specifying version 2 or above.
|
||||
This is allowed in preset files specifying version ``2`` or above.
|
||||
|
||||
Configure Preset
|
||||
^^^^^^^^^^^^^^^^
|
||||
@@ -119,6 +119,11 @@ that may contain the following fields:
|
||||
This field can also be a string, which is equivalent to an array
|
||||
containing one string.
|
||||
|
||||
``condition``
|
||||
|
||||
An optional `Condition`_ object. This is allowed in preset files specifying
|
||||
version ``3`` or above.
|
||||
|
||||
``vendor``
|
||||
|
||||
An optional map containing vendor-specific information. CMake does not
|
||||
@@ -183,6 +188,13 @@ that may contain the following fields:
|
||||
specified, it must be inherited from the ``inherits`` preset (unless this
|
||||
preset is ``hidden``).
|
||||
|
||||
``installDir``
|
||||
|
||||
An optional string representing the path to the installation directory.
|
||||
This field supports `macro expansion`_. If a relative path is specified,
|
||||
it is calculated relative to the source directory. This is allowed in
|
||||
preset files specifying version ``3`` or above.
|
||||
|
||||
``cmakeExecutable``
|
||||
|
||||
An optional string representing the path to the CMake executable to use
|
||||
@@ -338,6 +350,11 @@ that may contain the following fields:
|
||||
This field can also be a string, which is equivalent to an array
|
||||
containing one string.
|
||||
|
||||
``condition``
|
||||
|
||||
An optional `Condition`_ object. This is allowed in preset files specifying
|
||||
version ``3`` or above.
|
||||
|
||||
``vendor``
|
||||
|
||||
An optional map containing vendor-specific information. CMake does not
|
||||
@@ -457,6 +474,11 @@ that may contain the following fields:
|
||||
This field can also be a string, which is equivalent to an array
|
||||
containing one string.
|
||||
|
||||
``condition``
|
||||
|
||||
An optional `Condition`_ object. This is allowed in preset files specifying
|
||||
version ``3`` or above.
|
||||
|
||||
``vendor``
|
||||
|
||||
An optional map containing vendor-specific information. CMake does not
|
||||
@@ -782,6 +804,87 @@ that may contain the following fields:
|
||||
|
||||
Equivalent to passing ``--no-tests=ignore`` on the command line.
|
||||
|
||||
Condition
|
||||
^^^^^^^^^
|
||||
|
||||
The ``condition`` field of a preset, allowed in preset files specifying version
|
||||
``3`` or above, is used to determine whether or not the preset is enabled. For
|
||||
example, this can be used to disable a preset on platforms other than Windows.
|
||||
``condition`` may be either a boolean, ``null``, or an object. If it is a
|
||||
boolean, the boolean indicates whether the preset is enabled or disabled. If it
|
||||
is ``null``, the preset is enabled, but the ``null`` condition is not inherited
|
||||
by any presets that may inherit from the preset. Sub-conditions (for example in
|
||||
a ``not``, ``anyOf``, or ``allOf`` condition) may not be ``null``. If it is an
|
||||
object, it has the following fields:
|
||||
|
||||
``type``
|
||||
|
||||
A required string with one of the following values:
|
||||
|
||||
``"const"``
|
||||
|
||||
Indicates that the condition is constant. This is equivalent to using a
|
||||
boolean in place of the object. The condition object will have the
|
||||
following additional fields:
|
||||
|
||||
``value``
|
||||
|
||||
A required boolean which provides a constant value for the condition's
|
||||
evaluation.
|
||||
|
||||
``"equals"``
|
||||
|
||||
``"notEquals"``
|
||||
|
||||
Indicates that the condition compares two strings to see if they are equal
|
||||
(or not equal). The condition object will have the following additional
|
||||
fields:
|
||||
|
||||
``lhs``
|
||||
|
||||
First string to compare. This field supports macro expansion.
|
||||
|
||||
``rhs``
|
||||
|
||||
Second string to compare. This field supports macro expansion.
|
||||
|
||||
``"inList"``
|
||||
|
||||
``"notInList"``
|
||||
|
||||
Indicates that the condition searches for a string in a list of strings.
|
||||
The condition object will have the following additional fields:
|
||||
|
||||
``string``
|
||||
|
||||
A required string to search for. This field supports macro expansion.
|
||||
|
||||
``list``
|
||||
|
||||
A required list of strings to search. This field supports macro
|
||||
expansion, and uses short-circuit evaluation.
|
||||
|
||||
``"anyOf"``
|
||||
|
||||
``"allOf"``
|
||||
|
||||
Indicates that the condition is an aggregation of zero or more nested
|
||||
conditions. The condition object will have the following additional fields:
|
||||
|
||||
``conditions``
|
||||
|
||||
A required array of condition objects. These conditions use short-circuit
|
||||
evaluation.
|
||||
|
||||
``"not"``
|
||||
|
||||
Indicates that the condition is an inversion of another condition. The
|
||||
condition object will have the following additional fields:
|
||||
|
||||
``condition``
|
||||
|
||||
A required condition object.
|
||||
|
||||
Macro Expansion
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -823,6 +926,12 @@ Recognized macros include:
|
||||
test presets, this will evaluate to the generator specified by
|
||||
``configurePreset``.
|
||||
|
||||
``${hostSystemName}``
|
||||
|
||||
The name of the host operating system. Contains the same value as
|
||||
:variable:`CMAKE_HOST_SYSTEM_NAME`. This is allowed in preset files
|
||||
specifying version ``3`` or above.
|
||||
|
||||
``${dollar}``
|
||||
|
||||
A literal dollar sign (``$``).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": 2,
|
||||
"version": 3,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 20,
|
||||
@@ -35,6 +35,17 @@
|
||||
"displayName": "Ninja Multi-Config",
|
||||
"description": "Default build using Ninja Multi-Config generator",
|
||||
"generator": "Ninja Multi-Config"
|
||||
},
|
||||
{
|
||||
"name": "windows-only",
|
||||
"inherits": "default",
|
||||
"displayName": "Windows-only configuration",
|
||||
"description": "This build is only available on Windows",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
|
||||
"vendor": { "$ref": "#/definitions/vendor" },
|
||||
"configurePresets": { "$ref": "#/definitions/configurePresets"}
|
||||
"configurePresets": { "$ref": "#/definitions/configurePresetsV1"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
@@ -23,9 +23,23 @@
|
||||
},
|
||||
"cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
|
||||
"vendor": { "$ref": "#/definitions/vendor" },
|
||||
"configurePresets": { "$ref": "#/definitions/configurePresets"},
|
||||
"buildPresets": { "$ref": "#/definitions/buildPresets"},
|
||||
"testPresets": { "$ref": "#/definitions/testPresets"}
|
||||
"configurePresets": { "$ref": "#/definitions/configurePresetsV1"},
|
||||
"buildPresets": { "$ref": "#/definitions/buildPresetsV2"},
|
||||
"testPresets": { "$ref": "#/definitions/testPresetsV2"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"version": {
|
||||
"const": 3,
|
||||
"description": "A required integer representing the version of the JSON schema."
|
||||
},
|
||||
"cmakeMinimumRequired": { "$ref": "#/definitions/cmakeMinimumRequired"},
|
||||
"vendor": { "$ref": "#/definitions/vendor" },
|
||||
"configurePresets": { "$ref": "#/definitions/configurePresetsV3"},
|
||||
"buildPresets": { "$ref": "#/definitions/buildPresetsV3"},
|
||||
"testPresets": { "$ref": "#/definitions/testPresetsV3"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -58,7 +72,22 @@
|
||||
"description": "An optional map containing vendor-specific information. CMake does not interpret the contents of this field except to verify that it is a map if it does exist. However, the keys should be a vendor-specific domain name followed by a /-separated path. For example, the Example IDE 1.0 could use example.com/ExampleIDE/1.0. The value of each field can be anything desired by the vendor, though will typically be a map.",
|
||||
"properties": {}
|
||||
},
|
||||
"configurePresets": {
|
||||
"configurePresetsItemsV3": {
|
||||
"type": "array",
|
||||
"description": "A configure preset object.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"description": "A configure preset object.",
|
||||
"properties": {
|
||||
"installDir": {
|
||||
"type": "string",
|
||||
"description": "An optional string representing the path to the output binary directory. This field supports macro expansion. If a relative path is specified, it is calculated relative to the source directory. If binaryDir is not specified, it must be inherited from the inherits preset (unless this preset is hidden)."
|
||||
},
|
||||
"condition": { "$ref": "#/definitions/topCondition" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"configurePresetsItemsV1": {
|
||||
"type": "array",
|
||||
"description": "An optional array of configure preset objects.",
|
||||
"items": {
|
||||
@@ -302,6 +331,36 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"configurePresetsV3": {
|
||||
"type": "array",
|
||||
"description": "An optional array of configure preset objects.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/configurePresetsItemsV1" },
|
||||
{ "$ref": "#/definitions/configurePresetsItemsV3" }
|
||||
],
|
||||
"items": {
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"generator": {},
|
||||
"architecture": {},
|
||||
"toolset": {},
|
||||
"binaryDir": {},
|
||||
"installDir": {},
|
||||
"cmakeExecutable": {},
|
||||
"cacheVariables": {},
|
||||
"environment": {},
|
||||
"warnings": {},
|
||||
"errors": {},
|
||||
"debug": {},
|
||||
"condition": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
@@ -309,7 +368,48 @@
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"buildPresets": {
|
||||
"configurePresetsV1": {
|
||||
"type": "array",
|
||||
"description": "An optional array of configure preset objects.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/configurePresetsItemsV1" }
|
||||
],
|
||||
"items": {
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"generator": {},
|
||||
"architecture": {},
|
||||
"toolset": {},
|
||||
"binaryDir": {},
|
||||
"cmakeExecutable": {},
|
||||
"cacheVariables": {},
|
||||
"environment": {},
|
||||
"warnings": {},
|
||||
"errors": {},
|
||||
"debug": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"buildPresetsItemsV3": {
|
||||
"type": "array",
|
||||
"description": "An optional array of build preset objects. Used to specify arguments to cmake --build. Available in version 2 and higher.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"condition": { "$ref": "#/definitions/topCondition" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"buildPresetsItemsV2": {
|
||||
"type": "array",
|
||||
"description": "An optional array of build preset objects. Used to specify arguments to cmake --build. Available in version 2 and higher.",
|
||||
"items": {
|
||||
@@ -425,13 +525,86 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
"buildPresetsV3": {
|
||||
"type": "array",
|
||||
"description": "An optional array of build preset objects. Used to specify arguments to cmake --build. Available in version 2 and higher.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/buildPresetsItemsV3" },
|
||||
{ "$ref": "#/definitions/buildPresetsItemsV2" }
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"configurePreset": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"inheritConfigureEnvironment": {},
|
||||
"environment": {},
|
||||
"jobs": {},
|
||||
"targets": {},
|
||||
"configuration": {},
|
||||
"cleanFirst": {},
|
||||
"verbose": {},
|
||||
"nativeToolOptions": {},
|
||||
"condition": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"testPresets": {
|
||||
"buildPresetsV2": {
|
||||
"type": "array",
|
||||
"description": "An optional array of build preset objects. Used to specify arguments to cmake --build. Available in version 2 and higher.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/buildPresetsItemsV2" }
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"configurePreset": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"inheritConfigureEnvironment": {},
|
||||
"environment": {},
|
||||
"jobs": {},
|
||||
"targets": {},
|
||||
"configuration": {},
|
||||
"cleanFirst": {},
|
||||
"verbose": {},
|
||||
"nativeToolOptions": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"testPresetsItemsV3": {
|
||||
"type": "array",
|
||||
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 2 and higher.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"condition": { "$ref": "#/definitions/topCondition" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"testPresetsItemsV2": {
|
||||
"type": "array",
|
||||
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 2 and higher.",
|
||||
"items": {
|
||||
@@ -741,11 +914,266 @@
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
"testPresetsV3": {
|
||||
"type": "array",
|
||||
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 2 and higher.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/testPresetsItemsV2" },
|
||||
{ "$ref": "#/definitions/testPresetsItemsV3" }
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"configurePreset": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"inheritConfigureEnvironment": {},
|
||||
"environment": {},
|
||||
"configuration": {},
|
||||
"overwriteConfigurationFile": {},
|
||||
"output": {},
|
||||
"filter": {},
|
||||
"execution": {},
|
||||
"condition": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"testPresetsV2": {
|
||||
"type": "array",
|
||||
"description": "An optional array of test preset objects. Used to specify arguments to ctest. Available in version 2 and higher.",
|
||||
"allOf": [
|
||||
{ "$ref": "#/definitions/testPresetsItemsV2" }
|
||||
],
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {},
|
||||
"hidden": {},
|
||||
"inherits": {},
|
||||
"configurePreset": {},
|
||||
"vendor": {},
|
||||
"displayName": {},
|
||||
"description": {},
|
||||
"inheritConfigureEnvironment": {},
|
||||
"environment": {},
|
||||
"configuration": {},
|
||||
"overwriteConfigurationFile": {},
|
||||
"output": {},
|
||||
"filter": {},
|
||||
"execution": {}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"condition": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "A boolean which provides a constant value for the condition's evaluation."
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "const"
|
||||
},
|
||||
"value": {
|
||||
"type": "boolean",
|
||||
"description": "A required boolean which provides a constant value for the condition's evaluation."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"value"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "equals"
|
||||
},
|
||||
"lhs": {
|
||||
"type": "string",
|
||||
"description": "First string to compare. This field supports macro expansion."
|
||||
},
|
||||
"rhs": {
|
||||
"type": "string",
|
||||
"description": "Second string to compare. This field supports macro expansion."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"lhs",
|
||||
"rhs"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "notEquals"
|
||||
},
|
||||
"lhs": {
|
||||
"type": "string",
|
||||
"description": "First string to compare. This field supports macro expansion."
|
||||
},
|
||||
"rhs": {
|
||||
"type": "string",
|
||||
"description": "Second string to compare. This field supports macro expansion."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"lhs",
|
||||
"rhs"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "inList"
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": "A required string to search for. This field supports macro expansion."
|
||||
},
|
||||
"list": {
|
||||
"type": "array",
|
||||
"description": "A required list of strings to search. This field supports macro expansion, and uses short-circuit evaluation.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"string",
|
||||
"list"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "notInList"
|
||||
},
|
||||
"string": {
|
||||
"type": "string",
|
||||
"description": "A required string to search for. This field supports macro expansion."
|
||||
},
|
||||
"list": {
|
||||
"type": "array",
|
||||
"description": "A required list of strings to search. This field supports macro expansion, and uses short-circuit evaluation.",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"string",
|
||||
"list"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "anyOf"
|
||||
},
|
||||
"conditions": {
|
||||
"type": "array",
|
||||
"description": "A required array of condition objects. These conditions use short-circuit evaluation.",
|
||||
"items": { "$ref": "#/definitions/condition" }
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"conditions"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "allOf"
|
||||
},
|
||||
"conditions": {
|
||||
"type": "array",
|
||||
"description": "A required array of condition objects. These conditions use short-circuit evaluation.",
|
||||
"items": { "$ref": "#/definitions/condition" }
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"conditions"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "A required string specifying the type of the condition.",
|
||||
"const": "not"
|
||||
},
|
||||
"condition": { "$ref": "#/definitions/condition" }
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"condition"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"topCondition": {
|
||||
"anyOf": [
|
||||
{ "$ref": "#/definitions/condition" },
|
||||
{
|
||||
"type": "null",
|
||||
"description": "Null indicates that the condition always evaluates to true and is not inherited."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
Help/policy/CMP0121.rst
Normal file
21
Help/policy/CMP0121.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
CMP0121
|
||||
-------
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The :command:`list` command now detects invalid indicies.
|
||||
|
||||
Prior to CMake version 3.21, the :command:`list` command's ``GET``,
|
||||
``INSERT``, ``SUBLIST``, and ``REMOVE_AT`` subcommands did not detect invalid
|
||||
index arguments.
|
||||
|
||||
The ``OLD`` behavior of this policy is for invalid indicies to be treated as
|
||||
their integer value (if any) at the start of the string. For example,
|
||||
``2good4you`` is a ``2`` and ``not_an_integer`` is a ``0``. The ``NEW``
|
||||
behavior is for invalid indicies to trigger an error.
|
||||
|
||||
This policy was introduced in CMake version 3.21. CMake version |release|
|
||||
warns when the policy is not set and uses ``OLD`` behavior. Use the
|
||||
:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
@@ -24,6 +24,12 @@ The features known to this version of CMake are:
|
||||
``c_std_11``
|
||||
Compiler mode is at least C 11.
|
||||
|
||||
``c_std_17``
|
||||
Compiler mode is at least C 17.
|
||||
|
||||
``c_std_23``
|
||||
Compiler mode is at least C 23.
|
||||
|
||||
``c_function_prototypes``
|
||||
Function prototypes, as defined in ``ISO/IEC 9899:1990``.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ flag such as ``-std=gnu11`` to the compile line. For compilers that
|
||||
have no notion of a C standard level, such as Microsoft Visual C++ before
|
||||
VS 16.7, this property has no effect.
|
||||
|
||||
Supported values are ``90``, ``99`` and ``11``.
|
||||
Supported values are ``90``, ``99``, ``11``, ``17``, ``23``.
|
||||
|
||||
If the value requested does not result in a compile flag being added for
|
||||
the compiler in use, a previous standard flag will be added instead. This
|
||||
|
||||
7
Help/release/dev/0-sample-topic.rst
Normal file
7
Help/release/dev/0-sample-topic.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
0-sample-topic
|
||||
--------------
|
||||
|
||||
* This is a sample release note for the change in a topic.
|
||||
Developers should add similar notes for each topic branch
|
||||
making a noteworthy change. Each document should be named
|
||||
and titled to match the topic name to avoid merge conflicts.
|
||||
4
Help/release/dev/FindDevIL-imported-targets.rst
Normal file
4
Help/release/dev/FindDevIL-imported-targets.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
FindDevIL
|
||||
---------
|
||||
|
||||
* The :module:`FindDevIL` module now provides imported targets.
|
||||
4
Help/release/dev/FindIconv-version.rst
Normal file
4
Help/release/dev/FindIconv-version.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
FindIconv-version
|
||||
-----------------
|
||||
|
||||
* The :module:`FindIconv` module now has version support.
|
||||
4
Help/release/dev/FindIntl-version.rst
Normal file
4
Help/release/dev/FindIntl-version.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
FindIntl-version
|
||||
----------------
|
||||
|
||||
* The :module:`FindIntl` module now has version support.
|
||||
6
Help/release/dev/c-std.rst
Normal file
6
Help/release/dev/c-std.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
c-std
|
||||
-----
|
||||
|
||||
* :prop_tgt:`C_STANDARD` and the
|
||||
:manual:`Compile Features <cmake-compile-features(7)>` functionality gained
|
||||
support for C17 and C23.
|
||||
8
Help/release/dev/cmake-install-prefix-command.rst
Normal file
8
Help/release/dev/cmake-install-prefix-command.rst
Normal file
@@ -0,0 +1,8 @@
|
||||
cmake-install-prefix-command
|
||||
----------------------------
|
||||
|
||||
* The :manual:`cmake(1)` command gained the ``--install-prefix <dir>``
|
||||
command line option to specify the location of the install prefix.
|
||||
|
||||
* :manual:`cmake-presets(7)` configure preset gained support for specifying
|
||||
the install prefix.
|
||||
4
Help/release/dev/cmake-presets-condition.rst
Normal file
4
Help/release/dev/cmake-presets-condition.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
cmake-presets-condition
|
||||
-----------------------
|
||||
|
||||
* :manual:`cmake-presets(7)` now support conditional enabling of presets.
|
||||
5
Help/release/dev/cmake-presets-host-system-name.rst
Normal file
5
Help/release/dev/cmake-presets-host-system-name.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
cmake-presets-host-system-name
|
||||
------------------------------
|
||||
|
||||
* :manual:`cmake-presets(7)` gained support for a new ``${hostSystemName}``
|
||||
macro.
|
||||
10
Help/release/dev/cmake-system-name-version.rst
Normal file
10
Help/release/dev/cmake-system-name-version.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake-system-name-version
|
||||
-------------------------
|
||||
|
||||
* :variable:`CMAKE_HOST_SYSTEM_NAME`'s undocumented version-stripping behavior
|
||||
has been moved earlier, before :command:`project` or
|
||||
:command:`enable_language` is called.
|
||||
* :variable:`CMAKE_SYSTEM_NAME`'s undocumented version-stripping behavior has
|
||||
been removed entirely. If it is set by a ``-D`` flag or by a
|
||||
:manual:`toolchain file <cmake-toolchains(7)>`, it is left unaltered, even if
|
||||
it still contains a version number.
|
||||
5
Help/release/dev/cpack-dmg-filesystem.rst
Normal file
5
Help/release/dev/cpack-dmg-filesystem.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
cpack-dmg-filesystem
|
||||
--------------------
|
||||
|
||||
* The :cpack_gen:`CPack DragNDrop Generator` gained option
|
||||
:variable:`CPACK_DMG_FILESYSTEM` to control the ``.dmg`` filesystem.
|
||||
6
Help/release/dev/cpack-nsis-executable-name.rst
Normal file
6
Help/release/dev/cpack-nsis-executable-name.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
cpack-nsis-executable-name
|
||||
--------------------------
|
||||
|
||||
* The :cpack_gen:`CPack NSIS Generator` gained a new variable
|
||||
:variable:`CPACK_NSIS_EXECUTABLE` to specify the makensis
|
||||
executable to use instead of the default one.
|
||||
4
Help/release/dev/cxx-module-extensions.rst
Normal file
4
Help/release/dev/cxx-module-extensions.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
cxx-module-extensions
|
||||
---------------------
|
||||
|
||||
* Source file extensions ``.ixx`` and ``.cppm`` are now treated as C++.
|
||||
4
Help/release/dev/file-COPY_FILE.rst
Normal file
4
Help/release/dev/file-COPY_FILE.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
file-COPY_ONLY
|
||||
--------------
|
||||
|
||||
* The :command:`file(COPY_FILE)` command was added to copy a file to another.
|
||||
6
Help/release/dev/file-RENAME.rst
Normal file
6
Help/release/dev/file-RENAME.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
file-RENAME
|
||||
-----------
|
||||
|
||||
* The :command:`file(RENAME)` command learned to optionally capture
|
||||
failure in a result variable. It also gained a ``NO_REPLACE``
|
||||
option to fail if the destination exists.
|
||||
10
Help/release/dev/fileapi-codemodel-directory.rst
Normal file
10
Help/release/dev/fileapi-codemodel-directory.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
fileapi-codemodel-directory
|
||||
---------------------------
|
||||
|
||||
* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
|
||||
component been updated to 2.3.
|
||||
|
||||
* The :manual:`cmake-file-api(7)` "codemodel" version 2 gained a
|
||||
new "directory" object containing directory-level information.
|
||||
This includes a list of installers generated by the :command:`install`
|
||||
command.
|
||||
7
Help/release/dev/list-index-arg-parsing.rst
Normal file
7
Help/release/dev/list-index-arg-parsing.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
list-index-arg-parsing
|
||||
----------------------
|
||||
|
||||
* The :command:`list` command's ``GET``, ``INSERT``, ``SUBLIST``, and
|
||||
``REMOVE_AT`` subcommands now error with invalid (i.e., non-integer) values
|
||||
are given as any of their index arguments based on the setting of policy
|
||||
:policy:`CMP0121`.
|
||||
4
Help/release/dev/runtime-dll-deps.rst
Normal file
4
Help/release/dev/runtime-dll-deps.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
runtime-dll-deps
|
||||
----------------
|
||||
|
||||
* A new :genex:`TARGET_RUNTIME_DLLS` generator expression was added.
|
||||
@@ -7,6 +7,8 @@ CMake Release Notes
|
||||
This file should include the adjacent "dev.txt" file
|
||||
in development versions but not in release versions.
|
||||
|
||||
.. include:: dev.txt
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
|
||||
@@ -63,3 +63,27 @@ Supported pairs are:
|
||||
Specify an alternative ``VCTargetsPath`` value for Visual Studio
|
||||
project files. This allows use of VS platform extension configuration
|
||||
files (``.props`` and ``.targets``) that are not installed with VS.
|
||||
|
||||
Visual Studio Toolset Customization
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
**These are unstable interfaces with no compatibility guarantees**
|
||||
because they hook into undocumented internal CMake implementation details.
|
||||
Institutions may use these to internally maintain support for non-public
|
||||
Visual Studio platforms and toolsets, but must accept responsibility to
|
||||
make updates as changes are made to CMake.
|
||||
|
||||
Additional ``key=value`` pairs are available:
|
||||
|
||||
``customFlagTableDir=<path>``
|
||||
.. versionadded:: 3.21
|
||||
|
||||
Specify the absolute path to a directory from which to load custom
|
||||
flag tables stored as JSON documents with file names of the form
|
||||
``<platform>_<toolset>_<tool>.json`` or ``<platform>_<tool>.json``,
|
||||
where ``<platform>`` is the :variable:`CMAKE_VS_PLATFORM_NAME`,
|
||||
``<toolset>`` is the :variable:`CMAKE_VS_PLATFORM_TOOLSET`,
|
||||
and ``<tool>`` is the tool for which the flag table is meant.
|
||||
**This naming pattern is an internal CMake implementation detail.**
|
||||
The ``<tool>`` names are undocumented. The format of the ``.json``
|
||||
flag table files is undocumented.
|
||||
|
||||
@@ -15,3 +15,6 @@ This is initialized for each language from environment variables:
|
||||
Initialized by the :envvar:`CUDAFLAGS` environment variable.
|
||||
* ``CMAKE_Fortran_FLAGS``:
|
||||
Initialized by the :envvar:`FFLAGS` environment variable.
|
||||
|
||||
This value is a command-line string fragment. Therefore, multiple options
|
||||
should be separated by spaces, and options with spaces should be quoted.
|
||||
|
||||
@@ -12,6 +12,8 @@ the contents of a ``xxxFLAGS`` environment variable will be prepended,
|
||||
where ``xxx`` will be language-specific but not necessarily the same as
|
||||
``<LANG>`` (e.g. :envvar:`CXXFLAGS` for ``CXX``, :envvar:`FFLAGS` for
|
||||
``Fortran``, and so on).
|
||||
This value is a command-line string fragment. Therefore, multiple options
|
||||
should be separated by spaces, and options with spaces should be quoted.
|
||||
|
||||
See also the configuration-specific
|
||||
:variable:`CMAKE_<LANG>_FLAGS_<CONFIG>_INIT` variable.
|
||||
|
||||
@@ -9,10 +9,9 @@ The :ref:`Visual Studio Generators` for VS 2010 and above support using
|
||||
a standalone (non-installed) NVIDIA CUDA toolkit. The path
|
||||
may be specified by a field in :variable:`CMAKE_GENERATOR_TOOLSET` of
|
||||
the form ``cuda=C:\path\to\cuda``. The given directory must at least
|
||||
contain a folder ``.\nvcc`` and must provide Visual Studio integration
|
||||
files in path ``.\CUDAVisualStudioIntegration\extras\
|
||||
visual_studio_integration\MSBuildExtensions\``. One can create a standalone
|
||||
CUDA toolkit directory by either opening a installer with 7zip or
|
||||
copying the files that are extracted by the running installer.
|
||||
The value may be empty if no path to a standalone CUDA Toolkit was
|
||||
specified.
|
||||
contain the nvcc compiler in path ``.\bin`` and must provide Visual Studio
|
||||
integration files in path ``.\extras\visual_studio_integration\
|
||||
MSBuildExtensions\``. One can create a standalone CUDA toolkit directory by
|
||||
either opening a installer with 7zip or copying the files that are extracted
|
||||
by the running installer. The value may be empty if no path to a standalone
|
||||
CUDA Toolkit was specified.
|
||||
|
||||
@@ -38,6 +38,15 @@ if(NOT CMAKE_ASM_NASM_COMPILE_OBJECT)
|
||||
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
||||
endif()
|
||||
|
||||
set(CMAKE_DEPFILE_FLAGS_ASM_NASM "-MD <DEP_FILE> -MT <DEP_TARGET>")
|
||||
|
||||
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
|
||||
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
|
||||
# dependencies are computed by the compiler itself
|
||||
set(CMAKE_ASM_NASM_DEPFILE_FORMAT gcc)
|
||||
set(CMAKE_ASM_NASM_DEPENDS_USE_COMPILER TRUE)
|
||||
endif()
|
||||
|
||||
# Load the generic ASMInformation file:
|
||||
set(ASM_DIALECT "_NASM")
|
||||
include(CMakeASMInformation)
|
||||
|
||||
@@ -9,6 +9,8 @@ set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
|
||||
set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")
|
||||
set(CMAKE_C99_COMPILE_FEATURES "@CMAKE_C99_COMPILE_FEATURES@")
|
||||
set(CMAKE_C11_COMPILE_FEATURES "@CMAKE_C11_COMPILE_FEATURES@")
|
||||
set(CMAKE_C17_COMPILE_FEATURES "@CMAKE_C17_COMPILE_FEATURES@")
|
||||
set(CMAKE_C23_COMPILE_FEATURES "@CMAKE_C23_COMPILE_FEATURES@")
|
||||
|
||||
set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
|
||||
set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
|
||||
|
||||
@@ -33,13 +33,16 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
|
||||
@CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
|
||||
|
||||
#if !defined(__STDC__)
|
||||
# if (defined(_MSC_VER) && !defined(__clang__)) \
|
||||
|| (defined(__ibmxl__) || defined(__IBMC__))
|
||||
#if !defined(__STDC__) && !defined(__clang__)
|
||||
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
|
||||
# define C_DIALECT "90"
|
||||
# else
|
||||
# define C_DIALECT
|
||||
# endif
|
||||
#elif __STDC_VERSION__ > 201710L
|
||||
# define C_DIALECT "23"
|
||||
#elif __STDC_VERSION__ >= 201710L
|
||||
# define C_DIALECT "17"
|
||||
#elif __STDC_VERSION__ >= 201000L
|
||||
# define C_DIALECT "11"
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
|
||||
@@ -9,15 +9,15 @@ endif()
|
||||
set(CMAKE_INCLUDE_FLAG_CUDA "-I")
|
||||
|
||||
# Set implicit links early so compiler-specific modules can use them.
|
||||
set(__IMPLICT_LINKS )
|
||||
set(__IMPLICIT_LINKS)
|
||||
foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
string(APPEND __IMPLICT_LINKS " -L\"${dir}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
|
||||
endforeach()
|
||||
foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
|
||||
if(${lib} MATCHES "/")
|
||||
string(APPEND __IMPLICT_LINKS " \"${lib}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
|
||||
else()
|
||||
string(APPEND __IMPLICT_LINKS " -l${lib}")
|
||||
string(APPEND __IMPLICIT_LINKS " -l${lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -117,7 +117,7 @@ endif()
|
||||
# create a shared library
|
||||
if(NOT CMAKE_CUDA_CREATE_SHARED_LIBRARY)
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
endif()
|
||||
|
||||
# create a shared module copy the shared library rule by default
|
||||
@@ -157,32 +157,32 @@ endif()
|
||||
# compile a cu file into an executable
|
||||
if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
|
||||
set(CMAKE_CUDA_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
endif()
|
||||
|
||||
# Add implicit host link directories that contain device libraries
|
||||
# to the device link line.
|
||||
set(__IMPLICT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
|
||||
if(__IMPLICT_DLINK_DIRS)
|
||||
list(REMOVE_ITEM __IMPLICT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
set(__IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
|
||||
if(__IMPLICIT_DLINK_DIRS)
|
||||
list(REMOVE_ITEM __IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
endif()
|
||||
set(__IMPLICT_DLINK_FLAGS )
|
||||
foreach(dir ${__IMPLICT_DLINK_DIRS})
|
||||
set(__IMPLICIT_DLINK_FLAGS)
|
||||
foreach(dir ${__IMPLICIT_DLINK_DIRS})
|
||||
if(EXISTS "${dir}/libcurand_static.a")
|
||||
string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"")
|
||||
string(APPEND __IMPLICIT_DLINK_FLAGS " -L\"${dir}\"")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(__IMPLICT_DLINK_DIRS)
|
||||
unset(__IMPLICIT_DLINK_DIRS)
|
||||
|
||||
|
||||
#These are used when linking relocatable (dc) cuda code
|
||||
if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
|
||||
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
|
||||
endif()
|
||||
if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
|
||||
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_DLINK_FLAGS}")
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Used when device linking is handled by CMake.
|
||||
@@ -190,6 +190,6 @@ if(NOT CMAKE_CUDA_DEVICE_LINK_COMPILE)
|
||||
set(CMAKE_CUDA_DEVICE_LINK_COMPILE "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <FLAGS> -D__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ -D__NV_EXTRA_INITIALIZATION=\"\" -D__NV_EXTRA_FINALIZATION=\"\" -DREGISTERLINKBINARYFILE=\\\"<REGISTER_FILE>\\\" -DFATBINFILE=\\\"<FATBINARY>\\\" ${_CMAKE_COMPILE_AS_CUDA_FLAG} -c \"${CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT}/bin/crt/link.stub\" -o <OBJECT>")
|
||||
endif()
|
||||
|
||||
unset(__IMPLICT_DLINK_FLAGS)
|
||||
unset(__IMPLICIT_DLINK_FLAGS)
|
||||
|
||||
set(CMAKE_CUDA_INFORMATION_LOADED 1)
|
||||
|
||||
@@ -44,7 +44,7 @@ if(CMAKE_COMPILER_IS_MINGW)
|
||||
set(MINGW 1)
|
||||
endif()
|
||||
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm)
|
||||
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
|
||||
foreach (lang C OBJC OBJCXX)
|
||||
|
||||
@@ -31,7 +31,9 @@ else()
|
||||
set(CMAKE_CUDA_COMPILER_LIST nvcc)
|
||||
endif()
|
||||
|
||||
set(_CMAKE_CUDA_COMPILER_PATHS "$ENV{CUDA_PATH}/bin")
|
||||
_cmake_find_compiler(CUDA)
|
||||
unset(_CMAKE_CUDA_COMPILER_PATHS)
|
||||
else()
|
||||
_cmake_find_compiler_path(CUDA)
|
||||
endif()
|
||||
|
||||
@@ -10,6 +10,8 @@ function(cmake_determine_compile_features lang)
|
||||
set(CMAKE_C90_COMPILE_FEATURES)
|
||||
set(CMAKE_C99_COMPILE_FEATURES)
|
||||
set(CMAKE_C11_COMPILE_FEATURES)
|
||||
set(CMAKE_C17_COMPILE_FEATURES)
|
||||
set(CMAKE_C23_COMPILE_FEATURES)
|
||||
|
||||
include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
|
||||
|
||||
@@ -20,6 +22,12 @@ function(cmake_determine_compile_features lang)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (CMAKE_C17_COMPILE_FEATURES AND CMAKE_C23_COMPILE_FEATURES)
|
||||
list(REMOVE_ITEM CMAKE_C23_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES})
|
||||
endif()
|
||||
if (CMAKE_C11_COMPILE_FEATURES AND CMAKE_C17_COMPILE_FEATURES)
|
||||
list(REMOVE_ITEM CMAKE_C17_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES})
|
||||
endif()
|
||||
if (CMAKE_C99_COMPILE_FEATURES AND CMAKE_C11_COMPILE_FEATURES)
|
||||
list(REMOVE_ITEM CMAKE_C11_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES})
|
||||
endif()
|
||||
@@ -32,6 +40,8 @@ function(cmake_determine_compile_features lang)
|
||||
${CMAKE_C90_COMPILE_FEATURES}
|
||||
${CMAKE_C99_COMPILE_FEATURES}
|
||||
${CMAKE_C11_COMPILE_FEATURES}
|
||||
${CMAKE_C17_COMPILE_FEATURES}
|
||||
${CMAKE_C23_COMPILE_FEATURES}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -39,6 +49,8 @@ function(cmake_determine_compile_features lang)
|
||||
set(CMAKE_C90_COMPILE_FEATURES ${CMAKE_C90_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
set(CMAKE_C99_COMPILE_FEATURES ${CMAKE_C99_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
set(CMAKE_C11_COMPILE_FEATURES ${CMAKE_C11_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
set(CMAKE_C17_COMPILE_FEATURES ${CMAKE_C17_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
set(CMAKE_C23_COMPILE_FEATURES ${CMAKE_C23_COMPILE_FEATURES} PARENT_SCOPE)
|
||||
|
||||
message(CHECK_PASS "done")
|
||||
|
||||
|
||||
@@ -68,6 +68,16 @@ macro(_cmake_find_compiler lang)
|
||||
)
|
||||
endif()
|
||||
find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler")
|
||||
if(_CMAKE_${lang}_COMPILER_PATHS)
|
||||
# As a last fall-back, search in language-specific paths
|
||||
find_program(CMAKE_${lang}_COMPILER
|
||||
NAMES ${CMAKE_${lang}_COMPILER_LIST}
|
||||
NAMES_PER_DIR
|
||||
PATHS ${_CMAKE_${lang}_COMPILER_PATHS}
|
||||
DOC "${lang} compiler"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
endif()
|
||||
if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER)
|
||||
set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${CMAKE_${lang}_COMPILER_INIT}")
|
||||
endif()
|
||||
|
||||
@@ -452,9 +452,19 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
|
||||
set(id_ItemDefinitionGroup_entry "<CudaCompile>${cuda_target}<AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions><CodeGeneration>${cuda_codegen}</CodeGeneration></CudaCompile>")
|
||||
set(id_PostBuildEvent_Command [[echo CMAKE_CUDA_COMPILER=$(CudaToolkitBinDir)\nvcc.exe]])
|
||||
if(CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR)
|
||||
set(id_CudaToolkitCustomDir "<CudaToolkitCustomDir>${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc</CudaToolkitCustomDir>")
|
||||
string(CONCAT id_Import_props "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}\\CUDAVisualStudioIntegration\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.props\" />")
|
||||
string(CONCAT id_Import_targets "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}\\CUDAVisualStudioIntegration\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.targets\" />")
|
||||
# check for legacy cuda custom toolkit folder structure
|
||||
if(EXISTS ${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc)
|
||||
set(id_CudaToolkitCustomDir "<CudaToolkitCustomDir>${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}nvcc</CudaToolkitCustomDir>")
|
||||
else()
|
||||
set(id_CudaToolkitCustomDir "<CudaToolkitCustomDir>${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}</CudaToolkitCustomDir>")
|
||||
endif()
|
||||
if(EXISTS ${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}CUDAVisualStudioIntegration)
|
||||
string(CONCAT id_Import_props "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}CUDAVisualStudioIntegration\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.props\" />")
|
||||
string(CONCAT id_Import_targets "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}CUDAVisualStudioIntegration\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.targets\" />")
|
||||
else()
|
||||
string(CONCAT id_Import_props "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.props\" />")
|
||||
string(CONCAT id_Import_targets "<Import Project=\"${CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR}\\extras\\visual_studio_integration\\MSBuildExtensions\\${cuda_tools}.targets\" />")
|
||||
endif()
|
||||
else()
|
||||
string(CONCAT id_Import_props [[<Import Project="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.props" />]])
|
||||
string(CONCAT id_Import_targets [[<Import Project="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.targets" />]])
|
||||
|
||||
@@ -158,37 +158,14 @@ endif()
|
||||
|
||||
include(Platform/${CMAKE_SYSTEM_NAME}-Determine OPTIONAL)
|
||||
|
||||
macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
||||
if(NOT ${_PREFIX}_NAME)
|
||||
set(${_PREFIX}_NAME "UnknownOS")
|
||||
endif()
|
||||
|
||||
# fix for BSD/OS , remove the /
|
||||
if(${_PREFIX}_NAME MATCHES BSD.OS)
|
||||
set(${_PREFIX}_NAME BSDOS)
|
||||
endif()
|
||||
|
||||
# fix for GNU/kFreeBSD, remove the GNU/
|
||||
if(${_PREFIX}_NAME MATCHES kFreeBSD)
|
||||
set(${_PREFIX}_NAME kFreeBSD)
|
||||
endif()
|
||||
|
||||
# fix for CYGWIN which has windows version in it
|
||||
if(${_PREFIX}_NAME MATCHES CYGWIN)
|
||||
set(${_PREFIX}_NAME CYGWIN)
|
||||
endif()
|
||||
|
||||
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
|
||||
set(${_PREFIX} ${${_PREFIX}_NAME})
|
||||
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
|
||||
if(${_PREFIX}_VERSION)
|
||||
set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
|
||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
|
||||
set(CMAKE_SYSTEM ${CMAKE_SYSTEM_NAME})
|
||||
if(CMAKE_SYSTEM_VERSION)
|
||||
string(APPEND CMAKE_SYSTEM -${CMAKE_SYSTEM_VERSION})
|
||||
endif()
|
||||
set(CMAKE_HOST_SYSTEM ${CMAKE_HOST_SYSTEM_NAME})
|
||||
if(CMAKE_HOST_SYSTEM_VERSION)
|
||||
string(APPEND CMAKE_HOST_SYSTEM -${CMAKE_HOST_SYSTEM_VERSION})
|
||||
endif()
|
||||
|
||||
# this file is also executed from cpack, then we don't need to generate these files
|
||||
# in this case there is no CMAKE_BINARY_DIR
|
||||
|
||||
@@ -101,7 +101,10 @@ function(cmake_print_properties)
|
||||
if(CPP_CACHE_ENTRIES)
|
||||
set(items ${CPP_CACHE_ENTRIES})
|
||||
set(mode ${mode} CACHE_ENTRIES)
|
||||
set(keyword CACHE)
|
||||
# This is a workaround for the fact that passing `CACHE` as an argument to
|
||||
# set() causes a cache variable to be set.
|
||||
set(keyword "")
|
||||
string(APPEND keyword CACHE)
|
||||
endif()
|
||||
|
||||
if(NOT mode)
|
||||
|
||||
@@ -64,6 +64,12 @@ endmacro()
|
||||
# Define to allow compile features to be automatically determined
|
||||
macro(cmake_record_c_compile_features)
|
||||
set(_result 0)
|
||||
if(_result EQUAL 0 AND DEFINED CMAKE_C23_STANDARD_COMPILE_OPTION)
|
||||
_has_compiler_features_c(23)
|
||||
endif()
|
||||
if(_result EQUAL 0 AND DEFINED CMAKE_C17_STANDARD_COMPILE_OPTION)
|
||||
_has_compiler_features_c(17)
|
||||
endif()
|
||||
if(_result EQUAL 0 AND DEFINED CMAKE_C11_STANDARD_COMPILE_OPTION)
|
||||
if(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT)
|
||||
_has_compiler_features_c(11)
|
||||
|
||||
@@ -25,37 +25,60 @@ elseif("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
|
||||
if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2.1)
|
||||
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
|
||||
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
|
||||
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
|
||||
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
|
||||
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
|
||||
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
|
||||
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
elseif(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0)
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c1x")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)
|
||||
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c2x")
|
||||
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu2x")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
|
||||
set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "/std:c11")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "/std:c11")
|
||||
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "/std:c17")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "/std:c17")
|
||||
else()
|
||||
# clang-cl doesn't have any of these
|
||||
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
|
||||
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
|
||||
set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
|
||||
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
|
||||
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
__compiler_check_default_language_standard(C 3.4 99 3.6 11)
|
||||
else()
|
||||
set(CMAKE_C_STANDARD_DEFAULT "")
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2.1)
|
||||
set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0)
|
||||
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(C 2.1 99 3.5.2 11 11.0 17)
|
||||
|
||||
@@ -22,8 +22,8 @@ set(_CMAKE_CUDA_PTX_FLAG "--cuda-device-only -S")
|
||||
set(_CMAKE_CUDA_DEVICE_CODE "-fgpu-rdc -c")
|
||||
|
||||
# RulePlaceholderExpander expands crosscompile variables like sysroot and target only for CMAKE_<LANG>_COMPILER. Override the default.
|
||||
set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
|
||||
set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC")
|
||||
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
|
||||
|
||||
@@ -36,4 +36,14 @@ elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(C 3.4 90 5.0 11)
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1)
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 9.1)
|
||||
set(CMAKE_C23_STANDARD_COMPILE_OPTION "-std=c23")
|
||||
set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-std=gnu23")
|
||||
endif()
|
||||
|
||||
__compiler_check_default_language_standard(C 3.4 90 5.0 11 8.1 17)
|
||||
|
||||
@@ -37,6 +37,9 @@ if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
|
||||
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
|
||||
else()
|
||||
# clang-cl doesn't have any of these
|
||||
set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
|
||||
@@ -47,12 +50,13 @@ else()
|
||||
|
||||
set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
|
||||
|
||||
set(CMAKE_C17_STANDARD_COMPILE_OPTION "")
|
||||
set(CMAKE_C17_EXTENSION_COMPILE_OPTION "")
|
||||
endif()
|
||||
|
||||
if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
|
||||
# FIXME: The compiler actually defaults to C17, but
|
||||
# CMake does not yet model or detect that standard.
|
||||
__compiler_check_default_language_standard(C 2020 11)
|
||||
__compiler_check_default_language_standard(C 2020 17)
|
||||
else()
|
||||
set(CMAKE_C_STANDARD_DEFAULT "")
|
||||
endif()
|
||||
|
||||
@@ -941,10 +941,11 @@ function(_ExternalData_link_or_copy src dst)
|
||||
file(RELATIVE_PATH tgt "${dst_dir}" "${src}")
|
||||
endif()
|
||||
endif()
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${tgt}" "${tmp}" RESULT_VARIABLE result)
|
||||
# Create link (falling back to copying if there's a problem).
|
||||
file(CREATE_LINK "${tgt}" "${tmp}" RESULT result COPY_ON_ERROR SYMBOLIC)
|
||||
else()
|
||||
# Create a copy.
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${src}" "${tmp}" RESULT_VARIABLE result)
|
||||
file(COPY_FILE "${src}" "${tmp}" RESULT result)
|
||||
endif()
|
||||
if(result)
|
||||
file(REMOVE "${tmp}")
|
||||
@@ -1101,7 +1102,14 @@ function(_ExternalData_download_object name hash algo var_obj var_success var_er
|
||||
|
||||
set(success 1)
|
||||
if(found)
|
||||
file(RENAME "${tmp}" "${obj}")
|
||||
# Atomically create the object. If we lose a race with another process,
|
||||
# do not replace it. Content-addressing ensures it has what we expect.
|
||||
file(RENAME "${tmp}" "${obj}" NO_REPLACE RESULT result)
|
||||
if (result STREQUAL "NO_REPLACE")
|
||||
file(REMOVE "${tmp}")
|
||||
elseif (result)
|
||||
message(FATAL_ERROR "Failed to rename:\n \"${tmp}\"\nto:\n \"${obj}\"\nwith error:\n ${result}")
|
||||
endif()
|
||||
message(STATUS "Downloaded object: \"${obj}\"")
|
||||
elseif(EXISTS "${staged}")
|
||||
set(obj "${staged}")
|
||||
|
||||
@@ -34,7 +34,7 @@ The following shows a typical example of declaring content details:
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.8.0
|
||||
GIT_TAG 703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
|
||||
)
|
||||
|
||||
For most typical cases, populating the content can then be done with a single
|
||||
@@ -126,13 +126,13 @@ Declaring Content Details
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.8.0
|
||||
GIT_TAG 703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
myCompanyIcons
|
||||
URL https://intranet.mycompany.com/assets/iconset_1.12.tar.gz
|
||||
URL_HASH 5588a7b18261c20068beabfb4f530b87
|
||||
URL_HASH MD5=5588a7b18261c20068beabfb4f530b87
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
@@ -141,6 +141,11 @@ Declaring Content Details
|
||||
SVN_REVISION -r12345
|
||||
)
|
||||
|
||||
Where contents are being fetched from a remote location and you do not
|
||||
control that server, it is advisable to use a hash for ``GIT_TAG`` rather
|
||||
than a branch or tag name. A commit hash is more secure and helps to
|
||||
confirm that the downloaded contents are what you expected.
|
||||
|
||||
Populating The Content
|
||||
""""""""""""""""""""""
|
||||
|
||||
@@ -456,12 +461,12 @@ frameworks are available to the main build:
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG release-1.8.0
|
||||
GIT_TAG 703bd9caab50b139428cea1aaff9974ebee5742e # release-1.10.0
|
||||
)
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.5.0
|
||||
GIT_TAG de6fe184a9ac1a06895cdd1c9b437f0a0bdf14ad # v2.13.4
|
||||
)
|
||||
|
||||
# After the following call, the CMake targets defined by googletest and
|
||||
@@ -480,7 +485,7 @@ it into the main build:
|
||||
FetchContent_Declare(
|
||||
protobuf
|
||||
GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git
|
||||
GIT_TAG v3.12.0
|
||||
GIT_TAG ae50d9b9902526efd6c7a1907d09739f959c6297 # v3.15.0
|
||||
SOURCE_SUBDIR cmake
|
||||
)
|
||||
set(protobuf_BUILD_TESTS OFF)
|
||||
@@ -517,7 +522,7 @@ that all five projects are available on a company git server. The
|
||||
FetchContent_Declare(
|
||||
projE
|
||||
GIT_REPOSITORY git@mycompany.com:git/projE.git
|
||||
GIT_TAG origin/release/2.3-rc1
|
||||
GIT_TAG v2.3-rc1
|
||||
)
|
||||
|
||||
# Order is important, see notes in the discussion further below
|
||||
|
||||
@@ -189,7 +189,7 @@ This module defines the following :prop_tgt:`IMPORTED` targets:
|
||||
(adds ``-DBOOST_ALL_NO_LIB``).
|
||||
|
||||
``Boost::dynamic_linking``
|
||||
Interface target to enable dynamic linking linking with MSVC
|
||||
Interface target to enable dynamic linking with MSVC
|
||||
(adds ``-DBOOST_ALL_DYN_LINK``).
|
||||
|
||||
Implicit dependencies such as ``Boost::filesystem`` requiring
|
||||
|
||||
@@ -10,26 +10,57 @@ FindDevIL
|
||||
This module locates the developer's image library.
|
||||
http://openil.sourceforge.net/
|
||||
|
||||
IMPORTED Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
This module defines the :prop_tgt:`IMPORTED` targets:
|
||||
|
||||
``DevIL::IL``
|
||||
Defined if the system has DevIL.
|
||||
|
||||
``DevIL::ILU``
|
||||
Defined if the system has DevIL Utilities.
|
||||
|
||||
``DevIL::ILUT``
|
||||
Defined if the system has DevIL Utility Toolkit.
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module sets:
|
||||
|
||||
::
|
||||
``IL_LIBRARIES``
|
||||
The name of the IL library. These include the full path to
|
||||
the core DevIL library. This one has to be linked into the
|
||||
application.
|
||||
|
||||
IL_LIBRARIES - the name of the IL library. These include the full path to
|
||||
the core DevIL library. This one has to be linked into the
|
||||
application.
|
||||
ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
|
||||
library is for filters and effects, not actual loading. It
|
||||
doesn't have to be linked if the functionality it provides
|
||||
is not used.
|
||||
ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
|
||||
library interfaces with OpenGL. It is not strictly needed
|
||||
in applications.
|
||||
IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
|
||||
DevIL_FOUND - this is set to TRUE if all the above variables were set.
|
||||
This will be set to false if ILU or ILUT are not found,
|
||||
even if they are not needed. In most systems, if one
|
||||
library is found all the others are as well. That's the
|
||||
way the DevIL developers release it.
|
||||
``ILU_LIBRARIES``
|
||||
The name of the ILU library. Again, the full path. This
|
||||
library is for filters and effects, not actual loading. It
|
||||
doesn't have to be linked if the functionality it provides
|
||||
is not used.
|
||||
|
||||
``ILUT_LIBRARIES``
|
||||
The name of the ILUT library. Full path. This part of the
|
||||
library interfaces with OpenGL. It is not strictly needed
|
||||
in applications.
|
||||
|
||||
``IL_INCLUDE_DIR``
|
||||
where to find the il.h, ilu.h and ilut.h files.
|
||||
|
||||
``DevIL_FOUND``
|
||||
This is set to TRUE if all the above variables were set.
|
||||
This will be set to false if ILU or ILUT are not found,
|
||||
even if they are not needed. In most systems, if one
|
||||
library is found all the others are as well. That's the
|
||||
way the DevIL developers release it.
|
||||
|
||||
``DevIL_ILUT_FOUND``
|
||||
.. versionadded:: 3.21
|
||||
|
||||
This is set to TRUE if the ILUT library is found.
|
||||
#]=======================================================================]
|
||||
|
||||
# TODO: Add version support.
|
||||
@@ -73,3 +104,36 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(DevIL DEFAULT_MSG
|
||||
IL_INCLUDE_DIR)
|
||||
# provide legacy variable for compatibility
|
||||
set(IL_FOUND ${DevIL_FOUND})
|
||||
|
||||
# create imported targets ONLY if we found DevIL.
|
||||
if(DevIL_FOUND)
|
||||
# Report the ILUT found if ILUT_LIBRARIES contains valid path.
|
||||
if (ILUT_LIBRARIES)
|
||||
set(DevIL_ILUT_FOUND TRUE)
|
||||
else()
|
||||
set(DevIL_ILUT_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET DevIL::IL)
|
||||
add_library(DevIL::IL UNKNOWN IMPORTED)
|
||||
set_target_properties(DevIL::IL PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${IL_INCLUDE_DIR}"
|
||||
IMPORTED_LOCATION "${IL_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
# DevIL Utilities target
|
||||
if(NOT TARGET DevIL::ILU)
|
||||
add_library(DevIL::ILU UNKNOWN IMPORTED)
|
||||
set_target_properties(DevIL::ILU PROPERTIES
|
||||
IMPORTED_LOCATION "${ILU_LIBRARIES}")
|
||||
target_link_libraries(DevIL::ILU INTERFACE DevIL::IL)
|
||||
endif()
|
||||
|
||||
# ILUT (if found)
|
||||
if(NOT TARGET DevIL::ILUT AND DevIL_ILUT_FOUND)
|
||||
add_library(DevIL::ILUT UNKNOWN IMPORTED)
|
||||
set_target_properties(DevIL::ILUT PROPERTIES
|
||||
IMPORTED_LOCATION "${ILUT_LIBRARIES}")
|
||||
target_link_libraries(DevIL::ILUT INTERFACE DevIL::ILU)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -395,6 +395,7 @@ Deprecated Hint Variables
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0054 NEW) # quoted if arguments
|
||||
cmake_policy(SET CMP0057 NEW) # if IN_LIST
|
||||
|
||||
# For backwards compatibility support
|
||||
|
||||
@@ -25,6 +25,24 @@ The following variables are provided to indicate iconv support:
|
||||
|
||||
The iconv libraries to be linked.
|
||||
|
||||
.. variable:: Iconv_VERSION
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The version of iconv found (x.y)
|
||||
|
||||
.. variable:: Iconv_VERSION_MAJOR
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The major version of iconv
|
||||
|
||||
.. variable:: Iconv_VERSION_MINOR
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The minor version of iconv
|
||||
|
||||
.. variable:: Iconv_IS_BUILT_IN
|
||||
|
||||
A variable indicating whether iconv support is stemming from the
|
||||
@@ -51,6 +69,10 @@ The following cache variables may also be set:
|
||||
On POSIX platforms, iconv might be part of the C library and the cache
|
||||
variables ``Iconv_INCLUDE_DIR`` and ``Iconv_LIBRARY`` might be empty.
|
||||
|
||||
.. note::
|
||||
Some libiconv implementations don't embed the version number in their header files.
|
||||
In this case the variables ``Iconv_VERSION*`` will be empty.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
|
||||
@@ -118,9 +140,29 @@ find_library(Iconv_LIBRARY
|
||||
mark_as_advanced(Iconv_INCLUDE_DIR)
|
||||
mark_as_advanced(Iconv_LIBRARY)
|
||||
|
||||
# NOTE: glibc's iconv.h does not define _LIBICONV_VERSION
|
||||
if(Iconv_INCLUDE_DIR AND NOT Iconv_IS_BUILT_IN)
|
||||
file(STRINGS ${Iconv_INCLUDE_DIR}/iconv.h Iconv_VERSION_DEFINE REGEX "_LIBICONV_VERSION (.*)")
|
||||
|
||||
if(Iconv_VERSION_DEFINE MATCHES "(0x[A-Fa-f0-9]+)")
|
||||
set(Iconv_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||
# encoding -> version number: (major<<8) + minor
|
||||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_NUMBER} >> 8" OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_NUMBER} - (${Iconv_VERSION_MAJOR} << 8)" OUTPUT_FORMAT HEXADECIMAL)
|
||||
|
||||
math(EXPR Iconv_VERSION_MAJOR "${Iconv_VERSION_MAJOR}" OUTPUT_FORMAT DECIMAL)
|
||||
math(EXPR Iconv_VERSION_MINOR "${Iconv_VERSION_MINOR}" OUTPUT_FORMAT DECIMAL)
|
||||
set(Iconv_VERSION "${Iconv_VERSION_MAJOR}.${Iconv_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
unset(Iconv_VERSION_DEFINE)
|
||||
unset(Iconv_VERSION_NUMBER)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
if(NOT Iconv_IS_BUILT_IN)
|
||||
find_package_handle_standard_args(Iconv REQUIRED_VARS Iconv_LIBRARY Iconv_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Iconv REQUIRED_VARS Iconv_LIBRARY Iconv_INCLUDE_DIR
|
||||
VERSION_VAR Iconv_VERSION)
|
||||
else()
|
||||
find_package_handle_standard_args(Iconv REQUIRED_VARS Iconv_LIBRARY)
|
||||
endif()
|
||||
|
||||
@@ -10,27 +10,75 @@ FindIntl
|
||||
Find the Gettext libintl headers and libraries.
|
||||
|
||||
This module reports information about the Gettext libintl
|
||||
installation in several variables. General variables::
|
||||
installation in several variables.
|
||||
|
||||
Intl_FOUND - true if the libintl headers and libraries were found
|
||||
Intl_INCLUDE_DIRS - the directory containing the libintl headers
|
||||
Intl_LIBRARIES - libintl libraries to be linked
|
||||
.. variable:: Intl_FOUND
|
||||
|
||||
True if libintl is found.
|
||||
|
||||
.. variable:: Intl_INCLUDE_DIRS
|
||||
|
||||
The directory containing the libintl headers.
|
||||
|
||||
.. variable:: Intl_LIBRARIES
|
||||
|
||||
The intl libraries to be linked.
|
||||
|
||||
.. variable:: Intl_VERSION
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The version of intl found (x.y.z)
|
||||
|
||||
.. variable:: Intl_VERSION_MAJOR
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The major version of intl
|
||||
|
||||
.. variable:: Intl_VERSION_MINOR
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The minor version of intl
|
||||
|
||||
.. variable:: Intl_VERSION_PATCH
|
||||
|
||||
.. versionadded:: 3.21
|
||||
|
||||
The patch version of intl
|
||||
|
||||
.. versionadded:: 3.20
|
||||
This module defines :prop_tgt:`IMPORTED` target ``Intl::Intl``.
|
||||
|
||||
The following cache variables may also be set::
|
||||
The following cache variables may also be set:
|
||||
|
||||
Intl_INCLUDE_DIR - the directory containing the libintl headers
|
||||
Intl_LIBRARY - the libintl library (if any)
|
||||
Intl_HAVE_GETTEXT_BUILTIN - check if gettext is in the C library
|
||||
Intl_HAVE_DCGETTEXT_BUILTIN - check if dcgettext is in the C library
|
||||
Intl_IS_BUILTIN - whether intl is a part of the C library determined
|
||||
from the result of Intl_HAVE_GETTEXT_BUILTIN and Intl_HAVE_DCGETTEXT_BUILTIN
|
||||
.. variable:: Intl_INCLUDE_DIR
|
||||
|
||||
.. versionadded:: 3.20
|
||||
Added the ``Intl_HAVE_GETTEXT_BUILTIN``, ``Intl_HAVE_DCGETTEXT_BUILTIN`` and
|
||||
``Intl_IS_BUILTIN`` variables.
|
||||
The directory containing the libintl headers
|
||||
|
||||
.. variable:: Intl_LIBRARY
|
||||
|
||||
The libintl library (if any)
|
||||
|
||||
.. variable:: Intl_HAVE_GETTEXT_BUILTIN
|
||||
|
||||
.. versionadded:: 3.20
|
||||
|
||||
True if gettext is in the C library
|
||||
|
||||
.. variable:: Intl_HAVE_DCGETTEXT_BUILTIN
|
||||
|
||||
.. versionadded:: 3.20
|
||||
|
||||
True if dcgettext is in the C library
|
||||
|
||||
.. variable:: Intl_IS_BUILTIN
|
||||
|
||||
.. versionadded:: 3.20
|
||||
|
||||
whether intl is a part of the C library determined from the result of
|
||||
Intl_HAVE_GETTEXT_BUILTIN and Intl_HAVE_DCGETTEXT_BUILTIN
|
||||
|
||||
.. note::
|
||||
On some platforms, such as Linux with GNU libc, the gettext
|
||||
@@ -38,6 +86,10 @@ The following cache variables may also be set::
|
||||
is not required. ``Intl_LIBRARIES`` will be empty in this
|
||||
case.
|
||||
|
||||
.. note::
|
||||
Some libintl implementations don't embed the version number in their header files.
|
||||
In this case the variables ``Intl_VERSION*`` will be empty.
|
||||
|
||||
.. note::
|
||||
If you wish to use the Gettext tools (``msgmerge``,
|
||||
``msgfmt``, etc.), use :module:`FindGettext`.
|
||||
@@ -69,20 +121,43 @@ find_path(Intl_INCLUDE_DIR
|
||||
mark_as_advanced(Intl_INCLUDE_DIR)
|
||||
|
||||
# Find all Intl libraries
|
||||
set(Intl_REQUIRED_VARS)
|
||||
if(NOT Intl_IS_BUILTIN)
|
||||
find_library(Intl_LIBRARY "intl" "libintl" NAMES_PER_DIR
|
||||
DOC "libintl libraries (if not in the C library)")
|
||||
mark_as_advanced(Intl_LIBRARY)
|
||||
list(APPEND Intl_REQUIRED_VARS Intl_LIBRARY)
|
||||
set(Intl_LIBRARY_NAMES "intl" "libintl")
|
||||
else()
|
||||
set(Intl_LIBRARY_NAMES "c")
|
||||
endif()
|
||||
|
||||
find_library(Intl_LIBRARY ${Intl_LIBRARY_NAMES} NAMES_PER_DIR
|
||||
DOC "intl library (potentially the C library)")
|
||||
mark_as_advanced(Intl_LIBRARY)
|
||||
|
||||
# NOTE: glibc's libintl.h does not define LIBINTL_VERSION
|
||||
if(Intl_INCLUDE_DIR AND NOT Intl_IS_BUILTIN)
|
||||
file(STRINGS ${Intl_INCLUDE_DIR}/libintl.h Intl_VERSION_DEFINE REGEX "LIBINTL_VERSION (.*)")
|
||||
|
||||
if(Intl_VERSION_DEFINE MATCHES "(0x[A-Fa-f0-9]+)")
|
||||
set(Intl_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||
# encoding -> version number: (major<<16) + (minor<<8) + patch
|
||||
math(EXPR Intl_VERSION_MAJOR "${Intl_VERSION_NUMBER} >> 16" OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR Intl_VERSION_MINOR "(${Intl_VERSION_NUMBER} - (${Intl_VERSION_MAJOR} << 16)) >> 8" OUTPUT_FORMAT HEXADECIMAL)
|
||||
math(EXPR Intl_VERSION_PATCH "${Intl_VERSION_NUMBER} - ((${Intl_VERSION_MAJOR} << 16) + (${Intl_VERSION_MINOR} << 8))" OUTPUT_FORMAT HEXADECIMAL)
|
||||
|
||||
math(EXPR Intl_VERSION_MAJOR "${Intl_VERSION_MAJOR}" OUTPUT_FORMAT DECIMAL)
|
||||
math(EXPR Intl_VERSION_MINOR "${Intl_VERSION_MINOR}" OUTPUT_FORMAT DECIMAL)
|
||||
math(EXPR Intl_VERSION_PATCH "${Intl_VERSION_PATCH}" OUTPUT_FORMAT DECIMAL)
|
||||
set(Intl_VERSION "${Intl_VERSION_MAJOR}.${Intl_VERSION_MINOR}.${Intl_VERSION_PATCH}")
|
||||
endif()
|
||||
|
||||
unset(Intl_VERSION_DEFINE)
|
||||
unset(Intl_VERSION_NUMBER)
|
||||
endif()
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Intl
|
||||
FOUND_VAR Intl_FOUND
|
||||
REQUIRED_VARS Intl_INCLUDE_DIR ${Intl_REQUIRED_VARS}
|
||||
REQUIRED_VARS Intl_LIBRARY Intl_INCLUDE_DIR
|
||||
VERSION_VAR Intl_VERSION
|
||||
FAIL_MESSAGE "Failed to find Gettext libintl")
|
||||
unset(Intl_REQUIRED_VARS)
|
||||
|
||||
if(Intl_FOUND)
|
||||
set(Intl_INCLUDE_DIRS "${Intl_INCLUDE_DIR}")
|
||||
|
||||
@@ -6,14 +6,17 @@ configure_file(${FortranCInterface_SOURCE_DIR}/Input.cmake.in
|
||||
|
||||
# Detect the Fortran/C interface on the first run or when the
|
||||
# configuration changes.
|
||||
if(${FortranCInterface_BINARY_DIR}/Input.cmake
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
OR ${FortranCInterface_SOURCE_DIR}/Output.cmake.in
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
OR ${FortranCInterface_SOURCE_DIR}/CMakeLists.txt
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
OR ${CMAKE_CURRENT_LIST_FILE}
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
if(NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Input.cmake
|
||||
OR NOT EXISTS ${FortranCInterface_BINARY_DIR}/Output.cmake.in
|
||||
OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Input.cmake
|
||||
OR NOT ${FortranCInterface_SOURCE_DIR}/Output.cmake
|
||||
IS_NEWER_THAN ${FortranCInterface_BINARY_DIR}/Output.cmake.in
|
||||
OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
IS_NEWER_THAN ${FortranCInterface_SOURCE_DIR}/CMakeLists.txt
|
||||
OR NOT ${FortranCInterface_BINARY_DIR}/Output.cmake
|
||||
IS_NEWER_THAN ${CMAKE_CURRENT_LIST_FILE}
|
||||
)
|
||||
message(CHECK_START "Detecting Fortran/C Interface")
|
||||
else()
|
||||
|
||||
@@ -504,7 +504,8 @@ function(gtest_discover_tests TARGET)
|
||||
|
||||
string(CONCAT ctest_include_content
|
||||
"if(EXISTS \"$<TARGET_FILE:${TARGET}>\")" "\n"
|
||||
" if(\"$<TARGET_FILE:${TARGET}>\" IS_NEWER_THAN \"${ctest_tests_file}\")" "\n"
|
||||
" if(NOT EXISTS \"${ctest_tests_file}\" OR" "\n"
|
||||
" NOT \"${ctest_tests_file}\" IS_NEWER_THAN \"$<TARGET_FILE:${TARGET}>\")" "\n"
|
||||
" include(\"${_GOOGLETEST_DISCOVER_TESTS_SCRIPT}\")" "\n"
|
||||
" gtest_discover_tests_impl(" "\n"
|
||||
" TEST_EXECUTABLE" " [==[" "$<TARGET_FILE:${TARGET}>" "]==]" "\n"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
include(Platform/Darwin)
|
||||
|
||||
set(__IMPLICT_LINKS )
|
||||
set(__IMPLICIT_LINKS)
|
||||
foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
string(APPEND __IMPLICT_LINKS " -L\"${dir}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
|
||||
endforeach()
|
||||
foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
|
||||
if(${lib} MATCHES "/")
|
||||
string(APPEND __IMPLICT_LINKS " \"${lib}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
|
||||
else()
|
||||
string(APPEND __IMPLICT_LINKS " -l${lib}")
|
||||
string(APPEND __IMPLICIT_LINKS " -l${lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS "-shared -Wl,-headerpad_max_install_names")
|
||||
set(CMAKE_SHARED_MODULE_CREATE_CUDA_FLAGS "-shared -Wl,-headerpad_max_install_names")
|
||||
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_MODULE "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_MODULE "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
|
||||
@@ -10,7 +10,6 @@ set(__CYGWIN_COMPILER_GNU 1)
|
||||
|
||||
# TODO: Is -Wl,--enable-auto-import now always default?
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,--enable-auto-import")
|
||||
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
|
||||
|
||||
set(CMAKE_GNULD_IMAGE_VERSION
|
||||
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
|
||||
@@ -23,6 +22,7 @@ macro(__cygwin_compiler_gnu lang)
|
||||
"<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE
|
||||
"<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "-mwindows")
|
||||
|
||||
# No -fPIC on cygwin
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
|
||||
|
||||
@@ -71,8 +71,8 @@ macro(__windows_compiler_clang_gnu lang)
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE
|
||||
"<CMAKE_${lang}_COMPILER> -fuse-ld=lld-link -nostartfiles -nostdlib <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
|
||||
|
||||
set(CMAKE_CREATE_WIN32_EXE "-Xlinker /subsystem:windows")
|
||||
set(CMAKE_CREATE_CONSOLE_EXE "-Xlinker /subsystem:console")
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "-Xlinker /subsystem:windows")
|
||||
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "-Xlinker /subsystem:console")
|
||||
|
||||
if(NOT "${lang}" STREQUAL "ASM")
|
||||
set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmt)
|
||||
|
||||
@@ -51,11 +51,6 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
|
||||
# Borland cannot handle + in the file name, so mangle object file name
|
||||
set (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
|
||||
|
||||
# extra flags for a win32 exe
|
||||
set(CMAKE_CREATE_WIN32_EXE "${_tW}" )
|
||||
# extra flags for a console app
|
||||
set(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
|
||||
|
||||
set (CMAKE_BUILD_TYPE Debug CACHE STRING
|
||||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
|
||||
|
||||
@@ -124,6 +119,9 @@ macro(__embarcadero_language lang)
|
||||
"tlib ${CMAKE_START_TEMP_FILE}/p512 <LINK_FLAGS> /a <TARGET_QUOTED> <OBJECTS>${CMAKE_END_TEMP_FILE}"
|
||||
)
|
||||
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "${_tW}")
|
||||
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "${_tC}")
|
||||
|
||||
# Precompile Headers
|
||||
if (EMBARCADERO)
|
||||
set(CMAKE_PCH_EXTENSION .pch)
|
||||
|
||||
@@ -35,7 +35,6 @@ set(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||
set(CMAKE_LINK_LIBRARY_FLAG "-l")
|
||||
set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough
|
||||
set(CMAKE_LINK_LIBRARY_SUFFIX "")
|
||||
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
|
||||
|
||||
set(CMAKE_GNULD_IMAGE_VERSION
|
||||
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
|
||||
@@ -105,6 +104,7 @@ macro(__windows_compiler_gnu lang)
|
||||
"<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE
|
||||
"<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "-mwindows")
|
||||
|
||||
list(APPEND CMAKE_${lang}_ABI_FILES "Platform/Windows-GNU-${lang}-ABI")
|
||||
|
||||
|
||||
@@ -27,12 +27,8 @@ else()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
|
||||
set(CMAKE_CREATE_WIN32_EXE "/entry:WinMainCRTStartup")
|
||||
set(CMAKE_CREATE_CONSOLE_EXE "/entry:mainACRTStartup")
|
||||
set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce")
|
||||
else()
|
||||
set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows")
|
||||
set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console")
|
||||
set(_PLATFORM_LINK_FLAGS "")
|
||||
endif()
|
||||
|
||||
@@ -351,6 +347,14 @@ macro(__windows_compiler_msvc lang)
|
||||
set(CMAKE_${lang}_LINK_EXECUTABLE
|
||||
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "/entry:WinMainCRTStartup")
|
||||
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "/entry:mainACRTStartup")
|
||||
else()
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "/subsystem:windows")
|
||||
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "/subsystem:console")
|
||||
endif()
|
||||
|
||||
set(CMAKE_PCH_EXTENSION .pch)
|
||||
set(CMAKE_LINK_PCH ON)
|
||||
if (CMAKE_${lang}_COMPILER_ID STREQUAL "Clang")
|
||||
|
||||
@@ -7,49 +7,49 @@ set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
|
||||
set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} -c <SOURCE> -o <OBJECT> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS")
|
||||
|
||||
set(__IMPLICT_LINKS )
|
||||
set(__IMPLICIT_LINKS)
|
||||
foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
string(APPEND __IMPLICT_LINKS " -LIBPATH:\"${dir}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " -LIBPATH:\"${dir}\"")
|
||||
endforeach()
|
||||
foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
|
||||
string(APPEND __IMPLICT_LINKS " \"${lib}\"")
|
||||
string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
|
||||
endforeach()
|
||||
set(CMAKE_CUDA_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
|
||||
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
|
||||
|
||||
set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
|
||||
set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
|
||||
set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
|
||||
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}")
|
||||
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICIT_LINKS} ${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY})
|
||||
set(CMAKE_CUDA_CREATE_STATIC_LIBRARY "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
|
||||
set(CMAKE_CUDA_LINKER_SUPPORTS_PDB ON)
|
||||
set(CMAKE_CUDA_LINK_EXECUTABLE
|
||||
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}")
|
||||
unset(_CMAKE_VS_LINK_EXE)
|
||||
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICIT_LINKS} ${CMAKE_END_TEMP_FILE}")
|
||||
unset(_CMAKE_VS_LINK_DLL)
|
||||
unset(_CMAKE_VS_LINK_EXE)
|
||||
|
||||
|
||||
# Add implicit host link directories that contain device libraries
|
||||
# to the device link line.
|
||||
set(__IMPLICT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
|
||||
if(__IMPLICT_DLINK_DIRS)
|
||||
list(REMOVE_ITEM __IMPLICT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
set(__IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
|
||||
if(__IMPLICIT_DLINK_DIRS)
|
||||
list(REMOVE_ITEM __IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
|
||||
endif()
|
||||
set(__IMPLICT_DLINK_FLAGS )
|
||||
foreach(dir ${__IMPLICT_DLINK_DIRS})
|
||||
set(__IMPLICIT_DLINK_FLAGS)
|
||||
foreach(dir ${__IMPLICIT_DLINK_DIRS})
|
||||
if(EXISTS "${dir}/curand_static.lib")
|
||||
string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"")
|
||||
string(APPEND __IMPLICIT_DLINK_FLAGS " -L\"${dir}\"")
|
||||
endif()
|
||||
endforeach()
|
||||
unset(__IMPLICT_DLINK_DIRS)
|
||||
unset(__IMPLICIT_DLINK_DIRS)
|
||||
|
||||
set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICIT_DLINK_FLAGS}")
|
||||
set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICT_DLINK_FLAGS}")
|
||||
unset(__IMPLICT_DLINK_FLAGS)
|
||||
"<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Xcompiler=-Fd<TARGET_COMPILE_PDB>,-FS${__IMPLICIT_DLINK_FLAGS}")
|
||||
unset(__IMPLICIT_DLINK_FLAGS)
|
||||
|
||||
string(REPLACE "/D" "-D" _PLATFORM_DEFINES_CUDA "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_CXX}")
|
||||
|
||||
@@ -69,14 +69,6 @@ else()
|
||||
endif()
|
||||
unset(_cmp0092)
|
||||
|
||||
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
|
||||
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart")
|
||||
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "")
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl")
|
||||
endif()
|
||||
|
||||
string(APPEND CMAKE_CUDA_FLAGS_INIT " ${PLATFORM_DEFINES_CUDA} -D_WINDOWS -Xcompiler=\"${_W3}${_FLAGS_CXX}\"")
|
||||
string(APPEND CMAKE_CUDA_FLAGS_DEBUG_INIT " -Xcompiler=\"${_MDd}-Zi -Ob0 -Od ${_RTC1}\"")
|
||||
string(APPEND CMAKE_CUDA_FLAGS_RELEASE_INIT " -Xcompiler=\"${_MD}-O2 -Ob2\" -DNDEBUG")
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
include(Platform/Windows-OpenWatcom)
|
||||
__windows_open_watcom(C)
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
include(Platform/Windows-OpenWatcom)
|
||||
__windows_open_watcom(CXX)
|
||||
|
||||
@@ -6,8 +6,6 @@ include_guard()
|
||||
|
||||
set(CMAKE_BUILD_TYPE_INIT Debug)
|
||||
|
||||
set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
|
||||
set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system nt_dll")
|
||||
string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system nt_dll")
|
||||
|
||||
@@ -30,3 +28,8 @@ if(CMAKE_CROSSCOMPILING)
|
||||
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES $ENV{WATCOM}/h $ENV{WATCOM}/h/nt)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(__windows_open_watcom lang)
|
||||
set(CMAKE_${lang}_CREATE_WIN32_EXE "system nt_win")
|
||||
set(CMAKE_${lang}_CREATE_CONSOLE_EXE "system nt")
|
||||
endmacro()
|
||||
|
||||
@@ -27,8 +27,8 @@ set(CMAKE_Fortran_COMPILE_OBJECT
|
||||
set(CMAKE_Fortran_LINK_EXECUTABLE
|
||||
"<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
|
||||
|
||||
set(CMAKE_CREATE_WIN32_EXE /winapp)
|
||||
set(CMAKE_CREATE_CONSOLE_EXE )
|
||||
set(CMAKE_Fortran_CREATE_WIN32_EXE /winapp)
|
||||
set(CMAKE_Fortran_CREATE_CONSOLE_EXE )
|
||||
|
||||
# does the compiler support pdbtype and is it the newer compiler
|
||||
|
||||
|
||||
@@ -338,20 +338,11 @@ as well as ``SWIG``:
|
||||
initialized with the value of this variable.
|
||||
#]=======================================================================]
|
||||
|
||||
cmake_policy(GET CMP0078 target_name_policy)
|
||||
cmake_policy(GET CMP0086 module_name_policy)
|
||||
|
||||
cmake_policy (VERSION 3.12)
|
||||
if (target_name_policy)
|
||||
# respect user choice regarding CMP0078 policy
|
||||
cmake_policy(SET CMP0078 ${target_name_policy})
|
||||
endif()
|
||||
if (module_name_policy)
|
||||
# respect user choice regarding CMP0086 policy
|
||||
cmake_policy(SET CMP0086 ${module_name_policy})
|
||||
endif()
|
||||
unset(target_name_policy)
|
||||
unset(module_name_policy)
|
||||
cmake_policy(PUSH)
|
||||
# numbers and boolean constants
|
||||
cmake_policy (SET CMP0012 NEW)
|
||||
# IN_LIST operator
|
||||
cmake_policy (SET CMP0057 NEW)
|
||||
|
||||
set(SWIG_CXX_EXTENSION "cxx")
|
||||
set(SWIG_EXTRA_LIBRARIES "")
|
||||
@@ -911,7 +902,7 @@ function(SWIG_ADD_LIBRARY name)
|
||||
if (APPLE)
|
||||
set_target_properties (${target_name} PROPERTIES SUFFIX ".jnilib")
|
||||
endif()
|
||||
if ((WIN32 AND MINGW) OR CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL MSYS)
|
||||
if ((WIN32 AND MINGW) OR CYGWIN OR CMAKE_SYSTEM_NAME STREQUAL "MSYS")
|
||||
set_target_properties(${target_name} PROPERTIES PREFIX "")
|
||||
endif()
|
||||
elseif (swig_lowercase_language STREQUAL "lua")
|
||||
@@ -1007,3 +998,5 @@ function(SWIG_LINK_LIBRARIES name)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
cmake_policy(POP)
|
||||
|
||||
@@ -198,6 +198,8 @@ set(SRCS
|
||||
cmCMakePath.cxx
|
||||
cmCMakePresetsFile.cxx
|
||||
cmCMakePresetsFile.h
|
||||
cmCMakePresetsFileInternal.h
|
||||
cmCMakePresetsFileReadJSON.cxx
|
||||
cmCommandArgumentParserHelper.cxx
|
||||
cmCommonTargetGenerator.cxx
|
||||
cmCommonTargetGenerator.h
|
||||
@@ -785,8 +787,6 @@ if (WIN32)
|
||||
cmVisualStudioGeneratorOptions.cxx
|
||||
cmVisualStudio10TargetGenerator.h
|
||||
cmVisualStudio10TargetGenerator.cxx
|
||||
cmVisualStudio10ToolsetOptions.h
|
||||
cmVisualStudio10ToolsetOptions.cxx
|
||||
cmLocalVisualStudio10Generator.cxx
|
||||
cmLocalVisualStudio10Generator.h
|
||||
cmGlobalVisualStudio10Generator.h
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# CMake version number components.
|
||||
set(CMake_VERSION_MAJOR 3)
|
||||
set(CMake_VERSION_MINOR 20)
|
||||
set(CMake_VERSION_PATCH 0)
|
||||
set(CMake_VERSION_PATCH 20210324)
|
||||
#set(CMake_VERSION_RC 0)
|
||||
set(CMake_VERSION_IS_DIRTY 0)
|
||||
|
||||
|
||||
@@ -273,6 +273,11 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
||||
? this->GetOption("CPACK_DMG_FORMAT")
|
||||
: "UDZO";
|
||||
|
||||
const std::string cpack_dmg_filesystem =
|
||||
this->GetOption("CPACK_DMG_FILESYSTEM")
|
||||
? this->GetOption("CPACK_DMG_FILESYSTEM")
|
||||
: "HFS+";
|
||||
|
||||
// Get optional arguments ...
|
||||
std::string cpack_license_file =
|
||||
this->GetOption("CPACK_RESOURCE_FILE_LICENSE")
|
||||
@@ -418,7 +423,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
|
||||
temp_image_command << " -ov";
|
||||
temp_image_command << " -srcfolder \"" << staging.str() << "\"";
|
||||
temp_image_command << " -volname \"" << cpack_dmg_volume_name << "\"";
|
||||
temp_image_command << " -fs HFS+";
|
||||
temp_image_command << " -fs \"" << cpack_dmg_filesystem << "\"";
|
||||
temp_image_command << " -format " << temp_image_format;
|
||||
temp_image_command << " \"" << temp_image << "\"";
|
||||
|
||||
|
||||
@@ -384,7 +384,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||
for (std::string const& gf : this->files) {
|
||||
bool skip = false;
|
||||
std::string inFile = gf;
|
||||
if (cmSystemTools::FileIsDirectory(gf)) {
|
||||
if (cmSystemTools::FileIsDirectory(gf) &&
|
||||
!cmSystemTools::FileIsSymlink(gf)) {
|
||||
inFile += '/';
|
||||
}
|
||||
for (cmsys::RegularExpression& reg : ignoreFilesRegex) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user