cmake_language(DEFER [DIRECTORY <dir>] GET_CALL_IDS <var>)
This will store in ``<var>`` a :ref:`semicolon-separated list <CMake Language
-Lists>` of deferred call ids.
+Lists>` of deferred call ids. The ids are for the directory scope in which
+the calls have been deferred to (i.e. where they will be executed), which can
+be different to the scope in which they were created. The ``DIRECTORY``
+option can be used to specify the scope for which to retrieve the call ids.
+If that option is not given, the call ids for the current directory scope will
+be returned.
Details of a specific call may be retrieved from its id:
called, and the remaining elements are its unevaluated arguments (any
contained ``;`` characters are included literally and cannot be distinguished
from multiple arguments). If multiple calls are scheduled with the same id,
-this retrieves the first one. If no call is scheduled with the given id,
-this stores an empty string in the variable.
+this retrieves the first one. If no call is scheduled with the given id in
+the specified ``DIRECTORY`` scope (or the current directory scope if no
+``DIRECTORY`` option is given), this stores an empty string in the variable.
Deferred calls may be canceled by their id:
cmake_language(DEFER [DIRECTORY <dir>] CANCEL_CALL <id>...)
-This cancels all deferred calls matching any of the given ids.
-Unknown ids are silently ignored.
+This cancels all deferred calls matching any of the given ids in the specified
+``DIRECTORY`` scope (or the current directory scope if no ``DIRECTORY`` option
+is given). Unknown ids are silently ignored.
Deferred Call Examples
""""""""""""""""""""""
``...<max>`` part being ignored and preserving the pre-3.12 behavior
of basing policies on ``<min>``.
+This command will set the value of the
+:variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable to ``<min>``.
+
The ``FATAL_ERROR`` option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
with an error instead of just a warning.
--- /dev/null
+CMAKE_APPLE_SILICON_PROCESSOR
+-----------------------------
+
+.. versionadded:: 3.19.2
+
+.. include:: ENV_VAR.txt
+
+On Apple Silicon hosts running macOS, set this environment variable to tell
+CMake what architecture to use for :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`.
+The value must be either ``arm64`` or ``x86_64``.
+
+The :variable:`CMAKE_APPLE_SILICON_PROCESSOR` normal variable, if set,
+overrides this environment variable.
.. toctree::
:maxdepth: 1
+ /envvar/CMAKE_APPLE_SILICON_PROCESSOR
/envvar/CMAKE_BUILD_PARALLEL_LEVEL
/envvar/CMAKE_CONFIG_TYPE
/envvar/CMAKE_EXPORT_COMPILE_COMMANDS
expression is evaluated on.
``$<TARGET_FILE_NAME:tgt>``
The ``tgt`` filename.
+
+ Note that ``tgt`` is not added as a dependency of the target this
+ expression is evaluated on (see policy :policy:`CMP0112`).
``$<TARGET_FILE_DIR:tgt>``
Directory of the ``tgt`` binary file.
/module/AndroidTestUtilities
/module/BundleUtilities
/module/CheckCCompilerFlag
+ /module/CheckCompilerFlag
/module/CheckCSourceCompiles
/module/CheckCSourceRuns
/module/CheckCXXCompilerFlag
/module/CheckFortranSourceCompiles
/module/CheckFortranSourceRuns
/module/CheckFunctionExists
- /module/CheckIPOSupported
/module/CheckIncludeFileCXX
/module/CheckIncludeFile
/module/CheckIncludeFiles
+ /module/CheckIPOSupported
/module/CheckLanguage
/module/CheckLibraryExists
/module/CheckLinkerFlag
/module/CheckOBJCXXSourceRuns
/module/CheckPIESupported
/module/CheckPrototypeDefinition
- /module/CheckCompilerFlag
/module/CheckSourceCompiles
/module/CheckSourceRuns
/module/CheckStructHasMember
/module/CMakePrintSystemInformation
/module/CMakePushCheckState
/module/CMakeVerifyManifest
+ /module/CPack
/module/CPackComponent
/module/CPackIFW
/module/CPackIFWConfigureFile
- /module/CPack
/module/CSharpUtilities
/module/CTest
/module/CTestCoverageCollectGCOV
/module/TestForSSTREAM
/module/TestForSTDNamespace
/module/UseEcos
- /module/UseJavaClassFilelist
/module/UseJava
+ /module/UseJavaClassFilelist
/module/UseJavaSymlinks
/module/UseSWIG
/module/UsewxWidgets
/module/FindArmadillo
/module/FindASPELL
/module/FindAVIFile
+ /module/FindBacktrace
/module/FindBISON
/module/FindBLAS
- /module/FindBacktrace
/module/FindBoost
/module/FindBullet
/module/FindBZip2
/module/FindCABLE
/module/FindCoin3D
- /module/FindCups
/module/FindCUDAToolkit
+ /module/FindCups
/module/FindCURL
/module/FindCurses
/module/FindCVS
/module/FindEnvModules
/module/FindEXPAT
/module/FindFLEX
- /module/FindFLTK2
/module/FindFLTK
+ /module/FindFLTK2
/module/FindFontconfig
/module/FindFreetype
/module/FindGCCXML
/module/FindGnuTLS
/module/FindGSL
/module/FindGTest
- /module/FindGTK2
/module/FindGTK
+ /module/FindGTK2
/module/FindHDF5
/module/FindHg
/module/FindHSPELL
/module/FindHTMLHelp
/module/FindIce
+ /module/FindIconv
/module/FindIcotool
/module/FindICU
/module/FindImageMagick
- /module/FindIconv
/module/FindIntl
/module/FindITK
/module/FindJasper
/module/FindLibXml2
/module/FindLibXslt
/module/FindLTTngUST
+ /module/FindLua
/module/FindLua50
/module/FindLua51
- /module/FindLua
/module/FindMatlab
/module/FindMFC
/module/FindMotif
- /module/FindMPEG2
/module/FindMPEG
+ /module/FindMPEG2
/module/FindMPI
/module/FindODBC
/module/FindOpenACC
/module/FindOpenSceneGraph
/module/FindOpenSSL
/module/FindOpenThreads
+ /module/Findosg
+ /module/Findosg_functions
/module/FindosgAnimation
/module/FindosgDB
- /module/Findosg_functions
/module/FindosgFX
/module/FindosgGA
/module/FindosgIntrospection
/module/FindosgPresentation
/module/FindosgProducer
/module/FindosgQt
- /module/Findosg
/module/FindosgShadow
/module/FindosgSim
/module/FindosgTerrain
/module/FindosgVolume
/module/FindosgWidget
/module/FindPatch
- /module/FindPerlLibs
/module/FindPerl
+ /module/FindPerlLibs
/module/FindPHP4
/module/FindPhysFS
/module/FindPike
/module/FindQuickTime
/module/FindRTI
/module/FindRuby
+ /module/FindSDL
/module/FindSDL_image
/module/FindSDL_mixer
/module/FindSDL_net
- /module/FindSDL
/module/FindSDL_sound
/module/FindSDL_ttf
/module/FindSelfPackers
/module/FindWget
/module/FindWish
/module/FindwxWidgets
- /module/FindXCTest
+ /module/FindX11
/module/FindXalanC
+ /module/FindXCTest
/module/FindXercesC
- /module/FindX11
/module/FindXMLRPC
/module/FindZLIB
An optional array of strings representing the names of presets to inherit
from. The preset will inherit all of the fields from the ``inherits``
presets by default (except ``name``, ``hidden``, ``inherits``,
- ``description``, and ``longDescription``), but can override them as
+ ``description``, and ``displayName``), but can override them as
desired. If multiple ``inherits`` presets provide conflicting values for
the same field, the earlier preset in the ``inherits`` list will be
preferred. Presets in ``CMakePresets.json`` may not inherit from presets
/prop_dir/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
/prop_dir/INCLUDE_DIRECTORIES
/prop_dir/INCLUDE_REGULAR_EXPRESSION
- /prop_dir/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_dir/INTERPROCEDURAL_OPTIMIZATION
+ /prop_dir/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_dir/LABELS
/prop_dir/LINK_DIRECTORIES
/prop_dir/LINK_OPTIONS
/prop_tgt/ANDROID_SECURE_PROPS_PATH
/prop_tgt/ANDROID_SKIP_ANT_STEP
/prop_tgt/ANDROID_STL_TYPE
- /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY
- /prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
+ /prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
+ /prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
/prop_tgt/AUTOGEN_BUILD_DIR
/prop_tgt/AUTOGEN_ORIGIN_DEPENDS
/prop_tgt/AUTOGEN_PARALLEL
/prop_tgt/BUILD_RPATH_USE_ORIGIN
/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR
/prop_tgt/BUILD_WITH_INSTALL_RPATH
- /prop_tgt/BUNDLE_EXTENSION
/prop_tgt/BUNDLE
+ /prop_tgt/BUNDLE_EXTENSION
/prop_tgt/C_EXTENSIONS
/prop_tgt/C_STANDARD
/prop_tgt/C_STANDARD_REQUIRED
/prop_tgt/CONFIG_POSTFIX
/prop_tgt/CROSSCOMPILING_EMULATOR
/prop_tgt/CUDA_ARCHITECTURES
+ /prop_tgt/CUDA_EXTENSIONS
/prop_tgt/CUDA_PTX_COMPILATION
- /prop_tgt/CUDA_SEPARABLE_COMPILATION
/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS
/prop_tgt/CUDA_RUNTIME_LIBRARY
- /prop_tgt/CUDA_EXTENSIONS
+ /prop_tgt/CUDA_SEPARABLE_COMPILATION
/prop_tgt/CUDA_STANDARD
/prop_tgt/CUDA_STANDARD_REQUIRED
/prop_tgt/CXX_EXTENSIONS
/prop_tgt/CXX_STANDARD_REQUIRED
/prop_tgt/DEBUG_POSTFIX
/prop_tgt/DEFINE_SYMBOL
- /prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY
/prop_tgt/DEPLOYMENT_ADDITIONAL_FILES
+ /prop_tgt/DEPLOYMENT_REMOTE_DIRECTORY
/prop_tgt/DEPRECATION
/prop_tgt/DISABLE_PRECOMPILE_HEADERS
/prop_tgt/DOTNET_TARGET_FRAMEWORK
/prop_tgt/EchoString
/prop_tgt/ENABLE_EXPORTS
/prop_tgt/EXCLUDE_FROM_ALL
- /prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG
/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD
+ /prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD_CONFIG
/prop_tgt/EXPORT_NAME
/prop_tgt/EXPORT_PROPERTIES
/prop_tgt/FOLDER
/prop_tgt/GNUtoMS
/prop_tgt/HAS_CXX
/prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
+ /prop_tgt/IMPORTED
/prop_tgt/IMPORTED_COMMON_LANGUAGE_RUNTIME
/prop_tgt/IMPORTED_CONFIGURATIONS
/prop_tgt/IMPORTED_GLOBAL
- /prop_tgt/IMPORTED_IMPLIB_CONFIG
/prop_tgt/IMPORTED_IMPLIB
- /prop_tgt/IMPORTED_LIBNAME_CONFIG
+ /prop_tgt/IMPORTED_IMPLIB_CONFIG
/prop_tgt/IMPORTED_LIBNAME
- /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
+ /prop_tgt/IMPORTED_LIBNAME_CONFIG
/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES
- /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG
+ /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
/prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES
- /prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG
+ /prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG
/prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES
- /prop_tgt/IMPORTED_LINK_INTERFACE_MULTIPLICITY_CONFIG
+ /prop_tgt/IMPORTED_LINK_INTERFACE_LIBRARIES_CONFIG
/prop_tgt/IMPORTED_LINK_INTERFACE_MULTIPLICITY
- /prop_tgt/IMPORTED_LOCATION_CONFIG
+ /prop_tgt/IMPORTED_LINK_INTERFACE_MULTIPLICITY_CONFIG
/prop_tgt/IMPORTED_LOCATION
- /prop_tgt/IMPORTED_NO_SONAME_CONFIG
+ /prop_tgt/IMPORTED_LOCATION_CONFIG
/prop_tgt/IMPORTED_NO_SONAME
- /prop_tgt/IMPORTED_OBJECTS_CONFIG
+ /prop_tgt/IMPORTED_NO_SONAME_CONFIG
/prop_tgt/IMPORTED_OBJECTS
- /prop_tgt/IMPORTED
- /prop_tgt/IMPORTED_SONAME_CONFIG
+ /prop_tgt/IMPORTED_OBJECTS_CONFIG
/prop_tgt/IMPORTED_SONAME
+ /prop_tgt/IMPORTED_SONAME_CONFIG
/prop_tgt/IMPORT_PREFIX
/prop_tgt/IMPORT_SUFFIX
/prop_tgt/INCLUDE_DIRECTORIES
/prop_tgt/INTERFACE_LINK_DIRECTORIES
/prop_tgt/INTERFACE_LINK_LIBRARIES
/prop_tgt/INTERFACE_LINK_OPTIONS
- /prop_tgt/INTERFACE_PRECOMPILE_HEADERS
/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE
+ /prop_tgt/INTERFACE_PRECOMPILE_HEADERS
/prop_tgt/INTERFACE_SOURCES
/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
- /prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_tgt/INTERPROCEDURAL_OPTIMIZATION
+ /prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG
/prop_tgt/IOS_INSTALL_COMBINED
/prop_tgt/ISPC_HEADER_DIRECTORY
+ /prop_tgt/ISPC_HEADER_SUFFIX
/prop_tgt/ISPC_INSTRUCTION_SETS
/prop_tgt/JOB_POOL_COMPILE
/prop_tgt/JOB_POOL_LINK
/prop_tgt/LANG_CPPLINT
/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE
/prop_tgt/LANG_VISIBILITY_PRESET
- /prop_tgt/LIBRARY_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/LIBRARY_OUTPUT_DIRECTORY
- /prop_tgt/LIBRARY_OUTPUT_NAME_CONFIG
+ /prop_tgt/LIBRARY_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/LIBRARY_OUTPUT_NAME
- /prop_tgt/LINK_DEPENDS_NO_SHARED
+ /prop_tgt/LIBRARY_OUTPUT_NAME_CONFIG
/prop_tgt/LINK_DEPENDS
- /prop_tgt/LINKER_LANGUAGE
+ /prop_tgt/LINK_DEPENDS_NO_SHARED
/prop_tgt/LINK_DIRECTORIES
- /prop_tgt/LINK_FLAGS_CONFIG
/prop_tgt/LINK_FLAGS
- /prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG
+ /prop_tgt/LINK_FLAGS_CONFIG
/prop_tgt/LINK_INTERFACE_LIBRARIES
- /prop_tgt/LINK_INTERFACE_MULTIPLICITY_CONFIG
+ /prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG
/prop_tgt/LINK_INTERFACE_MULTIPLICITY
+ /prop_tgt/LINK_INTERFACE_MULTIPLICITY_CONFIG
/prop_tgt/LINK_LIBRARIES
/prop_tgt/LINK_OPTIONS
/prop_tgt/LINK_SEARCH_END_STATIC
/prop_tgt/LINK_SEARCH_START_STATIC
/prop_tgt/LINK_WHAT_YOU_USE
- /prop_tgt/LOCATION_CONFIG
+ /prop_tgt/LINKER_LANGUAGE
/prop_tgt/LOCATION
+ /prop_tgt/LOCATION_CONFIG
/prop_tgt/MACHO_COMPATIBILITY_VERSION
/prop_tgt/MACHO_CURRENT_VERSION
- /prop_tgt/MACOSX_BUNDLE_INFO_PLIST
/prop_tgt/MACOSX_BUNDLE
+ /prop_tgt/MACOSX_BUNDLE_INFO_PLIST
/prop_tgt/MACOSX_FRAMEWORK_INFO_PLIST
/prop_tgt/MACOSX_RPATH
/prop_tgt/MANUALLY_ADDED_DEPENDENCIES
/prop_tgt/OBJCXX_STANDARD
/prop_tgt/OBJCXX_STANDARD_REQUIRED
/prop_tgt/OPTIMIZE_DEPENDENCIES
- /prop_tgt/OSX_ARCHITECTURES_CONFIG
/prop_tgt/OSX_ARCHITECTURES
- /prop_tgt/OUTPUT_NAME_CONFIG
+ /prop_tgt/OSX_ARCHITECTURES_CONFIG
/prop_tgt/OUTPUT_NAME
+ /prop_tgt/OUTPUT_NAME_CONFIG
/prop_tgt/PCH_WARN_INVALID
/prop_tgt/PCH_INSTANTIATE_TEMPLATES
- /prop_tgt/PDB_NAME_CONFIG
/prop_tgt/PDB_NAME
- /prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG
+ /prop_tgt/PDB_NAME_CONFIG
/prop_tgt/PDB_OUTPUT_DIRECTORY
+ /prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/POSITION_INDEPENDENT_CODE
/prop_tgt/PRECOMPILE_HEADERS
/prop_tgt/PRECOMPILE_HEADERS_REUSE_FROM
/prop_tgt/RULE_LAUNCH_COMPILE
/prop_tgt/RULE_LAUNCH_CUSTOM
/prop_tgt/RULE_LAUNCH_LINK
- /prop_tgt/RUNTIME_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/RUNTIME_OUTPUT_DIRECTORY
- /prop_tgt/RUNTIME_OUTPUT_NAME_CONFIG
+ /prop_tgt/RUNTIME_OUTPUT_DIRECTORY_CONFIG
/prop_tgt/RUNTIME_OUTPUT_NAME
+ /prop_tgt/RUNTIME_OUTPUT_NAME_CONFIG
/prop_tgt/SKIP_BUILD_RPATH
/prop_tgt/SOURCE_DIR
/prop_tgt/SOURCES
/prop_tgt/SOVERSION
- /prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG
/prop_tgt/STATIC_LIBRARY_FLAGS
+ /prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG
/prop_tgt/STATIC_LIBRARY_OPTIONS
/prop_tgt/SUFFIX
/prop_tgt/Swift_DEPENDENCIES_FILE
/prop_tgt/VS_DEBUGGER_ENVIRONMENT
/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY
/prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION
+ /prop_tgt/VS_DOTNET_DOCUMENTATION_FILE
/prop_tgt/VS_DOTNET_REFERENCE_refname
/prop_tgt/VS_DOTNET_REFERENCEPROP_refname_TAG_tagname
/prop_tgt/VS_DOTNET_REFERENCES
/prop_tgt/VS_DOTNET_REFERENCES_COPY_LOCAL
/prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION
- /prop_tgt/VS_DOTNET_DOCUMENTATION_FILE
/prop_tgt/VS_DPI_AWARE
/prop_tgt/VS_GLOBAL_KEYWORD
/prop_tgt/VS_GLOBAL_PROJECT_TYPES
.. toctree::
:maxdepth: 1
- /prop_test/ATTACHED_FILES_ON_FAIL
/prop_test/ATTACHED_FILES
+ /prop_test/ATTACHED_FILES_ON_FAIL
/prop_test/COST
/prop_test/DEPENDS
/prop_test/DISABLED
/variable/CMAKE_ARGV0
/variable/CMAKE_BINARY_DIR
/variable/CMAKE_BUILD_TOOL
- /variable/CMAKE_CACHEFILE_DIR
/variable/CMAKE_CACHE_MAJOR_VERSION
/variable/CMAKE_CACHE_MINOR_VERSION
/variable/CMAKE_CACHE_PATCH_VERSION
+ /variable/CMAKE_CACHEFILE_DIR
/variable/CMAKE_CFG_INTDIR
/variable/CMAKE_COMMAND
/variable/CMAKE_CPACK_COMMAND
/variable/CMAKE_ANDROID_SKIP_ANT_STEP
/variable/CMAKE_ANDROID_STANDALONE_TOOLCHAIN
/variable/CMAKE_ANDROID_STL_TYPE
+ /variable/CMAKE_APPLE_SILICON_PROCESSOR
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS
/variable/CMAKE_CONFIG_POSTFIX
/variable/CMAKE_CROSS_CONFIGS
/variable/CMAKE_CTEST_ARGUMENTS
- /variable/CMAKE_CUDA_SEPARABLE_COMPILATION
/variable/CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS
/variable/CMAKE_CUDA_RUNTIME_LIBRARY
+ /variable/CMAKE_CUDA_SEPARABLE_COMPILATION
/variable/CMAKE_DEBUG_POSTFIX
/variable/CMAKE_DEFAULT_BUILD_TYPE
/variable/CMAKE_DEFAULT_CONFIGS
/variable/CMAKE_COMPILER_IS_GNUG77
/variable/CMAKE_CUDA_ARCHITECTURES
/variable/CMAKE_CUDA_COMPILE_FEATURES
- /variable/CMAKE_CUDA_HOST_COMPILER
/variable/CMAKE_CUDA_EXTENSIONS
+ /variable/CMAKE_CUDA_HOST_COMPILER
/variable/CMAKE_CUDA_STANDARD
/variable/CMAKE_CUDA_STANDARD_REQUIRED
/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
/variable/CMAKE_ISPC_HEADER_DIRECTORY
+ /variable/CMAKE_ISPC_HEADER_SUFFIX
/variable/CMAKE_ISPC_INSTRUCTION_SETS
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX
/variable/CMAKE_LANG_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES
/variable/CMAKE_LANG_LIBRARY_ARCHITECTURE
+ /variable/CMAKE_LANG_LINK_EXECUTABLE
/variable/CMAKE_LANG_LINKER_PREFERENCE
/variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES
/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG
/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP
- /variable/CMAKE_LANG_LINK_EXECUTABLE
/variable/CMAKE_LANG_OUTPUT_EXTENSION
/variable/CMAKE_LANG_SIMULATE_ID
/variable/CMAKE_LANG_SIMULATE_VERSION
The following target-based generator expressions that query for directory or
file name components no longer add a dependency on the evaluated target.
+ - ``TARGET_FILE_NAME``
- ``TARGET_FILE_DIR``
- ``TARGET_LINKER_FILE_BASE_NAME``
- ``TARGET_LINKER_FILE_NAME``
--- /dev/null
+ISPC_HEADER_SUFFIX
+------------------
+
+.. versionadded:: 3.19.2
+
+Specify output suffix to be used for ISPC generated headers provided by the target.
+
+This property is initialized by the value of the :variable:`CMAKE_ISPC_HEADER_SUFFIX`
+variable if it is set when a target is created.
+
+If the target contains ISPC source files, this specifies the header suffix to
+be used for the generated headers.
+
+The default value is ``_ispc.h``.
the middle C library, the bottom Fortran library will also build, even though
it does not have any side effects that are relevant to the C library, since the
C library does not have optimization enabled.
+
+This property is initialized by the value of the
+:variable:`CMAKE_OPTIMIZE_DEPENDENCIES` variable when the target is created.
* ``CUDA`` language support now works on QNX.
+Platforms
+---------
+
+* Apple Silicon is now supported (since CMake 3.19.2):
+
+ * The :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` is selected using ``uname -m``.
+ Since this may vary based on CMake's own architecture and that of
+ the invoking process tree, the :variable:`CMAKE_APPLE_SILICON_PROCESSOR`
+ variable or :envvar:`CMAKE_APPLE_SILICON_PROCESSOR` environment
+ variable may be set to specify a host architecture explicitly.
+
+ * If :variable:`CMAKE_OSX_ARCHITECTURES` is not set, CMake adds explicit
+ flags to tell the compiler to build for the
+ :variable:`CMAKE_HOST_SYSTEM_PROCESSOR` so the toolchain does not
+ have to guess based on the process tree's architecture.
+
File-Based API
--------------
been reverted to restore behavior from CMake 3.18 and below.
* CUDA 11.1 support for Clang.
+
+3.19.2
+------
+
+* The precompiled macOS binary provided on ``cmake.org`` is now a
+ universal binary with ``x86_64`` and ``arm64`` architectures.
+ It requires macOS 10.10 or newer.
+ The package file naming pattern has been changed from
+ ``cmake-$ver-Darwin-x86_64`` to ``cmake-$ver-macos-universal``.
+
+* Apple Silicon host architecture selection support was updated.
+ CMake 3.19.0 and 3.19.1 always chose ``arm64`` as the host architecture.
+ CMake 3.19.2 returns to using ``uname -m`` as CMake 3.18 and below did.
+ Since this may vary based on CMake's own architecture and that of
+ the invoking process tree, the :variable:`CMAKE_APPLE_SILICON_PROCESSOR`
+ variable or :envvar:`CMAKE_APPLE_SILICON_PROCESSOR` environment
+ variable may be set to specify a host architecture explicitly.
+
+* The :variable:`CMAKE_ISPC_HEADER_SUFFIX` variable and corresponding
+ :prop_tgt:`ISPC_HEADER_SUFFIX` target property were added to control
+ the header suffix used by ``ISPC`` compiler generated headers.
--- /dev/null
+CMAKE_APPLE_SILICON_PROCESSOR
+-----------------------------
+
+.. versionadded:: 3.19.2
+
+On Apple Silicon hosts running macOS, set this variable to tell
+CMake what architecture to use for :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`.
+The value must be either ``arm64`` or ``x86_64``.
+
+The value of this variable should never be modified by project code.
+It is meant to be set by a toolchain file specified by the
+:variable:`CMAKE_TOOLCHAIN_FILE` variable, or as a cache entry
+provided by the user, e.g. via ``-DCMAKE_APPLE_SILICON_PROCESSOR=...``.
+
+See also the :envvar:`CMAKE_APPLE_SILICON_PROCESSOR` environment variable.
The name of the CPU CMake is running on.
+Windows Platforms
+^^^^^^^^^^^^^^^^^
+
On Windows, this variable is set to the value of the environment variable
-``PROCESSOR_ARCHITECTURE``. On systems that support ``uname``, this variable is
-set to the output of:
+``PROCESSOR_ARCHITECTURE``.
+
+Unix Platforms
+^^^^^^^^^^^^^^
+
+On systems that support ``uname``, this variable is set to the output of:
-- ``uname -m`` on GNU, Linux, Cygwin, Darwin, Android, or
+- ``uname -m`` on GNU, Linux, Cygwin, Android, or
- ``arch`` on OpenBSD, or
- on other systems,
* ``uname -p`` if its exit code is nonzero, or
* ``uname -m`` otherwise.
+
+macOS Platforms
+^^^^^^^^^^^^^^^
+
+The value of ``uname -m`` is used by default.
+
+On Apple Silicon hosts, the architecture printed by ``uname -m`` may vary
+based on CMake's own architecture and that of the invoking process tree.
+
+.. versionadded:: 3.19.2
+
+ On Apple Silicon hosts:
+
+ * The :variable:`CMAKE_APPLE_SILICON_PROCESSOR` variable or
+ the :envvar:`CMAKE_APPLE_SILICON_PROCESSOR` environment variable
+ may be set to specify the host architecture explicitly.
+
+ * If :variable:`CMAKE_OSX_ARCHITECTURES` is not set, CMake adds explicit
+ flags to tell the compiler to build for the host architecture so the
+ toolchain does not have to guess based on the process tree's architecture.
--- /dev/null
+CMAKE_ISPC_HEADER_SUFFIX
+------------------------
+
+.. versionadded:: 3.19.2
+
+Output suffix to be used for ISPC generated headers.
+
+This variable is used to initialize the :prop_tgt:`ISPC_HEADER_SUFFIX`
+property on all the targets. See the target property for additional
+information.
HP = Hewlett-Packard Compiler (hp.com)
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
- IntelDPCPP = Intel DPCPP Compiler (intel.com)
- IntelClang = Intel Clang Compiler (intel.com)
MSVC = Microsoft Visual Studio (microsoft.com)
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
# The variable CVF_VERSION must be set before calling configure_file().
-if (PACKAGE_FIND_VERSION_RANGE)
- message(AUTHOR_WARNING
- "`find_package()` specify a version range but the version strategy "
- "(SameMajorVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
- "with this request. Only the lower endpoint of the range will be used.")
-endif()
-
set(PACKAGE_VERSION "@CVF_VERSION@")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(CVF_VERSION_MAJOR "@CVF_VERSION@")
endif()
- if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
- set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if(PACKAGE_FIND_VERSION_RANGE)
+ # both endpoints of the range must have the expected major version
+ math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
+ if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
else()
- set(PACKAGE_VERSION_COMPATIBLE FALSE)
- endif()
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
- if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
endif()
endif()
# The variable CVF_VERSION must be set before calling configure_file().
-if (PACKAGE_FIND_VERSION_RANGE)
- message(AUTHOR_WARNING
- "`find_package()` specify a version range but the version strategy "
- "(SameMinorVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
- "with this request. Only the lower endpoint of the range will be used.")
-endif()
-
set(PACKAGE_VERSION "@CVF_VERSION@")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(CVF_VERSION_MINOR "")
endif()
- if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
- (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
- set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if(PACKAGE_FIND_VERSION_RANGE)
+ # both endpoints of the range must have the expected major and minor versions
+ math (EXPR CVF_VERSION_MINOR_NEXT "${CVF_VERSION_MINOR} + 1")
+ if (NOT (PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR)
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE"
+ AND NOT (PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR
+ AND PACKAGE_FIND_VERSION_MAX_MINOR STREQUAL CVF_VERSION_MINOR))
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE"
+ AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL ${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR_NEXT})))
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
else()
- set(PACKAGE_VERSION_COMPATIBLE FALSE)
- endif()
+ if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
+ (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ else()
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+ endif()
- if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
+ endif()
endif()
endif()
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
ARMCC
AppleClang
ARMClang
- IntelDPCPP
- IntelClang
Clang
GNU
MSVC
endif()
set(cuda_tools "CUDA ${CMAKE_VS_PLATFORM_TOOLSET_CUDA}")
set(id_compile "CudaCompile")
- set(id_ItemDefinitionGroup_entry "<CudaCompile><AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>")
+ if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
+ set(cuda_target "<TargetMachinePlatform>64</TargetMachinePlatform>")
+ endif()
+ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
+ string(REGEX MATCH "[0-9]+" arch_name "${arch}")
+ string(APPEND cuda_codegen "compute_${arch_name},sm_${arch_name};")
+ endforeach()
+ 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="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.props" />]])
string(CONCAT id_Import_targets [[<Import Project="$(VCTargetsPath)\BuildCustomizations\]] "${cuda_tools}" [[.targets" />]])
endif()
- if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
- set(id_ItemDefinitionGroup_entry "<CudaCompile><TargetMachinePlatform>64</TargetMachinePlatform><AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>")
- endif()
if(CMAKE_CUDA_FLAGS MATCHES "(^| )-cudart +shared( |$)")
set(id_Link_AdditionalDependencies "<AdditionalDependencies>cudart.lib</AdditionalDependencies>")
else()
break()
endif()
endforeach()
- set(COMPILER_ID_TWICE)
+
# With the IAR Compiler, some strings are found twice, first time as incomplete
# list like "?<Constant "INFO:compiler[IAR]">". Remove the incomplete copies.
list(FILTER CMAKE_${lang}_COMPILER_ID_STRINGS EXCLUDE REGEX "\\?<Constant \\\"")
+
+ # The IAR-AVR compiler uses a binary format that places a '6'
+ # character (0x34) before each character in the string. Strip
+ # out these characters without removing any legitimate characters.
+ if(CMAKE_${lang}_COMPILER_ID_STRINGS MATCHES "(.)I.N.F.O.:.")
+ string(REGEX REPLACE "${CMAKE_MATCH_1}([^;])" "\\1"
+ CMAKE_${lang}_COMPILER_ID_STRINGS "${CMAKE_${lang}_COMPILER_ID_STRINGS}")
+ endif()
+
+ # Remove arbitrary text that may appear before or after each INFO string.
+ string(REGEX MATCHALL "INFO:[A-Za-z0-9_]+\\[([^]\"]*)\\]"
+ CMAKE_${lang}_COMPILER_ID_STRINGS "${CMAKE_${lang}_COMPILER_ID_STRINGS}")
+
# In C# binaries, some strings are found more than once.
list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_ID_STRINGS)
+
+ set(COMPILER_ID_TWICE)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
- # The IAR-AVR compiler uses a binary format that places a '6'
- # character (0x34) before each character in the string. Strip
- # out these characters without removing any legitimate characters.
- if("${info}" MATCHES "(.)I.N.F.O.:.")
- string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}")
- endif()
if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
if(COMPILER_ID)
set(COMPILER_ID_TWICE 1)
else()
exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
endif()
- if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|Darwin|^GNU$|Android")
+ if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|^GNU$|Android")
exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
- if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
- if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
- # Check whether we are running under Rosetta on arm64 hardware.
+ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+ # If we are running on Apple Silicon, honor CMAKE_APPLE_SILICON_PROCESSOR.
+ if(DEFINED CMAKE_APPLE_SILICON_PROCESSOR)
+ set(_CMAKE_APPLE_SILICON_PROCESSOR "${CMAKE_APPLE_SILICON_PROCESSOR}")
+ elseif(DEFINED ENV{CMAKE_APPLE_SILICON_PROCESSOR})
+ set(_CMAKE_APPLE_SILICON_PROCESSOR "$ENV{CMAKE_APPLE_SILICON_PROCESSOR}")
+ else()
+ set(_CMAKE_APPLE_SILICON_PROCESSOR "")
+ endif()
+ if(_CMAKE_APPLE_SILICON_PROCESSOR)
+ if(";${_CMAKE_APPLE_SILICON_PROCESSOR};" MATCHES "^;(arm64|x86_64);$")
execute_process(COMMAND sysctl -q hw.optional.arm64
OUTPUT_VARIABLE _sysctl_stdout
ERROR_VARIABLE _sysctl_stderr
RESULT_VARIABLE _sysctl_result
)
- if(_sysctl_result EQUAL 0 AND _sysctl_stdout MATCHES "hw.optional.arm64: 1")
- set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64")
+ if(NOT _sysctl_result EQUAL 0 OR NOT _sysctl_stdout MATCHES "hw.optional.arm64: 1")
+ set(_CMAKE_APPLE_SILICON_PROCESSOR "")
endif()
- elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
- # OS X ppc 'uname -m' may report 'Power Macintosh' instead of 'powerpc'
- set(CMAKE_HOST_SYSTEM_PROCESSOR "powerpc")
+ unset(_sysctl_result)
+ unset(_sysctl_stderr)
+ unset(_sysctl_stdout)
endif()
endif()
+ if(_CMAKE_APPLE_SILICON_PROCESSOR)
+ set(CMAKE_HOST_SYSTEM_PROCESSOR "${_CMAKE_APPLE_SILICON_PROCESSOR}")
+ else()
+ exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
+ RETURN_VALUE val)
+ endif()
+ unset(_CMAKE_APPLE_SILICON_PROCESSOR)
+ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "Power Macintosh")
+ # OS X ppc 'uname -m' may report 'Power Macintosh' instead of 'powerpc'
+ set(CMAKE_HOST_SYSTEM_PROCESSOR "powerpc")
+ endif()
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
#else
PRINT *, 'INFO:compiler[]'
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYFTN)
PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]'
#endif
write your own custom ``ConfigVersion.cmake`` file instead of using this
macro.
-.. note:: ``COMPATIBILITY_MODE`` ``AnyNewerVersion`` handles the version range
- if any is specified (see :command:`find_package` command for the details).
- All other modes are incompatible with version ranges and will display an
- author warning if one is specified.
+.. note:: ``COMPATIBILITY_MODE`` ``AnyNewerVersion``, ``SameMajorVersion`` and
+ ``SameMinorVersion`` handle the version range if any is specified (see
+ :command:`find_package` command for the details). ``ExactVersion`` is
+ incompatible with version ranges and will display an author warning if one is
+ specified.
If ``ARCH_INDEPENDENT`` is given, the installed package version will be
considered compatible even if it was built for a different architecture than
#]=======================================================================]
-include (Internal/CMakeCheckCompilerFlag)
+include (Internal/CMakeTryCompilerOrLinkerFlag)
function (check_pie_supported)
cmake_policy(GET CMP0083 cmp0083)
foreach(lang IN LISTS CHECK_PIE_LANGUAGES)
if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER)
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
CMAKE_${lang}_LINK_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_PIE_SUPPORTED)
string (APPEND outputs "PIE (${lang}): ${output}\n")
endif()
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
CMAKE_${lang}_LINK_NO_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_NO_PIE_SUPPORTED)
set(__COMPILER_GNU 1)
include(Compiler/CMakeCommonCompilerMacros)
-include(Internal/CMakeCheckCompilerFlag)
set(__pch_header_C "c-header")
set(__pch_header_CXX "c++-header")
set(CMAKE_ISPC_COMPILE_OPTIONS_PIE --pic)
set(CMAKE_ISPC_COMPILE_OPTIONS_PIC --pic)
-set(CMAKE_INCLUDE_SYSTEM_FLAG_ISPC -isystem=)
-
set(CMAKE_ISPC_RESPONSE_FILE_FLAG "@")
set(CMAKE_ISPC_USE_RESPONSE_FILE_FOR_INCLUDES 1)
set(CMAKE_ISPC_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+++ /dev/null
-
-set(_compiler_id_pp_test "defined(__clang__) && defined(__INTEL_CLANG_COMPILER)")
-
-include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
-
-string(APPEND _compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_CLANG_COMPILER)")
+++ /dev/null
-
-set(_compiler_id_pp_test "defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__)")
-
-include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
-
-string(APPEND _compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_DPCPP_COMPILER__)")
endif()
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}}")
+if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")
set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89" "--strict_ansi")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89" "--relaxed_ansi")
set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99" "--strict_ansi")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99" "--relaxed_ansi")
- if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} AND
- CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}}")
+ if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID} AND
+ CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "--c11" "--strict_ansi")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--c11" "--relaxed_ansi")
add_library(GLUT::Cocoa UNKNOWN IMPORTED)
# Cocoa should always be a Framework, but we check to make sure.
if(GLUT_cocoa_LIBRARY MATCHES "/([^/]+)\\.framework$")
+ set(_glut_cocoa "${GLUT_cocoa_LIBRARY}/${CMAKE_MATCH_1}")
+ if(EXISTS "${_glut_cocoa}.tbd")
+ string(APPEND _glut_cocoa ".tbd")
+ endif()
set_target_properties(GLUT::Cocoa PROPERTIES
- IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}/${CMAKE_MATCH_1}")
+ IMPORTED_LOCATION "${_glut_cocoa}")
else()
set_target_properties(GLUT::Cocoa PROPERTIES
IMPORTED_LOCATION "${GLUT_cocoa_LIBRARY}")
set_target_properties(GLUT::GLUT PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GLUT_INCLUDE_DIR}")
if(GLUT_glut_LIBRARY MATCHES "/([^/]+)\\.framework$")
+ set(_glut_glut "${GLUT_glut_LIBRARY}/${CMAKE_MATCH_1}")
+ if(EXISTS "${_glut_glut}.tbd")
+ string(APPEND _glut_glut ".tbd")
+ endif()
set_target_properties(GLUT::GLUT PROPERTIES
- IMPORTED_LOCATION "${GLUT_glut_LIBRARY}/${CMAKE_MATCH_1}")
+ IMPORTED_LOCATION "${_glut_glut}")
else()
if(GLUT_glut_LIBRARY_RELEASE)
set_property(TARGET GLUT::GLUT APPEND PROPERTY
# Error if we still don't have the location.
message(SEND_ERROR
"HDF5 was found, but a different variable was set which contains "
- "its location.")
+ "the location of the `hdf5::${hdf5_target_name}` library.")
endif ()
add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_DEFINITIONS}")
continue ()
endif ()
+ set(hdf5_alt_target_name "")
if (hdf5_lang STREQUAL "C")
set(hdf5_target_name "hdf5_hl")
elseif (hdf5_lang STREQUAL "CXX")
set(hdf5_target_name "hdf5_hl_cpp")
elseif (hdf5_lang STREQUAL "Fortran")
set(hdf5_target_name "hdf5_hl_fortran")
+ set(hdf5_alt_target_name "hdf5hl_fortran")
else ()
continue ()
endif ()
set(_hdf5_location "${HDF5_${hdf5_lang}_HL_LIBRARY}")
elseif (DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}")
set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}}")
+ elseif (hdf5_alt_target_name AND DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}")
+ set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}}")
else ()
# Error if we still don't have the location.
message(SEND_ERROR
"HDF5 was found, but a different variable was set which contains "
- "its location.")
+ "the location of the `hdf5::${hdf5_target_name}` library.")
endif ()
add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_HL_DEFINITIONS}")
unset (${FPCV_RESULT_MESSAGE_VARIABLE} PARENT_SCOPE)
endif()
- if (CMAKE_FIND_PACKAGE_NAME)
- set (package ${CMAKE_FIND_PACKAGE_NAME})
+ if (_CMAKE_FPHSA_PACKAGE_NAME)
+ set (package "${_CMAKE_FPHSA_PACKAGE_NAME}")
+ elseif (CMAKE_FIND_PACKAGE_NAME)
+ set (package "${CMAKE_FIND_PACKAGE_NAME}")
else()
message (FATAL_ERROR "find_package_check_version(): Cannot be used outside a 'Find Module'")
endif()
"will be used.")
endif()
+ # to propagate package name to FIND_PACKAGE_CHECK_VERSION
+ set(_CMAKE_FPHSA_PACKAGE_NAME "${_NAME}")
+
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
list (REMOVE_DUPLICATES _values)
elseif (NAME STREQUAL "SOABI")
# clean-up: remove prefix character and suffix
- string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
+ if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$")
+ set(_values "")
+ else()
+ string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
+ endif()
endif()
endif()
endif()
endforeach()
if (_values)
# clean-up: remove prefix character and suffix
- string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
+ if (_values MATCHES "^(\\.${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.so|\\.pyd)$")
+ set(_values "")
+ else()
+ string (REGEX REPLACE "^[.-](.+)(${CMAKE_SHARED_LIBRARY_SUFFIX}|\\.(so|pyd))$" "\\1" _values "${_values}")
+ endif()
endif()
endif()
else()
NOTE: This function is used internally by CMake. Projects should not include
this file directly.
-The cmake_check_compiler_flag() function can be used to compile and link a
+The cmake_try_compiler_or_linker_flag() function can be used to compile and link a
source file to check whether a specific compiler or linker flag is supported.
The function does not use the try_compile() command so as to avoid infinite
recursion. It may not work for all platforms or toolchains, the caller is
responsible for ensuring it is only called in valid situations.
- cmake_check_compiler_flag(<lang> <flag> <result>
+ cmake_try_compiler_or_linker_flag(<lang> <flag> <result>
[SRC_EXT <ext>] [COMMAND_PATTERN <pattern>]
[FAIL_REGEX <regex> ...]
[OUTPUT_VARIABLE <output>])
include_guard(GLOBAL)
include(CMakeCheckCompilerFlagCommonPatterns)
-function(CMAKE_CHECK_COMPILER_FLAG lang flag result)
+function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result)
# Cache results between runs similar to check_<lang>_source_compiles()
if(DEFINED ${result})
return()
function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var)
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_src "int main(void) { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_src "int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_src "__host__ int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_src " program test\n stop\n end program")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_src [=[
#ifndef __OBJC__
# error "Not an Objective-C compiler"
int main(void) { return 0; }]=])
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_src [=[
#ifndef __OBJC__
# error "Not an Objective-C++ compiler"
int main(void) { return 0; }]=])
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL ISPC)
+ elseif(_lang STREQUAL "ISPC")
set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }")
else()
message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.")
function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
if(NOT DEFINED "${_var}")
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_textual "C")
set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_textual "C++")
set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_textual "CUDA")
set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_textual "Fortran")
set(_lang_ext "F90")
- elseif(_lang STREQUAL ISPC)
+ elseif(_lang STREQUAL "ISPC")
set(_lang_textual "ISPC")
set(_lang_ext "ispc")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_textual "Objective-C")
set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_textual "Objective-C++")
set(_lang_ext "mm")
else()
function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
if(NOT DEFINED "${_var}")
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_textual "C")
set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_textual "C++")
set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_textual "CUDA")
set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_textual "Fortran")
set(_lang_ext "F90")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_textual "Objective-C")
set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_textual "Objective-C++")
set(_lang_ext "mm")
else()
if(NOT CMAKE_CROSSCOMPILING AND
CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
- CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64" AND
- CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
- # When building on Apple Silicon (arm64), we need to explicitly specify
+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm64|x86_64)$")
+ execute_process(COMMAND sysctl -q hw.optional.arm64
+ OUTPUT_VARIABLE _sysctl_stdout
+ ERROR_VARIABLE _sysctl_stderr
+ RESULT_VARIABLE _sysctl_result
+ )
+ # When building on an Apple Silicon host, we need to explicitly specify
# the architecture to the toolchain since it will otherwise guess the
# architecture based on that of the build system tool.
# Set an *internal variable* to tell the generators to do this.
- set(_CMAKE_APPLE_ARCHS_DEFAULT "arm64")
+ if(_sysctl_result EQUAL 0 AND _sysctl_stdout MATCHES "hw.optional.arm64: 1")
+ set(_CMAKE_APPLE_ARCHS_DEFAULT "${CMAKE_HOST_SYSTEM_PROCESSOR}")
+ endif()
+ unset(_sysctl_result)
+ unset(_sysctl_stderr)
+ unset(_sysctl_stdout)
endif()
# macOS, iOS, tvOS, and watchOS should lookup compilers from
unset(_apps_paths)
include(Platform/UnixPaths)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+ list(PREPEND CMAKE_SYSTEM_PREFIX_PATH
+ /opt/homebrew # Brew on Apple Silicon
+ )
+endif()
+
if(_CMAKE_OSX_SYSROOT_PATH)
if(EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 ${_CMAKE_OSX_SYSROOT_PATH}/usr)
set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
set (CMAKE_LINK_DEF_FILE_FLAG "-Xlinker /DEF:")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
+
if("${CMAKE_${lang}_SIMULATE_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)")
math(EXPR MSVC_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
endif()
enable_language(RC)
endmacro()
-macro(__enable_llvm_rc_preprocessing clang_option_prefix)
+macro(__enable_llvm_rc_preprocessing clang_option_prefix extra_pp_flags)
# Feed the preprocessed rc file to llvm-rc
if(CMAKE_RC_COMPILER_INIT MATCHES "llvm-rc" OR CMAKE_RC_COMPILER MATCHES "llvm-rc")
if(DEFINED CMAKE_C_COMPILER_ID)
endif()
if(DEFINED CMAKE_RC_PREPROCESSOR)
set(CMAKE_DEPFILE_FLAGS_RC "${clang_option_prefix}-MD ${clang_option_prefix}-MF ${clang_option_prefix}<DEPFILE>")
- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> /fo <OBJECT> <OBJECT>.pp")
+ set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> ${extra_pp_flags} -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> /fo <OBJECT> <OBJECT>.pp")
if(CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_NINJA_CMCLDEPS_RC 0)
set(CMAKE_NINJA_DEP_TYPE_RC gcc)
if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" )
include(Platform/Windows-MSVC)
# Set the clang option forwarding prefix for clang-cl usage in the llvm-rc processing stage
- __enable_llvm_rc_preprocessing("-clang:")
+ __enable_llvm_rc_preprocessing("-clang:" "")
macro(__windows_compiler_clang_base lang)
set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
__windows_compiler_msvc(${lang})
set(CMAKE_BUILD_TYPE_INIT Debug)
- __enable_llvm_rc_preprocessing("")
+ __enable_llvm_rc_preprocessing("" "-x c")
macro(__windows_compiler_clang_base lang)
__windows_compiler_clang_gnu(${lang})
endmacro()
else()
include(Platform/Windows-GNU)
- __enable_llvm_rc_preprocessing("")
+ __enable_llvm_rc_preprocessing("" "-x c")
macro(__windows_compiler_clang_base lang)
__windows_compiler_gnu(${lang})
endmacro()
# file Copyright.txt or https://cmake.org/licensing for details.
# To ensure maximum portability across various compilers and platforms
-# deactivate any compiler extensions
-set(CMAKE_C_EXTENSIONS FALSE)
-set(CMAKE_CXX_EXTENSIONS FALSE)
+# deactivate any compiler extensions. Skip this for QNX, where additional
+# work is needed to build without compiler extensions.
+if (NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ set(CMAKE_C_EXTENSIONS FALSE)
+ set(CMAKE_CXX_EXTENSIONS FALSE)
+endif()
include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 1)
+set(CMake_VERSION_PATCH 2)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info.
- set(git_info [==[64fb825438 CMake 3.19.1]==])
+ set(git_info [==[0932b1c2b2 CMake 3.19.2]==])
# Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
+
+// FIXME: Port to QFileSystemModel from the deprecated QDirModel.
+// Be sure completion works when incrementally editing existing paths.
+#define QT_DEPRECATED_WARNINGS_SINCE QT_VERSION_CHECK(5, 14, 0)
+
#include "QCMakeWidgets.h"
#include <utility>
+#include <QDirModel>
#include <QFileDialog>
#include <QFileInfo>
-#include <QFileSystemModel>
#include <QResizeEvent>
#include <QToolButton>
}
}
-// use same QFileSystemModel for all completers
-static QFileSystemModel* fileDirModel()
+// use same QDirModel for all completers
+static QDirModel* fileDirModel()
{
- static QFileSystemModel* m = nullptr;
+ static QDirModel* m = nullptr;
if (!m) {
- m = new QFileSystemModel();
+ m = new QDirModel();
}
return m;
}
-static QFileSystemModel* pathDirModel()
+static QDirModel* pathDirModel()
{
- static QFileSystemModel* m = nullptr;
+ static QDirModel* m = nullptr;
if (!m) {
- m = new QFileSystemModel();
+ m = new QDirModel();
m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot);
}
return m;
QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs)
: QCompleter(o)
{
- QFileSystemModel* m = dirs ? pathDirModel() : fileDirModel();
+ QDirModel* m = dirs ? pathDirModel() : fileDirModel();
this->setModel(m);
}
std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = "CMAKE_CUDA_RUNTIME_LIBRARY";
std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS";
std::string const kCMAKE_ISPC_INSTRUCTION_SETS = "CMAKE_ISPC_INSTRUCTION_SETS";
+std::string const kCMAKE_ISPC_HEADER_SUFFIX = "CMAKE_ISPC_HEADER_SUFFIX";
std::string const kCMAKE_LINK_SEARCH_END_STATIC =
"CMAKE_LINK_SEARCH_END_STATIC";
std::string const kCMAKE_LINK_SEARCH_START_STATIC =
vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY);
vars.insert(kCMAKE_ENABLE_EXPORTS);
vars.insert(kCMAKE_ISPC_INSTRUCTION_SETS);
+ vars.insert(kCMAKE_ISPC_HEADER_SUFFIX);
vars.insert(kCMAKE_LINK_SEARCH_END_STATIC);
vars.insert(kCMAKE_LINK_SEARCH_START_STATIC);
vars.insert(kCMAKE_OSX_ARCHITECTURES);
#include <cctype> /* isspace */
#include <cstdio>
#include <iostream>
+#include <map>
#include <memory>
#include <sstream>
+#include <utility>
#include <vector>
#include <cm/string_view>
}
}
- if (arguments.CommandErrorIsFatal == "ANY"_s) {
- if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) {
- std::vector<int> failedIndexes;
- for (int i = 0; i < static_cast<int>(arguments.Commands.size()); ++i) {
- if (cmsysProcess_GetStateByIndex(cp, i) ==
- kwsysProcess_StateByIndex_Exited) {
- int exitCode = cmsysProcess_GetExitValueByIndex(cp, i);
- if (exitCode) {
- failedIndexes.push_back(i);
- }
+ auto queryProcessStatusByIndex = [&cp](int index) -> std::string {
+ std::string processStatus;
+ switch (cmsysProcess_GetStateByIndex(cp, static_cast<int>(index))) {
+ case kwsysProcess_StateByIndex_Exited: {
+ int exitCode = cmsysProcess_GetExitValueByIndex(cp, index);
+ if (exitCode) {
+ processStatus = "Child return code: " + std::to_string(exitCode);
}
+ } break;
+ case kwsysProcess_StateByIndex_Exception: {
+ processStatus = cmStrCat(
+ "Abnormal exit with child return code: ",
+ cmsysProcess_GetExceptionStringByIndex(cp, static_cast<int>(index)));
+ break;
}
- if (!failedIndexes.empty()) {
- std::ostringstream oss;
- oss << "failed command indexes: ";
- for (auto i = 0u; i < failedIndexes.size(); i++) {
- if (i == failedIndexes.size() - 1) {
- oss << failedIndexes[i] + 1;
- } else {
- oss << failedIndexes[i] + 1 << ", ";
+ case kwsysProcess_StateByIndex_Error:
+ default:
+ processStatus = "Error getting the child return code";
+ break;
+ }
+ return processStatus;
+ };
+
+ if (arguments.CommandErrorIsFatal == "ANY"_s) {
+ bool ret = true;
+ switch (cmsysProcess_GetState(cp)) {
+ case cmsysProcess_State_Exited: {
+ std::map<int, std::string> failureIndices;
+ for (int i = 0; i < static_cast<int>(arguments.Commands.size()); ++i) {
+ std::string processStatus = queryProcessStatusByIndex(i);
+ if (!processStatus.empty()) {
+ failureIndices[i] = processStatus;
+ }
+ if (!failureIndices.empty()) {
+ std::ostringstream oss;
+ oss << "failed command indexes:\n";
+ for (auto const& e : failureIndices) {
+ oss << " " << e.first + 1 << ": \"" << e.second << "\"\n";
+ }
+ status.SetError(oss.str());
+ ret = false;
}
}
- status.SetError(oss.str());
- cmSystemTools::SetFatalErrorOccured();
- return false;
- }
+ } break;
+ case cmsysProcess_State_Exception:
+ status.SetError(
+ cmStrCat("abnormal exit: ", cmsysProcess_GetExceptionString(cp)));
+ ret = false;
+ break;
+ case cmsysProcess_State_Error:
+ status.SetError(cmStrCat("error getting child return code: ",
+ cmsysProcess_GetErrorString(cp)));
+ ret = false;
+ break;
+ case cmsysProcess_State_Expired:
+ status.SetError("Process terminated due to timeout");
+ ret = false;
+ break;
+ }
+
+ if (!ret) {
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
}
}
if (arguments.CommandErrorIsFatal == "LAST"_s) {
- if (cmsysProcess_GetState(cp) == cmsysProcess_State_Exited) {
- int lastIndex = static_cast<int>(arguments.Commands.size() - 1);
- if (cmsysProcess_GetStateByIndex(cp, lastIndex) ==
- kwsysProcess_StateByIndex_Exited) {
- int exitCode = cmsysProcess_GetExitValueByIndex(cp, lastIndex);
- if (exitCode) {
+ bool ret = true;
+ switch (cmsysProcess_GetState(cp)) {
+ case cmsysProcess_State_Exited: {
+ int lastIndex = static_cast<int>(arguments.Commands.size() - 1);
+ const std::string processStatus = queryProcessStatusByIndex(lastIndex);
+ if (!processStatus.empty()) {
status.SetError("last command failed");
- cmSystemTools::SetFatalErrorOccured();
- return false;
+ ret = false;
}
- }
+ } break;
+ case cmsysProcess_State_Exception:
+ status.SetError(
+ cmStrCat("Abnormal exit: ", cmsysProcess_GetExceptionString(cp)));
+ ret = false;
+ break;
+ case cmsysProcess_State_Error:
+ status.SetError(cmStrCat("Error getting child return code: ",
+ cmsysProcess_GetErrorString(cp)));
+ ret = false;
+ break;
+ case cmsysProcess_State_Expired:
+ status.SetError("Process terminated due to timeout");
+ ret = false;
+ break;
+ }
+ if (!ret) {
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
}
}
if (this->ExportSet) {
for (std::unique_ptr<cmTargetExport> const& te :
this->ExportSet->GetTargetExports()) {
+ if (te->NamelinkOnly) {
+ continue;
+ }
targets.push_back(te->TargetName);
}
return;
std::string sep;
for (std::unique_ptr<cmTargetExport> const& te :
this->IEGen->GetExportSet()->GetTargetExports()) {
+ if (te->NamelinkOnly) {
+ continue;
+ }
expectedTargets += sep + this->Namespace + te->Target->GetExportName();
sep = " ";
if (this->ExportedTargets.insert(te->Target).second) {
objects.push_back(map_it->second);
}
+ // We need to compute the relative path from the root of
+ // of the object directory to handle subdirectory paths
+ std::string rootObjectDir = this->GetObjectDirectory(config);
+ rootObjectDir = cmSystemTools::CollapseFullPath(rootObjectDir);
auto ispcObjects = this->GetGeneratedISPCObjects(config);
for (std::string const& output : ispcObjects) {
- objects.push_back(cmSystemTools::GetFilenameName(output));
+ auto relativePathFromObjectDir = output.substr(rootObjectDir.size());
+ objects.push_back(relativePathFromObjectDir);
}
}
this->CloseBuildFileStreams();
#ifdef _WIN32
- // The ninja tools will not be able to update metadata on Windows
+ // Older ninja tools will not be able to update metadata on Windows
// when we are re-generating inside an existing 'ninja' invocation
// because the outer tool has the files open for write.
- if (!this->GetCMakeInstance()->GetRegenerateDuringBuild())
+ if (this->NinjaSupportsMetadataOnRegeneration ||
+ !this->GetCMakeInstance()->GetRegenerateDuringBuild())
#endif
{
this->CleanMetaData();
// Skip some ninja tools if they need 'build.ninja' but it is missing.
bool const missingBuildManifest = expectBuildManifest &&
- (this->NinjaSupportsCleanDeadTool ||
- this->NinjaSupportsUnconditionalRecompactTool) &&
+ this->NinjaSupportsUnconditionalRecompactTool &&
!cmSystemTools::FileExists("build.ninja");
- // The `cleandead` tool needs to know about all outputs in the build we just
- // wrote out. Ninja-Multi doesn't have a single `build.ninja` we can use that
- // is the union of all generated configurations, so we can't run it reliably
- // in that case.
- if (this->NinjaSupportsCleanDeadTool && !this->DisableCleandead &&
- expectBuildManifest && !missingBuildManifest) {
- run_ninja_tool({ "cleandead" });
- }
// The `recompact` tool loads the manifest. As above, we don't have a single
// `build.ninja` to load for this in Ninja-Multi. This may be relaxed in the
// future pending further investigation into how Ninja works upstream
}
}
}
- this->NinjaSupportsCleanDeadTool = !cmSystemTools::VersionCompare(
- cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
- RequiredNinjaVersionForCleanDeadTool().c_str());
this->NinjaSupportsUnconditionalRecompactTool =
!cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
this->NinjaSupportsMultipleOutputs = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
RequiredNinjaVersionForMultipleOutputs().c_str());
+ this->NinjaSupportsMetadataOnRegeneration = !cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+ RequiredNinjaVersionForMetadataOnRegeneration().c_str());
}
bool cmGlobalNinjaGenerator::CheckLanguages(
{
return "1.10";
}
- static std::string RequiredNinjaVersionForCleanDeadTool() { return "1.10"; }
static std::string RequiredNinjaVersionForMultipleOutputs()
{
return "1.10";
}
+ static std::string RequiredNinjaVersionForMetadataOnRegeneration()
+ {
+ return "1.10.2";
+ }
bool SupportsConsolePool() const;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
bool NinjaSupportsDyndeps = false;
bool NinjaSupportsRestatTool = false;
bool NinjaSupportsUnconditionalRecompactTool = false;
- bool NinjaSupportsCleanDeadTool = false;
bool NinjaSupportsMultipleOutputs = false;
+ bool NinjaSupportsMetadataOnRegeneration = false;
private:
void InitOutputPathPrefix();
std::unique_ptr<cmInstallFilesGenerator> publicHeaderGenerator;
std::unique_ptr<cmInstallFilesGenerator> resourceGenerator;
+ // Avoid selecting default destinations for PUBLIC_HEADER and
+ // PRIVATE_HEADER if any artifacts are specified.
+ bool artifactsSpecified = false;
+
+ // Track whether this is a namelink-only rule.
+ bool namelinkOnly = false;
+
auto addTargetExport = [&]() {
// Add this install rule to an export if one was specified.
if (!exports.empty()) {
te->ObjectsGenerator = objectGenerator.get();
te->InterfaceIncludeDirectories =
cmJoin(includesArgs.GetIncludeDirs(), ";");
-
+ te->NamelinkOnly = namelinkOnly;
helper.Makefile->GetGlobalGenerator()
->GetExportSets()[exports]
.AddTargetExport(std::move(te));
}
};
- // Avoid selecting default destinations for PUBLIC_HEADER and
- // PRIVATE_HEADER if any artifacts are specified.
- bool artifactsSpecified = false;
-
- // Track whether this is a namelink-only rule.
- bool namelinkOnly = false;
-
switch (target.GetType()) {
case cmStateEnums::SHARED_LIBRARY: {
// Shared libraries are handled differently on DLL and non-DLL
if (target.IsDLLPlatform()) {
// When in namelink only mode skip all libraries on Windows.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
if (target.IsFrameworkOnApple()) {
// When in namelink only mode skip frameworks.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
if (target.IsFrameworkOnApple()) {
// When in namelink only mode skip frameworks.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
target->GetAppleArchs(config, archs);
if (!archs.empty() &&
(lang == "C" || lang == "CXX" || lang == "OBJ" || lang == "OBJCXX" ||
- cmHasLiteralPrefix(lang, "ASM"))) {
+ lang == "ASM")) {
for (std::string const& arch : archs) {
if (filterArch.empty() || filterArch == arch) {
flags += " -arch ";
this->AddConfigVariableFlags(flags, cmStrCat("CMAKE_", lang, "_FLAGS"),
config);
- std::string const& compiler = this->Makefile->GetSafeDefinition(
+ std::string compiler = this->Makefile->GetSafeDefinition(
cmStrCat("CMAKE_", lang, "_COMPILER_ID"));
+ std::string compilerSimulateId = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_SIMULATE_ID"));
if (lang == "Swift") {
if (cmProp v = target->GetProperty("Swift_LANGUAGE_VERSION")) {
if (cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL,
target->AddCUDAToolkitFlags(flags);
} else if (lang == "ISPC") {
target->AddISPCTargetFlags(flags);
+ } else if (lang == "RC" &&
+ this->Makefile->GetSafeDefinition("CMAKE_RC_COMPILER")
+ .find("llvm-rc") != std::string::npos) {
+ compiler = this->Makefile->GetSafeDefinition("CMAKE_C_COMPILER_ID");
+ if (!compiler.empty()) {
+ compilerSimulateId =
+ this->Makefile->GetSafeDefinition("CMAKE_C_SIMULATE_ID");
+ } else {
+ compiler = this->Makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_ID");
+ compilerSimulateId =
+ this->Makefile->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID");
+ }
}
+
// Add VFS Overlay for Clang compiliers
if (compiler == "Clang") {
if (cmProp vfsOverlay =
this->Makefile->GetDefinition("CMAKE_CLANG_VFS_OVERLAY")) {
- std::string const& compilerSimulateId =
- this->Makefile->GetSafeDefinition(
- cmStrCat("CMAKE_", lang, "_SIMULATE_ID"));
if (compilerSimulateId == "MSVC") {
this->AppendCompileOptions(
flags,
return;
}
- std::vector<std::string> ispcSuffixes =
+ cmProp ispcHeaderSuffixProp = target->GetProperty("ISPC_HEADER_SUFFIX");
+ assert(ispcHeaderSuffixProp != nullptr);
+
+ std::vector<std::string> ispcArchSuffixes =
detail::ComputeISPCObjectSuffixes(target);
- const bool extra_objects = (ispcSuffixes.size() > 1);
+ const bool extra_objects = (ispcArchSuffixes.size() > 1);
std::vector<std::string> configsList =
this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
for (std::string const& config : configsList) {
- std::string perConfigDir = target->GetObjectDirectory(config);
+ std::string rootObjectDir = target->GetObjectDirectory(config);
+ std::string headerDir = rootObjectDir;
if (cmProp prop = target->GetProperty("ISPC_HEADER_DIRECTORY")) {
- perConfigDir = cmSystemTools::CollapseFullPath(
+ headerDir = cmSystemTools::CollapseFullPath(
cmStrCat(this->GetBinaryDirectory(), '/', *prop));
}
const std::string& lang = sf->GetLanguage();
if (lang == "ISPC") {
std::string const& objectName = target->GetObjectName(sf);
+
+ // Drop both ".obj" and the source file extension
std::string ispcSource =
cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+ ispcSource =
+ cmSystemTools::GetFilenameWithoutLastExtension(ispcSource);
- auto headerPath = cmStrCat(perConfigDir, '/', ispcSource, ".h");
+ auto headerPath =
+ cmStrCat(headerDir, '/', ispcSource, *ispcHeaderSuffixProp);
target->AddISPCGeneratedHeader(headerPath, config);
if (extra_objects) {
std::vector<std::string> objs = detail::ComputeISPCExtraObjects(
- objectName, perConfigDir, ispcSuffixes);
+ objectName, rootObjectDir, ispcArchSuffixes);
target->AddISPCGeneratedObject(std::move(objs), config);
}
}
}
if (!useMultiArchPch.empty()) {
- target->Target->SetProperty(
- cmStrCat(lang, "_COMPILE_OPTIONS_USE_PCH"), useMultiArchPch);
+
+ target->Target->AppendProperty(
+ cmStrCat(lang, "_COMPILE_OPTIONS_USE_PCH"),
+ cmStrCat("$<$<CONFIG:", config, ">:", useMultiArchPch, ">"));
}
}
std::string const& objectName, std::string const& buildDirectory,
std::vector<std::string> const& ispcSuffixes)
{
+ auto normalizedDir = cmSystemTools::CollapseFullPath(buildDirectory);
std::vector<std::string> computedObjects;
computedObjects.reserve(ispcSuffixes.size());
auto extension = cmSystemTools::GetFilenameLastExtension(objectName);
- auto objNameNoExt =
- cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+
+ // We can't use cmSystemTools::GetFilenameWithoutLastExtension as it
+ // drops any directories in objectName
+ auto objNameNoExt = objectName;
+ std::string::size_type dot_pos = objectName.rfind('.');
+ if (dot_pos != std::string::npos) {
+ objNameNoExt.resize(dot_pos);
+ }
+
for (const auto& ispcTarget : ispcSuffixes) {
computedObjects.emplace_back(
- cmStrCat(buildDirectory, "/", objNameNoExt, "_", ispcTarget, extension));
+ cmStrCat(normalizedDir, "/", objNameNoExt, "_", ispcTarget, extension));
}
return computedObjects;
if (lang == "ISPC") {
std::string ispcSource =
cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+ ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource);
+
+ cmProp ispcSuffixProp =
+ this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX");
+ assert(ispcSuffixProp != nullptr);
std::string directory = this->GeneratorTarget->GetObjectDirectory(config);
if (cmProp prop =
directory =
cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop);
}
- ispcHeaderRelative = cmStrCat(directory, '/', ispcSource, ".h");
+ ispcHeaderRelative = cmStrCat(directory, '/', ispcSource, *ispcSuffixProp);
ispcHeaderForShell = this->LocalGenerator->ConvertToOutputFormat(
ispcHeaderRelative, cmOutputConverter::SHELL);
}
this->GeneratorTarget->GetObjectName(source);
std::string ispcSource =
cmSystemTools::GetFilenameWithoutLastExtension(objectName);
+ ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(ispcSource);
- std::string ispcDirectory = objectFileDir;
+ cmProp ispcSuffixProp =
+ this->GeneratorTarget->GetProperty("ISPC_HEADER_SUFFIX");
+ assert(ispcSuffixProp != nullptr);
+
+ std::string ispcHeaderDirectory =
+ this->GeneratorTarget->GetObjectDirectory(config);
if (cmProp prop =
this->GeneratorTarget->GetProperty("ISPC_HEADER_DIRECTORY")) {
- ispcDirectory = *prop;
+ ispcHeaderDirectory =
+ cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', *prop);
}
- ispcDirectory =
- cmStrCat(this->LocalGenerator->GetBinaryDirectory(), '/', ispcDirectory);
- std::string ispcHeader = cmStrCat(ispcDirectory, '/', ispcSource, ".h");
+ std::string ispcHeader =
+ cmStrCat(ispcHeaderDirectory, '/', ispcSource, *ispcSuffixProp);
ispcHeader = this->ConvertToNinjaPath(ispcHeader);
// Make sure ninja knows what command generates the header
auto ispcSuffixes =
detail::ComputeISPCObjectSuffixes(this->GeneratorTarget);
if (ispcSuffixes.size() > 1) {
+ std::string rootObjectDir =
+ this->GeneratorTarget->GetObjectDirectory(config);
auto ispcSideEfffectObjects = detail::ComputeISPCExtraObjects(
- objectName, ispcDirectory, ispcSuffixes);
+ objectName, rootObjectDir, ispcSuffixes);
for (auto sideEffect : ispcSideEfffectObjects) {
sideEffect = this->ConvertToNinjaPath(sideEffect);
initProp("JOB_POOL_PRECOMPILE_HEADER");
initProp("ISPC_COMPILER_LAUNCHER");
initProp("ISPC_HEADER_DIRECTORY");
+ initPropValue("ISPC_HEADER_SUFFIX", "_ispc.h");
initProp("ISPC_INSTRUCTION_SETS");
initProp("LINK_SEARCH_START_STATIC");
initProp("LINK_SEARCH_END_STATIC");
cmInstallFilesGenerator* HeaderGenerator;
std::string InterfaceIncludeDirectories;
///@}
+
+ bool NamelinkOnly = false;
};
this->CurrentSnapshot = this->State->Reset();
this->State->RemoveUserDefinedCommands();
this->CurrentSnapshot.SetDefaultDefinitions();
+ // FIXME: InstalledFiles probably belongs in the global generator.
+ this->InstalledFiles.clear();
}
#ifndef CMAKE_BOOTSTRAP
set(${reg} 0)
endif()
endforeach()
- if(COMMAND cmake_host_system_information)
+ if(CMAKE_HOST_WIN32 AND COMMAND cmake_host_system_information)
set(info_vs15 "VS_15_DIR")
set(info_vs16 "VS_16_DIR")
set(vs_versions)
endif()
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT DEFINED CMake_TEST_APPLE_SILICON)
+ execute_process(COMMAND sysctl -q hw.optional.arm64
+ OUTPUT_VARIABLE _sysctl_stdout
+ ERROR_VARIABLE _sysctl_stderr
+ RESULT_VARIABLE _sysctl_result
+ )
+ if(_sysctl_result EQUAL 0 AND _sysctl_stdout MATCHES "hw.optional.arm64: 1")
+ set(CMake_TEST_APPLE_SILICON 1)
+ else()
+ set(CMake_TEST_APPLE_SILICON 0)
+ endif()
+ unset(_sysctl_result)
+ unset(_sysctl_stderr)
+ unset(_sysctl_stdout)
+ endif()
+
#---------------------------------------------------------------------------
# Add tests below here.
set(CTEST_TEST_OSX_ARCH 0)
set(CMake_TEST_XCODE_VERSION 0)
if(APPLE)
- execute_process(
- COMMAND sw_vers -productVersion
- OUTPUT_VARIABLE OSX_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- if(OSX_VERSION VERSION_LESS 10.4)
- message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4")
- message(STATUS "OSX_VERSION='${OSX_VERSION}'")
- set(CTEST_TEST_CPACK OFF)
- else()
- set(CTEST_TEST_OSX_ARCH 1)
- endif()
+ set(CTEST_TEST_OSX_ARCH 1)
if(XCODE_VERSION)
set(CMake_TEST_XCODE_VERSION "${XCODE_VERSION}")
else()
)
endif()
- if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5
- AND OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
- set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>)
- set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_MATCH_1} -DCMAKE_OSX_SYSROOT=macosx)
- ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
+ if(CMake_TEST_XCODE_VERSION AND NOT CMake_TEST_XCODE_VERSION VERSION_LESS 5)
+ if(NOT CMake_TEST_XCTest_DEPLOYMENT_TARGET)
+ execute_process(
+ COMMAND sw_vers -productVersion
+ OUTPUT_VARIABLE OSX_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if(OSX_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
+ set(CMake_TEST_XCTest_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+ if(CMake_TEST_XCTest_DEPLOYMENT_TARGET)
+ set(XCTest_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+ set(XCTest_BUILD_OPTIONS -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMake_TEST_XCTest_DEPLOYMENT_TARGET} -DCMAKE_OSX_SYSROOT=macosx)
+ ADD_TEST_MACRO(XCTest ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> -V)
+ endif()
endif()
add_test(linkorder1 ${CMAKE_CTEST_COMMAND}
endif()
endif()
- find_package(Java COMPONENTS Development QUIET)
- if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW
- AND NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
+ if(NOT DEFINED CMake_TEST_Java)
+ if(APPLE OR MINGW)
+ set(CMake_TEST_Java 0)
+ else()
+ set(CMake_TEST_Java 1)
+ endif()
+ endif()
+ if(CMake_TEST_Java)
+ find_package(Java COMPONENTS Development QUIET)
+ endif()
+ if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE)
set(JavaExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
ADD_TEST_MACRO(JavaExportImport JavaExportImport)
endmacro ()
add_ispc_test_macro(ISPC.ChainedStaticLibraries ISPCChainedStaticLibraries)
+add_ispc_test_macro(ISPC.CustomHeaderSuffix ISPCCustomHeaderSuffix)
add_ispc_test_macro(ISPC.Defines ISPCDefines)
add_ispc_test_macro(ISPC.DynamicLibrary ISPCDynamicLibrary)
add_ispc_test_macro(ISPC.ObjectGenex ISPCObjectGenex)
add_ispc_test_macro(ISPC.ObjectLibrary ISPCObjectLibrary)
add_ispc_test_macro(ISPC.ResponseAndDefine ISPCResponseAndDefine)
add_ispc_test_macro(ISPC.StaticLibrary ISPCStaticLibrary)
+add_ispc_test_macro(ISPC.SystemIncludes ISPCSystemIncludes)
add_ispc_test_macro(ISPC.TryCompile ISPCTryCompile)
#include <stdio.h>
-#include "extra.ispc.h"
+#include "extra_ispc.h"
int extra()
{
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
int main()
{
--- /dev/null
+
+cmake_minimum_required(VERSION 3.18)
+project(ISPCCustomHeaderSuffix CXX ISPC)
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(CMAKE_ISPC_FLAGS "--arch=x86")
+endif()
+
+set(CMAKE_ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16")
+
+set(CMAKE_ISPC_HEADER_SUFFIX ".ispc.h")
+
+add_library(ispc_suffix_1 OBJECT simple.ispc)
+add_library(ispc_suffix_2 OBJECT extra.ispc)
+
+set_target_properties(ispc_suffix_2 PROPERTIES ISPC_HEADER_SUFFIX "___ispc.h")
+
+set_target_properties(ispc_suffix_1 ispc_suffix_2
+ PROPERTIES POSITION_INDEPENDENT_CODE ON
+)
+
+add_executable(ISPCCustomHeaderSuffix main.cxx extra.cxx)
+target_link_libraries(ISPCCustomHeaderSuffix PRIVATE ispc_suffix_1 ispc_suffix_2)
--- /dev/null
+#include <stdio.h>
+
+#include "extra___ispc.h"
+
+int extra()
+{
+ float vin[16], vout[16];
+ for (int i = 0; i < 16; ++i)
+ vin[i] = i;
+
+ ispc::extra(vin, vout, 16);
+
+ for (int i = 0; i < 16; ++i)
+ printf("%d: extra(%f) = %f\n", i, vin[i], vout[i]);
+
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+
+#include "simple.ispc.h"
+
+int main()
+{
+ float vin[16], vout[16];
+ for (int i = 0; i < 16; ++i)
+ vin[i] = i;
+
+ ispc::simple(vin, vout, 16);
+
+ for (int i = 0; i < 16; ++i)
+ printf("%d: simple(%f) = %f\n", i, vin[i], vout[i]);
+}
--- /dev/null
+
+export void simple(uniform float vin[], uniform float vout[],
+ uniform int count) {
+ foreach (index = 0 ... count) {
+ float v = vin[index];
+ if (v < 3.)
+ v = v * v;
+ else
+ v = sqrt(v);
+ vout[index] = v;
+ }
+}
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
int main()
{
#include <stdio.h>
-#include "extra.ispc.h"
+#include "extra_ispc.h"
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
endif()
-add_library(ispc_objects OBJECT simple.ispc extra.ispc)
+add_library(ispc_objects OBJECT simple.ispc subdir/extra.ispc)
set_target_properties(ispc_objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(ispc_objects PROPERTIES ISPC_INSTRUCTION_SETS "sse2-i32x4;sse4-i8x16")
#include <stdio.h>
-#include "extra.ispc.h"
+#include "extra_ispc.h"
int extra()
{
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
int main()
{
--- /dev/null
+
+export void extra(uniform float vin[], uniform float vout[],
+ uniform int count) {
+ foreach (index = 0 ... count) {
+ float v = vin[index];
+ if (v < 3.)
+ v = v * v;
+ else
+ v = sqrt(v);
+ vout[index] = v;
+ }
+}
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
int main()
{
#include <stdio.h>
-#include "simple.ispc.h"
+#include "simple_ispc.h"
int main()
{
--- /dev/null
+cmake_minimum_required(VERSION 3.18)
+project(ispc_spaces_in_path ISPC CXX)
+
+
+add_executable(ISPCSystemIncludes main.cxx simple.ispc)
+set_target_properties(ISPCSystemIncludes PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set_target_properties(ISPCSystemIncludes PROPERTIES ISPC_HEADER_SUFFIX ".ispc.h")
+target_include_directories(ISPCSystemIncludes SYSTEM PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
+
+
+target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>")
+if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>")
+endif()
--- /dev/null
+#include <stdio.h>
+
+#include "simple.ispc.h"
+
+int main()
+{
+ float vin[16], vout[16];
+ for (int i = 0; i < 16; ++i)
+ vin[i] = i;
+
+ ispc::simple(vin, vout, 16);
+
+ for (int i = 0; i < 16; ++i)
+ printf("%d: simple(%f) = %f\n", i, vin[i], vout[i]);
+}
--- /dev/null
+
+export void simple(uniform float vin[], uniform float vout[],
+ uniform int count) {
+ foreach (index = 0 ... count) {
+ float v = vin[index];
+ v = sqrt(v);
+ vout[index] = v;
+ }
+}
--- /dev/null
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
--- /dev/null
+include(RunCMake)
+
+# Isolate from caller's environment.
+set(ENV{CMAKE_APPLE_SILICON_PROCESSOR} "")
+set(ENV{CMAKE_OSX_ARCHITECTURES} "")
+
+function(run_arch case)
+ set(RunCMake_TEST_OPTIONS ${ARGN})
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${case}-build")
+ run_cmake(${case})
+ unset(RunCMake_TEST_OPTIONS)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+endfunction()
+
+run_arch(default)
+
+run_arch(arm64-var -DCMAKE_APPLE_SILICON_PROCESSOR=arm64)
+run_arch(x86_64-var -DCMAKE_APPLE_SILICON_PROCESSOR=x86_64)
+
+set(ENV{CMAKE_APPLE_SILICON_PROCESSOR} "arm64")
+run_arch(arm64-env)
+
+set(ENV{CMAKE_APPLE_SILICON_PROCESSOR} "x86_64")
+run_arch(x86_64-env)
+
+set(ENV{CMAKE_APPLE_SILICON_PROCESSOR} "")
--- /dev/null
+enable_language(C)
+
+if(NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
+ message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR is '${CMAKE_HOST_SYSTEM_PROCESSOR}', not 'arm64'")
+endif()
+if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
+ message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is '${CMAKE_OSX_ARCHITECTURES}', not empty ''")
+endif()
+
+add_library(arm64 arm64.c)
--- /dev/null
+include(arm64-common.cmake)
--- /dev/null
+include(arm64-common.cmake)
--- /dev/null
+#ifndef __aarch64__
+# error "Not compiling as arm64"
+#endif
+#ifdef __x86_64__
+# error "Incorrectly compiling as x86_64"
+#endif
+void arm64_arch(void)
+{
+}
--- /dev/null
+#if defined(HOST_ARM64)
+# if !defined(__aarch64__)
+# error "Not compiling as host arm64"
+# endif
+#elif defined(HOST_X86_64)
+# if !defined(__x86_64__)
+# error "Not compiling as host x86_64"
+# endif
+#else
+# error "One of HOST_ARM64 or HOST_X86_64 must be defined."
+#endif
+void default_arch(void)
+{
+}
--- /dev/null
+enable_language(C)
+
+if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
+ set(host_def HOST_ARM64)
+elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(host_def HOST_X86_64)
+else()
+ message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR is '${CMAKE_HOST_SYSTEM_PROCESSOR}', not 'arm64' or 'x86_64'")
+endif()
+if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
+ message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is '${CMAKE_OSX_ARCHITECTURES}', not empty ''")
+endif()
+
+add_library(default default.c)
+target_compile_definitions(default PRIVATE ${host_def})
--- /dev/null
+enable_language(C)
+
+if(NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR is '${CMAKE_HOST_SYSTEM_PROCESSOR}', not 'x86_64'")
+endif()
+if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "")
+ message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is '${CMAKE_OSX_ARCHITECTURES}', not empty ''")
+endif()
+
+add_library(x86_64 x86_64.c)
--- /dev/null
+include(x86_64-common.cmake)
--- /dev/null
+include(x86_64-common.cmake)
--- /dev/null
+#ifndef __x86_64__
+# error "Not compiling as x86_64"
+#endif
+#ifdef __aarch64__
+# error "Incorrectly compiling as arm64"
+#endif
+void x86_64_arch(void)
+{
+}
endif()
add_RunCMake_test(AndroidTestUtilities)
+if(CMake_TEST_APPLE_SILICON)
+ add_RunCMake_test(AppleSilicon)
+endif()
set(autogen_with_qt5 FALSE)
if(CMake_TEST_Qt5)
find_package(Qt5Widgets QUIET NO_MODULE)
add_RunCMake_test(add_test)
add_RunCMake_test(build_command)
add_executable(exit_code exit_code.c)
-set(execute_process_ARGS -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>)
+set(execute_process_ARGS
+ -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>
+ -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
+ )
if(NOT CMake_TEST_EXTERNAL_CMAKE)
list(APPEND execute_process_ARGS -DTEST_ENCODING_EXE=$<TARGET_FILE:testEncoding>)
endif()
add_RunCMake_test(target_include_directories)
add_RunCMake_test(target_sources)
add_RunCMake_test(CheckCompilerFlag -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
- -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
+ -DCMake_TEST_ISPC=${CMake_TEST_ISPC}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
add_RunCMake_test(CheckSourceCompiles -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
- -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
-add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+ -DCMake_TEST_ISPC=${CMake_TEST_ISPC}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
+add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
set_property(TEST RunCMake.CheckCompilerFlag
RunCMake.CheckSourceCompiles
RunCMake.CheckSourceRuns
enable_language (C)
include(CheckCompilerFlag)
+set(C 1) # test that this is tolerated
+
check_compiler_flag(C "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid C compile flag didn't fail.")
enable_language (CUDA)
include(CheckCompilerFlag)
+set(CUDA 1) # test that this is tolerated
+
check_compiler_flag(CUDA "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CUDA compile flag didn't fail.")
enable_language (CXX)
include(CheckCompilerFlag)
+set(CXX 1) # test that this is tolerated
+
check_compiler_flag(CXX "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CXX compile flag didn't fail.")
enable_language (Fortran)
include(CheckCompilerFlag)
+set(Fortran 1) # test that this is tolerated
+
check_compiler_flag(Fortran "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid Fortran compile flag didn't fail.")
enable_language (OBJC)
include(CheckCompilerFlag)
+set(OBJC 1) # test that this is tolerated
+
check_compiler_flag(OBJC "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid OBJC compile flag didn't fail.")
enable_language (OBJCXX)
include(CheckCompilerFlag)
+set(OBJCXX 1) # test that this is tolerated
+
check_compiler_flag(OBJCXX "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid OBJCXX compile flag didn't fail.")
enable_language (C)
include(CheckSourceCompiles)
+set(C 1) # test that this is tolerated
+
check_source_compiles(C "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid C source didn't fail.")
enable_language (CUDA)
include(CheckSourceCompiles)
+set(CUDA 1) # test that this is tolerated
+
check_source_compiles(CUDA "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CUDA source didn't fail.")
enable_language (CXX)
include(CheckSourceCompiles)
+set(CXX 1) # test that this is tolerated
+
check_source_compiles(CXX "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CXX source didn't fail.")
enable_language (Fortran)
include(CheckSourceCompiles)
+set(Fortran 1) # test that this is tolerated
+
check_source_compiles(Fortran [=[
PROGRAM TEST_HAVE_PRINT
PRINT *, 'Hello'
enable_language (OBJC)
include(CheckSourceCompiles)
+set(OBJC 1) # test that this is tolerated
+
check_source_compiles(OBJC [[
#import <Foundation/Foundation.h>
int main() {
enable_language (OBJCXX)
include(CheckSourceCompiles)
+set(OBJCXX 1) # test that this is tolerated
+
check_source_compiles(OBJCXX [[
#include <vector>
#import <Foundation/Foundation.h>
enable_language (C)
include(CheckSourceRuns)
+set(C 1) # test that this is tolerated
+
check_source_runs(C "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "C check_source_runs succeeded, but should have failed.")
enable_language (CUDA)
include(CheckSourceRuns)
+set(CUDA 1) # test that this is tolerated
+
check_source_runs(CUDA "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "CUDA check_source_runs succeeded, but should have failed.")
enable_language (CXX)
include(CheckSourceRuns)
+set(CXX 1) # test that this is tolerated
+
check_source_runs(CXX "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "CXX check_source_runs succeeded, but should have failed.")
enable_language (Fortran)
include(CheckSourceRuns)
+set(Fortran 1) # test that this is tolerated
+
check_source_runs(Fortran [=[
PROGRAM TEST_HAVE_PRINT
PRINT *, 'Hello'
enable_language (OBJC)
include(CheckSourceRuns)
+set(OBJC 1) # test that this is tolerated
+
check_source_runs(OBJC [[
#import <Foundation/Foundation.h>
int main() {
enable_language (OBJCXX)
include(CheckSourceRuns)
+set(OBJCXX 1) # test that this is tolerated
+
check_source_runs(OBJCXX [[
#include <vector>
#import <Foundation/Foundation.h>
"|Please obtain a new version at"
"|contact PGI Sales at"
+ "|[^\n]*install_name_tool: warning: changes being made to the file will invalidate the code signature in:"
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|[^\n]*objc[^\n]*: Class AMSupportURL[^\n]* One of the two will be used. Which one is undefined."
"|[^\n]*is a member of multiple groups"
include(WriteBasicConfigVersionFile)
-set(_compatibilities AnyNewerVersion
- SameMajorVersion
- SameMinorVersion
- ExactVersion)
+set(COMPATIBILITIES AnyNewerVersion
+ SameMajorVersion
+ SameMinorVersion
+ ExactVersion)
function(TEST_WRITE_BASIC_CONFIG_VERSION_FILE_PREPARE _version_installed)
set(_same_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(_no_CMAKE_SIZEOF_VOID_P "")
math(EXPR _diff_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P} + 1")
- foreach(_compat ${_compatibilities})
+ foreach(_compat ${COMPATIBILITIES})
set(_pkg ${_compat}${_version_installed})
string(REPLACE "." "" _pkg ${_pkg})
set(_filename "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}ConfigVersion.cmake")
_expected_compatible_SameMajorVersion
_expected_compatible_SameMinorVersion
_expected_compatible_ExactVersion)
- set(PACKAGE_FIND_VERSION ${_version_requested})
- if("${PACKAGE_FIND_VERSION}" MATCHES [[(^([0-9]+)(\.([0-9]+)(\.([0-9]+)(\.([0-9]+))?)?)?)?$]])
- set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_2}")
- set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_4}")
- set(PACKAGE_FIND_VERSION_PATCH "${CMAKE_MATCH_6}")
- set(PACKAGE_FIND_VERSION_TWEAK "${CMAKE_MATCH_8}")
- else()
- message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version number")
- endif()
-
- if ("${_version_installed}" STREQUAL "${_version_requested}")
- set(_expected_exact 1)
- else()
+ if("${_version_requested}" MATCHES [[^([0-9]+(\.[0-9]+)*)\.\.\.(<)?([0-9]+(\.[0-9]+)*)$]])
+ set (_compatibilities ${COMPATIBILITIES})
+ # ExactVersion must not be tested
+ list(POP_BACK _compatibilities)
+ set(PACKAGE_FIND_VERSION_RANGE TRUE)
+ set(PACKAGE_FIND_VERSION_RANGE_MIN INCLUDE)
+ if ("${CMAKE_MATCH_3}" STREQUAL "<")
+ set(PACKAGE_FIND_VERSION_RANGE_MAX EXCLUDE)
+ else()
+ set(PACKAGE_FIND_VERSION_RANGE_MAX INCLUDE)
+ endif()
+ set(PACKAGE_FIND_VERSION_MIN "${CMAKE_MATCH_1}")
+ set(PACKAGE_FIND_VERSION_MAX "${CMAKE_MATCH_4}")
+ if("${PACKAGE_FIND_VERSION_MIN}" MATCHES [[(^([0-9]+)(\.([0-9]+)(\.([0-9]+)(\.([0-9]+))?)?)?)?$]])
+ set(PACKAGE_FIND_VERSION_MIN_MAJOR "${CMAKE_MATCH_2}")
+ set(PACKAGE_FIND_VERSION_MIN_MINOR "${CMAKE_MATCH_4}")
+ set(PACKAGE_FIND_VERSION_MIN_PATCH "${CMAKE_MATCH_6}")
+ set(PACKAGE_FIND_VERSION_MIN_TWEAK "${CMAKE_MATCH_8}")
+ else()
+ message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version range")
+ endif()
+ set(PACKAGE_FIND_VERSION "${PACKAGE_FIND_VERSION_MIN}")
+ set(PACKAGE_FIND_VERSION_MAJOR "${PACKAGE_FIND_VERSION_MIN_MAJOR}")
+ set(PACKAGE_FIND_VERSION_MINOR "${PACKAGE_FIND_VERSION_MIN_MINOR}")
+ set(PACKAGE_FIND_VERSION_PATCH "${PACKAGE_FIND_VERSION_MIN_PATCH}")
+ set(PACKAGE_FIND_VERSION_TWEAK "${PACKAGE_FIND_VERSION_MIN_TWEAK}")
+ if("${PACKAGE_FIND_VERSION_MAX}" MATCHES [[(^([0-9]+)(\.([0-9]+)(\.([0-9]+)(\.([0-9]+))?)?)?)?$]])
+ set(PACKAGE_FIND_VERSION_MAX_MAJOR "${CMAKE_MATCH_2}")
+ set(PACKAGE_FIND_VERSION_MAX_MINOR "${CMAKE_MATCH_4}")
+ set(PACKAGE_FIND_VERSION_MAX_PATCH "${CMAKE_MATCH_6}")
+ set(PACKAGE_FIND_VERSION_MAX_TWEAK "${CMAKE_MATCH_8}")
+ else()
+ message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version range")
+ endif()
set(_expected_exact 0)
+ else()
+ set (_compatibilities ${COMPATIBILITIES})
+ set(PACKAGE_FIND_VERSION ${_version_requested})
+ if("${PACKAGE_FIND_VERSION}" MATCHES [[(^([0-9]+)(\.([0-9]+)(\.([0-9]+)(\.([0-9]+))?)?)?)?$]])
+ set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_2}")
+ set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_4}")
+ set(PACKAGE_FIND_VERSION_PATCH "${CMAKE_MATCH_6}")
+ set(PACKAGE_FIND_VERSION_TWEAK "${CMAKE_MATCH_8}")
+ else()
+ message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version number")
+ endif()
+
+ if ("${_version_installed}" STREQUAL "${_version_requested}")
+ set(_expected_exact 1)
+ else()
+ set(_expected_exact 0)
+ endif()
endif()
unset(PACKAGE_VERSION_COMPATIBLE)
test_write_basic_config_version_file(4.5.6.7 9.9.9.2 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[older tweak]
test_write_basic_config_version_file(4.5.6.7 9.9.9.7 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[same tweak]
test_write_basic_config_version_file(4.5.6.7 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
+
+test_write_basic_config_version_file(4 0...5 1 0 0 0)
+test_write_basic_config_version_file(4 2...5 1 0 0 0)
+test_write_basic_config_version_file(4 2...4 1 0 0 0)
+test_write_basic_config_version_file(4 4...<5 1 1 0 0)
+test_write_basic_config_version_file(4 9...10 0 0 0 0)
+
+test_write_basic_config_version_file(4 0.1...5 1 0 0 0)
+test_write_basic_config_version_file(4 2.1...5 1 0 0 0)
+test_write_basic_config_version_file(4 2.8...5 1 0 0 0)
+test_write_basic_config_version_file(4 2.1...4 1 0 0 0)
+test_write_basic_config_version_file(4 2.8...4 1 0 0 0)
+test_write_basic_config_version_file(4 4.0...<5 1 1 0 0)
+test_write_basic_config_version_file(4 4.8...<5 0 0 0 0)
+test_write_basic_config_version_file(4 4.1...5 0 0 0 0)
+test_write_basic_config_version_file(4 4.8...5 0 0 0 0)
+test_write_basic_config_version_file(4 9.1...10 0 0 0 0)
+test_write_basic_config_version_file(4 9.8...10 0 0 0 0)
+
+
+test_write_basic_config_version_file(4.5 0.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5 2.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5 2.8...5 1 0 0 0)
+test_write_basic_config_version_file(4.5 2.1...4 0 0 0 0)
+test_write_basic_config_version_file(4.5 2.8...4 0 0 0 0)
+test_write_basic_config_version_file(4.5 2.8...4.8 1 0 0 0)
+test_write_basic_config_version_file(4.5 4.1...<5 1 1 0 0)
+test_write_basic_config_version_file(4.5 4.8...<5 0 0 0 0)
+test_write_basic_config_version_file(4.5 4.5...4.5.8 1 1 1 0)
+test_write_basic_config_version_file(4.5 4.5...<4.6 1 1 1 0)
+test_write_basic_config_version_file(4.5 4.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5 4.8...5 0 0 0 0)
+test_write_basic_config_version_file(4.5 9.1...10 0 0 0 0)
+test_write_basic_config_version_file(4.5 9.8...10 0 0 0 0)
+
+
+test_write_basic_config_version_file(4.5.6 0.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5.6 2.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5.6 2.8...5 1 0 0 0)
+test_write_basic_config_version_file(4.5.6 2.1...4 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 2.8...4 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 2.8...4.8 1 0 0 0)
+test_write_basic_config_version_file(4.5.6 4.1...<5 1 1 0 0)
+test_write_basic_config_version_file(4.5.6 4.8...<5 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 4.5...4.5.4 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 4.5...4.5.8 1 1 1 0)
+test_write_basic_config_version_file(4.5.6 4.5...<4.6 1 1 1 0)
+test_write_basic_config_version_file(4.5.6 4.1...5 1 0 0 0)
+test_write_basic_config_version_file(4.5.6 4.8...5 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 9.1...10 0 0 0 0)
+test_write_basic_config_version_file(4.5.6 9.8...10 0 0 0 0)
--- /dev/null
+CMake Error at .*AnyCommandAbnormalExit.cmake:[0-9]+ \(execute_process\):
+ execute_process failed command indexes:
+
+ 1: "Abnormal exit with child return code: Segmentation fault
--- /dev/null
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
+ "import os; os.kill(os.getpid(),11)"
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND_ERROR_IS_FATAL ANY
+ )
CMake Error at .*AnyCommandError.cmake:1 \(execute_process\):
- execute_process failed command indexes: 2, 3, 4
+ execute_process failed command indexes:
+
+ 2: "Child return code: 1"
+ 3: "Child return code: 1"
execute_process(COMMAND ${CMAKE_COMMAND} -E true
- COMMAND ${CMAKE_COMMAND} -E false
- COMMAND ${CMAKE_COMMAND} -E false
- COMMAND ${CMAKE_COMMAND} -E false
- COMMAND ${CMAKE_COMMAND} -E true
- COMMAND ${CMAKE_COMMAND} -E true
- COMMAND_ERROR_IS_FATAL ANY
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND_ERROR_IS_FATAL ANY
)
--- /dev/null
+execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND_ERROR_IS_FATAL ANY
+ )
--- /dev/null
+CMake Error at .*AnyCommandTimeout.cmake:9 \(execute_process\):
+ execute_process Process terminated due to timeout
--- /dev/null
+execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E sleep 10
+ COMMAND ${CMAKE_COMMAND} -E true
+ TIMEOUT 1
+ RESULT_VARIABLE result
+)
+
+if(NOT result EQUAL "0")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E sleep 10
+ COMMAND ${CMAKE_COMMAND} -E true
+ TIMEOUT 1
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+endif()
--- /dev/null
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
+ "import os; os.kill(os.getpid(),11)"
+ COMMAND ${CMAKE_COMMAND} -E true
+ RESULT_VARIABLE result
+ )
+
+if(result EQUAL "0")
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
+ "import os; os.kill(os.getpid(),11)"
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND_ERROR_IS_FATAL LAST
+ )
+endif()
--- /dev/null
+CMake Error at .*LastCommandAbnormalExit-2.cmake:[0-9]+ \(execute_process\):
+ execute_process Abnormal exit: Segmentation fault
--- /dev/null
+execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND "${PYTHON_EXECUTABLE}" -c
+ "import os; os.kill(os.getpid(),11)"
+ RESULT_VARIABLE result
+ )
+
+if(NOT result EQUAL "0")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND "${PYTHON_EXECUTABLE}" -c
+ "import os; os.kill(os.getpid(),11)"
+ COMMAND_ERROR_IS_FATAL LAST
+ )
+endif()
-CMake Error at .*LastCommandError.cmake:1 \(execute_process\):
+CMake Error at .*LastCommandError.cmake:11 \(execute_process\):
execute_process last command failed
execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E false
+ RESULT_VARIABLE result
+)
+
+if(NOT result EQUAL "0")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E true
COMMAND ${CMAKE_COMMAND} -E false
COMMAND ${CMAKE_COMMAND} -E false
COMMAND ${CMAKE_COMMAND} -E false
COMMAND ${CMAKE_COMMAND} -E true
COMMAND ${CMAKE_COMMAND} -E false
COMMAND_ERROR_IS_FATAL LAST
-)
+ )
+endif()
--- /dev/null
+execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E true
+ RESULT_VARIABLE result
+ )
+
+if(result EQUAL "0")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E false
+ COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND_ERROR_IS_FATAL LAST
+ )
+endif()
--- /dev/null
+CMake Error at .*LastCommandTimeout.cmake:9 \(execute_process\):
+ execute_process Process terminated due to timeout
--- /dev/null
+execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E sleep 10
+ COMMAND ${CMAKE_COMMAND} -E true
+ TIMEOUT 1
+ RESULT_VARIABLE result
+)
+
+if(NOT result EQUAL "0")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E true
+ COMMAND ${CMAKE_COMMAND} -E sleep 10
+ COMMAND ${CMAKE_COMMAND} -E true
+ TIMEOUT 1
+ COMMAND_ERROR_IS_FATAL LAST
+ )
+endif()
run_cmake_command(EchoVariable ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/EchoVariable.cmake)
+run_cmake_command(CommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/CommandError.cmake)
run_cmake_command(AnyCommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/AnyCommandError.cmake)
+run_cmake_command(AnyCommandTimeout ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/AnyCommandTimeout.cmake)
+run_cmake_command(AnyCommandGood ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/AnyCommandGood.cmake)
run_cmake_command(LastCommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandError.cmake)
-run_cmake_command(CommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/CommandError.cmake)
+run_cmake_command(LastCommandTimeout ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandTimeout.cmake)
+run_cmake_command(LastCommandGood ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandGood.cmake)
+
+if(UNIX AND PYTHON_EXECUTABLE)
+ run_cmake_command(AnyCommandAbnormalExit ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/AnyCommandAbnormalExit.cmake)
+ run_cmake_command(LastCommandAbnormalExit-1 ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-1.cmake)
+ run_cmake_command(LastCommandAbnormalExit-2 ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -P ${RunCMake_SOURCE_DIR}/LastCommandAbnormalExit-2.cmake)
+endif()
run_cmake(DependOnDoubleExport)
run_cmake(UnknownExport)
run_cmake(NamelinkOnlyExport)
+run_cmake(SeparateNamelinkExport)
--- /dev/null
+enable_language(CXX)
+add_library(foo SHARED empty.cpp)
+install(TARGETS foo EXPORT fooExport
+ RUNTIME DESTINATION bin
+ LIBRARY
+ DESTINATION lib
+ COMPONENT runtime
+ NAMELINK_SKIP
+)
+install(TARGETS foo EXPORT fooExport
+ LIBRARY
+ DESTINATION lib
+ COMPONENT development
+ NAMELINK_ONLY
+)
+export(EXPORT fooExport FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake")
--- /dev/null
+enable_language(C)
+add_library(foo SHARED empty.c)
+install(TARGETS foo EXPORT fooExport
+ RUNTIME DESTINATION bin
+ LIBRARY
+ DESTINATION lib
+ COMPONENT runtime
+ NAMELINK_SKIP
+)
+install(TARGETS foo EXPORT fooExport
+ LIBRARY
+ DESTINATION lib
+ COMPONENT development
+ NAMELINK_ONLY
+)
+install(EXPORT fooExport
+ DESTINATION "lib/cmake/"
+ FILE "foo.cmake"
+)
run_cmake(EXPORT-OldIFace)
run_cmake(EXPORT-UnknownExport)
run_cmake(EXPORT-NamelinkOnly)
+run_cmake(EXPORT-SeparateNamelink)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)
argument specifying either ``x86_64`` or ``i386``.
.. _`kitware/cmake Docker Hub Repository`: https://hub.docker.com/r/kitware/cmake
+
+macOS
+-----
+
+The ``macos/`` directory contains scripts used to produce dependencies
+for building CMake binaries on macOS.
--- /dev/null
+#!/usr/bin/env bash
+
+# Run this script on a macOS x86_64 host to generate Qt universal binaries.
+#
+# This script requires the 'makeuniversal' tool from:
+#
+# https://github.com/fizzyade/makeuniversal
+#
+# Build it with an existing local Qt installation first.
+#
+# Set the PATH environment variable to contain the location of 'makeuniversal'.
+
+set -e
+set -x
+
+# Verify that 'makeuniversal' is available in the PATH.
+type -p makeuniversal >/dev/null
+
+# Download, verify, and extract sources.
+curl -OL https://download.qt.io/archive/qt/5.9/5.9.9/single/qt-everywhere-opensource-src-5.9.9.tar.xz
+shasum -a 256 qt-everywhere-opensource-src-5.9.9.tar.xz | grep -q 5ce285209290a157d7f42ec8eb22bf3f1d76f2e03a95fc0b99b553391be01642
+tar xjf qt-everywhere-opensource-src-5.9.9.tar.xz
+patch -p0 < "${BASH_SOURCE%/*}/qt-5.9.9.patch"
+
+# Build the x86_64 variant.
+mkdir qt-5.9.9-x86_64
+cd qt-5.9.9-x86_64
+../qt-everywhere-opensource-src-5.9.9/configure \
+ --prefix=/ \
+ -platform macx-clang \
+ -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 \
+ -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \
+ -release \
+ -opensource -confirm-license \
+ -gui \
+ -widgets \
+ -no-gif \
+ -no-icu \
+ -no-pch \
+ -no-angle \
+ -no-opengl \
+ -no-dbus \
+ -no-harfbuzz \
+ -skip declarative \
+ -skip multimedia \
+ -skip qtcanvas3d \
+ -skip qtcharts \
+ -skip qtconnectivity \
+ -skip qtdeclarative \
+ -skip qtgamepad \
+ -skip qtlocation \
+ -skip qtmultimedia \
+ -skip qtnetworkauth \
+ -skip qtpurchasing \
+ -skip qtremoteobjects \
+ -skip qtscript \
+ -skip qtsensors \
+ -skip qtserialbus \
+ -skip qtserialport \
+ -skip qtsvg \
+ -skip qtwebchannel \
+ -skip qtwebengine \
+ -skip qtwebsockets \
+ -skip qtxmlpatterns \
+ -nomake examples \
+ -nomake tests \
+ -nomake tools
+make -j 8
+cd ..
+
+# Build the arm64 variant.
+mkdir qt-5.9.9-arm64
+cd qt-5.9.9-arm64
+../qt-everywhere-opensource-src-5.9.9/configure \
+ --prefix=/ \
+ -platform macx-clang \
+ -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 \
+ -device-option QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 \
+ -release \
+ -opensource -confirm-license \
+ -gui \
+ -widgets \
+ -no-gif \
+ -no-icu \
+ -no-pch \
+ -no-angle \
+ -no-opengl \
+ -no-dbus \
+ -no-harfbuzz \
+ -skip declarative \
+ -skip multimedia \
+ -skip qtcanvas3d \
+ -skip qtcharts \
+ -skip qtconnectivity \
+ -skip qtdeclarative \
+ -skip qtgamepad \
+ -skip qtlocation \
+ -skip qtmultimedia \
+ -skip qtnetworkauth \
+ -skip qtpurchasing \
+ -skip qtremoteobjects \
+ -skip qtscript \
+ -skip qtsensors \
+ -skip qtserialbus \
+ -skip qtserialport \
+ -skip qtsvg \
+ -skip qtwebchannel \
+ -skip qtwebengine \
+ -skip qtwebsockets \
+ -skip qtxmlpatterns \
+ -nomake examples \
+ -nomake tests \
+ -nomake tools
+# Some executables fail to link due to architecture mismatch.
+# Build what we can first.
+make -j 8 -k || true
+# Provide needed executables using the x86_64 variants.
+cp ../qt-5.9.9-x86_64/qtbase/bin/uic qtbase/bin/uic
+install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/uic
+cp ../qt-5.9.9-x86_64/qtbase/bin/qlalr qtbase/bin/qlalr
+install_name_tool -add_rpath @executable_path/../../../qt-5.9.9-x86_64/qtbase/lib qtbase/bin/qlalr
+# Some parts still fail to build, but the parts we need can finish.
+make -j 8 -k || true
+cd ..
+
+# Combine the two builds into universal binaries.
+makeuniversal qt-5.9.9-univ qt-5.9.9-x86_64 qt-5.9.9-arm64
+cd qt-5.9.9-univ
+make install -j 8 INSTALL_ROOT=/tmp/qt-5.9.9-macosx10.10-x86_64-arm64
+cd ..
+
+# Create the final tarball containing universal binaries.
+tar cjf qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz -C /tmp qt-5.9.9-macosx10.10-x86_64-arm64
--- /dev/null
+--- qt-everywhere-opensource-src-5.9.9/qtbase/mkspecs/features/mac/default_post.prf.orig 2019-12-03 07:50:08.000000000 -0500
++++ qt-everywhere-opensource-src-5.9.9/qtbase/mkspecs/features/mac/default_post.prf 2020-12-14 09:45:11.000000000 -0500
+@@ -130,7 +130,7 @@
+ -isysroot$$xcodeSDKInfo(Path, $$sdk)
+ QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
+ -Xarch_$${arch} \
+- -Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
++ -isysroot$$xcodeSDKInfo(Path, $$sdk)
+
+ QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
+ QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
+@@ -151,7 +151,7 @@
+ version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+ QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+ QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+- QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
++ QMAKE_LFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+ }
+
+ # Enable precompiled headers for multiple architectures