codekingpro commited on
Commit
47993d5
·
verified ·
1 Parent(s): 2a504a6

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. cmake/bin/vcruntime140_1.dll +0 -0
  2. cmake/share/aclocal/cmake.m4 +44 -0
  3. cmake/share/cmake-3.31/Help/index.rst +109 -0
  4. cmake/share/cmake-3.31/Licenses/LGPLv3.txt +165 -0
  5. cmake/share/cmake-3.31/Modules/AddFileDependencies.cmake +33 -0
  6. cmake/share/cmake-3.31/Modules/AndroidTestUtilities.cmake +165 -0
  7. cmake/share/cmake-3.31/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake +176 -0
  8. cmake/share/cmake-3.31/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in +32 -0
  9. cmake/share/cmake-3.31/Modules/BasicConfigVersion-ExactVersion.cmake.in +72 -0
  10. cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMajorVersion.cmake.in +54 -0
  11. cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMinorVersion.cmake.in +74 -0
  12. cmake/share/cmake-3.31/Modules/BundleUtilities.cmake +1131 -0
  13. cmake/share/cmake-3.31/Modules/CMake.cmake +7 -0
  14. cmake/share/cmake-3.31/Modules/CMakeASM-ATTInformation.cmake +15 -0
  15. cmake/share/cmake-3.31/Modules/CMakeASMCompiler.cmake.in +28 -0
  16. cmake/share/cmake-3.31/Modules/CMakeASMInformation.cmake +101 -0
  17. cmake/share/cmake-3.31/Modules/CMakeASM_MARMASMInformation.cmake +25 -0
  18. cmake/share/cmake-3.31/Modules/CMakeASM_MASMInformation.cmake +25 -0
  19. cmake/share/cmake-3.31/Modules/CMakeASM_NASMInformation.cmake +66 -0
  20. cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory.cmake +194 -0
  21. cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in +2 -0
  22. cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in +9 -0
  23. cmake/share/cmake-3.31/Modules/CMakeAddNewLanguage.txt +39 -0
  24. cmake/share/cmake-3.31/Modules/CMakeBackwardCompatibilityC.cmake +76 -0
  25. cmake/share/cmake-3.31/Modules/CMakeBackwardCompatibilityCXX.cmake +49 -0
  26. cmake/share/cmake-3.31/Modules/CMakeBorlandFindMake.cmake +7 -0
  27. cmake/share/cmake-3.31/Modules/CMakeBuildSettings.cmake.in +13 -0
  28. cmake/share/cmake-3.31/Modules/CMakeCCompiler.cmake.in +81 -0
  29. cmake/share/cmake-3.31/Modules/CMakeCCompilerABI.c +28 -0
  30. cmake/share/cmake-3.31/Modules/CMakeCCompilerId.c.in +116 -0
  31. cmake/share/cmake-3.31/Modules/CMakeCInformation.cmake +180 -0
  32. cmake/share/cmake-3.31/Modules/CMakeCSharpCompiler.cmake.in +10 -0
  33. cmake/share/cmake-3.31/Modules/CMakeCSharpCompilerId.cs.in +71 -0
  34. cmake/share/cmake-3.31/Modules/CMakeCSharpInformation.cmake +70 -0
  35. cmake/share/cmake-3.31/Modules/CMakeCUDACompiler.cmake.in +87 -0
  36. cmake/share/cmake-3.31/Modules/CMakeCUDACompilerABI.cu +26 -0
  37. cmake/share/cmake-3.31/Modules/CMakeCUDACompilerId.cu.in +110 -0
  38. cmake/share/cmake-3.31/Modules/CMakeCUDAInformation.cmake +155 -0
  39. cmake/share/cmake-3.31/Modules/CMakeCXXCompiler.cmake.in +97 -0
  40. cmake/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp +18 -0
  41. cmake/share/cmake-3.31/Modules/CMakeCXXCompilerId.cpp.in +146 -0
  42. cmake/share/cmake-3.31/Modules/CMakeCXXInformation.cmake +188 -0
  43. cmake/share/cmake-3.31/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake +37 -0
  44. cmake/share/cmake-3.31/Modules/CMakeCommonLanguageInclude.cmake +123 -0
  45. cmake/share/cmake-3.31/Modules/CMakeCompilerABI.h +45 -0
  46. cmake/share/cmake-3.31/Modules/CMakeCompilerCUDAArch.h +29 -0
  47. cmake/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake +162 -0
  48. cmake/share/cmake-3.31/Modules/CMakeConfigurableFile.in +1 -0
  49. cmake/share/cmake-3.31/Modules/CMakeDependentOption.cmake +92 -0
  50. cmake/share/cmake-3.31/Modules/CMakeDetermineASM-ATTCompiler.cmake +10 -0
cmake/bin/vcruntime140_1.dll ADDED
Binary file (49.8 kB). View file
 
cmake/share/aclocal/cmake.m4 ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dnl Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ dnl file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ AC_DEFUN([CMAKE_FIND_BINARY],
5
+ [AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
6
+
7
+ if test "x$ac_cv_env_CMAKE_BINARY_set" != "xset"; then
8
+ AC_PATH_TOOL([CMAKE_BINARY], [cmake])dnl
9
+ fi
10
+ ])dnl
11
+
12
+ # $1: package name
13
+ # $2: language (e.g. C/CXX/Fortran)
14
+ # $3: The compiler ID, defaults to GNU.
15
+ # Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
16
+ # PathScale, Cray, SCO, MSVC, LCC
17
+ # $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
18
+ # $5: optional path to cmake binary
19
+ AC_DEFUN([CMAKE_FIND_PACKAGE], [
20
+ AC_REQUIRE([CMAKE_FIND_BINARY])dnl
21
+
22
+ AC_ARG_VAR([$1][_][$2][FLAGS], [$2 compiler flags for $1. This overrides the cmake output])dnl
23
+ AC_ARG_VAR([$1][_LIBS], [linker flags for $1. This overrides the cmake output])dnl
24
+
25
+ failed=false
26
+ AC_MSG_CHECKING([for $1])
27
+ if test -z "${$1[]_$2[]FLAGS}"; then
28
+ $1[]_$2[]FLAGS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=COMPILE $4` || failed=true
29
+ fi
30
+ if test -z "${$1[]_LIBS}"; then
31
+ $1[]_LIBS=`$CMAKE_BINARY --find-package "-DNAME=$1" "-DCOMPILER_ID=m4_default([$3], [GNU])" "-DLANGUAGE=$2" -DMODE=LINK $4` || failed=true
32
+ fi
33
+
34
+ if $failed; then
35
+ unset $1[]_$2[]FLAGS
36
+ unset $1[]_LIBS
37
+
38
+ AC_MSG_RESULT([no])
39
+ $6
40
+ else
41
+ AC_MSG_RESULT([yes])
42
+ $5
43
+ fi[]dnl
44
+ ])
cmake/share/cmake-3.31/Help/index.rst ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .. title:: CMake Reference Documentation
2
+
3
+ Introduction
4
+ ############
5
+
6
+ CMake is a tool to manage building of source code. Originally, CMake was
7
+ designed as a generator for various dialects of ``Makefile``, today
8
+ CMake generates modern buildsystems such as ``Ninja`` as well as project
9
+ files for IDEs such as Visual Studio and Xcode.
10
+
11
+ CMake is widely used for the C and C++ languages, but it may be used to
12
+ build source code of other languages too.
13
+
14
+ People encountering CMake for the first time may have different initial
15
+ goals. To learn how to build a source code package downloaded from the
16
+ internet, start with the :guide:`User Interaction Guide`.
17
+ This will detail the steps needed to run the :manual:`cmake(1)` or
18
+ :manual:`cmake-gui(1)` executable and how to choose a generator, and
19
+ how to complete the build.
20
+
21
+ The :guide:`Using Dependencies Guide` is aimed at developers
22
+ wishing to get started using a third-party library.
23
+
24
+ For developers starting a project using CMake, the :guide:`CMake Tutorial`
25
+ is a suitable starting point. The :manual:`cmake-buildsystem(7)`
26
+ manual is aimed at developers expanding their knowledge of maintaining
27
+ a buildsystem and becoming familiar with the build targets that
28
+ can be represented in CMake. The :manual:`cmake-packages(7)` manual
29
+ explains how to create packages which can easily be consumed by
30
+ third-party CMake-based buildsystems.
31
+
32
+ Command-Line Tools
33
+ ##################
34
+
35
+ .. toctree::
36
+ :maxdepth: 1
37
+
38
+ /manual/cmake.1
39
+ /manual/ctest.1
40
+ /manual/cpack.1
41
+
42
+ Interactive Dialogs
43
+ ###################
44
+
45
+ .. toctree::
46
+ :maxdepth: 1
47
+
48
+ /manual/cmake-gui.1
49
+ /manual/ccmake.1
50
+
51
+ Reference Manuals
52
+ #################
53
+
54
+ .. toctree::
55
+ :maxdepth: 1
56
+
57
+ /manual/cmake-buildsystem.7
58
+ /manual/cmake-commands.7
59
+ /manual/cmake-compile-features.7
60
+ /manual/cmake-configure-log.7
61
+ /manual/cmake-cxxmodules.7
62
+ /manual/cmake-developer.7
63
+ /manual/cmake-env-variables.7
64
+ /manual/cmake-file-api.7
65
+ /manual/cmake-generator-expressions.7
66
+ /manual/cmake-generators.7
67
+ /manual/cmake-language.7
68
+ /manual/cmake-modules.7
69
+ /manual/cmake-packages.7
70
+ /manual/cmake-policies.7
71
+ /manual/cmake-presets.7
72
+ /manual/cmake-properties.7
73
+ /manual/cmake-qt.7
74
+ /manual/cmake-server.7
75
+ /manual/cmake-toolchains.7
76
+ /manual/cmake-variables.7
77
+ /manual/cpack-generators.7
78
+
79
+ .. only:: not man
80
+
81
+ Guides
82
+ ######
83
+
84
+ .. toctree::
85
+ :maxdepth: 1
86
+
87
+ /guide/tutorial/index
88
+ /guide/user-interaction/index
89
+ /guide/using-dependencies/index
90
+ /guide/importing-exporting/index
91
+ /guide/ide-integration/index
92
+
93
+ .. only:: html or text
94
+
95
+ Release Notes
96
+ #############
97
+
98
+ .. toctree::
99
+ :maxdepth: 1
100
+
101
+ /release/index
102
+
103
+ .. only:: html
104
+
105
+ Index and Search
106
+ ################
107
+
108
+ * :ref:`genindex`
109
+ * :ref:`search`
cmake/share/cmake-3.31/Licenses/LGPLv3.txt ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
cmake/share/cmake-3.31/Modules/AddFileDependencies.cmake ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ AddFileDependencies
6
+ -------------------
7
+
8
+ .. deprecated:: 3.20
9
+
10
+ Add dependencies to a source file.
11
+
12
+ .. code-block:: cmake
13
+
14
+ add_file_dependencies(<source> <files>...)
15
+
16
+ Adds the given ``<files>`` to the dependencies of file ``<source>``.
17
+
18
+ Do not use this command in new code. It is just a wrapper around:
19
+
20
+ .. code-block:: cmake
21
+
22
+ set_property(SOURCE <source> APPEND PROPERTY OBJECT_DEPENDS <files>...)
23
+
24
+ Instead use the :command:`set_property` command to append to the
25
+ :prop_sf:`OBJECT_DEPENDS` source file property directly.
26
+
27
+ #]=======================================================================]
28
+
29
+ function(add_file_dependencies _file)
30
+
31
+ set_property(SOURCE "${_file}" APPEND PROPERTY OBJECT_DEPENDS "${ARGN}")
32
+
33
+ endfunction()
cmake/share/cmake-3.31/Modules/AndroidTestUtilities.cmake ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[======================================================================[.rst:
5
+ AndroidTestUtilities
6
+ ------------------------
7
+
8
+ .. versionadded:: 3.7
9
+
10
+ Create a test that automatically loads specified data onto an Android device.
11
+
12
+ Introduction
13
+ ^^^^^^^^^^^^
14
+
15
+ Use this module to push data needed for testing an Android device behavior
16
+ onto a connected Android device. The module will accept files and libraries as
17
+ well as separate destinations for each. It will create a test that loads the
18
+ files into a device object store and link to them from the specified
19
+ destination. The files are only uploaded if they are not already in the object
20
+ store.
21
+
22
+ For example:
23
+
24
+ .. code-block:: cmake
25
+
26
+ include(AndroidTestUtilities)
27
+ android_add_test_data(
28
+ example_setup_test
29
+ FILES <files>...
30
+ LIBS <libs>...
31
+ DEVICE_TEST_DIR "/data/local/tests/example"
32
+ DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA"
33
+ )
34
+
35
+
36
+ At build time a test named "example_setup_test" will be created. Run this test
37
+ on the command line with :manual:`ctest(1)` to load the data onto the Android
38
+ device.
39
+
40
+ Module Functions
41
+ ^^^^^^^^^^^^^^^^
42
+
43
+ .. command:: android_add_test_data
44
+
45
+ .. code-block:: cmake
46
+
47
+ android_add_test_data(<test-name>
48
+ [FILES <files>...] [FILES_DEST <device-dir>]
49
+ [LIBS <libs>...] [LIBS_DEST <device-dir>]
50
+ [DEVICE_OBJECT_STORE <device-dir>]
51
+ [DEVICE_TEST_DIR <device-dir>]
52
+ [NO_LINK_REGEX <strings>...]
53
+ )
54
+
55
+ The ``android_add_test_data`` function is used to copy files and libraries
56
+ needed to run project-specific tests. On the host operating system, this is
57
+ done at build time. For on-device testing, the files are loaded onto the
58
+ device by the manufactured test at run time.
59
+
60
+ This function accepts the following named parameters:
61
+
62
+ ``FILES <files>...``
63
+ zero or more files needed for testing
64
+ ``LIBS <libs>...``
65
+ zero or more libraries needed for testing
66
+ ``FILES_DEST <device-dir>``
67
+ absolute path where the data files are expected to be
68
+ ``LIBS_DEST <device-dir>``
69
+ absolute path where the libraries are expected to be
70
+ ``DEVICE_OBJECT_STORE <device-dir>``
71
+ absolute path to the location where the data is stored on-device
72
+ ``DEVICE_TEST_DIR <device-dir>``
73
+ absolute path to the root directory of the on-device test location
74
+ ``NO_LINK_REGEX <strings>...``
75
+ list of regex strings matching the names of files that should be
76
+ copied from the object store to the testing directory
77
+ #]======================================================================]
78
+
79
+ include(${CMAKE_CURRENT_LIST_DIR}/ExternalData.cmake)
80
+
81
+ # The parameters to this function should be set to the list of directories,
82
+ # files, and libraries that need to be installed prior to testing.
83
+ function(android_add_test_data test_name)
84
+ # As the names suggest, oneValueArgs lists the arguments that specify a
85
+ # single value, while multiValueArgs can contain one or more values.
86
+ set(keywordArgs)
87
+ set(oneValueArgs FILES_DEST LIBS_DEST DEVICE_OBJECT_STORE DEVICE_TEST_DIR)
88
+ set(multiValueArgs FILES LIBS NO_LINK_REGEX)
89
+
90
+ # For example, if you called this function with FILES </path/to/file>
91
+ # then this path would be stored in the variable AST_FILES.
92
+ # The AST prefix stands for the name of this function (android_add_test_data).
93
+ cmake_parse_arguments(AST "${keywordArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
94
+ if(NOT AST_DEVICE_TEST_DIR)
95
+ message(FATAL_ERROR "-- You must specify the location of the on device test directory.")
96
+ endif()
97
+ if(NOT AST_DEVICE_OBJECT_STORE)
98
+ message(FATAL_ERROR "-- You must specify the location of the on device object store.")
99
+ endif()
100
+ if(${AST_DEVICE_TEST_DIR} STREQUAL "/")
101
+ message(FATAL_ERROR "-- The device test directory cannot be '/'")
102
+ endif()
103
+
104
+ # Copy all test data files into the binary directory, where tests are run.
105
+ # ExternalData will handle fetching DATA{...} references.
106
+ string(REPLACE "|" ";" hash_algs "${_ExternalData_REGEX_EXT}")
107
+ # Convert ExternalData placeholder file names to DATA{} syntax.
108
+ foreach(alg ${hash_algs})
109
+ string(REGEX REPLACE "([^ ;]+)\\.${alg}" "DATA{\\1}" AST_FILES "${AST_FILES}")
110
+ endforeach()
111
+
112
+ set(DATA_TARGET_NAME "${test_name}")
113
+ string(FIND "${AST_FILES}" "DATA{" data_files_found)
114
+ if(${data_files_found} GREATER "-1")
115
+ # Use ExternalData if any DATA{} files were found.
116
+ ExternalData_Expand_Arguments(
117
+ ${DATA_TARGET_NAME}
118
+ extern_data_output
119
+ ${AST_FILES})
120
+ ExternalData_Add_Target(${DATA_TARGET_NAME})
121
+ else()
122
+ add_custom_target(${DATA_TARGET_NAME} ALL)
123
+ set(extern_data_output ${AST_FILES})
124
+ endif()
125
+
126
+ # For regular files on Linux, just copy them directly.
127
+ foreach(path ${AST_FILES})
128
+ foreach(output ${extern_data_output})
129
+ if(${output} STREQUAL ${path})
130
+ # Check if a destination was specified. If not, we copy by default
131
+ # into this project's binary directory, preserving its relative path.
132
+ if(AST_${VAR}_DEST)
133
+ set(DEST ${CMAKE_BINARY_DIR}/${parent_dir}/${AST_${VAR}_DEST})
134
+ else()
135
+ get_filename_component(parent_dir ${path} DIRECTORY)
136
+ set(DEST "${CMAKE_BINARY_DIR}/${parent_dir}")
137
+ endif()
138
+ get_filename_component(extern_data_source ${output} REALPATH)
139
+ get_filename_component(extern_data_basename ${output} NAME)
140
+ add_custom_command(
141
+ TARGET ${DATA_TARGET_NAME} POST_BUILD
142
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${extern_data_source} ${DEST}/${extern_data_basename}
143
+ )
144
+ endif()
145
+ endforeach()
146
+ endforeach()
147
+
148
+ if(ANDROID)
149
+ string(REGEX REPLACE "DATA{([^ ;]+)}" "\\1" processed_FILES "${AST_FILES}")
150
+ # There's no target used for this command, so we don't need to do anything
151
+ # here for CMP0178.
152
+ add_test(
153
+ NAME ${test_name}
154
+ COMMAND ${CMAKE_COMMAND}
155
+ "-Darg_files_dest=${AST_FILES_DEST}"
156
+ "-Darg_libs_dest=${AST_LIBS_DEST}"
157
+ "-Darg_dev_test_dir=${AST_DEVICE_TEST_DIR}"
158
+ "-Darg_dev_obj_store=${AST_DEVICE_OBJECT_STORE}"
159
+ "-Darg_no_link_regex=${AST_NO_LINK_REGEX}"
160
+ "-Darg_files=${processed_FILES}"
161
+ "-Darg_libs=${AST_LIBS}"
162
+ "-Darg_src_dir=${CMAKE_CURRENT_SOURCE_DIR}"
163
+ -P ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/AndroidTestUtilities/PushToAndroidDevice.cmake)
164
+ endif()
165
+ endfunction()
cmake/share/cmake-3.31/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ # This function handles pushing all of the test files needed to the device.
5
+ # It places the data files in the object store and makes links to them from
6
+ # the appropriate directories.
7
+ #
8
+ # This function accepts the following named parameters:
9
+ # DIRS : one or more directories needed for testing.
10
+ # FILES : one or more files needed for testing.
11
+ # LIBS : one or more libraries needed for testing.
12
+ # DIRS_DEST : specify where the directories should be installed.
13
+ # FILES_DEST : specify where the files should be installed.
14
+ # LIBS_DEST : specify where the libraries should be installed.
15
+ # DEV_OBJ_STORE : specify where the actual data files should be placed.
16
+ # DEV_TEST_DIR : specify the root file for the module test directory.
17
+ # The DEV_OBJ_STORE and DEV_TEST_DIR variables are required.
18
+
19
+ # The parameters to this function should be set to the list of directories,
20
+ # files, and libraries that need to be installed prior to testing.
21
+ function(android_push_test_files_to_device)
22
+
23
+ # The functions in the module need the adb executable.
24
+ find_program(adb_executable adb)
25
+ if(NOT adb_executable)
26
+ message(FATAL_ERROR "could not find adb")
27
+ endif()
28
+
29
+ function(execute_adb_command)
30
+ execute_process(COMMAND ${adb_executable} ${ARGN} RESULT_VARIABLE res_var OUTPUT_VARIABLE out_var ERROR_VARIABLE err_var)
31
+ set(out_var ${out_var} PARENT_SCOPE)
32
+ if(res_var)
33
+ string(REGEX REPLACE ";" " " com "${ARGN}")
34
+ message(FATAL_ERROR "Error occurred during adb command: adb ${com}\nError: ${err_var}.")
35
+ endif()
36
+ endfunction()
37
+
38
+ # Checks to make sure that a given file exists on the device. If it does,
39
+ # if(file_exists) will return true.
40
+ macro(check_device_file_exists device_file file_exists)
41
+ set(${file_exists} "")
42
+ execute_process(
43
+ COMMAND ${adb_executable} shell ls ${device_file}
44
+ OUTPUT_VARIABLE out_var ERROR_VARIABLE out_var)
45
+ if(NOT out_var) # when a directory exists but is empty the output is empty
46
+ set(${file_exists} "YES")
47
+ else()
48
+ string(FIND ${out_var} "No such file or directory" no_file_exists)
49
+ if(${no_file_exists} STREQUAL "-1") # -1 means the file exists
50
+ set(${file_exists} "YES")
51
+ endif()
52
+ endif()
53
+ endmacro()
54
+
55
+ # Checks to see if a filename matches a regex.
56
+ function(filename_regex filename reg_ex)
57
+ string(REGEX MATCH ${reg_ex} filename_match ${filename})
58
+ set(filename_match ${filename_match} PARENT_SCOPE)
59
+ endfunction()
60
+
61
+ # If a file with given name exists in the CMAKE_BINARY_DIR then use that file.
62
+ # Otherwise use the file with root in CMAKE_CURRENT_SOURCE_DIR.
63
+ macro(set_absolute_path relative_path absolute_path)
64
+ set(${absolute_path} ${arg_src_dir}/${relative_path})
65
+ if(EXISTS ${CMAKE_BINARY_DIR}/${relative_path})
66
+ set(${absolute_path} ${CMAKE_BINARY_DIR}/${relative_path})
67
+ endif()
68
+ if(NOT EXISTS ${${absolute_path}})
69
+ if(EXISTS ${relative_path})
70
+ set(${absolute_path} ${relative_path})
71
+ else()
72
+ message(FATAL_ERROR "Cannot find file for specified path: ${relative_path}")
73
+ endif()
74
+ endif()
75
+ endmacro()
76
+
77
+ # This function pushes the data into the device object store and
78
+ # creates a link to that data file in a specified location.
79
+ #
80
+ # This function requires the following un-named parameters:
81
+ # data_path : absolute path to data to load into dev obj store.
82
+ # dev_object_store : absolute path to the device object store directory.
83
+ # link_origin : absolute path to the origin of the link to the dev obj store data file.
84
+ function(push_and_link data_path dev_object_store link_origin)
85
+ FILE(SHA1 ${data_path} hash_val)
86
+ set(obj_store_dst ${dev_object_store}/${hash_val})
87
+ check_device_file_exists(${obj_store_dst} obj_store_file_exists)
88
+ # TODO: Verify that the object store file is indeed hashed correctly. Could use md5.
89
+ if(NOT obj_store_file_exists)
90
+ execute_adb_command(push ${data_path} ${obj_store_dst})
91
+ endif()
92
+ check_device_file_exists(${link_origin} link_exists)
93
+ if(link_exists)
94
+ execute_adb_command(shell rm -f ${link_origin})
95
+ endif()
96
+ foreach(ex ${arg_no_link_regex})
97
+ filename_regex(${data_path} ${ex})
98
+ LIST(APPEND match_ex ${filename_match})
99
+ endforeach()
100
+ if(match_ex)
101
+ execute_adb_command(shell cp ${obj_store_dst} ${link_origin})
102
+ else()
103
+ execute_adb_command(shell ln -s ${obj_store_dst} ${link_origin})
104
+ endif()
105
+ endfunction()
106
+
107
+ #----------------------------------------------------------------------------
108
+ #--------------------Beginning of actual function----------------------------
109
+ #----------------------------------------------------------------------------
110
+ set(oneValueArgs FILES_DEST LIBS_DEST DEV_TEST_DIR DEV_OBJ_STORE)
111
+ set(multiValueArgs FILES LIBS)
112
+ cmake_parse_arguments(_ptd "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
113
+
114
+ # Setup of object store and test dir.
115
+ check_device_file_exists(${_ptd_DEV_OBJ_STORE} dev_obj_store_exists)
116
+ if(NOT dev_obj_store_exists)
117
+ execute_adb_command(shell mkdir -p ${_ptd_DEV_OBJ_STORE})
118
+ endif()
119
+ check_device_file_exists(${_ptd_DEV_TEST_DIR} test_dir_exists)
120
+ if(test_dir_exists)
121
+ # This is protected in the SetupProjectTests module.
122
+ execute_adb_command(shell rm -r ${_ptd_DEV_TEST_DIR})
123
+ endif()
124
+ execute_adb_command(shell mkdir -p ${_ptd_DEV_TEST_DIR})
125
+
126
+ # Looping over the various types of test data possible.
127
+ foreach(TYPE ${multiValueArgs})
128
+ if(_ptd_${TYPE})
129
+
130
+ # determine if the data type destination has been explicitly specified.
131
+ if(_ptd_${TYPE}_DEST)
132
+ set(dest ${_ptd_${TYPE}_DEST})
133
+ else()
134
+ if(${TYPE} STREQUAL LIBS)
135
+ set(dest ${_ptd_DEV_TEST_DIR}/lib)
136
+ else()
137
+ set(dest ${_ptd_DEV_TEST_DIR})
138
+ endif()
139
+ endif()
140
+ execute_adb_command(shell mkdir -p ${dest})
141
+
142
+ # Loop over the files passed in
143
+ foreach(relative_path ${_ptd_${TYPE}})
144
+ # The absolute path can be through the source directory or the build directory.
145
+ # If the file/dir exists in the build directory that version is chosen.
146
+ set_absolute_path(${relative_path} absolute_path)
147
+ # Need to transfer all data files in the data directories to the device
148
+ # except those explicitly ignored.
149
+ if(${TYPE} STREQUAL FILES)
150
+ get_filename_component(file_dir ${relative_path} DIRECTORY)
151
+ # dest was determined earlier, relative_path is a dir, file is path from relative path to a data
152
+ set(cur_dest ${dest}/${relative_path})
153
+ set(on_dev_dir ${dest}/${file_dir})
154
+ execute_adb_command(shell mkdir -p ${on_dev_dir})
155
+ if(IS_SYMLINK ${absolute_path})
156
+ get_filename_component(real_data_origin ${absolute_path} REALPATH)
157
+ push_and_link(${real_data_origin} ${_ptd_DEV_OBJ_STORE} ${cur_dest})
158
+ else()
159
+ push_and_link(${absolute_path} ${_ptd_DEV_OBJ_STORE} ${cur_dest})
160
+ endif()
161
+ else() # LIBS
162
+ execute_adb_command(push ${absolute_path} ${dest})
163
+ endif()
164
+ endforeach()
165
+ endif()
166
+ endforeach()
167
+ endfunction()
168
+
169
+ android_push_test_files_to_device(
170
+ FILES_DEST ${arg_files_dest}
171
+ LIBS_DEST ${arg_libs_dest}
172
+ DEV_TEST_DIR ${arg_dev_test_dir}
173
+ DEV_OBJ_STORE ${arg_dev_obj_store}
174
+ FILES ${arg_files}
175
+ LIBS ${arg_libs}
176
+ )
cmake/share/cmake-3.31/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
8
+ # The variable CVF_VERSION must be set before calling configure_file().
9
+
10
+ set(PACKAGE_VERSION "@CVF_VERSION@")
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ # Package version must be in the requested version range
14
+ if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
15
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
16
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
17
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
18
+ else()
19
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
20
+ endif()
21
+ else()
22
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
23
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
24
+ else()
25
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
26
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
27
+ set(PACKAGE_VERSION_EXACT TRUE)
28
+ endif()
29
+ endif()
30
+ endif()
31
+
32
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-ExactVersion.cmake.in ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
8
+ # The tweak version component is ignored.
9
+ # The variable CVF_VERSION must be set before calling configure_file().
10
+
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ message(AUTHOR_WARNING
14
+ "`find_package()` specify a version range but the version strategy "
15
+ "(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
16
+ "with this request. Only the lower endpoint of the range will be used.")
17
+ endif()
18
+
19
+ set(PACKAGE_VERSION "@CVF_VERSION@")
20
+
21
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
22
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
23
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
24
+ set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
25
+
26
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
27
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
28
+ endif()
29
+ if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
30
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
31
+ endif()
32
+ if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
33
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
34
+ endif()
35
+
36
+ set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
37
+ else()
38
+ set(CVF_VERSION_NO_TWEAK "@CVF_VERSION@")
39
+ endif()
40
+
41
+ if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
42
+ set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
43
+ set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
44
+ set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
45
+
46
+ if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
47
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
48
+ endif()
49
+ if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
50
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
51
+ endif()
52
+ if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
53
+ string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
54
+ endif()
55
+
56
+ set(REQUESTED_VERSION_NO_TWEAK
57
+ "${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
58
+ else()
59
+ set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
60
+ endif()
61
+
62
+ if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
63
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
64
+ else()
65
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
66
+ endif()
67
+
68
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
69
+ set(PACKAGE_VERSION_EXACT TRUE)
70
+ endif()
71
+
72
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMajorVersion.cmake.in ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
8
+ # but only if the requested major version is the same as the current one.
9
+ # The variable CVF_VERSION must be set before calling configure_file().
10
+
11
+
12
+ set(PACKAGE_VERSION "@CVF_VERSION@")
13
+
14
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
15
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
16
+ else()
17
+
18
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.")
19
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
20
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
21
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
22
+ endif()
23
+ else()
24
+ set(CVF_VERSION_MAJOR "@CVF_VERSION@")
25
+ endif()
26
+
27
+ if(PACKAGE_FIND_VERSION_RANGE)
28
+ # both endpoints of the range must have the expected major version
29
+ math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
30
+ if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
31
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
32
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
33
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
34
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
35
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
36
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
37
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
38
+ else()
39
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
40
+ endif()
41
+ else()
42
+ if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
43
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
44
+ else()
45
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
46
+ endif()
47
+
48
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
49
+ set(PACKAGE_VERSION_EXACT TRUE)
50
+ endif()
51
+ endif()
52
+ endif()
53
+
54
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BasicConfigVersion-SameMinorVersion.cmake.in ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
8
+ # but only if the requested major and minor versions are the same as the current
9
+ # one.
10
+ # The variable CVF_VERSION must be set before calling configure_file().
11
+
12
+
13
+ set(PACKAGE_VERSION "@CVF_VERSION@")
14
+
15
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
+ else()
18
+
19
+ if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.([0-9]+)")
20
+ set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
+ set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
+
23
+ if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
24
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
25
+ endif()
26
+ if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
27
+ string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
+ endif()
29
+ else()
30
+ set(CVF_VERSION_MAJOR "@CVF_VERSION@")
31
+ set(CVF_VERSION_MINOR "")
32
+ endif()
33
+
34
+ if(PACKAGE_FIND_VERSION_RANGE)
35
+ # both endpoints of the range must have the expected major and minor versions
36
+ math (EXPR CVF_VERSION_MINOR_NEXT "${CVF_VERSION_MINOR} + 1")
37
+ if (NOT (PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
38
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR)
39
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE"
40
+ AND NOT (PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR
41
+ AND PACKAGE_FIND_VERSION_MAX_MINOR STREQUAL CVF_VERSION_MINOR))
42
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE"
43
+ AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL ${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR_NEXT})))
44
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
45
+ elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
46
+ AND PACKAGE_FIND_VERSION_MIN_MINOR STREQUAL CVF_VERSION_MINOR
47
+ AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
48
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
49
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
50
+ else()
51
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
52
+ endif()
53
+ else()
54
+ if(NOT PACKAGE_FIND_VERSION_MAJOR VERSION_EQUAL 0)
55
+ string(REGEX REPLACE "^0+" "" PACKAGE_FIND_VERSION_MAJOR "${PACKAGE_FIND_VERSION_MAJOR}")
56
+ endif()
57
+ if(NOT PACKAGE_FIND_VERSION_MINOR VERSION_EQUAL 0)
58
+ string(REGEX REPLACE "^0+" "" PACKAGE_FIND_VERSION_MINOR "${PACKAGE_FIND_VERSION_MINOR}")
59
+ endif()
60
+
61
+ if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND
62
+ (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR))
63
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
64
+ else()
65
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
66
+ endif()
67
+
68
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
69
+ set(PACKAGE_VERSION_EXACT TRUE)
70
+ endif()
71
+ endif()
72
+ endif()
73
+
74
+ @CVF_ARCH_INDEPENDENT_CHECK@
cmake/share/cmake-3.31/Modules/BundleUtilities.cmake ADDED
@@ -0,0 +1,1131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ BundleUtilities
6
+ ---------------
7
+
8
+ Functions to help assemble a standalone bundle application.
9
+
10
+ A collection of CMake utility functions useful for dealing with ``.app``
11
+ bundles on the Mac and bundle-like directories on any OS.
12
+
13
+ The following functions are provided by this module:
14
+
15
+ .. code-block:: cmake
16
+
17
+ fixup_bundle
18
+ copy_and_fixup_bundle
19
+ verify_app
20
+ get_bundle_main_executable
21
+ get_dotapp_dir
22
+ get_bundle_and_executable
23
+ get_bundle_all_executables
24
+ get_item_key
25
+ get_item_rpaths
26
+ clear_bundle_keys
27
+ set_bundle_key_values
28
+ get_bundle_keys
29
+ copy_resolved_item_into_bundle
30
+ copy_resolved_framework_into_bundle
31
+ fixup_bundle_item
32
+ verify_bundle_prerequisites
33
+ verify_bundle_symlinks
34
+
35
+ Requires CMake 2.6 or greater because it uses function, break and
36
+ ``PARENT_SCOPE``. Also depends on ``GetPrerequisites.cmake``.
37
+
38
+ DO NOT USE THESE FUNCTIONS AT CONFIGURE TIME (from ``CMakeLists.txt``)!
39
+ Instead, invoke them from an :command:`install(CODE)` or
40
+ :command:`install(SCRIPT)` rule.
41
+
42
+ .. code-block:: cmake
43
+
44
+ fixup_bundle(<app> <libs> <dirs>)
45
+
46
+ Fix up ``<app>`` bundle in-place and make it standalone, such that it can be
47
+ drag-n-drop copied to another machine and run on that machine as long
48
+ as all of the system libraries are compatible.
49
+
50
+ If you pass plugins to ``fixup_bundle`` as the libs parameter, you should
51
+ install them or copy them into the bundle before calling ``fixup_bundle``.
52
+ The ``<libs>`` parameter is a list of libraries that must be fixed up, but
53
+ that cannot be determined by ``otool`` output analysis (i.e. ``plugins``).
54
+
55
+ Gather all the keys for all the executables and libraries in a bundle,
56
+ and then, for each key, copy each prerequisite into the bundle. Then
57
+ fix each one up according to its own list of prerequisites.
58
+
59
+ Then clear all the keys and call ``verify_app`` on the final bundle to
60
+ ensure that it is truly standalone.
61
+
62
+ .. versionadded:: 3.6
63
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
64
+ which are then ignored
65
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
66
+
67
+ .. code-block:: cmake
68
+
69
+ copy_and_fixup_bundle(<src> <dst> <libs> <dirs>)
70
+
71
+ Makes a copy of the bundle ``<src>`` at location ``<dst>`` and then fixes up
72
+ the new copied bundle in-place at ``<dst>``.
73
+
74
+ .. code-block:: cmake
75
+
76
+ verify_app(<app>)
77
+
78
+ Verifies that an application ``<app>`` appears valid based on running
79
+ analysis tools on it. Calls :command:`message(FATAL_ERROR)` if the application
80
+ is not verified.
81
+
82
+ .. versionadded:: 3.6
83
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
84
+ which are then ignored
85
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
86
+
87
+ .. code-block:: cmake
88
+
89
+ get_bundle_main_executable(<bundle> <result_var>)
90
+
91
+ The result will be the full path name of the bundle's main executable
92
+ file or an ``error:`` prefixed string if it could not be determined.
93
+
94
+ .. code-block:: cmake
95
+
96
+ get_dotapp_dir(<exe> <dotapp_dir_var>)
97
+
98
+ Returns the nearest parent dir whose name ends with ``.app`` given the
99
+ full path to an executable. If there is no such parent dir, then
100
+ simply return the dir containing the executable.
101
+
102
+ The returned directory may or may not exist.
103
+
104
+ .. code-block:: cmake
105
+
106
+ get_bundle_and_executable(<app> <bundle_var> <executable_var> <valid_var>)
107
+
108
+ Takes either a ``.app`` directory name or the name of an executable
109
+ nested inside a ``.app`` directory and returns the path to the ``.app``
110
+ directory in ``<bundle_var>`` and the path to its main executable in
111
+ ``<executable_var>``.
112
+
113
+ .. code-block:: cmake
114
+
115
+ get_bundle_all_executables(<bundle> <exes_var>)
116
+
117
+ Scans ``<bundle>`` bundle recursively for all ``<exes_var>`` executable
118
+ files and accumulates them into a variable.
119
+
120
+ .. code-block:: cmake
121
+
122
+ get_item_key(<item> <key_var>)
123
+
124
+ Given ``<item>`` file name, generate ``<key_var>`` key that should be unique
125
+ considering the set of libraries that need copying or fixing up to
126
+ make a bundle standalone. This is essentially the file name including
127
+ extension with ``.`` replaced by ``_``
128
+
129
+ This key is used as a prefix for CMake variables so that we can
130
+ associate a set of variables with a given item based on its key.
131
+
132
+ .. code-block:: cmake
133
+
134
+ clear_bundle_keys(<keys_var>)
135
+
136
+ Loop over the ``<keys_var>`` list of keys, clearing all the variables
137
+ associated with each key. After the loop, clear the list of keys itself.
138
+
139
+ Caller of ``get_bundle_keys`` should call ``clear_bundle_keys`` when done with
140
+ list of keys.
141
+
142
+ .. code-block:: cmake
143
+
144
+ set_bundle_key_values(<keys_var> <context> <item> <exepath> <dirs>
145
+ <copyflag> [<rpaths>])
146
+
147
+ Add ``<keys_var>`` key to the list (if necessary) for the given item.
148
+ If added, also set all the variables associated with that key.
149
+
150
+ .. code-block:: cmake
151
+
152
+ get_bundle_keys(<app> <libs> <dirs> <keys_var>)
153
+
154
+ Loop over all the executable and library files within ``<app>`` bundle (and
155
+ given as extra ``<libs>``) and accumulate a list of keys representing
156
+ them. Set values associated with each key such that we can loop over
157
+ all of them and copy prerequisite libs into the bundle and then do
158
+ appropriate ``install_name_tool`` fixups.
159
+
160
+ .. versionadded:: 3.6
161
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
162
+ which are then ignored
163
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
164
+
165
+ .. code-block:: cmake
166
+
167
+ copy_resolved_item_into_bundle(<resolved_item> <resolved_embedded_item>)
168
+
169
+ Copy a resolved item into the bundle if necessary.
170
+ Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
171
+ ``<resolved_embedded_item>``.
172
+
173
+ .. code-block:: cmake
174
+
175
+ copy_resolved_framework_into_bundle(<resolved_item> <resolved_embedded_item>)
176
+
177
+ Copy a resolved framework into the bundle if necessary.
178
+ Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
179
+ ``<resolved_embedded_item>``.
180
+
181
+ By default, ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` is not set. If you want
182
+ full frameworks embedded in your bundles, set
183
+ ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` to ``ON`` before calling fixup_bundle. By
184
+ default, ``COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE`` copies the framework
185
+ dylib itself plus the framework ``Resources`` directory.
186
+
187
+ .. code-block:: cmake
188
+
189
+ fixup_bundle_item(<resolved_embedded_item> <exepath> <dirs>)
190
+
191
+ Get the direct/non-system prerequisites of the ``<resolved_embedded_item>``.
192
+ For each prerequisite, change the way it is referenced to the value of
193
+ the ``_EMBEDDED_ITEM`` keyed variable for that prerequisite. (Most likely
194
+ changing to an ``@executable_path`` style reference.)
195
+
196
+ This function requires that the ``<resolved_embedded_item>`` be ``inside``
197
+ the bundle already. In other words, if you pass plugins to ``fixup_bundle``
198
+ as the libs parameter, you should install them or copy them into the
199
+ bundle before calling ``fixup_bundle``. The ``libs`` parameter is a list of
200
+ libraries that must be fixed up, but that cannot be determined by
201
+ otool output analysis. (i.e., ``plugins``)
202
+
203
+ Also, change the id of the item being fixed up to its own
204
+ ``_EMBEDDED_ITEM`` value.
205
+
206
+ Accumulate changes in a local variable and make *one* call to
207
+ ``install_name_tool`` at the end of the function with all the changes at
208
+ once.
209
+
210
+ If the ``BU_CHMOD_BUNDLE_ITEMS`` variable is set then bundle items will be
211
+ marked writable before ``install_name_tool`` tries to change them.
212
+
213
+ .. code-block:: cmake
214
+
215
+ verify_bundle_prerequisites(<bundle> <result_var> <info_var>)
216
+
217
+ Verifies that the sum of all prerequisites of all files inside the
218
+ bundle are contained within the bundle or are ``system`` libraries,
219
+ presumed to exist everywhere.
220
+
221
+ .. versionadded:: 3.6
222
+ As an optional parameter (``IGNORE_ITEM``) a list of file names can be passed,
223
+ which are then ignored
224
+ (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
225
+
226
+ .. code-block:: cmake
227
+
228
+ verify_bundle_symlinks(<bundle> <result_var> <info_var>)
229
+
230
+ Verifies that any symlinks found in the ``<bundle>`` bundle point to other files
231
+ that are already also in the bundle... Anything that points to an
232
+ external file causes this function to fail the verification.
233
+ #]=======================================================================]
234
+
235
+ function(_warn_cmp0080)
236
+ cmake_policy(GET_WARNING CMP0080 _cmp0080_warning)
237
+ message(AUTHOR_WARNING "${_cmp0080_warning}\n")
238
+ endfunction()
239
+
240
+ # Do not include this module at configure time!
241
+ if(DEFINED CMAKE_GENERATOR)
242
+ cmake_policy(GET CMP0080 _BundleUtilities_CMP0080)
243
+ if(_BundleUtilities_CMP0080 STREQUAL "NEW")
244
+ message(FATAL_ERROR "BundleUtilities cannot be included at configure time!")
245
+ elseif(NOT _BundleUtilities_CMP0080 STREQUAL "OLD" AND NOT _CMP0080_SUPPRESS_WARNING)
246
+ _warn_cmp0080()
247
+ endif()
248
+ endif()
249
+
250
+ cmake_policy(PUSH)
251
+ cmake_policy(SET CMP0057 NEW) # if IN_LIST
252
+
253
+ # The functions defined in this file depend on the get_prerequisites function
254
+ # (and possibly others) found in:
255
+ #
256
+ include("${CMAKE_CURRENT_LIST_DIR}/GetPrerequisites.cmake")
257
+
258
+
259
+ function(get_bundle_main_executable bundle result_var)
260
+ set(result "error: '${bundle}/Contents/Info.plist' file does not exist")
261
+
262
+ if(EXISTS "${bundle}/Contents/Info.plist")
263
+ set(result "error: no CFBundleExecutable in '${bundle}/Contents/Info.plist' file")
264
+ set(line_is_main_executable 0)
265
+ set(bundle_executable "")
266
+
267
+ # Read Info.plist as a list of lines:
268
+ #
269
+ set(eol_char "E")
270
+ file(READ "${bundle}/Contents/Info.plist" info_plist)
271
+ string(REPLACE ";" "\\;" info_plist "${info_plist}")
272
+ string(REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
273
+ string(REPLACE "\r" "${eol_char};" info_plist "${info_plist}")
274
+
275
+ # Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
276
+ # is the name of the main executable.
277
+ #
278
+ foreach(line ${info_plist})
279
+ if(line_is_main_executable)
280
+ string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
281
+ break()
282
+ endif()
283
+
284
+ if(line MATCHES "<key>CFBundleExecutable</key>")
285
+ set(line_is_main_executable 1)
286
+ endif()
287
+ endforeach()
288
+
289
+ if(NOT bundle_executable STREQUAL "")
290
+ if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
291
+ set(result "${bundle}/Contents/MacOS/${bundle_executable}")
292
+ else()
293
+
294
+ # Ultimate goal:
295
+ # If not in "Contents/MacOS" then scan the bundle for matching files. If
296
+ # there is only one executable file that matches, then use it, otherwise
297
+ # it's an error...
298
+ #
299
+ #file(GLOB_RECURSE file_list "${bundle}/${bundle_executable}")
300
+
301
+ # But for now, pragmatically, it's an error. Expect the main executable
302
+ # for the bundle to be in Contents/MacOS, it's an error if it's not:
303
+ #
304
+ set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
305
+ endif()
306
+ endif()
307
+ else()
308
+ #
309
+ # More inclusive technique... (This one would work on Windows and Linux
310
+ # too, if a developer followed the typical Mac bundle naming convention...)
311
+ #
312
+ # If there is no Info.plist file, try to find an executable with the same
313
+ # base name as the .app directory:
314
+ #
315
+ endif()
316
+
317
+ set(${result_var} "${result}" PARENT_SCOPE)
318
+ endfunction()
319
+
320
+
321
+ function(get_dotapp_dir exe dotapp_dir_var)
322
+ set(s "${exe}")
323
+
324
+ if(s MATCHES "/.*\\.app/")
325
+ # If there is a ".app" parent directory,
326
+ # ascend until we hit it:
327
+ # (typical of a Mac bundle executable)
328
+ #
329
+ set(done 0)
330
+ while(NOT ${done})
331
+ get_filename_component(snamewe "${s}" NAME_WE)
332
+ get_filename_component(sname "${s}" NAME)
333
+ get_filename_component(sdir "${s}" PATH)
334
+ set(s "${sdir}")
335
+ if(sname MATCHES "\\.app$")
336
+ set(done 1)
337
+ set(dotapp_dir "${sdir}/${sname}")
338
+ endif()
339
+ endwhile()
340
+ else()
341
+ # Otherwise use a directory containing the exe
342
+ # (typical of a non-bundle executable on Mac, Windows or Linux)
343
+ #
344
+ is_file_executable("${s}" is_executable)
345
+ if(is_executable)
346
+ get_filename_component(sdir "${s}" PATH)
347
+ set(dotapp_dir "${sdir}")
348
+ else()
349
+ set(dotapp_dir "${s}")
350
+ endif()
351
+ endif()
352
+
353
+
354
+ set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
355
+ endfunction()
356
+
357
+
358
+ function(get_bundle_and_executable app bundle_var executable_var valid_var)
359
+ set(valid 0)
360
+
361
+ if(EXISTS "${app}")
362
+ # Is it a directory ending in .app?
363
+ if(IS_DIRECTORY "${app}")
364
+ if(app MATCHES "\\.app$")
365
+ get_bundle_main_executable("${app}" executable)
366
+ if(EXISTS "${app}" AND EXISTS "${executable}")
367
+ set(${bundle_var} "${app}" PARENT_SCOPE)
368
+ set(${executable_var} "${executable}" PARENT_SCOPE)
369
+ set(valid 1)
370
+ #message(STATUS "info: handled .app directory case...")
371
+ else()
372
+ message(STATUS "warning: *NOT* handled - .app directory case...")
373
+ endif()
374
+ else()
375
+ message(STATUS "warning: *NOT* handled - directory but not .app case...")
376
+ endif()
377
+ else()
378
+ # Is it an executable file?
379
+ is_file_executable("${app}" is_executable)
380
+ if(is_executable)
381
+ get_dotapp_dir("${app}" dotapp_dir)
382
+ if(EXISTS "${dotapp_dir}")
383
+ set(${bundle_var} "${dotapp_dir}" PARENT_SCOPE)
384
+ set(${executable_var} "${app}" PARENT_SCOPE)
385
+ set(valid 1)
386
+ #message(STATUS "info: handled executable file in .app dir case...")
387
+ else()
388
+ get_filename_component(app_dir "${app}" PATH)
389
+ set(${bundle_var} "${app_dir}" PARENT_SCOPE)
390
+ set(${executable_var} "${app}" PARENT_SCOPE)
391
+ set(valid 1)
392
+ #message(STATUS "info: handled executable file in any dir case...")
393
+ endif()
394
+ else()
395
+ message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
396
+ endif()
397
+ endif()
398
+ else()
399
+ message(STATUS "warning: *NOT* handled - directory/file does not exist...")
400
+ endif()
401
+
402
+ if(NOT valid)
403
+ set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
404
+ set(${executable_var} "error: not a bundle" PARENT_SCOPE)
405
+ endif()
406
+
407
+ set(${valid_var} ${valid} PARENT_SCOPE)
408
+ endfunction()
409
+
410
+
411
+ function(get_bundle_all_executables bundle exes_var)
412
+ set(exes "")
413
+
414
+ if(UNIX)
415
+ find_program(find_cmd "find")
416
+ mark_as_advanced(find_cmd)
417
+ endif()
418
+
419
+ # find command is much quicker than checking every file one by one on Unix
420
+ # which can take long time for large bundles, and since anyway we expect
421
+ # executable to have execute flag set we can narrow the list much quicker.
422
+ if(find_cmd)
423
+ execute_process(COMMAND "${find_cmd}" "${bundle}"
424
+ -type f \( -perm -0100 -o -perm -0010 -o -perm -0001 \)
425
+ OUTPUT_VARIABLE file_list
426
+ OUTPUT_STRIP_TRAILING_WHITESPACE
427
+ )
428
+ string(REPLACE "\n" ";" file_list "${file_list}")
429
+ else()
430
+ file(GLOB_RECURSE file_list "${bundle}/*")
431
+ endif()
432
+
433
+ foreach(f ${file_list})
434
+ is_file_executable("${f}" is_executable)
435
+ if(is_executable)
436
+ set(exes ${exes} "${f}")
437
+ endif()
438
+ endforeach()
439
+
440
+ set(${exes_var} "${exes}" PARENT_SCOPE)
441
+ endfunction()
442
+
443
+
444
+ function(get_item_rpaths item rpaths_var)
445
+ if(APPLE)
446
+ find_program(otool_cmd "otool")
447
+ mark_as_advanced(otool_cmd)
448
+ endif()
449
+
450
+ if(otool_cmd)
451
+ execute_process(
452
+ COMMAND "${otool_cmd}" -l "${item}"
453
+ OUTPUT_VARIABLE load_cmds_ov
454
+ RESULT_VARIABLE otool_rv
455
+ ERROR_VARIABLE otool_ev
456
+ )
457
+ if(NOT otool_rv STREQUAL "0")
458
+ message(FATAL_ERROR "otool -l failed: ${otool_rv}\n${otool_ev}")
459
+ endif()
460
+ string(REGEX REPLACE "[^\n]+cmd LC_RPATH\n[^\n]+\n[^\n]+path ([^\n]+) \\(offset[^\n]+\n" "rpath \\1\n" load_cmds_ov "${load_cmds_ov}")
461
+ string(REGEX MATCHALL "rpath [^\n]+" load_cmds_ov "${load_cmds_ov}")
462
+ string(REGEX REPLACE "rpath " "" load_cmds_ov "${load_cmds_ov}")
463
+ if(load_cmds_ov)
464
+ foreach(rpath ${load_cmds_ov})
465
+ gp_append_unique(${rpaths_var} "${rpath}")
466
+ endforeach()
467
+ endif()
468
+ endif()
469
+
470
+ if(UNIX AND NOT APPLE)
471
+ file(READ_ELF ${item} RPATH rpath_var RUNPATH runpath_var CAPTURE_ERROR error_var)
472
+ get_filename_component(item_dir ${item} DIRECTORY)
473
+ foreach(rpath ${rpath_var} ${runpath_var})
474
+ # Substitute $ORIGIN with the exepath and add to the found rpaths
475
+ string(REPLACE "$ORIGIN" "${item_dir}" rpath "${rpath}")
476
+ gp_append_unique(${rpaths_var} "${rpath}")
477
+ endforeach()
478
+ endif()
479
+
480
+ set(${rpaths_var} ${${rpaths_var}} PARENT_SCOPE)
481
+ endfunction()
482
+
483
+
484
+ function(get_item_key item key_var)
485
+ get_filename_component(item_name "${item}" NAME)
486
+ if(WIN32)
487
+ string(TOLOWER "${item_name}" item_name)
488
+ endif()
489
+ string(REPLACE "." "_" ${key_var} "${item_name}")
490
+ set(${key_var} ${${key_var}} PARENT_SCOPE)
491
+ endfunction()
492
+
493
+
494
+ function(clear_bundle_keys keys_var)
495
+ foreach(key ${${keys_var}})
496
+ set(${key}_ITEM PARENT_SCOPE)
497
+ set(${key}_RESOLVED_ITEM PARENT_SCOPE)
498
+ set(${key}_DEFAULT_EMBEDDED_PATH PARENT_SCOPE)
499
+ set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
500
+ set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
501
+ set(${key}_COPYFLAG PARENT_SCOPE)
502
+ set(${key}_RPATHS PARENT_SCOPE)
503
+ endforeach()
504
+ set(${keys_var} PARENT_SCOPE)
505
+ endfunction()
506
+
507
+
508
+ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
509
+ if(ARGC GREATER 6)
510
+ set(rpaths "${ARGV6}")
511
+ else()
512
+ set(rpaths "")
513
+ endif()
514
+ get_filename_component(item_name "${item}" NAME)
515
+
516
+ get_item_key("${item}" key)
517
+
518
+ list(LENGTH ${keys_var} length_before)
519
+ gp_append_unique(${keys_var} "${key}")
520
+ list(LENGTH ${keys_var} length_after)
521
+
522
+ if(NOT length_before EQUAL length_after)
523
+ gp_resolve_item("${context}" "${item}" "${exepath}" "${dirs}" resolved_item "${rpaths}")
524
+
525
+ gp_item_default_embedded_path("${item}" default_embedded_path)
526
+
527
+ get_item_rpaths("${resolved_item}" item_rpaths)
528
+
529
+ if((NOT item MATCHES "\\.dylib$") AND (item MATCHES "[^/]+\\.framework/"))
530
+ # For frameworks, construct the name under the embedded path from the
531
+ # opening "${item_name}.framework/" to the closing "/${item_name}":
532
+ #
533
+ string(REGEX REPLACE "^.*(${item_name}.framework/.*/?${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
534
+ else()
535
+ # For other items, just use the same name as the original, but in the
536
+ # embedded path:
537
+ #
538
+ set(embedded_item "${default_embedded_path}/${item_name}")
539
+ endif()
540
+
541
+ # Replace @executable_path and resolve ".." references:
542
+ #
543
+ string(REPLACE "@executable_path" "${exepath}" resolved_embedded_item "${embedded_item}")
544
+ get_filename_component(resolved_embedded_item "${resolved_embedded_item}" ABSOLUTE)
545
+
546
+ # *But* -- if we are not copying, then force resolved_embedded_item to be
547
+ # the same as resolved_item. In the case of multiple executables in the
548
+ # original bundle, using the default_embedded_path results in looking for
549
+ # the resolved executable next to the main bundle executable. This is here
550
+ # so that exes in the other sibling directories (like "bin") get fixed up
551
+ # properly...
552
+ #
553
+ if(NOT copyflag)
554
+ set(resolved_embedded_item "${resolved_item}")
555
+ endif()
556
+
557
+ set(${keys_var} ${${keys_var}} PARENT_SCOPE)
558
+ set(${key}_ITEM "${item}" PARENT_SCOPE)
559
+ set(${key}_RESOLVED_ITEM "${resolved_item}" PARENT_SCOPE)
560
+ set(${key}_DEFAULT_EMBEDDED_PATH "${default_embedded_path}" PARENT_SCOPE)
561
+ set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
562
+ set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
563
+ set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
564
+ set(${key}_RPATHS "${item_rpaths}" PARENT_SCOPE)
565
+ set(${key}_RDEP_RPATHS "${rpaths}" PARENT_SCOPE)
566
+ else()
567
+ #message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
568
+ endif()
569
+ endfunction()
570
+
571
+
572
+ function(get_bundle_keys app libs dirs keys_var)
573
+ set(${keys_var} PARENT_SCOPE)
574
+
575
+ set(options)
576
+ set(oneValueArgs)
577
+ set(multiValueArgs IGNORE_ITEM)
578
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
579
+
580
+ get_bundle_and_executable("${app}" bundle executable valid)
581
+ if(valid)
582
+ # Always use the exepath of the main bundle executable for @executable_path
583
+ # replacements:
584
+ #
585
+ get_filename_component(exepath "${executable}" PATH)
586
+
587
+ # But do fixups on all executables in the bundle:
588
+ #
589
+ get_bundle_all_executables("${bundle}" exes)
590
+
591
+ # Set keys for main executable first:
592
+ #
593
+ set_bundle_key_values(${keys_var} "${executable}" "${executable}" "${exepath}" "${dirs}" 0)
594
+
595
+ # Get rpaths specified by main executable:
596
+ #
597
+ get_item_key("${executable}" executable_key)
598
+ set(main_rpaths "${${executable_key}_RPATHS}")
599
+
600
+ # For each extra lib, accumulate a key as well and then also accumulate
601
+ # any of its prerequisites. (Extra libs are typically dynamically loaded
602
+ # plugins: libraries that are prerequisites for full runtime functionality
603
+ # but that do not show up in otool -L output...)
604
+ #
605
+ foreach(lib ${libs})
606
+ set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0 "${main_rpaths}")
607
+
608
+ set(prereqs "")
609
+ get_filename_component(prereq_filename ${lib} NAME)
610
+
611
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
612
+ get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}" "${main_rpaths}")
613
+ foreach(pr ${prereqs})
614
+ set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1 "${main_rpaths}")
615
+ endforeach()
616
+ else()
617
+ message(STATUS "Ignoring file: ${prereq_filename}")
618
+ endif()
619
+ endforeach()
620
+
621
+ # For each executable found in the bundle, accumulate keys as we go.
622
+ # The list of keys should be complete when all prerequisites of all
623
+ # binaries in the bundle have been analyzed.
624
+ #
625
+ foreach(exe ${exes})
626
+ # Main executable is scanned first above:
627
+ #
628
+ if(NOT exe STREQUAL executable)
629
+ # Add the exe itself to the keys:
630
+ #
631
+ set_bundle_key_values(${keys_var} "${exe}" "${exe}" "${exepath}" "${dirs}" 0 "${main_rpaths}")
632
+
633
+ # Get rpaths specified by executable:
634
+ #
635
+ get_item_key("${exe}" exe_key)
636
+ set(exe_rpaths "${main_rpaths}" "${${exe_key}_RPATHS}")
637
+ else()
638
+ set(exe_rpaths "${main_rpaths}")
639
+ endif()
640
+
641
+ # Add each prerequisite to the keys:
642
+ #
643
+ set(prereqs "")
644
+ get_filename_component(prereq_filename ${exe} NAME)
645
+
646
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
647
+ get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}" "${exe_rpaths}")
648
+ foreach(pr ${prereqs})
649
+ set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
650
+ endforeach()
651
+ else()
652
+ message(STATUS "Ignoring file: ${prereq_filename}")
653
+ endif()
654
+ endforeach()
655
+
656
+ # preserve library symlink structure
657
+ foreach(key ${${keys_var}})
658
+ if("${${key}_COPYFLAG}" STREQUAL "1")
659
+ if(IS_SYMLINK "${${key}_RESOLVED_ITEM}")
660
+ get_filename_component(target "${${key}_RESOLVED_ITEM}" REALPATH)
661
+ set_bundle_key_values(${keys_var} "${exe}" "${target}" "${exepath}" "${dirs}" 1 "${exe_rpaths}")
662
+ get_item_key("${target}" targetkey)
663
+
664
+ if(WIN32)
665
+ # ignore case on Windows
666
+ string(TOLOWER "${${key}_RESOLVED_ITEM}" resolved_item_compare)
667
+ string(TOLOWER "${${targetkey}_RESOLVED_EMBEDDED_ITEM}" resolved_embedded_item_compare)
668
+ else()
669
+ set(resolved_item_compare "${${key}_RESOLVED_ITEM}")
670
+ set(resolved_embedded_item_compare "${${targetkey}_RESOLVED_EMBEDDED_ITEM}")
671
+ endif()
672
+ get_filename_component(resolved_item_compare "${resolved_item_compare}" NAME)
673
+ get_filename_component(resolved_embedded_item_compare "${resolved_embedded_item_compare}" NAME)
674
+
675
+ if(NOT resolved_item_compare STREQUAL resolved_embedded_item_compare)
676
+ set(${key}_COPYFLAG "2")
677
+ set(${key}_RESOLVED_ITEM "${${targetkey}_RESOLVED_EMBEDDED_ITEM}")
678
+ endif()
679
+
680
+ endif()
681
+ endif()
682
+ endforeach()
683
+ # Propagate values to caller's scope:
684
+ #
685
+ set(${keys_var} ${${keys_var}} PARENT_SCOPE)
686
+ foreach(key ${${keys_var}})
687
+ set(${key}_ITEM "${${key}_ITEM}" PARENT_SCOPE)
688
+ set(${key}_RESOLVED_ITEM "${${key}_RESOLVED_ITEM}" PARENT_SCOPE)
689
+ set(${key}_DEFAULT_EMBEDDED_PATH "${${key}_DEFAULT_EMBEDDED_PATH}" PARENT_SCOPE)
690
+ set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
691
+ set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
692
+ set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
693
+ set(${key}_RPATHS "${${key}_RPATHS}" PARENT_SCOPE)
694
+ set(${key}_RDEP_RPATHS "${${key}_RDEP_RPATHS}" PARENT_SCOPE)
695
+ endforeach()
696
+ endif()
697
+ endfunction()
698
+
699
+ function(link_resolved_item_into_bundle resolved_item resolved_embedded_item)
700
+ if(WIN32)
701
+ # ignore case on Windows
702
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
703
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
704
+ else()
705
+ set(resolved_item_compare "${resolved_item}")
706
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
707
+ endif()
708
+
709
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
710
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not linking...")
711
+ else()
712
+ get_filename_component(target_dir "${resolved_embedded_item}" DIRECTORY)
713
+ file(RELATIVE_PATH symlink_target "${target_dir}" "${resolved_item}")
714
+ if (NOT EXISTS "${target_dir}")
715
+ file(MAKE_DIRECTORY "${target_dir}")
716
+ endif()
717
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${symlink_target}" "${resolved_embedded_item}")
718
+ endif()
719
+ endfunction()
720
+
721
+ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
722
+ if(WIN32)
723
+ # ignore case on Windows
724
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
725
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
726
+ else()
727
+ set(resolved_item_compare "${resolved_item}")
728
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
729
+ endif()
730
+
731
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
732
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
733
+ else()
734
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
735
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
736
+ if(UNIX AND NOT APPLE)
737
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
738
+ endif()
739
+ endif()
740
+
741
+ endfunction()
742
+
743
+
744
+ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
745
+ if(WIN32)
746
+ # ignore case on Windows
747
+ string(TOLOWER "${resolved_item}" resolved_item_compare)
748
+ string(TOLOWER "${resolved_embedded_item}" resolved_embedded_item_compare)
749
+ else()
750
+ set(resolved_item_compare "${resolved_item}")
751
+ set(resolved_embedded_item_compare "${resolved_embedded_item}")
752
+ endif()
753
+
754
+ if(resolved_item_compare STREQUAL resolved_embedded_item_compare)
755
+ message(STATUS "warning: resolved_item == resolved_embedded_item - not copying...")
756
+ else()
757
+ if(BU_COPY_FULL_FRAMEWORK_CONTENTS)
758
+ # Full Framework (everything):
759
+ get_filename_component(resolved_dir "${resolved_item}" PATH)
760
+ get_filename_component(resolved_dir "${resolved_dir}/../.." ABSOLUTE)
761
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_item}" PATH)
762
+ get_filename_component(resolved_embedded_dir "${resolved_embedded_dir}/../.." ABSOLUTE)
763
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_dir}' '${resolved_embedded_dir}'")
764
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_dir}" "${resolved_embedded_dir}")
765
+ else()
766
+ # Framework lib itself:
767
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
768
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
769
+
770
+ # Plus Resources, if they exist:
771
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources" resolved_resources "${resolved_item}")
772
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources" resolved_embedded_resources "${resolved_embedded_item}")
773
+ if(EXISTS "${resolved_resources}")
774
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_resources}' '${resolved_embedded_resources}'")
775
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
776
+ endif()
777
+
778
+ # Some frameworks e.g. Qt put Info.plist in wrong place, so when it is
779
+ # missing in resources, copy it from other well known incorrect locations:
780
+ if(NOT EXISTS "${resolved_resources}/Info.plist")
781
+ # Check for Contents/Info.plist in framework root (older Qt SDK):
782
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1/Contents/Info.plist" resolved_info_plist "${resolved_item}")
783
+ string(REGEX REPLACE "^(.*)/[^/]+$" "\\1/Resources/Info.plist" resolved_embedded_info_plist "${resolved_embedded_item}")
784
+ if(EXISTS "${resolved_info_plist}")
785
+ #message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy_directory '${resolved_info_plist}' '${resolved_embedded_info_plist}'")
786
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_info_plist}" "${resolved_embedded_info_plist}")
787
+ endif()
788
+ endif()
789
+
790
+ # Check if framework is versioned and fix it layout
791
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+$" "\\1" resolved_embedded_version "${resolved_embedded_item}")
792
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+$" "\\1" resolved_embedded_versions "${resolved_embedded_item}")
793
+ string(REGEX REPLACE "^.*/([^/]+)/[^/]+/[^/]+$" "\\1" resolved_embedded_versions_basename "${resolved_embedded_item}")
794
+ if(resolved_embedded_versions_basename STREQUAL "Versions")
795
+ # Ensure Current symlink points to the framework version
796
+ if(NOT EXISTS "${resolved_embedded_versions}/Current")
797
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${resolved_embedded_version}" "${resolved_embedded_versions}/Current")
798
+ endif()
799
+ # Restore symlinks in framework root pointing to current framework
800
+ # binary and resources:
801
+ string(REGEX REPLACE "^(.*)/[^/]+/[^/]+/[^/]+$" "\\1" resolved_embedded_root "${resolved_embedded_item}")
802
+ string(REGEX REPLACE "^.*/([^/]+)$" "\\1" resolved_embedded_item_basename "${resolved_embedded_item}")
803
+ if(NOT EXISTS "${resolved_embedded_root}/${resolved_embedded_item_basename}")
804
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/${resolved_embedded_item_basename}" "${resolved_embedded_root}/${resolved_embedded_item_basename}")
805
+ endif()
806
+ if(NOT EXISTS "${resolved_embedded_root}/Resources")
807
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "Versions/Current/Resources" "${resolved_embedded_root}/Resources")
808
+ endif()
809
+ endif()
810
+ endif()
811
+ if(UNIX AND NOT APPLE)
812
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
813
+ endif()
814
+ endif()
815
+
816
+ endfunction()
817
+
818
+
819
+ function(fixup_bundle_item resolved_embedded_item exepath dirs)
820
+ # This item's key is "ikey":
821
+ #
822
+ get_item_key("${resolved_embedded_item}" ikey)
823
+
824
+ # Ensure the item is "inside the .app bundle" -- it should not be fixed up if
825
+ # it is not in the .app bundle... Otherwise, we'll modify files in the build
826
+ # tree, or in other varied locations around the file system, with our call to
827
+ # install_name_tool. Make sure that doesn't happen here:
828
+ #
829
+ get_dotapp_dir("${exepath}" exe_dotapp_dir)
830
+ string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
831
+ string(LENGTH "${resolved_embedded_item}" resolved_embedded_item_length)
832
+ set(path_too_short 0)
833
+ set(is_embedded 0)
834
+ if(resolved_embedded_item_length LESS exe_dotapp_dir_length)
835
+ set(path_too_short 1)
836
+ endif()
837
+ if(NOT path_too_short)
838
+ string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
839
+ if("${exe_dotapp_dir}/" STREQUAL item_substring)
840
+ set(is_embedded 1)
841
+ endif()
842
+ endif()
843
+ if(NOT is_embedded)
844
+ message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
845
+ message(" item_substring='${item_substring}'")
846
+ message(" resolved_embedded_item='${resolved_embedded_item}'")
847
+ message("")
848
+ message("Install or copy the item into the bundle before calling fixup_bundle.")
849
+ message("Or maybe there's a typo or incorrect path in one of the args to fixup_bundle?")
850
+ message("")
851
+ message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
852
+ endif()
853
+
854
+ set(rpaths "${${ikey}_RPATHS}" "${${ikey}_RDEP_RPATHS}")
855
+
856
+ set(prereqs "")
857
+ get_prerequisites("${resolved_embedded_item}" prereqs 1 0 "${exepath}" "${dirs}" "${rpaths}")
858
+
859
+ set(changes "")
860
+
861
+ foreach(pr ${prereqs})
862
+ # Each referenced item's key is "rkey" in the loop:
863
+ #
864
+ get_item_key("${pr}" rkey)
865
+
866
+ if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
867
+ set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
868
+ else()
869
+ message("warning: unexpected reference to '${pr}'")
870
+ endif()
871
+ endforeach()
872
+
873
+ # CMAKE_INSTALL_NAME_TOOL may not be set if executed in script mode
874
+ # Duplicated from CMakeFindBinUtils.cmake
875
+ find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
876
+
877
+ # Only if install_name_tool supports -delete_rpath:
878
+ #
879
+ execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL}
880
+ OUTPUT_VARIABLE install_name_tool_usage
881
+ ERROR_VARIABLE install_name_tool_usage
882
+ )
883
+ if(install_name_tool_usage MATCHES ".*-delete_rpath.*")
884
+ foreach(rpath ${${ikey}_RPATHS})
885
+ set(changes ${changes} -delete_rpath "${rpath}")
886
+ endforeach()
887
+ endif()
888
+
889
+ if(${ikey}_EMBEDDED_ITEM)
890
+ set(changes ${changes} -id "${${ikey}_EMBEDDED_ITEM}")
891
+ endif()
892
+
893
+ # Change this item's id and all of its references in one call
894
+ # to install_name_tool:
895
+ #
896
+ if(changes)
897
+ # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
898
+ file(READ ${resolved_embedded_item} file_contents LIMIT 5)
899
+ if(NOT "${resolved_embedded_item}" MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" AND
900
+ NOT file_contents MATCHES "^#!")
901
+ set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
902
+ if(BU_CHMOD_BUNDLE_ITEMS)
903
+ execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
904
+ endif()
905
+ execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
906
+ if(NOT install_name_tool_result EQUAL 0)
907
+ string(REPLACE ";" "' '" msg "'${cmd}'")
908
+ message(FATAL_ERROR "Command failed:\n ${msg}")
909
+ endif()
910
+ endif()
911
+ endif()
912
+ endfunction()
913
+
914
+
915
+ function(fixup_bundle app libs dirs)
916
+ message(STATUS "fixup_bundle")
917
+ message(STATUS " app='${app}'")
918
+ message(STATUS " libs='${libs}'")
919
+ message(STATUS " dirs='${dirs}'")
920
+
921
+ set(options)
922
+ set(oneValueArgs)
923
+ set(multiValueArgs IGNORE_ITEM)
924
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
925
+
926
+ message(STATUS " ignoreItems='${CFG_IGNORE_ITEM}'")
927
+
928
+ get_bundle_and_executable("${app}" bundle executable valid)
929
+ if(valid)
930
+ get_filename_component(exepath "${executable}" PATH)
931
+
932
+ message(STATUS "fixup_bundle: preparing...")
933
+ get_bundle_keys("${app}" "${libs}" "${dirs}" keys IGNORE_ITEM "${CFG_IGNORE_ITEM}")
934
+
935
+ message(STATUS "fixup_bundle: copying...")
936
+ list(LENGTH keys n)
937
+ math(EXPR n ${n}*2)
938
+
939
+ set(i 0)
940
+ foreach(key ${keys})
941
+ math(EXPR i ${i}+1)
942
+ if("${${key}_COPYFLAG}" STREQUAL "2")
943
+ message(STATUS "${i}/${n}: linking '${${key}_RESOLVED_ITEM}' -> '${${key}_RESOLVED_EMBEDDED_ITEM}'")
944
+ elseif(${${key}_COPYFLAG})
945
+ message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
946
+ else()
947
+ message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
948
+ endif()
949
+
950
+ set(show_status 0)
951
+ if(show_status)
952
+ message(STATUS "key='${key}'")
953
+ message(STATUS "item='${${key}_ITEM}'")
954
+ message(STATUS "resolved_item='${${key}_RESOLVED_ITEM}'")
955
+ message(STATUS "default_embedded_path='${${key}_DEFAULT_EMBEDDED_PATH}'")
956
+ message(STATUS "embedded_item='${${key}_EMBEDDED_ITEM}'")
957
+ message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
958
+ message(STATUS "copyflag='${${key}_COPYFLAG}'")
959
+ message(STATUS "")
960
+ endif()
961
+
962
+ if("${${key}_COPYFLAG}" STREQUAL "2")
963
+ link_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
964
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
965
+ elseif(${${key}_COPYFLAG})
966
+ set(item "${${key}_ITEM}")
967
+ if(item MATCHES "[^/]+\\.framework/")
968
+ copy_resolved_framework_into_bundle("${${key}_RESOLVED_ITEM}"
969
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
970
+ else()
971
+ copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
972
+ "${${key}_RESOLVED_EMBEDDED_ITEM}")
973
+ endif()
974
+ endif()
975
+ endforeach()
976
+
977
+ message(STATUS "fixup_bundle: fixing...")
978
+ foreach(key ${keys})
979
+ math(EXPR i ${i}+1)
980
+ if(APPLE)
981
+ message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
982
+ if(NOT "${${key}_COPYFLAG}" STREQUAL "2")
983
+ fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
984
+ endif()
985
+ else()
986
+ message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
987
+ endif()
988
+ endforeach()
989
+
990
+ message(STATUS "fixup_bundle: cleaning up...")
991
+ clear_bundle_keys(keys)
992
+
993
+ message(STATUS "fixup_bundle: verifying...")
994
+ verify_app("${app}" IGNORE_ITEM "${CFG_IGNORE_ITEM}")
995
+ else()
996
+ message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
997
+ endif()
998
+
999
+ message(STATUS "fixup_bundle: done")
1000
+ endfunction()
1001
+
1002
+
1003
+ function(copy_and_fixup_bundle src dst libs dirs)
1004
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
1005
+ fixup_bundle("${dst}" "${libs}" "${dirs}")
1006
+ endfunction()
1007
+
1008
+
1009
+ function(verify_bundle_prerequisites bundle result_var info_var)
1010
+ set(result 1)
1011
+ set(info "")
1012
+ set(count 0)
1013
+
1014
+ set(options)
1015
+ set(oneValueArgs)
1016
+ set(multiValueArgs IGNORE_ITEM)
1017
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
1018
+
1019
+ get_bundle_main_executable("${bundle}" main_bundle_exe)
1020
+
1021
+ get_bundle_all_executables("${bundle}" file_list)
1022
+ foreach(f ${file_list})
1023
+ get_filename_component(exepath "${f}" PATH)
1024
+ math(EXPR count "${count} + 1")
1025
+
1026
+ message(STATUS "executable file ${count}: ${f}")
1027
+
1028
+ set(prereqs "")
1029
+ get_filename_component(prereq_filename ${f} NAME)
1030
+
1031
+ if(NOT prereq_filename IN_LIST CFG_IGNORE_ITEM)
1032
+ get_item_rpaths(${f} _main_exe_rpaths)
1033
+ get_prerequisites("${f}" prereqs 1 1 "${exepath}" "${_main_exe_rpaths}")
1034
+
1035
+ # On the Mac,
1036
+ # "embedded" and "system" prerequisites are fine... anything else means
1037
+ # the bundle's prerequisites are not verified (i.e., the bundle is not
1038
+ # really "standalone")
1039
+ #
1040
+ # On Windows (and others? Linux/Unix/...?)
1041
+ # "local" and "system" prereqs are fine...
1042
+ #
1043
+
1044
+ set(external_prereqs "")
1045
+
1046
+ foreach(p ${prereqs})
1047
+ set(p_type "")
1048
+ gp_file_type("${f}" "${p}" p_type)
1049
+
1050
+ if(APPLE)
1051
+ if(NOT p_type STREQUAL "embedded" AND NOT p_type STREQUAL "system")
1052
+ set(external_prereqs ${external_prereqs} "${p}")
1053
+ endif()
1054
+ else()
1055
+ if(NOT p_type STREQUAL "local" AND NOT p_type STREQUAL "system")
1056
+ set(external_prereqs ${external_prereqs} "${p}")
1057
+ endif()
1058
+ endif()
1059
+ endforeach()
1060
+
1061
+ if(external_prereqs)
1062
+ # Found non-system/somehow-unacceptable prerequisites:
1063
+ set(result 0)
1064
+ set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
1065
+ endif()
1066
+ else()
1067
+ message(STATUS "Ignoring file: ${prereq_filename}")
1068
+ endif()
1069
+ endforeach()
1070
+
1071
+ if(result)
1072
+ set(info "Verified ${count} executable files in '${bundle}'")
1073
+ endif()
1074
+
1075
+ set(${result_var} "${result}" PARENT_SCOPE)
1076
+ set(${info_var} "${info}" PARENT_SCOPE)
1077
+ endfunction()
1078
+
1079
+
1080
+ function(verify_bundle_symlinks bundle result_var info_var)
1081
+ set(result 1)
1082
+ set(info "")
1083
+ set(count 0)
1084
+
1085
+ # TODO: implement this function for real...
1086
+ # Right now, it is just a stub that verifies unconditionally...
1087
+
1088
+ set(${result_var} "${result}" PARENT_SCOPE)
1089
+ set(${info_var} "${info}" PARENT_SCOPE)
1090
+ endfunction()
1091
+
1092
+
1093
+ function(verify_app app)
1094
+ set(verified 0)
1095
+ set(info "")
1096
+
1097
+ set(options)
1098
+ set(oneValueArgs)
1099
+ set(multiValueArgs IGNORE_ITEM)
1100
+ cmake_parse_arguments(CFG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
1101
+
1102
+ get_bundle_and_executable("${app}" bundle executable valid)
1103
+
1104
+ message(STATUS "===========================================================================")
1105
+ message(STATUS "Analyzing app='${app}'")
1106
+ message(STATUS "bundle='${bundle}'")
1107
+ message(STATUS "executable='${executable}'")
1108
+ message(STATUS "valid='${valid}'")
1109
+
1110
+ # Verify that the bundle does not have any "external" prerequisites:
1111
+ #
1112
+ verify_bundle_prerequisites("${bundle}" verified info IGNORE_ITEM "${CFG_IGNORE_ITEM}")
1113
+ message(STATUS "verified='${verified}'")
1114
+ message(STATUS "info='${info}'")
1115
+ message(STATUS "")
1116
+
1117
+ if(verified)
1118
+ # Verify that the bundle does not have any symlinks to external files:
1119
+ #
1120
+ verify_bundle_symlinks("${bundle}" verified info)
1121
+ message(STATUS "verified='${verified}'")
1122
+ message(STATUS "info='${info}'")
1123
+ message(STATUS "")
1124
+ endif()
1125
+
1126
+ if(NOT verified)
1127
+ message(FATAL_ERROR "error: verify_app failed")
1128
+ endif()
1129
+ endfunction()
1130
+
1131
+ cmake_policy(POP)
cmake/share/cmake-3.31/Modules/CMake.cmake ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # This file is used by cmake.cxx to compute the CMAKE_ROOT location.
6
+ # Do not remove this file from cvs without updating cmake.cxx to look
7
+ # for a different file.
cmake/share/cmake-3.31/Modules/CMakeASM-ATTInformation.cmake ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # support for AT&T syntax assemblers, e.g. GNU as
6
+
7
+ set(ASM_DIALECT "-ATT")
8
+ # *.S files are supposed to be preprocessed, so they should not be passed to
9
+ # assembler but should be processed by gcc
10
+ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
11
+
12
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
13
+
14
+ include(CMakeASMInformation)
15
+ set(ASM_DIALECT)
cmake/share/cmake-3.31/Modules/CMakeASMCompiler.cmake.in ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
2
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
3
+ set(CMAKE_AR "@CMAKE_AR@")
4
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_AR "@_CMAKE_ASM_COMPILER_AR@")
5
+ set(CMAKE_RANLIB "@CMAKE_RANLIB@")
6
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
7
+ set(CMAKE_LINKER "@CMAKE_LINKER@")
8
+ set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
9
+ set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
10
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER "@CMAKE_ASM_COMPILER_LINKER@")
11
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_ID "@CMAKE_ASM_COMPILER_LINKER_ID@")
12
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_VERSION @CMAKE_ASM_COMPILER_LINKER_VERSION@)
13
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_ASM_COMPILER_LINKER_FRONTEND_VARIANT@)
14
+ set(CMAKE_MT "@CMAKE_MT@")
15
+ set(CMAKE_TAPI "@CMAKE_TAPI@")
16
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
17
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
18
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
19
+ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
20
+ @_SET_CMAKE_ASM_COMPILER_ID_VENDOR_MATCH@
21
+ @_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID@
22
+ @_SET_CMAKE_ASM_COMPILER_SYSROOT@
23
+
24
+ set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
25
+ set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
26
+ set(CMAKE_ASM@ASM_DIALECT@_LINKER_DEPFILE_SUPPORTED @CMAKE_ASM_LINKER_DEPFILE_SUPPORTED@)
27
+
28
+ @CMAKE_ASM_COMPILER_CUSTOM_CODE@
cmake/share/cmake-3.31/Modules/CMakeASMInformation.cmake ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ if(UNIX)
6
+ set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
7
+ else()
8
+ set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
9
+ endif()
10
+
11
+ set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
12
+ set(CMAKE_BASE_NAME)
13
+ get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
14
+
15
+ if("${CMAKE_BASE_NAME}" STREQUAL "as")
16
+ set(CMAKE_BASE_NAME gas)
17
+ endif()
18
+
19
+ # Load compiler-specific information.
20
+ set(_INCLUDED_FILE "")
21
+ if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
22
+ include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
23
+ endif()
24
+ if(NOT _INCLUDED_FILE)
25
+ if("ASM${ASM_DIALECT}" STREQUAL "ASM")
26
+ message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
27
+ endif()
28
+ include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
29
+ endif()
30
+
31
+ if(CMAKE_SYSTEM_PROCESSOR)
32
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
33
+ if(NOT _INCLUDED_FILE)
34
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
35
+ endif()
36
+ endif()
37
+
38
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
39
+ if(NOT _INCLUDED_FILE)
40
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
41
+ endif()
42
+
43
+ # This should be included before the _INIT variables are
44
+ # used to initialize the cache. Since the rule variables
45
+ # have if blocks on them, users can still define them here.
46
+ # But, it should still be after the platform file so changes can
47
+ # be made to those values.
48
+
49
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE)
50
+ # Save the full path of the file so try_compile can use it.
51
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
52
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
53
+ endif()
54
+
55
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE_ASM)
56
+ # Save the full path of the file so try_compile can use it.
57
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_ASM} RESULT_VARIABLE _override)
58
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_ASM "${_override}")
59
+ endif()
60
+
61
+ # Set default assembler file extensions:
62
+ if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
63
+ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
64
+ endif()
65
+
66
+
67
+ # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
68
+ set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
69
+
70
+ cmake_initialize_per_config_variable(CMAKE_ASM${ASM_DIALECT}_FLAGS "Flags used by the ASM${ASM_DIALECT} compiler")
71
+
72
+ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
73
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
74
+ endif()
75
+
76
+ if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
77
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
78
+ "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
79
+ "<CMAKE_RANLIB> <TARGET>")
80
+ endif()
81
+
82
+ if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
83
+ set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
84
+ "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
85
+ endif()
86
+
87
+ if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
88
+ set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
89
+ endif()
90
+
91
+ if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
92
+ set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
93
+ endif()
94
+
95
+ if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
96
+ set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
97
+ endif()
98
+
99
+ set(CMAKE_ASM${ASM_DIALECT}_USE_LINKER_INFORMATION TRUE)
100
+
101
+ set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeASM_MARMASMInformation.cmake ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # support for the MS ARM assembler, marmasm and marmasm64
6
+
7
+ set(ASM_DIALECT "_MARMASM")
8
+
9
+ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
10
+
11
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
12
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY "<CMAKE_AR> <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
13
+
14
+ # The ASM_MARMASM compiler id for this compiler is "MSVC", so fill out the runtime library table.
15
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
16
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
17
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
18
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
19
+
20
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded "-g")
21
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "")
22
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "")
23
+
24
+ include(CMakeASMInformation)
25
+ set(ASM_DIALECT)
cmake/share/cmake-3.31/Modules/CMakeASM_MASMInformation.cmake ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # support for the MS assembler, masm and masm64
6
+
7
+ set(ASM_DIALECT "_MASM")
8
+
9
+ set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
10
+
11
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -c -Fo <OBJECT> <SOURCE>")
12
+ set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY "<CMAKE_AR> <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
13
+
14
+ # The ASM_MASM compiler id for this compiler is "MSVC", so fill out the runtime library table.
15
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
16
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
17
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
18
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
19
+
20
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded "-Zi")
21
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase "")
22
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue "")
23
+
24
+ include(CMakeASMInformation)
25
+ set(ASM_DIALECT)
cmake/share/cmake-3.31/Modules/CMakeASM_NASMInformation.cmake ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # support for the nasm assembler
6
+
7
+ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
8
+
9
+ if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
10
+ if(WIN32)
11
+ if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
12
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
13
+ elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
14
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
15
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
16
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
17
+ else()
18
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
19
+ endif()
20
+ elseif(APPLE)
21
+ if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
22
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
23
+ elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
24
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
25
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
26
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
27
+ else()
28
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
29
+ endif()
30
+ else()
31
+ if(DEFINED CMAKE_C_SIZEOF_DATA_PTR AND CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
32
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
33
+ elseif(DEFINED CMAKE_CXX_SIZEOF_DATA_PTR AND CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
34
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
35
+ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
36
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
37
+ else()
38
+ set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
39
+ endif()
40
+ endif()
41
+ endif()
42
+
43
+ if(NOT CMAKE_ASM_NASM_COMPILE_OBJECT)
44
+ set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
45
+ endif()
46
+
47
+ if(NOT CMAKE_ASM_NASM_LINK_EXECUTABLE)
48
+ set(CMAKE_ASM_NASM_LINK_EXECUTABLE
49
+ "<CMAKE_LINKER> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
50
+ endif()
51
+
52
+ if(CMAKE_ASM_NASM_COMPILER_ID STREQUAL "NASM")
53
+ set(CMAKE_DEPFILE_FLAGS_ASM_NASM "-MD <DEP_FILE> -MT <DEP_TARGET>")
54
+
55
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
56
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
57
+ # dependencies are computed by the compiler itself
58
+ set(CMAKE_ASM_NASM_DEPFILE_FORMAT gcc)
59
+ set(CMAKE_ASM_NASM_DEPENDS_USE_COMPILER TRUE)
60
+ endif()
61
+ endif()
62
+
63
+ # Load the generic ASMInformation file:
64
+ set(ASM_DIALECT "_NASM")
65
+ include(CMakeASMInformation)
66
+ set(ASM_DIALECT)
cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory.cmake ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ CMakeAddFortranSubdirectory
6
+ ---------------------------
7
+
8
+ Add a fortran-only subdirectory, find a fortran compiler, and build.
9
+
10
+ The ``cmake_add_fortran_subdirectory`` function adds a subdirectory
11
+ to a project that contains a fortran-only subproject. The module will
12
+ check the current compiler and see if it can support fortran. If no
13
+ fortran compiler is found and the compiler is MSVC, then this module
14
+ will find the MinGW gfortran. It will then use an external project to
15
+ build with the MinGW tools. It will also create imported targets for
16
+ the libraries created. This will only work if the fortran code is
17
+ built into a dll, so :variable:`BUILD_SHARED_LIBS` is turned on in
18
+ the project. In addition the :variable:`CMAKE_GNUtoMS` option is set
19
+ to on, so that Microsoft ``.lib`` files are created. Usage is as follows:
20
+
21
+ ::
22
+
23
+ cmake_add_fortran_subdirectory(
24
+ <subdir> # name of subdirectory
25
+ PROJECT <project_name> # project name in subdir top CMakeLists.txt
26
+ ARCHIVE_DIR <dir> # dir where project places .lib files
27
+ RUNTIME_DIR <dir> # dir where project places .dll files
28
+ LIBRARIES <lib>... # names of library targets to import
29
+ LINK_LIBRARIES # link interface libraries for LIBRARIES
30
+ [LINK_LIBS <lib> <dep>...]...
31
+ CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
32
+ NO_EXTERNAL_INSTALL # skip installation of external project
33
+ )
34
+
35
+ Relative paths in ``ARCHIVE_DIR`` and ``RUNTIME_DIR`` are interpreted with
36
+ respect to the build directory corresponding to the source directory
37
+ in which the function is invoked.
38
+
39
+ Limitations:
40
+
41
+ ``NO_EXTERNAL_INSTALL`` is required for forward compatibility with a
42
+ future version that supports installation of the external project
43
+ binaries during ``make install``.
44
+ #]=======================================================================]
45
+
46
+ include(CheckLanguage)
47
+ include(ExternalProject)
48
+
49
+ function(_setup_mingw_config_and_build source_dir build_dir)
50
+ # Look for a MinGW gfortran.
51
+ find_program(MINGW_GFORTRAN
52
+ NAMES gfortran
53
+ PATHS
54
+ c:/MinGW/bin
55
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
56
+ )
57
+ if(NOT MINGW_GFORTRAN)
58
+ message(FATAL_ERROR
59
+ "gfortran not found, please install MinGW with the gfortran option."
60
+ "Or set the cache variable MINGW_GFORTRAN to the full path. "
61
+ " This is required to build")
62
+ endif()
63
+
64
+ # Validate the MinGW gfortran we found.
65
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
66
+ set(_mingw_target "Target:.*64.*mingw")
67
+ else()
68
+ set(_mingw_target "Target:.*mingw32")
69
+ endif()
70
+ execute_process(COMMAND "${MINGW_GFORTRAN}" -v
71
+ ERROR_VARIABLE out ERROR_STRIP_TRAILING_WHITESPACE)
72
+ if(NOT "${out}" MATCHES "${_mingw_target}")
73
+ string(REPLACE "\n" "\n " out " ${out}")
74
+ message(FATAL_ERROR
75
+ "MINGW_GFORTRAN is set to\n"
76
+ " ${MINGW_GFORTRAN}\n"
77
+ "which is not a MinGW gfortran for this architecture. "
78
+ "The output from -v does not match \"${_mingw_target}\":\n"
79
+ "${out}\n"
80
+ "Set MINGW_GFORTRAN to a proper MinGW gfortran for this architecture."
81
+ )
82
+ endif()
83
+
84
+ # Configure scripts to run MinGW tools with the proper PATH.
85
+ get_filename_component(MINGW_PATH ${MINGW_GFORTRAN} PATH)
86
+ file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH)
87
+ string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}")
88
+ configure_file(
89
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CMakeAddFortranSubdirectory/config_mingw.cmake.in
90
+ ${build_dir}/config_mingw.cmake
91
+ @ONLY)
92
+ configure_file(
93
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CMakeAddFortranSubdirectory/build_mingw.cmake.in
94
+ ${build_dir}/build_mingw.cmake
95
+ @ONLY)
96
+ endfunction()
97
+
98
+ function(_add_fortran_library_link_interface library depend_library)
99
+ set_target_properties(${library} PROPERTIES
100
+ IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "${depend_library}")
101
+ endfunction()
102
+
103
+
104
+ function(cmake_add_fortran_subdirectory subdir)
105
+ # Parse arguments to function
106
+ set(options NO_EXTERNAL_INSTALL)
107
+ set(oneValueArgs PROJECT ARCHIVE_DIR RUNTIME_DIR)
108
+ set(multiValueArgs LIBRARIES LINK_LIBRARIES CMAKE_COMMAND_LINE)
109
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
110
+ if(NOT ARGS_NO_EXTERNAL_INSTALL)
111
+ message(FATAL_ERROR
112
+ "Option NO_EXTERNAL_INSTALL is required (for forward compatibility) "
113
+ "but was not given."
114
+ )
115
+ endif()
116
+
117
+ # if we are not using MSVC without fortran support
118
+ # then just use the usual add_subdirectory to build
119
+ # the fortran library
120
+ check_language(Fortran)
121
+ if(NOT (MSVC AND (NOT CMAKE_Fortran_COMPILER)))
122
+ add_subdirectory(${subdir})
123
+ return()
124
+ endif()
125
+
126
+ # if we have MSVC without Intel fortran then setup
127
+ # external projects to build with mingw fortran
128
+
129
+ set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
130
+ set(project_name "${ARGS_PROJECT}")
131
+ set(library_dir "${ARGS_ARCHIVE_DIR}")
132
+ set(binary_dir "${ARGS_RUNTIME_DIR}")
133
+ set(libraries ${ARGS_LIBRARIES})
134
+ # use the same directory that add_subdirectory would have used
135
+ set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
136
+ foreach(dir_var library_dir binary_dir)
137
+ if(NOT IS_ABSOLUTE "${${dir_var}}")
138
+ get_filename_component(${dir_var}
139
+ "${CMAKE_CURRENT_BINARY_DIR}/${${dir_var}}" ABSOLUTE)
140
+ endif()
141
+ endforeach()
142
+ # create build and configure wrapper scripts
143
+ _setup_mingw_config_and_build("${source_dir}" "${build_dir}")
144
+ # create the external project
145
+ externalproject_add(${project_name}_build
146
+ SOURCE_DIR ${source_dir}
147
+ BINARY_DIR ${build_dir}
148
+ CONFIGURE_COMMAND ${CMAKE_COMMAND}
149
+ -P ${build_dir}/config_mingw.cmake
150
+ BUILD_COMMAND ${CMAKE_COMMAND}
151
+ -P ${build_dir}/build_mingw.cmake
152
+ BUILD_ALWAYS 1
153
+ INSTALL_COMMAND ""
154
+ )
155
+ # create imported targets for all libraries
156
+ foreach(lib ${libraries})
157
+ add_library(${lib} SHARED IMPORTED GLOBAL)
158
+ set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
159
+ set_target_properties(${lib} PROPERTIES
160
+ IMPORTED_IMPLIB_NOCONFIG "${library_dir}/lib${lib}.lib"
161
+ IMPORTED_LOCATION_NOCONFIG "${binary_dir}/lib${lib}.dll"
162
+ )
163
+ add_dependencies(${lib} ${project_name}_build)
164
+ endforeach()
165
+
166
+ # now setup link libraries for targets
167
+ set(start FALSE)
168
+ set(target)
169
+ foreach(lib ${ARGS_LINK_LIBRARIES})
170
+ if("${lib}" STREQUAL "LINK_LIBS")
171
+ set(start TRUE)
172
+ else()
173
+ if(start)
174
+ if(DEFINED target)
175
+ # process current target and target_libs
176
+ _add_fortran_library_link_interface(${target} "${target_libs}")
177
+ # zero out target and target_libs
178
+ set(target)
179
+ set(target_libs)
180
+ endif()
181
+ # save the current target and set start to FALSE
182
+ set(target ${lib})
183
+ set(start FALSE)
184
+ else()
185
+ # append the lib to target_libs
186
+ list(APPEND target_libs "${lib}")
187
+ endif()
188
+ endif()
189
+ endforeach()
190
+ # process anything that is left in target and target_libs
191
+ if(DEFINED target)
192
+ _add_fortran_library_link_interface(${target} "${target_libs}")
193
+ endif()
194
+ endfunction()
cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory/build_mingw.cmake.in ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
2
+ execute_process(COMMAND "@CMAKE_COMMAND@" --build . )
cmake/share/cmake-3.31/Modules/CMakeAddFortranSubdirectory/config_mingw.cmake.in ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
2
+ set(CMAKE_COMMAND_LINE "@ARGS_CMAKE_COMMAND_LINE@")
3
+ execute_process(
4
+ COMMAND "@CMAKE_COMMAND@" "-GMinGW Makefiles"
5
+ -DCMAKE_Fortran_COMPILER:PATH=@MINGW_GFORTRAN@
6
+ -DBUILD_SHARED_LIBS=ON
7
+ -DCMAKE_GNUtoMS=ON
8
+ ${CMAKE_COMMAND_LINE}
9
+ "@source_dir@")
cmake/share/cmake-3.31/Modules/CMakeAddNewLanguage.txt ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This file provides a few notes to CMake developers about how to add
2
+ support for a new language to CMake. It is also possible to place
3
+ these files in :variable:`CMAKE_MODULE_PATH` within an outside project
4
+ to add languages not supported by upstream CMake. However, this is not
5
+ a fully supported use case.
6
+
7
+ The implementation behind the scenes of project/enable_language,
8
+ including the compiler/platform modules, is an *internal* API that
9
+ does not make any compatibility guarantees. It is not covered in the
10
+ official reference documentation that is versioned with the source code.
11
+ Maintainers of external language support are responsible for porting
12
+ it to each version of CMake as upstream changes are made. Since
13
+ the API is internal we will not necessarily include notice of any
14
+ changes in release notes.
15
+
16
+
17
+ CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
18
+
19
+ CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake
20
+ This file is used to store compiler information and is copied down into try
21
+ compile directories so that try compiles do not need to re-determine and test the LANG
22
+
23
+ CMake(LANG)Information.cmake => set compiler configuration:
24
+ CMAKE_(LANG)_CREATE_SHARED_LIBRARY
25
+ CMAKE_(LANG)_CREATE_SHARED_MODULE
26
+ CMAKE_(LANG)_CREATE_STATIC_LIBRARY
27
+ CMAKE_(LANG)_COMPILE_OBJECT
28
+ CMAKE_(LANG)_LINK_EXECUTABLE
29
+
30
+ CMAKE_(LANG)_USE_LINKER_INFORMATION
31
+
32
+ CMakeTest(LANG)Compiler.cmake -> test the compiler and set:
33
+ SET(CMAKE_(LANG)_COMPILER_WORKS 1 CACHE INTERNAL "")
34
+
35
+
36
+ If the variable CMAKE_(LANG)_USE_LINKER_INFORMATION has value TRUE, the file CMake(LANG)LinkerInformation.cmake
37
+ should be defined.
38
+
39
+ CMake(LANG)LinkerInformation.cmake -> set up linker configuration for LANG.
cmake/share/cmake-3.31/Modules/CMakeBackwardCompatibilityC.cmake ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
6
+ # Old CMake versions did not support OS X universal binaries anyway,
7
+ # so just get through this with at least some size for the types.
8
+ list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
9
+ if(${NUM_ARCHS} GREATER 1)
10
+ if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
11
+ message(WARNING "This module does not work with OS X universal binaries.")
12
+ set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
13
+ list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
14
+ endif()
15
+ endif()
16
+
17
+ include (CheckTypeSize)
18
+ CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
19
+ CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
20
+ CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
21
+ CHECK_TYPE_SIZE(char CMAKE_SIZEOF_CHAR)
22
+ CHECK_TYPE_SIZE(short CMAKE_SIZEOF_SHORT)
23
+ CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
24
+ CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
25
+
26
+ include (CheckIncludeFile)
27
+ CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
28
+ CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
29
+ CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
30
+
31
+ include (CheckIncludeFiles)
32
+ CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
33
+
34
+ include (TestBigEndian)
35
+ TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
36
+ include (FindX11)
37
+
38
+ if("${X11_X11_INCLUDE_PATH}" STREQUAL "/usr/include")
39
+ set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
40
+ else()
41
+ set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
42
+ "X11 extra flags.")
43
+ endif()
44
+ set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
45
+ "Libraries and options used in X11 programs.")
46
+ set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
47
+
48
+ include (FindThreads)
49
+
50
+ set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
51
+ "Thread library used.")
52
+
53
+ set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
54
+ "Use the pthreads library.")
55
+
56
+ set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
57
+ "Use the win32 thread library.")
58
+
59
+ set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
60
+ "Use HP pthreads.")
61
+
62
+ if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
63
+ set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
64
+ set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
65
+ endif()
66
+ endif()
67
+
68
+ mark_as_advanced(
69
+ CMAKE_HP_PTHREADS
70
+ CMAKE_THREAD_LIBS
71
+ CMAKE_USE_PTHREADS
72
+ CMAKE_USE_WIN32_THREADS
73
+ CMAKE_X_CFLAGS
74
+ CMAKE_X_LIBS
75
+ )
76
+
cmake/share/cmake-3.31/Modules/CMakeBackwardCompatibilityCXX.cmake ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ CMakeBackwardCompatibilityCXX
6
+ -----------------------------
7
+
8
+ define a bunch of backwards compatibility variables
9
+
10
+ ::
11
+
12
+ CMAKE_ANSI_CXXFLAGS - flag for ansi c++
13
+ CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
14
+ include(TestForANSIStreamHeaders)
15
+ include(CheckIncludeFileCXX)
16
+ include(TestForSTDNamespace)
17
+ include(TestForANSIForScope)
18
+ #]=======================================================================]
19
+
20
+ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
21
+ # check for some ANSI flags in the CXX compiler if it is not gnu
22
+ if(NOT CMAKE_COMPILER_IS_GNUCXX)
23
+ include(TestCXXAcceptsFlag)
24
+ set(CMAKE_TRY_ANSI_CXX_FLAGS "")
25
+ if(CMAKE_SYSTEM_NAME MATCHES "OSF")
26
+ set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
27
+ endif()
28
+ # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
29
+ # if the compiler accepts it
30
+ if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
31
+ CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
32
+ # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
33
+ # to the flag
34
+ if(CMAKE_CXX_ACCEPTS_FLAGS)
35
+ set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
36
+ "What flags are required by the c++ compiler to make it ansi." )
37
+ endif()
38
+ endif()
39
+ endif()
40
+ set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
41
+ string(APPEND CMAKE_CXX_FLAGS " ${CMAKE_ANSI_CXXFLAGS}")
42
+ include(TestForANSIStreamHeaders)
43
+ include(CheckIncludeFileCXX)
44
+ include(TestForSTDNamespace)
45
+ include(TestForANSIForScope)
46
+ include(TestForSSTREAM)
47
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
48
+ endif()
49
+
cmake/share/cmake-3.31/Modules/CMakeBorlandFindMake.cmake ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ set (CMAKE_MAKE_PROGRAM "make" CACHE STRING
6
+ "Program used to build from makefiles.")
7
+ mark_as_advanced(CMAKE_MAKE_PROGRAM)
cmake/share/cmake-3.31/Modules/CMakeBuildSettings.cmake.in ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # The command CMAKE_EXPORT_BUILD_SETTINGS(...) was used by
3
+ # @PROJECT_NAME@ to generate this file. As of CMake 2.8 the
4
+ # functionality of this command has been dropped as it was deemed
5
+ # harmful (confusing users by changing their compiler).
6
+
7
+ # CMake 2.6 and below do not support loading their equivalent of this
8
+ # file if it was produced by a newer version of CMake. CMake 2.8 and
9
+ # above simply do not load this file. Therefore we simply error out.
10
+ message(FATAL_ERROR
11
+ "This @PROJECT_NAME@ was built by CMake @CMAKE_VERSION@, but this is CMake "
12
+ "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}. "
13
+ "Please upgrade CMake to a more recent version.")
cmake/share/cmake-3.31/Modules/CMakeCCompiler.cmake.in ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
2
+ set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
3
+ set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
4
+ set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
5
+ set(CMAKE_C_COMPILER_VERSION_INTERNAL "@CMAKE_C_COMPILER_VERSION_INTERNAL@")
6
+ set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@")
7
+ set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@")
8
+ set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT@")
9
+ set(CMAKE_C_STANDARD_LATEST "@CMAKE_C_STANDARD_LATEST@")
10
+ set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
11
+ set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")
12
+ set(CMAKE_C99_COMPILE_FEATURES "@CMAKE_C99_COMPILE_FEATURES@")
13
+ set(CMAKE_C11_COMPILE_FEATURES "@CMAKE_C11_COMPILE_FEATURES@")
14
+ set(CMAKE_C17_COMPILE_FEATURES "@CMAKE_C17_COMPILE_FEATURES@")
15
+ set(CMAKE_C23_COMPILE_FEATURES "@CMAKE_C23_COMPILE_FEATURES@")
16
+
17
+ set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
18
+ set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
19
+ set(CMAKE_C_COMPILER_FRONTEND_VARIANT "@CMAKE_C_COMPILER_FRONTEND_VARIANT@")
20
+ set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
21
+ @_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID@
22
+ @_SET_CMAKE_C_COMPILER_SYSROOT@
23
+ @SET_MSVC_C_ARCHITECTURE_ID@
24
+ @SET_CMAKE_XCODE_ARCHS@
25
+ set(CMAKE_AR "@CMAKE_AR@")
26
+ set(CMAKE_C_COMPILER_AR "@CMAKE_C_COMPILER_AR@")
27
+ set(CMAKE_RANLIB "@CMAKE_RANLIB@")
28
+ set(CMAKE_C_COMPILER_RANLIB "@CMAKE_C_COMPILER_RANLIB@")
29
+ set(CMAKE_LINKER "@CMAKE_LINKER@")
30
+ set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
31
+ set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
32
+ set(CMAKE_C_COMPILER_LINKER "@CMAKE_C_COMPILER_LINKER@")
33
+ set(CMAKE_C_COMPILER_LINKER_ID "@CMAKE_C_COMPILER_LINKER_ID@")
34
+ set(CMAKE_C_COMPILER_LINKER_VERSION @CMAKE_C_COMPILER_LINKER_VERSION@)
35
+ set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT@)
36
+ set(CMAKE_MT "@CMAKE_MT@")
37
+ set(CMAKE_TAPI "@CMAKE_TAPI@")
38
+ set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
39
+ set(CMAKE_C_COMPILER_LOADED 1)
40
+ set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@)
41
+ set(CMAKE_C_ABI_COMPILED @CMAKE_C_ABI_COMPILED@)
42
+
43
+ set(CMAKE_C_COMPILER_ENV_VAR "CC")
44
+
45
+ set(CMAKE_C_COMPILER_ID_RUN 1)
46
+ set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
47
+ set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
48
+ set(CMAKE_C_LINKER_PREFERENCE 10)
49
+ set(CMAKE_C_LINKER_DEPFILE_SUPPORTED @CMAKE_C_LINKER_DEPFILE_SUPPORTED@)
50
+
51
+ # Save compiler ABI information.
52
+ set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
53
+ set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
54
+ set(CMAKE_C_BYTE_ORDER "@CMAKE_C_BYTE_ORDER@")
55
+ set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
56
+
57
+ if(CMAKE_C_SIZEOF_DATA_PTR)
58
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
59
+ endif()
60
+
61
+ if(CMAKE_C_COMPILER_ABI)
62
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
63
+ endif()
64
+
65
+ if(CMAKE_C_LIBRARY_ARCHITECTURE)
66
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
67
+ endif()
68
+
69
+ set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "@CMAKE_C_CL_SHOWINCLUDES_PREFIX@")
70
+ if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
71
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
72
+ endif()
73
+
74
+ @CMAKE_C_COMPILER_CUSTOM_CODE@
75
+ @CMAKE_C_SYSROOT_FLAG_CODE@
76
+ @CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
77
+
78
+ set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES@")
79
+ set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
80
+ set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
81
+ set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
cmake/share/cmake-3.31/Modules/CMakeCCompilerABI.c ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifdef __cplusplus
2
+ # error "A C++ compiler has been selected for C."
3
+ #endif
4
+
5
+ #ifdef __CLASSIC_C__
6
+ # define const
7
+ #endif
8
+
9
+ #include "CMakeCompilerABI.h"
10
+
11
+ #ifdef __CLASSIC_C__
12
+ int main(argc, argv)
13
+ int argc;
14
+ char* argv[];
15
+ #else
16
+ int main(int argc, char* argv[])
17
+ #endif
18
+ {
19
+ int require = 0;
20
+ require += info_sizeof_dptr[argc];
21
+ require += info_byte_order_big_endian[argc];
22
+ require += info_byte_order_little_endian[argc];
23
+ #if defined(ABI_ID)
24
+ require += info_abi[argc];
25
+ #endif
26
+ (void)argv;
27
+ return require;
28
+ }
cmake/share/cmake-3.31/Modules/CMakeCCompilerId.c.in ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifdef __cplusplus
2
+ # error "A C++ compiler has been selected for C."
3
+ #endif
4
+
5
+ #if defined(__18CXX)
6
+ # define ID_VOID_MAIN
7
+ #endif
8
+ #if defined(__CLASSIC_C__)
9
+ /* cv-qualifiers did not exist in K&R C */
10
+ # define const
11
+ # define volatile
12
+ #endif
13
+
14
+ #if !defined(__has_include)
15
+ /* If the compiler does not have __has_include, pretend the answer is
16
+ always no. */
17
+ # define __has_include(x) 0
18
+ #endif
19
+
20
+ @CMAKE_C_COMPILER_ID_CONTENT@
21
+
22
+ /* Construct the string literal in pieces to prevent the source from
23
+ getting matched. Store it in a pointer rather than an array
24
+ because some compilers will just produce instructions to fill the
25
+ array rather than assigning a pointer to a static array. */
26
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
27
+ #ifdef SIMULATE_ID
28
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
29
+ #endif
30
+
31
+ #ifdef __QNXNTO__
32
+ char const* qnxnto = "INFO" ":" "qnxnto[]";
33
+ #endif
34
+
35
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
36
+ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
37
+ #endif
38
+
39
+ @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
40
+ @CMAKE_C_COMPILER_ID_ERROR_FOR_TEST@
41
+
42
+ #define C_STD_99 199901L
43
+ #define C_STD_11 201112L
44
+ #define C_STD_17 201710L
45
+ #define C_STD_23 202311L
46
+
47
+ #ifdef __STDC_VERSION__
48
+ # define C_STD __STDC_VERSION__
49
+ #endif
50
+
51
+ #if !defined(__STDC__) && !defined(__clang__)
52
+ # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
53
+ # define C_VERSION "90"
54
+ # else
55
+ # define C_VERSION
56
+ # endif
57
+ #elif C_STD > C_STD_17
58
+ # define C_VERSION "23"
59
+ #elif C_STD > C_STD_11
60
+ # define C_VERSION "17"
61
+ #elif C_STD > C_STD_99
62
+ # define C_VERSION "11"
63
+ #elif C_STD >= C_STD_99
64
+ # define C_VERSION "99"
65
+ #else
66
+ # define C_VERSION "90"
67
+ #endif
68
+ const char* info_language_standard_default =
69
+ "INFO" ":" "standard_default[" C_VERSION "]";
70
+
71
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
72
+ #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
73
+ defined(__TI_COMPILER_VERSION__)) && \
74
+ !defined(__STRICT_ANSI__)
75
+ "ON"
76
+ #else
77
+ "OFF"
78
+ #endif
79
+ "]";
80
+
81
+ /*--------------------------------------------------------------------------*/
82
+
83
+ #ifdef ID_VOID_MAIN
84
+ void main() {}
85
+ #else
86
+ # if defined(__CLASSIC_C__)
87
+ int main(argc, argv) int argc; char *argv[];
88
+ # else
89
+ int main(int argc, char* argv[])
90
+ # endif
91
+ {
92
+ int require = 0;
93
+ require += info_compiler[argc];
94
+ require += info_platform[argc];
95
+ require += info_arch[argc];
96
+ #ifdef COMPILER_VERSION_MAJOR
97
+ require += info_version[argc];
98
+ #endif
99
+ #ifdef COMPILER_VERSION_INTERNAL
100
+ require += info_version_internal[argc];
101
+ #endif
102
+ #ifdef SIMULATE_ID
103
+ require += info_simulate[argc];
104
+ #endif
105
+ #ifdef SIMULATE_VERSION_MAJOR
106
+ require += info_simulate_version[argc];
107
+ #endif
108
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
109
+ require += info_cray[argc];
110
+ #endif
111
+ require += info_language_standard_default[argc];
112
+ require += info_language_extensions_default[argc];
113
+ (void)argv;
114
+ return require;
115
+ }
116
+ #endif
cmake/share/cmake-3.31/Modules/CMakeCInformation.cmake ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # This file sets the basic flags for the C language in CMake.
6
+ # It also loads the available platform file for the system-compiler
7
+ # if it exists.
8
+ # It also loads a system - compiler - processor (or target hardware)
9
+ # specific file, which is mainly useful for crosscompiling and embedded systems.
10
+
11
+ include(CMakeLanguageInformation)
12
+
13
+ # some compilers use different extensions (e.g. sdcc uses .rel)
14
+ # so set the extension here first so it can be overridden by the compiler specific file
15
+ if(UNIX)
16
+ set(CMAKE_C_OUTPUT_EXTENSION .o)
17
+ else()
18
+ set(CMAKE_C_OUTPUT_EXTENSION .obj)
19
+ endif()
20
+
21
+ set(_INCLUDED_FILE 0)
22
+
23
+ # Load compiler-specific information.
24
+ if(CMAKE_C_COMPILER_ID)
25
+ include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
26
+ endif()
27
+
28
+ set(CMAKE_BASE_NAME)
29
+ get_filename_component(CMAKE_BASE_NAME "${CMAKE_C_COMPILER}" NAME_WE)
30
+ if(CMAKE_COMPILER_IS_GNUCC)
31
+ set(CMAKE_BASE_NAME gcc)
32
+ endif()
33
+
34
+
35
+ # load a hardware specific file, mostly useful for embedded compilers
36
+ if(CMAKE_SYSTEM_PROCESSOR)
37
+ if(CMAKE_C_COMPILER_ID)
38
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
39
+ endif()
40
+ if (NOT _INCLUDED_FILE)
41
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
42
+ endif ()
43
+ endif()
44
+
45
+
46
+ # load the system- and compiler specific files
47
+ if(CMAKE_C_COMPILER_ID)
48
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
49
+ OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
50
+ endif()
51
+ if (NOT _INCLUDED_FILE)
52
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
53
+ OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
54
+ endif ()
55
+
56
+ # load any compiler-wrapper specific information
57
+ if (CMAKE_C_COMPILER_WRAPPER)
58
+ __cmake_include_compiler_wrapper(C)
59
+ endif ()
60
+
61
+ # We specify the compiler information in the system file for some
62
+ # platforms, but this language may not have been enabled when the file
63
+ # was first included. Include it again to get the language info.
64
+ # Remove this when all compiler info is removed from system files.
65
+ if (NOT _INCLUDED_FILE)
66
+ include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
67
+ endif ()
68
+
69
+ if(CMAKE_C_SIZEOF_DATA_PTR)
70
+ foreach(f IN LISTS CMAKE_C_ABI_FILES)
71
+ include(${f})
72
+ endforeach()
73
+ unset(CMAKE_C_ABI_FILES)
74
+ endif()
75
+
76
+ # This should be included before the _INIT variables are
77
+ # used to initialize the cache. Since the rule variables
78
+ # have if blocks on them, users can still define them here.
79
+ # But, it should still be after the platform file so changes can
80
+ # be made to those values.
81
+
82
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE)
83
+ # Save the full path of the file so try_compile can use it.
84
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
85
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
86
+ endif()
87
+
88
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
89
+ # Save the full path of the file so try_compile can use it.
90
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
91
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
92
+ endif()
93
+
94
+ set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
95
+
96
+ cmake_initialize_per_config_variable(CMAKE_C_FLAGS "Flags used by the C compiler")
97
+
98
+ if(CMAKE_C_STANDARD_LIBRARIES_INIT)
99
+ set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
100
+ CACHE STRING "Libraries linked by default with all C applications.")
101
+ mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
102
+ endif()
103
+
104
+ if(NOT CMAKE_C_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_C_COMPILER_LAUNCHER})
105
+ set(CMAKE_C_COMPILER_LAUNCHER "$ENV{CMAKE_C_COMPILER_LAUNCHER}"
106
+ CACHE STRING "Compiler launcher for C.")
107
+ endif()
108
+
109
+ if(NOT CMAKE_C_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_C_LINKER_LAUNCHER})
110
+ set(CMAKE_C_LINKER_LAUNCHER "$ENV{CMAKE_C_LINKER_LAUNCHER}"
111
+ CACHE STRING "Linker launcher for C.")
112
+ endif()
113
+
114
+ include(CMakeCommonLanguageInclude)
115
+ _cmake_common_language_platform_flags(C)
116
+
117
+ # now define the following rule variables
118
+
119
+ # CMAKE_C_CREATE_SHARED_LIBRARY
120
+ # CMAKE_C_CREATE_SHARED_MODULE
121
+ # CMAKE_C_COMPILE_OBJECT
122
+ # CMAKE_C_LINK_EXECUTABLE
123
+
124
+ # variables supplied by the generator at use time
125
+ # <TARGET>
126
+ # <TARGET_BASE> the target without the suffix
127
+ # <OBJECTS>
128
+ # <OBJECT>
129
+ # <LINK_LIBRARIES>
130
+ # <FLAGS>
131
+ # <LINK_FLAGS>
132
+
133
+ # C compiler information
134
+ # <CMAKE_C_COMPILER>
135
+ # <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
136
+ # <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
137
+ # <CMAKE_C_LINK_FLAGS>
138
+
139
+ # Static library tools
140
+ # <CMAKE_AR>
141
+ # <CMAKE_RANLIB>
142
+
143
+
144
+ # create a C shared library
145
+ if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
146
+ set(CMAKE_C_CREATE_SHARED_LIBRARY
147
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
148
+ endif()
149
+
150
+ # create a C shared module just copy the shared library rule
151
+ if(NOT CMAKE_C_CREATE_SHARED_MODULE)
152
+ set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
153
+ endif()
154
+
155
+ # Create a static archive incrementally for large object file counts.
156
+ # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
157
+ if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
158
+ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
159
+ endif()
160
+ if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
161
+ set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
162
+ endif()
163
+ if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
164
+ set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
165
+ endif()
166
+
167
+ # compile a C file into an object file
168
+ if(NOT CMAKE_C_COMPILE_OBJECT)
169
+ set(CMAKE_C_COMPILE_OBJECT
170
+ "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
171
+ endif()
172
+
173
+ if(NOT CMAKE_C_LINK_EXECUTABLE)
174
+ set(CMAKE_C_LINK_EXECUTABLE
175
+ "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
176
+ endif()
177
+
178
+ set(CMAKE_C_USE_LINKER_INFORMATION TRUE)
179
+
180
+ set(CMAKE_C_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCSharpCompiler.cmake.in ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_CSharp_COMPILER "@CMAKE_CSharp_COMPILER@")
2
+ set(CMAKE_CSharp_COMPILER_ID "@CMAKE_CSharp_COMPILER_ID@")
3
+ set(CMAKE_CSharp_COMPILER_VERSION "@CMAKE_CSharp_COMPILER_VERSION@")
4
+
5
+ set(CMAKE_CSharp_COMPILER_LOADED 1)
6
+ set(CMAKE_CSharp_COMPILER_WORKS "@CMAKE_CSharp_COMPILER_WORKS@")
7
+
8
+ set(CMAKE_CSharp_COMPILER_ID_RUN "@CMAKE_CSharp_COMPILER_ID_RUN@")
9
+ set(CMAKE_CSharp_IGNORE_EXTENSIONS "inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC")
10
+ set(CMAKE_CSharp_SOURCE_FILE_EXTENSIONS "cs")
cmake/share/cmake-3.31/Modules/CMakeCSharpCompilerId.cs.in ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ using System;
2
+
3
+ namespace CSharp
4
+ {
5
+ public class CSharpApp
6
+ {
7
+ const string InfoCompiler = "INFO:compiler[Microsoft "
8
+ #if PlatformToolsetv100
9
+ + "Visual Studio"
10
+ #elif PlatformToolsetv110
11
+ + "Visual Studio"
12
+ #elif PlatformToolsetv120
13
+ + "Visual Studio"
14
+ #elif PlatformToolsetv140
15
+ + "Visual Studio"
16
+ #elif PlatformToolsetv141
17
+ + "Visual Studio"
18
+ #elif PlatformToolsetv142
19
+ + "Visual Studio"
20
+ #elif PlatformToolsetv143
21
+ + "Visual Studio"
22
+ #else
23
+ + "unknown"
24
+ #endif
25
+ + "]";
26
+
27
+ const string InfoPlatform = "INFO:platform[Windows]";
28
+
29
+ const string InfoArchitecture = "INFO:arch["
30
+ #if Platformx64
31
+ + "x64"
32
+ #elif Platformx86
33
+ + "x86"
34
+ #elif PlatformxWin32
35
+ + "Win32]"
36
+ #else
37
+ + "unknown"
38
+ #endif
39
+ + "]";
40
+
41
+ const string InfoCompilerVersion = "INFO:compiler_version["
42
+ #if PlatformToolsetv100
43
+ + "2010"
44
+ #elif PlatformToolsetv110
45
+ + "2012"
46
+ #elif PlatformToolsetv120
47
+ + "2013"
48
+ #elif PlatformToolsetv140
49
+ + "2015"
50
+ #elif PlatformToolsetv141
51
+ + "2017"
52
+ #elif PlatformToolsetv142
53
+ + "2019"
54
+ #elif PlatformToolsetv143
55
+ + "2022"
56
+ #else
57
+ + "9999"
58
+ #endif
59
+ + "]";
60
+
61
+ static void Main(string[] args)
62
+ {
63
+ // we have to print the lines to make sure
64
+ // the compiler does not optimize them away ...
65
+ System.Console.WriteLine(InfoCompiler);
66
+ System.Console.WriteLine(InfoPlatform);
67
+ System.Console.WriteLine(InfoArchitecture);
68
+ System.Console.WriteLine(InfoCompilerVersion);
69
+ }
70
+ }
71
+ }
cmake/share/cmake-3.31/Modules/CMakeCSharpInformation.cmake ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ # This file sets the basic flags for the C# language in CMake.
5
+ # It also loads the available platform file for the system-compiler
6
+ # if it exists.
7
+
8
+ set(CMAKE_BASE_NAME)
9
+ get_filename_component(CMAKE_BASE_NAME "${CMAKE_CSharp_COMPILER}" NAME_WE)
10
+
11
+ set(CMAKE_BUILD_TYPE_INIT Debug)
12
+
13
+ set(CMAKE_CSharp_FLAGS_INIT "/define:TRACE")
14
+ set(CMAKE_CSharp_FLAGS_DEBUG_INIT "/debug:full /optimize- /warn:3 /errorreport:prompt /define:DEBUG")
15
+ set(CMAKE_CSharp_FLAGS_RELEASE_INIT "/debug:none /optimize /warn:1 /errorreport:queue")
16
+ set(CMAKE_CSharp_FLAGS_RELWITHDEBINFO_INIT "/debug:full /optimize-")
17
+ set(CMAKE_CSharp_FLAGS_MINSIZEREL_INIT "/debug:none /optimize")
18
+ set(CMAKE_CSharp_LINKER_SUPPORTS_PDB ON)
19
+
20
+ set(CMAKE_CSharp_STANDARD_LIBRARIES_INIT "System")
21
+
22
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
23
+ set(CMAKE_CSharp_FLAGS_INIT "/platform:x86 ${CMAKE_CSharp_FLAGS_INIT}")
24
+ else()
25
+ set(CMAKE_CSharp_FLAGS_INIT "/platform:x64 ${CMAKE_CSharp_FLAGS_INIT}")
26
+ endif()
27
+
28
+ # This should be included before the _INIT variables are
29
+ # used to initialize the cache. Since the rule variables
30
+ # have if blocks on them, users can still define them here.
31
+ # But, it should still be after the platform file so changes can
32
+ # be made to those values.
33
+
34
+ # for most systems a module is the same as a shared library
35
+ # so unless the variable CMAKE_MODULE_EXISTS is set just
36
+ # copy the values from the LIBRARY variables
37
+ if(NOT CMAKE_MODULE_EXISTS)
38
+ set(CMAKE_SHARED_MODULE_CSharp_FLAGS ${CMAKE_SHARED_LIBRARY_CSharp_FLAGS})
39
+ set(CMAKE_SHARED_MODULE_CREATE_CSharp_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CSharp_FLAGS})
40
+ endif()
41
+
42
+ # add the flags to the cache based
43
+ # on the initial values computed in the platform/*.cmake files
44
+ # use _INIT variables so that this only happens the first time
45
+ # and you can set these flags in the cmake cache
46
+ set(CMAKE_CSharp_FLAGS_INIT "$ENV{CSFLAGS} ${CMAKE_CSharp_FLAGS_INIT}")
47
+
48
+ cmake_initialize_per_config_variable(CMAKE_CSharp_FLAGS "Flags used by the C# compiler")
49
+
50
+ if(CMAKE_CSharp_STANDARD_LIBRARIES_INIT)
51
+ set(CMAKE_CSharp_STANDARD_LIBRARIES "${CMAKE_CSharp_STANDARD_LIBRARIES_INIT}"
52
+ CACHE STRING "Libraries linked by default with all C# applications.")
53
+ mark_as_advanced(CMAKE_CSharp_STANDARD_LIBRARIES)
54
+ endif()
55
+
56
+ # set missing flags (if they are not defined). This is needed in the
57
+ # unlikely case that you have only C# and no C/C++ targets in your
58
+ # project.
59
+ cmake_initialize_per_config_variable(CMAKE_EXE_LINKER_FLAGS "Flags used by the linker")
60
+ cmake_initialize_per_config_variable(CMAKE_SHARED_LINKER_FLAGS "Flags used by the linker during the creation of shared libraries")
61
+
62
+ set(CMAKE_CSharp_CREATE_SHARED_LIBRARY "CSharp_NO_CREATE_SHARED_LIBRARY")
63
+ set(CMAKE_CSharp_CREATE_SHARED_MODULE "CSharp_NO_CREATE_SHARED_MODULE")
64
+ set(CMAKE_CSharp_LINK_EXECUTABLE "CSharp_NO_LINK_EXECUTABLE")
65
+
66
+ set(CMAKE_CSharp_USE_RESPONSE_FILE_FOR_OBJECTS 1)
67
+
68
+ set(CMAKE_CSharp_USE_LINKER_INFORMATION FALSE)
69
+
70
+ set(CMAKE_CSharp_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCUDACompiler.cmake.in ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_CUDA_COMPILER "@CMAKE_CUDA_COMPILER@")
2
+ set(CMAKE_CUDA_HOST_COMPILER "@CMAKE_CUDA_HOST_COMPILER@")
3
+ set(CMAKE_CUDA_HOST_LINK_LAUNCHER "@CMAKE_CUDA_HOST_LINK_LAUNCHER@")
4
+ set(CMAKE_CUDA_COMPILER_ID "@CMAKE_CUDA_COMPILER_ID@")
5
+ set(CMAKE_CUDA_COMPILER_VERSION "@CMAKE_CUDA_COMPILER_VERSION@")
6
+ set(CMAKE_CUDA_HOST_COMPILER_ID "@CMAKE_CUDA_HOST_COMPILER_ID@")
7
+ set(CMAKE_CUDA_HOST_COMPILER_VERSION "@CMAKE_CUDA_HOST_COMPILER_VERSION@")
8
+ set(CMAKE_CUDA_DEVICE_LINKER "@CMAKE_CUDA_DEVICE_LINKER@")
9
+ set(CMAKE_CUDA_FATBINARY "@CMAKE_CUDA_FATBINARY@")
10
+ set(CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT "@CMAKE_CUDA_STANDARD_COMPUTED_DEFAULT@")
11
+ set(CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CUDA_EXTENSIONS_COMPUTED_DEFAULT@")
12
+ set(CMAKE_CUDA_STANDARD_LATEST "@CMAKE_CUDA_STANDARD_LATEST@")
13
+ set(CMAKE_CUDA_COMPILE_FEATURES "@CMAKE_CUDA_COMPILE_FEATURES@")
14
+ set(CMAKE_CUDA03_COMPILE_FEATURES "@CMAKE_CUDA03_COMPILE_FEATURES@")
15
+ set(CMAKE_CUDA11_COMPILE_FEATURES "@CMAKE_CUDA11_COMPILE_FEATURES@")
16
+ set(CMAKE_CUDA14_COMPILE_FEATURES "@CMAKE_CUDA14_COMPILE_FEATURES@")
17
+ set(CMAKE_CUDA17_COMPILE_FEATURES "@CMAKE_CUDA17_COMPILE_FEATURES@")
18
+ set(CMAKE_CUDA20_COMPILE_FEATURES "@CMAKE_CUDA20_COMPILE_FEATURES@")
19
+ set(CMAKE_CUDA23_COMPILE_FEATURES "@CMAKE_CUDA23_COMPILE_FEATURES@")
20
+ set(CMAKE_CUDA26_COMPILE_FEATURES "@CMAKE_CUDA26_COMPILE_FEATURES@")
21
+
22
+ set(CMAKE_CUDA_PLATFORM_ID "@CMAKE_CUDA_PLATFORM_ID@")
23
+ set(CMAKE_CUDA_SIMULATE_ID "@CMAKE_CUDA_SIMULATE_ID@")
24
+ set(CMAKE_CUDA_COMPILER_FRONTEND_VARIANT "@CMAKE_CUDA_COMPILER_FRONTEND_VARIANT@")
25
+ set(CMAKE_CUDA_SIMULATE_VERSION "@CMAKE_CUDA_SIMULATE_VERSION@")
26
+ @SET_MSVC_CUDA_ARCHITECTURE_ID@
27
+ @_SET_CMAKE_CUDA_COMPILER_SYSROOT@
28
+
29
+ set(CMAKE_CUDA_COMPILER_ENV_VAR "CUDACXX")
30
+ set(CMAKE_CUDA_HOST_COMPILER_ENV_VAR "CUDAHOSTCXX")
31
+
32
+ set(CMAKE_CUDA_COMPILER_LOADED 1)
33
+ set(CMAKE_CUDA_COMPILER_ID_RUN 1)
34
+ set(CMAKE_CUDA_SOURCE_FILE_EXTENSIONS cu)
35
+ set(CMAKE_CUDA_LINKER_PREFERENCE 15)
36
+ set(CMAKE_CUDA_LINKER_PREFERENCE_PROPAGATES 1)
37
+ set(CMAKE_CUDA_LINKER_DEPFILE_SUPPORTED @CMAKE_CUDA_LINKER_DEPFILE_SUPPORTED@)
38
+
39
+ set(CMAKE_CUDA_SIZEOF_DATA_PTR "@CMAKE_CUDA_SIZEOF_DATA_PTR@")
40
+ set(CMAKE_CUDA_COMPILER_ABI "@CMAKE_CUDA_COMPILER_ABI@")
41
+ set(CMAKE_CUDA_BYTE_ORDER "@CMAKE_CUDA_BYTE_ORDER@")
42
+ set(CMAKE_CUDA_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
43
+
44
+ if(CMAKE_CUDA_SIZEOF_DATA_PTR)
45
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_CUDA_SIZEOF_DATA_PTR}")
46
+ endif()
47
+
48
+ if(CMAKE_CUDA_COMPILER_ABI)
49
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CUDA_COMPILER_ABI}")
50
+ endif()
51
+
52
+ if(CMAKE_CUDA_LIBRARY_ARCHITECTURE)
53
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CUDA_LIBRARY_ARCHITECTURE@")
54
+ endif()
55
+
56
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "@CMAKE_CUDA_COMPILER_TOOLKIT_ROOT@")
57
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT "@CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT@")
58
+ set(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION "@CMAKE_CUDA_COMPILER_TOOLKIT_VERSION@")
59
+ set(CMAKE_CUDA_COMPILER_LIBRARY_ROOT "@CMAKE_CUDA_COMPILER_LIBRARY_ROOT@")
60
+
61
+ set(CMAKE_CUDA_ARCHITECTURES_ALL "@CMAKE_CUDA_ARCHITECTURES_ALL@")
62
+ set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR "@CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR@")
63
+ set(CMAKE_CUDA_ARCHITECTURES_NATIVE "@CMAKE_CUDA_ARCHITECTURES_NATIVE@")
64
+
65
+ set(CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@")
66
+
67
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES@")
68
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES@")
69
+ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
70
+
71
+ set(CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES@")
72
+ set(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES@")
73
+ set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES@")
74
+ set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
75
+
76
+ @_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT@
77
+
78
+ set(CMAKE_LINKER "@CMAKE_LINKER@")
79
+ set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
80
+ set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
81
+ set(CMAKE_CUDA_COMPILER_LINKER "@CMAKE_CUDA_COMPILER_LINKER@")
82
+ set(CMAKE_CUDA_COMPILER_LINKER_ID "@CMAKE_CUDA_COMPILER_LINKER_ID@")
83
+ set(CMAKE_CUDA_COMPILER_LINKER_VERSION @CMAKE_CUDA_COMPILER_LINKER_VERSION@)
84
+ set(CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_CUDA_COMPILER_LINKER_FRONTEND_VARIANT@)
85
+ set(CMAKE_AR "@CMAKE_AR@")
86
+ set(CMAKE_RANLIB "@CMAKE_RANLIB@")
87
+ set(CMAKE_MT "@CMAKE_MT@")
cmake/share/cmake-3.31/Modules/CMakeCUDACompilerABI.cu ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __CUDACC__
2
+ # error "A C or C++ compiler has been selected for CUDA"
3
+ #endif
4
+
5
+ #include "CMakeCompilerABI.h"
6
+ #include "CMakeCompilerCUDAArch.h"
7
+
8
+ int main(int argc, char* argv[])
9
+ {
10
+ int require = 0;
11
+ require += info_sizeof_dptr[argc];
12
+ require += info_byte_order_big_endian[argc];
13
+ require += info_byte_order_little_endian[argc];
14
+ #if defined(ABI_ID)
15
+ require += info_abi[argc];
16
+ #endif
17
+ static_cast<void>(argv);
18
+
19
+ if (!cmakeCompilerCUDAArch()) {
20
+ // Convince the compiler that the non-zero return value depends
21
+ // on the info strings so they are not optimized out.
22
+ return require ? -1 : 1;
23
+ }
24
+
25
+ return 0;
26
+ }
cmake/share/cmake-3.31/Modules/CMakeCUDACompilerId.cu.in ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __CUDACC__
2
+ # error "A C or C++ compiler has been selected for CUDA"
3
+ #endif
4
+
5
+ @CMAKE_CUDA_COMPILER_ID_CONTENT@
6
+
7
+ /* Construct the string literal in pieces to prevent the source from
8
+ getting matched. Store it in a pointer rather than an array
9
+ because some compilers will just produce instructions to fill the
10
+ array rather than assigning a pointer to a static array. */
11
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
12
+ #ifdef SIMULATE_ID
13
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
14
+ #endif
15
+
16
+ @CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT@
17
+ @CMAKE_CUDA_COMPILER_ID_ERROR_FOR_TEST@
18
+
19
+ #ifdef HOST_COMPILER_ID
20
+ char const* info_host_compiler = "INFO" ":" "host_compiler[" HOST_COMPILER_ID "]";
21
+ #endif
22
+ #ifdef HOST_COMPILER_VERSION
23
+ char const* info_host_compiler_version = "INFO" ":" "host_compiler_version[" HOST_COMPILER_VERSION "]";
24
+ #elif defined(HOST_COMPILER_VERSION_MAJOR)
25
+ char const info_host_compiler_version[] = {
26
+ 'I', 'N', 'F', 'O', ':','h','o','s','t','_',
27
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
28
+ HOST_COMPILER_VERSION_MAJOR,
29
+ # ifdef HOST_COMPILER_VERSION_MINOR
30
+ '.', HOST_COMPILER_VERSION_MINOR,
31
+ # ifdef HOST_COMPILER_VERSION_PATCH
32
+ '.', HOST_COMPILER_VERSION_PATCH,
33
+ # ifdef HOST_COMPILER_VERSION_TWEAK
34
+ '.', HOST_COMPILER_VERSION_TWEAK,
35
+ # endif
36
+ # endif
37
+ # endif
38
+ ']','\0'};
39
+ #endif
40
+
41
+ #define CXX_STD_11 201103L
42
+ #define CXX_STD_14 201402L
43
+ #define CXX_STD_17 201703L
44
+ #define CXX_STD_20 202002L
45
+ #define CXX_STD_23 202302L
46
+
47
+ #if defined(_MSC_VER) && defined(_MSVC_LANG)
48
+ # if _MSVC_LANG > __cplusplus
49
+ # define CXX_STD _MSVC_LANG
50
+ # else
51
+ # define CXX_STD __cplusplus
52
+ # endif
53
+ #else
54
+ # define CXX_STD __cplusplus
55
+ #endif
56
+
57
+ const char* info_language_standard_default = "INFO" ":" "standard_default["
58
+ #if CXX_STD > CXX_STD_23
59
+ "26"
60
+ #elif CXX_STD > CXX_STD_20
61
+ "23"
62
+ #elif CXX_STD > CXX_STD_17
63
+ "20"
64
+ #elif CXX_STD > CXX_STD_14
65
+ "17"
66
+ #elif CXX_STD > CXX_STD_11
67
+ "14"
68
+ #elif CXX_STD >= CXX_STD_11
69
+ "11"
70
+ #else
71
+ "03"
72
+ #endif
73
+ "]";
74
+
75
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
76
+ #if (defined(__clang__) || defined(__GNUC__)) && \
77
+ !defined(__STRICT_ANSI__)
78
+ "ON"
79
+ #else
80
+ "OFF"
81
+ #endif
82
+ "]";
83
+
84
+ /*--------------------------------------------------------------------------*/
85
+
86
+ int main(int argc, char* argv[])
87
+ {
88
+ int require = 0;
89
+ require += info_compiler[argc];
90
+ require += info_platform[argc];
91
+ #ifdef COMPILER_VERSION_MAJOR
92
+ require += info_version[argc];
93
+ #endif
94
+ #ifdef SIMULATE_ID
95
+ require += info_simulate[argc];
96
+ #endif
97
+ #ifdef SIMULATE_VERSION_MAJOR
98
+ require += info_simulate_version[argc];
99
+ #endif
100
+ #ifdef HOST_COMPILER_ID
101
+ require += info_host_compiler[argc];
102
+ #endif
103
+ #ifdef HOST_COMPILER_VERSION_MAJOR
104
+ require += info_host_compiler_version[argc];
105
+ #endif
106
+ require += info_language_standard_default[argc];
107
+ require += info_language_extensions_default[argc];
108
+ (void)argv;
109
+ return require;
110
+ }
cmake/share/cmake-3.31/Modules/CMakeCUDAInformation.cmake ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ if(UNIX)
5
+ set(CMAKE_CUDA_OUTPUT_EXTENSION .o)
6
+ else()
7
+ set(CMAKE_CUDA_OUTPUT_EXTENSION .obj)
8
+ endif()
9
+ set(CMAKE_INCLUDE_FLAG_CUDA "-I")
10
+
11
+ # Set implicit links early so compiler-specific modules can use them.
12
+ set(__IMPLICIT_LINKS)
13
+ foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
14
+ string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
15
+ endforeach()
16
+ foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
17
+ if(${lib} MATCHES "/")
18
+ string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
19
+ else()
20
+ string(APPEND __IMPLICIT_LINKS " -l${lib}")
21
+ endif()
22
+ endforeach()
23
+
24
+ # Load compiler-specific information.
25
+ if(CMAKE_CUDA_COMPILER_ID)
26
+ include(Compiler/${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
27
+ endif()
28
+
29
+ # load the system- and compiler specific files
30
+ if(CMAKE_CUDA_COMPILER_ID)
31
+ # load a hardware specific file, mostly useful for embedded compilers
32
+ if(CMAKE_SYSTEM_PROCESSOR)
33
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
34
+ endif()
35
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CUDA_COMPILER_ID}-CUDA OPTIONAL)
36
+ endif()
37
+
38
+
39
+ # This should be included before the _INIT variables are
40
+ # used to initialize the cache. Since the rule variables
41
+ # have if blocks on them, users can still define them here.
42
+ # But, it should still be after the platform file so changes can
43
+ # be made to those values.
44
+
45
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE)
46
+ # Save the full path of the file so try_compile can use it.
47
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
48
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
49
+ endif()
50
+
51
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA)
52
+ # Save the full path of the file so try_compile can use it.
53
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA} RESULT_VARIABLE _override)
54
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA "${_override}")
55
+ endif()
56
+
57
+
58
+
59
+ # add the flags to the cache based
60
+ # on the initial values computed in the platform/*.cmake files
61
+ # use _INIT variables so that this only happens the first time
62
+ # and you can set these flags in the cmake cache
63
+ set(CMAKE_CUDA_FLAGS_INIT "$ENV{CUDAFLAGS} ${CMAKE_CUDA_FLAGS_INIT}")
64
+
65
+ cmake_initialize_per_config_variable(CMAKE_CUDA_FLAGS "Flags used by the CUDA compiler")
66
+
67
+ if(CMAKE_CUDA_STANDARD_LIBRARIES_INIT)
68
+ set(CMAKE_CUDA_STANDARD_LIBRARIES "${CMAKE_CUDA_STANDARD_LIBRARIES_INIT}"
69
+ CACHE STRING "Libraries linked by default with all CUDA applications.")
70
+ mark_as_advanced(CMAKE_CUDA_STANDARD_LIBRARIES)
71
+ endif()
72
+
73
+ if(NOT CMAKE_CUDA_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_COMPILER_LAUNCHER})
74
+ set(CMAKE_CUDA_COMPILER_LAUNCHER "$ENV{CMAKE_CUDA_COMPILER_LAUNCHER}"
75
+ CACHE STRING "Compiler launcher for CUDA.")
76
+ endif()
77
+
78
+ include(CMakeCommonLanguageInclude)
79
+ _cmake_common_language_platform_flags(CUDA)
80
+
81
+ # now define the following rules:
82
+ # CMAKE_CUDA_CREATE_SHARED_LIBRARY
83
+ # CMAKE_CUDA_CREATE_SHARED_MODULE
84
+ # CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
85
+ # CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
86
+ # CMAKE_CUDA_LINK_EXECUTABLE
87
+
88
+ # create a shared library
89
+ if(NOT CMAKE_CUDA_CREATE_SHARED_LIBRARY)
90
+ set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
91
+ "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
92
+ endif()
93
+
94
+ # create a shared module copy the shared library rule by default
95
+ if(NOT CMAKE_CUDA_CREATE_SHARED_MODULE)
96
+ set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY})
97
+ endif()
98
+
99
+ # Create a static archive incrementally for large object file counts.
100
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_CREATE)
101
+ set(CMAKE_CUDA_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
102
+ endif()
103
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_APPEND)
104
+ set(CMAKE_CUDA_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
105
+ endif()
106
+ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_FINISH)
107
+ set(CMAKE_CUDA_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
108
+ endif()
109
+
110
+ if(NOT CMAKE_CUDA_COMPILE_OBJECT)
111
+ set(CMAKE_CUDA_COMPILE_OBJECT
112
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} <CUDA_COMPILE_MODE> <SOURCE> -o <OBJECT>")
113
+ endif()
114
+
115
+ # compile a cu file into an executable
116
+ if(NOT CMAKE_CUDA_LINK_EXECUTABLE)
117
+ set(CMAKE_CUDA_LINK_EXECUTABLE
118
+ "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
119
+ endif()
120
+
121
+ # Add implicit host link directories that contain device libraries
122
+ # to the device link line.
123
+ set(__IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
124
+ if(__IMPLICIT_DLINK_DIRS)
125
+ list(REMOVE_ITEM __IMPLICIT_DLINK_DIRS ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
126
+ endif()
127
+ set(__IMPLICIT_DLINK_FLAGS)
128
+ foreach(dir ${__IMPLICIT_DLINK_DIRS})
129
+ if(EXISTS "${dir}/libcurand_static.a")
130
+ string(APPEND __IMPLICIT_DLINK_FLAGS " -L\"${dir}\"")
131
+ endif()
132
+ endforeach()
133
+ unset(__IMPLICIT_DLINK_DIRS)
134
+
135
+
136
+ #These are used when linking relocatable (dc) cuda code
137
+ if(NOT CMAKE_CUDA_DEVICE_LINK_LIBRARY)
138
+ set(CMAKE_CUDA_DEVICE_LINK_LIBRARY
139
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
140
+ endif()
141
+ if(NOT CMAKE_CUDA_DEVICE_LINK_EXECUTABLE)
142
+ set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE
143
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_CUDA_COMPILE_OPTIONS_PIC} ${_CMAKE_CUDA_EXTRA_DEVICE_LINK_FLAGS} -shared -dlink <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_DLINK_FLAGS}")
144
+ endif()
145
+
146
+ # Used when device linking is handled by CMake.
147
+ if(NOT CMAKE_CUDA_DEVICE_LINK_COMPILE)
148
+ set(CMAKE_CUDA_DEVICE_LINK_COMPILE "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <FLAGS> <LINK_FLAGS> -D__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ -D__NV_EXTRA_INITIALIZATION=\"\" -D__NV_EXTRA_FINALIZATION=\"\" -DREGISTERLINKBINARYFILE=\\\"<REGISTER_FILE>\\\" -DFATBINFILE=\\\"<FATBINARY>\\\" ${_CMAKE_COMPILE_AS_CUDA_FLAG} -c \"${CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT}/bin/crt/link.stub\" -o <OBJECT>")
149
+ endif()
150
+
151
+ unset(__IMPLICIT_DLINK_FLAGS)
152
+
153
+ set(CMAKE_CUDA_USE_LINKER_INFORMATION TRUE)
154
+
155
+ set(CMAKE_CUDA_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCXXCompiler.cmake.in ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
2
+ set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
3
+ set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
4
+ set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
5
+ set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "@CMAKE_CXX_COMPILER_VERSION_INTERNAL@")
6
+ set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@")
7
+ set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@")
8
+ set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT@")
9
+ set(CMAKE_CXX_STANDARD_LATEST "@CMAKE_CXX_STANDARD_LATEST@")
10
+ set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
11
+ set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
12
+ set(CMAKE_CXX11_COMPILE_FEATURES "@CMAKE_CXX11_COMPILE_FEATURES@")
13
+ set(CMAKE_CXX14_COMPILE_FEATURES "@CMAKE_CXX14_COMPILE_FEATURES@")
14
+ set(CMAKE_CXX17_COMPILE_FEATURES "@CMAKE_CXX17_COMPILE_FEATURES@")
15
+ set(CMAKE_CXX20_COMPILE_FEATURES "@CMAKE_CXX20_COMPILE_FEATURES@")
16
+ set(CMAKE_CXX23_COMPILE_FEATURES "@CMAKE_CXX23_COMPILE_FEATURES@")
17
+ set(CMAKE_CXX26_COMPILE_FEATURES "@CMAKE_CXX26_COMPILE_FEATURES@")
18
+
19
+ set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
20
+ set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
21
+ set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "@CMAKE_CXX_COMPILER_FRONTEND_VARIANT@")
22
+ set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
23
+ @_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID@
24
+ @_SET_CMAKE_CXX_COMPILER_SYSROOT@
25
+ @SET_MSVC_CXX_ARCHITECTURE_ID@
26
+ @SET_CMAKE_XCODE_ARCHS@
27
+ set(CMAKE_AR "@CMAKE_AR@")
28
+ set(CMAKE_CXX_COMPILER_AR "@CMAKE_CXX_COMPILER_AR@")
29
+ set(CMAKE_RANLIB "@CMAKE_RANLIB@")
30
+ set(CMAKE_CXX_COMPILER_RANLIB "@CMAKE_CXX_COMPILER_RANLIB@")
31
+ set(CMAKE_LINKER "@CMAKE_LINKER@")
32
+ set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
33
+ set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
34
+ set(CMAKE_CXX_COMPILER_LINKER "@CMAKE_CXX_COMPILER_LINKER@")
35
+ set(CMAKE_CXX_COMPILER_LINKER_ID "@CMAKE_CXX_COMPILER_LINKER_ID@")
36
+ set(CMAKE_CXX_COMPILER_LINKER_VERSION @CMAKE_CXX_COMPILER_LINKER_VERSION@)
37
+ set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT@)
38
+ set(CMAKE_MT "@CMAKE_MT@")
39
+ set(CMAKE_TAPI "@CMAKE_TAPI@")
40
+ set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
41
+ set(CMAKE_CXX_COMPILER_LOADED 1)
42
+ set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@)
43
+ set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@)
44
+
45
+ set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
46
+
47
+ set(CMAKE_CXX_COMPILER_ID_RUN 1)
48
+ set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m)
49
+ set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
50
+
51
+ foreach (lang IN ITEMS C OBJC OBJCXX)
52
+ if (CMAKE_${lang}_COMPILER_ID_RUN)
53
+ foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
54
+ list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
55
+ endforeach()
56
+ endif()
57
+ endforeach()
58
+
59
+ set(CMAKE_CXX_LINKER_PREFERENCE 30)
60
+ set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
61
+ set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED @CMAKE_CXX_LINKER_DEPFILE_SUPPORTED@)
62
+
63
+ # Save compiler ABI information.
64
+ set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
65
+ set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
66
+ set(CMAKE_CXX_BYTE_ORDER "@CMAKE_CXX_BYTE_ORDER@")
67
+ set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
68
+
69
+ if(CMAKE_CXX_SIZEOF_DATA_PTR)
70
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
71
+ endif()
72
+
73
+ if(CMAKE_CXX_COMPILER_ABI)
74
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
75
+ endif()
76
+
77
+ if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
78
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
79
+ endif()
80
+
81
+ set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "@CMAKE_CXX_CL_SHOWINCLUDES_PREFIX@")
82
+ if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
83
+ set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
84
+ endif()
85
+
86
+ @CMAKE_CXX_COMPILER_CUSTOM_CODE@
87
+ @CMAKE_CXX_SYSROOT_FLAG_CODE@
88
+ @CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
89
+
90
+ set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES@")
91
+ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
92
+ set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
93
+ set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
94
+ set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "@CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR@")
95
+
96
+ set(CMAKE_CXX_COMPILER_IMPORT_STD "")
97
+ @CMAKE_CXX_IMPORT_STD@
cmake/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ifndef __cplusplus
2
+ # error "A C compiler has been selected for C++."
3
+ #endif
4
+
5
+ #include "CMakeCompilerABI.h"
6
+
7
+ int main(int argc, char* argv[])
8
+ {
9
+ int require = 0;
10
+ require += info_sizeof_dptr[argc];
11
+ require += info_byte_order_big_endian[argc];
12
+ require += info_byte_order_little_endian[argc];
13
+ #if defined(ABI_ID)
14
+ require += info_abi[argc];
15
+ #endif
16
+ (void)argv;
17
+ return require;
18
+ }
cmake/share/cmake-3.31/Modules/CMakeCXXCompilerId.cpp.in ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This source file must have a .cpp extension so that all C++ compilers
2
+ recognize the extension without flags. Borland does not know .cxx for
3
+ example. */
4
+ #ifndef __cplusplus
5
+ # error "A C compiler has been selected for C++."
6
+ #endif
7
+
8
+ #if !defined(__has_include)
9
+ /* If the compiler does not have __has_include, pretend the answer is
10
+ always no. */
11
+ # define __has_include(x) 0
12
+ #endif
13
+
14
+ @CMAKE_CXX_COMPILER_ID_CONTENT@
15
+
16
+ /* Construct the string literal in pieces to prevent the source from
17
+ getting matched. Store it in a pointer rather than an array
18
+ because some compilers will just produce instructions to fill the
19
+ array rather than assigning a pointer to a static array. */
20
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
21
+ #ifdef SIMULATE_ID
22
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
23
+ #endif
24
+
25
+ #ifdef __QNXNTO__
26
+ char const* qnxnto = "INFO" ":" "qnxnto[]";
27
+ #endif
28
+
29
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
30
+ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
31
+ #endif
32
+
33
+ @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
34
+ @CMAKE_CXX_COMPILER_ID_ERROR_FOR_TEST@
35
+
36
+ #define CXX_STD_98 199711L
37
+ #define CXX_STD_11 201103L
38
+ #define CXX_STD_14 201402L
39
+ #define CXX_STD_17 201703L
40
+ #define CXX_STD_20 202002L
41
+ #define CXX_STD_23 202302L
42
+
43
+ #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
44
+ # if _MSVC_LANG > CXX_STD_17
45
+ # define CXX_STD _MSVC_LANG
46
+ # elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
47
+ # define CXX_STD CXX_STD_20
48
+ # elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
49
+ # define CXX_STD CXX_STD_20
50
+ # elif _MSVC_LANG > CXX_STD_14
51
+ # define CXX_STD CXX_STD_17
52
+ # elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
53
+ # define CXX_STD CXX_STD_14
54
+ # elif defined(__INTEL_CXX11_MODE__)
55
+ # define CXX_STD CXX_STD_11
56
+ # else
57
+ # define CXX_STD CXX_STD_98
58
+ # endif
59
+ #elif defined(_MSC_VER) && defined(_MSVC_LANG)
60
+ # if _MSVC_LANG > __cplusplus
61
+ # define CXX_STD _MSVC_LANG
62
+ # else
63
+ # define CXX_STD __cplusplus
64
+ # endif
65
+ #elif defined(__NVCOMPILER)
66
+ # if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
67
+ # define CXX_STD CXX_STD_20
68
+ # else
69
+ # define CXX_STD __cplusplus
70
+ # endif
71
+ #elif defined(__INTEL_COMPILER) || defined(__PGI)
72
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
73
+ # define CXX_STD CXX_STD_17
74
+ # elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
75
+ # define CXX_STD CXX_STD_14
76
+ # else
77
+ # define CXX_STD __cplusplus
78
+ # endif
79
+ #elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
80
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
81
+ # define CXX_STD CXX_STD_14
82
+ # else
83
+ # define CXX_STD __cplusplus
84
+ # endif
85
+ #elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
86
+ # define CXX_STD CXX_STD_11
87
+ #else
88
+ # define CXX_STD __cplusplus
89
+ #endif
90
+
91
+ const char* info_language_standard_default = "INFO" ":" "standard_default["
92
+ #if CXX_STD > CXX_STD_23
93
+ "26"
94
+ #elif CXX_STD > CXX_STD_20
95
+ "23"
96
+ #elif CXX_STD > CXX_STD_17
97
+ "20"
98
+ #elif CXX_STD > CXX_STD_14
99
+ "17"
100
+ #elif CXX_STD > CXX_STD_11
101
+ "14"
102
+ #elif CXX_STD >= CXX_STD_11
103
+ "11"
104
+ #else
105
+ "98"
106
+ #endif
107
+ "]";
108
+
109
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
110
+ #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
111
+ defined(__TI_COMPILER_VERSION__)) && \
112
+ !defined(__STRICT_ANSI__)
113
+ "ON"
114
+ #else
115
+ "OFF"
116
+ #endif
117
+ "]";
118
+
119
+ /*--------------------------------------------------------------------------*/
120
+
121
+ int main(int argc, char* argv[])
122
+ {
123
+ int require = 0;
124
+ require += info_compiler[argc];
125
+ require += info_platform[argc];
126
+ require += info_arch[argc];
127
+ #ifdef COMPILER_VERSION_MAJOR
128
+ require += info_version[argc];
129
+ #endif
130
+ #ifdef COMPILER_VERSION_INTERNAL
131
+ require += info_version_internal[argc];
132
+ #endif
133
+ #ifdef SIMULATE_ID
134
+ require += info_simulate[argc];
135
+ #endif
136
+ #ifdef SIMULATE_VERSION_MAJOR
137
+ require += info_simulate_version[argc];
138
+ #endif
139
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
140
+ require += info_cray[argc];
141
+ #endif
142
+ require += info_language_standard_default[argc];
143
+ require += info_language_extensions_default[argc];
144
+ (void)argv;
145
+ return require;
146
+ }
cmake/share/cmake-3.31/Modules/CMakeCXXInformation.cmake ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # This file sets the basic flags for the C++ language in CMake.
6
+ # It also loads the available platform file for the system-compiler
7
+ # if it exists.
8
+ # It also loads a system - compiler - processor (or target hardware)
9
+ # specific file, which is mainly useful for crosscompiling and embedded systems.
10
+
11
+ include(CMakeLanguageInformation)
12
+
13
+ # some compilers use different extensions (e.g. sdcc uses .rel)
14
+ # so set the extension here first so it can be overridden by the compiler specific file
15
+ if(UNIX)
16
+ set(CMAKE_CXX_OUTPUT_EXTENSION .o)
17
+ else()
18
+ set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
19
+ endif()
20
+
21
+ set(_INCLUDED_FILE 0)
22
+
23
+ # Load compiler-specific information.
24
+ if(CMAKE_CXX_COMPILER_ID)
25
+ include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
26
+ endif()
27
+
28
+ set(CMAKE_BASE_NAME)
29
+ get_filename_component(CMAKE_BASE_NAME "${CMAKE_CXX_COMPILER}" NAME_WE)
30
+ # since the gnu compiler has several names force g++
31
+ if(CMAKE_COMPILER_IS_GNUCXX)
32
+ set(CMAKE_BASE_NAME g++)
33
+ endif()
34
+
35
+
36
+ # load a hardware specific file, mostly useful for embedded compilers
37
+ if(CMAKE_SYSTEM_PROCESSOR)
38
+ if(CMAKE_CXX_COMPILER_ID)
39
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
40
+ endif()
41
+ if (NOT _INCLUDED_FILE)
42
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
43
+ endif ()
44
+ endif()
45
+
46
+ # load the system- and compiler specific files
47
+ if(CMAKE_CXX_COMPILER_ID)
48
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
49
+ endif()
50
+ if (NOT _INCLUDED_FILE)
51
+ include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
52
+ RESULT_VARIABLE _INCLUDED_FILE)
53
+ endif ()
54
+
55
+ # load any compiler-wrapper specific information
56
+ if (CMAKE_CXX_COMPILER_WRAPPER)
57
+ __cmake_include_compiler_wrapper(CXX)
58
+ endif ()
59
+
60
+ # We specify the compiler information in the system file for some
61
+ # platforms, but this language may not have been enabled when the file
62
+ # was first included. Include it again to get the language info.
63
+ # Remove this when all compiler info is removed from system files.
64
+ if (NOT _INCLUDED_FILE)
65
+ include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
66
+ endif ()
67
+
68
+ if(CMAKE_CXX_SIZEOF_DATA_PTR)
69
+ foreach(f IN LISTS CMAKE_CXX_ABI_FILES)
70
+ include(${f})
71
+ endforeach()
72
+ unset(CMAKE_CXX_ABI_FILES)
73
+ endif()
74
+
75
+ # This should be included before the _INIT variables are
76
+ # used to initialize the cache. Since the rule variables
77
+ # have if blocks on them, users can still define them here.
78
+ # But, it should still be after the platform file so changes can
79
+ # be made to those values.
80
+
81
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE)
82
+ # Save the full path of the file so try_compile can use it.
83
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
84
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
85
+ endif()
86
+
87
+ if(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
88
+ # Save the full path of the file so try_compile can use it.
89
+ include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
90
+ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
91
+ endif()
92
+
93
+
94
+ # add the flags to the cache based
95
+ # on the initial values computed in the platform/*.cmake files
96
+ # use _INIT variables so that this only happens the first time
97
+ # and you can set these flags in the cmake cache
98
+ set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
99
+
100
+ cmake_initialize_per_config_variable(CMAKE_CXX_FLAGS "Flags used by the CXX compiler")
101
+
102
+ if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
103
+ set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
104
+ CACHE STRING "Libraries linked by default with all C++ applications.")
105
+ mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
106
+ endif()
107
+
108
+ if(NOT CMAKE_CXX_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_CXX_COMPILER_LAUNCHER})
109
+ set(CMAKE_CXX_COMPILER_LAUNCHER "$ENV{CMAKE_CXX_COMPILER_LAUNCHER}"
110
+ CACHE STRING "Compiler launcher for CXX.")
111
+ endif()
112
+
113
+ if(NOT CMAKE_CXX_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_CXX_LINKER_LAUNCHER})
114
+ set(CMAKE_CXX_LINKER_LAUNCHER "$ENV{CMAKE_CXX_LINKER_LAUNCHER}"
115
+ CACHE STRING "Linker launcher for CXX.")
116
+ endif()
117
+
118
+ include(CMakeCommonLanguageInclude)
119
+ _cmake_common_language_platform_flags(CXX)
120
+
121
+ # now define the following rules:
122
+ # CMAKE_CXX_CREATE_SHARED_LIBRARY
123
+ # CMAKE_CXX_CREATE_SHARED_MODULE
124
+ # CMAKE_CXX_COMPILE_OBJECT
125
+ # CMAKE_CXX_LINK_EXECUTABLE
126
+
127
+ # variables supplied by the generator at use time
128
+ # <TARGET>
129
+ # <TARGET_BASE> the target without the suffix
130
+ # <OBJECTS>
131
+ # <OBJECT>
132
+ # <LINK_LIBRARIES>
133
+ # <FLAGS>
134
+ # <LINK_FLAGS>
135
+
136
+ # CXX compiler information
137
+ # <CMAKE_CXX_COMPILER>
138
+ # <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
139
+ # <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
140
+ # <CMAKE_CXX_LINK_FLAGS>
141
+
142
+ # Static library tools
143
+ # <CMAKE_AR>
144
+ # <CMAKE_RANLIB>
145
+
146
+
147
+ # create a shared C++ library
148
+ if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
149
+ set(CMAKE_CXX_CREATE_SHARED_LIBRARY
150
+ "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
151
+ endif()
152
+
153
+ # create a c++ shared module copy the shared library rule by default
154
+ if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
155
+ set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
156
+ endif()
157
+
158
+
159
+ # Create a static archive incrementally for large object file counts.
160
+ # If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
161
+ if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
162
+ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
163
+ endif()
164
+ if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
165
+ set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
166
+ endif()
167
+ if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
168
+ set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
169
+ endif()
170
+
171
+ # compile a C++ file into an object file
172
+ if(NOT CMAKE_CXX_COMPILE_OBJECT)
173
+ set(CMAKE_CXX_COMPILE_OBJECT
174
+ "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
175
+ endif()
176
+
177
+ if(NOT CMAKE_CXX_LINK_EXECUTABLE)
178
+ set(CMAKE_CXX_LINK_EXECUTABLE
179
+ "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
180
+ endif()
181
+
182
+ mark_as_advanced(
183
+ CMAKE_VERBOSE_MAKEFILE
184
+ )
185
+
186
+ set(CMAKE_CXX_USE_LINKER_INFORMATION TRUE)
187
+
188
+ set(CMAKE_CXX_INFORMATION_LOADED 1)
cmake/share/cmake-3.31/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # Do NOT include this module directly into any of your code. It is meant as
6
+ # a library for Check*CompilerFlag.cmake modules. It's content may change in
7
+ # any way between releases.
8
+
9
+ macro (CHECK_COMPILER_FLAG_COMMON_PATTERNS _VAR)
10
+ set(${_VAR}
11
+ FAIL_REGEX "[Uu]nrecogni[sz]ed .*option" # GNU, NAG, Fujitsu
12
+ FAIL_REGEX "switch .* is no longer supported" # GNU
13
+ FAIL_REGEX "unknown .*option" # Clang
14
+ FAIL_REGEX "optimization flag .* not supported" # Clang
15
+ FAIL_REGEX "unknown argument ignored" # Clang (cl)
16
+ FAIL_REGEX "ignoring unknown option" # MSVC, Intel
17
+ FAIL_REGEX "warning D9002" # MSVC, any lang
18
+ FAIL_REGEX "option.*not supported" # Intel
19
+ FAIL_REGEX "invalid argument .*option" # Intel
20
+ FAIL_REGEX "ignoring option .*argument required" # Intel
21
+ FAIL_REGEX "ignoring option .*argument is of wrong type" # Intel
22
+ FAIL_REGEX "[Uu]nknown option" # HP
23
+ FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
24
+ FAIL_REGEX "command option .* is not recognized" # XL
25
+ FAIL_REGEX "command option .* contains an incorrect subargument" # XL
26
+ FAIL_REGEX "Option .* is not recognized. Option will be ignored." # XL
27
+ FAIL_REGEX "not supported in this configuration. ignored" # AIX
28
+ FAIL_REGEX "File with unknown suffix passed to linker" # PGI
29
+ FAIL_REGEX "[Uu]nknown switch" # PGI
30
+ FAIL_REGEX "WARNING: unknown flag:" # Open64
31
+ FAIL_REGEX "Incorrect command line option:" # Borland
32
+ FAIL_REGEX "Warning: illegal option" # SunStudio 12
33
+ FAIL_REGEX "[Ww]arning: Invalid suboption" # Fujitsu
34
+ FAIL_REGEX "An invalid option .* appears on the command line" # Cray
35
+ FAIL_REGEX "WARNING: invalid compiler option" # TI armcl
36
+ )
37
+ endmacro ()
cmake/share/cmake-3.31/Modules/CMakeCommonLanguageInclude.cmake ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # this file has flags that are shared across languages and sets
6
+ # cache values that can be initialized in the platform-compiler.cmake file
7
+ # it may be included by more than one language.
8
+
9
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
10
+ string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
11
+ string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " $ENV{LDFLAGS}")
12
+
13
+ cmake_initialize_per_config_variable(CMAKE_EXE_LINKER_FLAGS "Flags used by the linker")
14
+ cmake_initialize_per_config_variable(CMAKE_SHARED_LINKER_FLAGS "Flags used by the linker during the creation of shared libraries")
15
+ cmake_initialize_per_config_variable(CMAKE_MODULE_LINKER_FLAGS "Flags used by the linker during the creation of modules")
16
+ cmake_initialize_per_config_variable(CMAKE_STATIC_LINKER_FLAGS "Flags used by the linker during the creation of static libraries")
17
+
18
+ # Alias the build tool variable for backward compatibility.
19
+ set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM})
20
+
21
+ mark_as_advanced(
22
+ CMAKE_VERBOSE_MAKEFILE
23
+ )
24
+
25
+ # The Platform/* modules set a bunch of platform-specific flags expressed
26
+ # for the C toolchain. Other languages call this to copy them as defaults.
27
+ macro(_cmake_common_language_platform_flags lang)
28
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS)
29
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
30
+ endif()
31
+
32
+ if(NOT DEFINED CMAKE_${lang}_COMPILE_OPTIONS_PIC)
33
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
34
+ endif()
35
+
36
+ if(NOT DEFINED CMAKE_${lang}_COMPILE_OPTIONS_PIE)
37
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
38
+ endif()
39
+ if(NOT DEFINED CMAKE_${lang}_LINK_OPTIONS_PIE)
40
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_C_LINK_OPTIONS_PIE})
41
+ endif()
42
+ if(NOT DEFINED CMAKE_${lang}_LINK_OPTIONS_NO_PIE)
43
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE ${CMAKE_C_LINK_OPTIONS_NO_PIE})
44
+ endif()
45
+
46
+ if(NOT DEFINED CMAKE_${lang}_COMPILE_OPTIONS_DLL)
47
+ set(CMAKE_${lang}_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
48
+ endif()
49
+
50
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_${lang}_FLAGS)
51
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
52
+ endif()
53
+
54
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS)
55
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
56
+ endif()
57
+
58
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG)
59
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
60
+ endif()
61
+
62
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP)
63
+ set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
64
+ endif()
65
+
66
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG)
67
+ set(CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
68
+ endif()
69
+
70
+ if(NOT DEFINED CMAKE_EXE_EXPORTS_${lang}_FLAG)
71
+ set(CMAKE_EXE_EXPORTS_${lang}_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
72
+ endif()
73
+
74
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG)
75
+ set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
76
+ endif()
77
+
78
+ if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG)
79
+ set(CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG})
80
+ endif()
81
+
82
+ if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG_SEP)
83
+ set(CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP})
84
+ endif()
85
+
86
+ if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_${lang}_FLAG)
87
+ set(CMAKE_EXECUTABLE_RPATH_LINK_${lang}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG})
88
+ endif()
89
+
90
+ if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_${lang}_WITH_RUNTIME_PATH)
91
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
92
+ endif()
93
+
94
+ if(NOT DEFINED CMAKE_INCLUDE_FLAG_${lang})
95
+ set(CMAKE_INCLUDE_FLAG_${lang} ${CMAKE_INCLUDE_FLAG_C})
96
+ endif()
97
+
98
+ # for most systems a module is the same as a shared library
99
+ # so unless the variable CMAKE_MODULE_EXISTS is set just
100
+ # copy the values from the LIBRARY variables
101
+ if(NOT CMAKE_MODULE_EXISTS)
102
+ set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_${lang}_FLAGS})
103
+ set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS})
104
+ endif()
105
+
106
+ if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS)
107
+ set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
108
+ endif()
109
+ if(NOT DEFINED CMAKE_SHARED_MODULE_${lang}_FLAGS)
110
+ set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
111
+ endif()
112
+
113
+ foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
114
+ if(NOT DEFINED CMAKE_${type}_LINK_STATIC_${lang}_FLAGS)
115
+ set(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS
116
+ ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
117
+ endif()
118
+ if(NOT DEFINED CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS)
119
+ set(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS
120
+ ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
121
+ endif()
122
+ endforeach()
123
+ endmacro()
cmake/share/cmake-3.31/Modules/CMakeCompilerABI.h ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /* Size of a pointer-to-data in bytes. */
3
+ #define SIZEOF_DPTR (sizeof(void*))
4
+ const char info_sizeof_dptr[] = {
5
+ /* clang-format off */
6
+ 'I', 'N', 'F', 'O', ':', 's', 'i', 'z', 'e', 'o', 'f', '_', 'd', 'p', 't',
7
+ 'r', '[', ('0' + ((SIZEOF_DPTR / 10) % 10)), ('0' + (SIZEOF_DPTR % 10)), ']',
8
+ '\0'
9
+ /* clang-format on */
10
+ };
11
+
12
+ /* Byte order. Only one of these will have bytes in the right order. */
13
+ static unsigned short const info_byte_order_big_endian[] = {
14
+ /* INFO:byte_order string for BIG_ENDIAN */
15
+ 0x494E, 0x464F, 0x3A62, 0x7974, 0x655F, 0x6F72, 0x6465, 0x725B,
16
+ 0x4249, 0x475F, 0x454E, 0x4449, 0x414E, 0x5D00, 0x0000
17
+ };
18
+ static unsigned short const info_byte_order_little_endian[] = {
19
+ /* INFO:byte_order string for LITTLE_ENDIAN */
20
+ 0x4E49, 0x4F46, 0x623A, 0x7479, 0x5F65, 0x726F, 0x6564, 0x5B72,
21
+ 0x494C, 0x5454, 0x454C, 0x455F, 0x444E, 0x4149, 0x5D4E, 0x0000
22
+ };
23
+
24
+ /* Application Binary Interface. */
25
+
26
+ /* Check for (some) ARM ABIs.
27
+ * See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
28
+ #if defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
29
+ # define ABI_ID "ELF ARMEABI"
30
+ #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
31
+ # define ABI_ID "ELF ARM"
32
+ #elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
33
+ # define ABI_ID "ELF ARM"
34
+
35
+ #elif defined(__linux__) && defined(__ELF__) && defined(__amd64__) && \
36
+ defined(__ILP32__)
37
+ # define ABI_ID "ELF X32"
38
+
39
+ #elif defined(__ELF__)
40
+ # define ABI_ID "ELF"
41
+ #endif
42
+
43
+ #if defined(ABI_ID)
44
+ static char const info_abi[] = "INFO:abi[" ABI_ID "]";
45
+ #endif
cmake/share/cmake-3.31/Modules/CMakeCompilerCUDAArch.h ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include <cstdio>
2
+
3
+ #include <cuda_runtime.h>
4
+
5
+ static bool cmakeCompilerCUDAArch()
6
+ {
7
+ int count = 0;
8
+ if (cudaGetDeviceCount(&count) != cudaSuccess || count == 0) {
9
+ std::fprintf(stderr, "No CUDA devices found.\n");
10
+ return -1;
11
+ }
12
+
13
+ bool found = false;
14
+ const char* sep = "";
15
+ for (int device = 0; device < count; ++device) {
16
+ cudaDeviceProp prop;
17
+ if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) {
18
+ std::printf("%s%d%d", sep, prop.major, prop.minor);
19
+ sep = ";";
20
+ found = true;
21
+ }
22
+ }
23
+
24
+ if (!found) {
25
+ std::fprintf(stderr, "No CUDA architecture detected from any devices.\n");
26
+ }
27
+
28
+ return found;
29
+ }
cmake/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ function(_readFile file)
6
+ include(${file})
7
+ get_filename_component(name ${file} NAME_WE)
8
+ string(REGEX REPLACE "-.*" "" CompilerId ${name})
9
+ set(_compiler_id_version_compute_${CompilerId} ${_compiler_id_version_compute} PARENT_SCOPE)
10
+ set(_compiler_id_simulate_${CompilerId} ${_compiler_id_simulate} PARENT_SCOPE)
11
+ set(_compiler_id_pp_test_${CompilerId} ${_compiler_id_pp_test} PARENT_SCOPE)
12
+ endfunction()
13
+
14
+ function(compiler_id_detection outvar lang)
15
+
16
+ if (NOT "x${lang}" STREQUAL "xFortran" AND NOT "x${lang}" STREQUAL "xCSharp"
17
+ AND NOT "x${lang}" STREQUAL "xISPC")
18
+ file(GLOB lang_files
19
+ "${CMAKE_ROOT}/Modules/Compiler/*-DetermineCompiler.cmake")
20
+ set(nonlang CXX)
21
+ if ("x${lang}" STREQUAL "xCXX")
22
+ set(nonlang C)
23
+ endif()
24
+
25
+ file(GLOB nonlang_files
26
+ "${CMAKE_ROOT}/Modules/Compiler/*-${nonlang}-DetermineCompiler.cmake")
27
+ list(REMOVE_ITEM lang_files ${nonlang_files})
28
+ endif()
29
+
30
+ set(files ${lang_files})
31
+ if (files)
32
+ foreach(file ${files})
33
+ _readFile(${file})
34
+ endforeach()
35
+
36
+ set(options ID_STRING VERSION_STRINGS ID_DEFINE PLATFORM_DEFAULT_COMPILER)
37
+ set(oneValueArgs PREFIX)
38
+ cmake_parse_arguments(CID "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
39
+ if (CID_UNPARSED_ARGUMENTS)
40
+ message(FATAL_ERROR "Unrecognized arguments: \"${CID_UNPARSED_ARGUMENTS}\"")
41
+ endif()
42
+
43
+ # Order is relevant here. For example, compilers which pretend to be
44
+ # GCC must appear before the actual GCC.
45
+ list(APPEND ordered_compilers
46
+ Intel
47
+ IntelLLVM
48
+ PathScale
49
+ Embarcadero
50
+ Borland
51
+ Watcom
52
+ OpenWatcom
53
+ SunPro
54
+ HP
55
+ Compaq
56
+ zOS
57
+ IBMClang
58
+ XLClang
59
+ XL
60
+ VisualAge
61
+ NVHPC
62
+ PGI
63
+ CrayClang
64
+ Cray
65
+ TI
66
+ FujitsuClang
67
+ Fujitsu
68
+ GHS
69
+ Tasking
70
+ OrangeC
71
+ )
72
+ if ("x${lang}" STREQUAL "xC")
73
+ list(APPEND ordered_compilers
74
+ TinyCC
75
+ Bruce
76
+ )
77
+ endif()
78
+ list(APPEND ordered_compilers
79
+ SCO
80
+ ARMCC
81
+ AppleClang
82
+ ARMClang
83
+ TIClang
84
+ )
85
+ list(APPEND ordered_compilers
86
+ Clang
87
+ LCC
88
+ GNU
89
+ MSVC
90
+ ADSP
91
+ IAR
92
+ )
93
+ if ("x${lang}" STREQUAL "xC")
94
+ list(APPEND ordered_compilers
95
+ SDCC
96
+ )
97
+ endif()
98
+
99
+ if("x${lang}" STREQUAL "xCUDA")
100
+ set(ordered_compilers NVIDIA Clang)
101
+ endif()
102
+
103
+ if("x${lang}" STREQUAL "xHIP")
104
+ set(ordered_compilers NVIDIA Clang)
105
+ endif()
106
+
107
+ if(CID_ID_DEFINE)
108
+ foreach(Id ${ordered_compilers})
109
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n")
110
+ endforeach()
111
+ # Hard-code definitions for compilers that are no longer supported.
112
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "# define ${CID_PREFIX}COMPILER_IS_MIPSpro 0\n")
113
+ endif()
114
+
115
+ set(pp_if "#if")
116
+ if (CID_VERSION_STRINGS)
117
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n/* Version number components: V=Version, R=Revision, P=Patch
118
+ Version date components: YYYY=Year, MM=Month, DD=Day */\n")
119
+ endif()
120
+
121
+ foreach(Id ${ordered_compilers})
122
+ if (NOT _compiler_id_pp_test_${Id})
123
+ message(FATAL_ERROR "No preprocessor test for \"${Id}\"")
124
+ endif()
125
+ set(id_content "${pp_if} ${_compiler_id_pp_test_${Id}}\n")
126
+ if (CID_ID_STRING)
127
+ set(PREFIX ${CID_PREFIX})
128
+ string(CONFIGURE "${_compiler_id_simulate_${Id}}" SIMULATE_BLOCK @ONLY)
129
+ string(APPEND id_content "# define ${CID_PREFIX}COMPILER_ID \"${Id}\"${SIMULATE_BLOCK}")
130
+ endif()
131
+ if (CID_ID_DEFINE)
132
+ string(APPEND id_content "# undef ${CID_PREFIX}COMPILER_IS_${Id}\n")
133
+ string(APPEND id_content "# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n")
134
+ endif()
135
+ if (CID_VERSION_STRINGS)
136
+ set(PREFIX ${CID_PREFIX})
137
+ set(MACRO_DEC DEC)
138
+ set(MACRO_HEX HEX)
139
+ string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY)
140
+ string(APPEND id_content "${VERSION_BLOCK}\n")
141
+ endif()
142
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${id_content}")
143
+ set(pp_if "#elif")
144
+ endforeach()
145
+
146
+ if (CID_PLATFORM_DEFAULT_COMPILER)
147
+ set(platform_compiler_detection "
148
+ /* These compilers are either not known or too old to define an
149
+ identification macro. Try to identify the platform and guess that
150
+ it is the native compiler. */
151
+ #elif defined(__hpux) || defined(__hpua)
152
+ # define ${CID_PREFIX}COMPILER_ID \"HP\"
153
+
154
+ #else /* unknown compiler */
155
+ # define ${CID_PREFIX}COMPILER_ID \"\"")
156
+ endif()
157
+
158
+ string(APPEND CMAKE_${lang}_COMPILER_ID_CONTENT "\n${platform_compiler_detection}\n#endif")
159
+ endif()
160
+
161
+ set(${outvar} ${CMAKE_${lang}_COMPILER_ID_CONTENT} PARENT_SCOPE)
162
+ endfunction()
cmake/share/cmake-3.31/Modules/CMakeConfigurableFile.in ADDED
@@ -0,0 +1 @@
 
 
1
+ @CMAKE_CONFIGURABLE_FILE_CONTENT@
cmake/share/cmake-3.31/Modules/CMakeDependentOption.cmake ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+ #[=======================================================================[.rst:
5
+ CMakeDependentOption
6
+ --------------------
7
+
8
+ Macro to provide an option dependent on other options.
9
+
10
+ This macro presents an option to the user only if a set of other
11
+ conditions are true.
12
+
13
+ .. command:: cmake_dependent_option
14
+
15
+ .. code-block:: cmake
16
+
17
+ cmake_dependent_option(<option> "<help_text>" <value> <depends> <force>)
18
+
19
+ Makes ``<option>`` available to the user if the
20
+ :ref:`semicolon-separated list <CMake Language Lists>` of conditions in
21
+ ``<depends>`` are all true. Otherwise, a local variable named ``<option>``
22
+ is set to ``<force>``.
23
+
24
+ When ``<option>`` is available, the given ``<help_text>`` and initial
25
+ ``<value>`` are used. Otherwise, any value set by the user is preserved for
26
+ when ``<depends>`` is satisfied in the future.
27
+
28
+ Note that the ``<option>`` variable only has a value which satisfies the
29
+ ``<depends>`` condition within the scope of the caller because it is a local
30
+ variable.
31
+
32
+ Example invocation:
33
+
34
+ .. code-block:: cmake
35
+
36
+ cmake_dependent_option(USE_FOO "Use Foo" ON "USE_BAR;NOT USE_ZOT" OFF)
37
+
38
+ If ``USE_BAR`` is true and ``USE_ZOT`` is false, this provides an option called
39
+ ``USE_FOO`` that defaults to ON. Otherwise, it sets ``USE_FOO`` to OFF and
40
+ hides the option from the user. If the status of ``USE_BAR`` or ``USE_ZOT``
41
+ ever changes, any value for the ``USE_FOO`` option is saved so that when the
42
+ option is re-enabled it retains its old value.
43
+
44
+ .. versionadded:: 3.22
45
+
46
+ Full :ref:`Condition Syntax` is now supported. See policy :policy:`CMP0127`.
47
+
48
+ #]=======================================================================]
49
+
50
+ macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
51
+ cmake_policy(GET CMP0127 _CDO_CMP0127
52
+ PARENT_SCOPE # undocumented, do not use outside of CMake
53
+ )
54
+ if(${option}_ISSET MATCHES "^${option}_ISSET$")
55
+ set(${option}_AVAILABLE 1)
56
+ if("x${_CDO_CMP0127}x" STREQUAL "xNEWx")
57
+ foreach(d ${depends})
58
+ cmake_language(EVAL CODE "
59
+ if (${d})
60
+ else()
61
+ set(${option}_AVAILABLE 0)
62
+ endif()"
63
+ )
64
+ endforeach()
65
+ else()
66
+ foreach(d ${depends})
67
+ string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
68
+ if(${CMAKE_DEPENDENT_OPTION_DEP})
69
+ else()
70
+ set(${option}_AVAILABLE 0)
71
+ endif()
72
+ endforeach()
73
+ endif()
74
+ if(${option}_AVAILABLE)
75
+ option(${option} "${doc}" "${default}")
76
+ set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
77
+ else()
78
+ if(${option} MATCHES "^${option}$")
79
+ else()
80
+ set(${option} "${${option}}" CACHE INTERNAL "${doc}")
81
+ endif()
82
+ set(${option} ${force})
83
+ endif()
84
+ else()
85
+ set(${option} "${${option}_ISSET}")
86
+ endif()
87
+ if("x${_CDO_CMP0127}x" STREQUAL "xx" AND "x${depends}x" MATCHES "[^A-Za-z0-9_.; ]")
88
+ cmake_policy(GET_WARNING CMP0127 _CDO_CMP0127_WARNING)
89
+ message(AUTHOR_WARNING "${_CDO_CMP0127_WARNING}")
90
+ endif()
91
+ unset(_CDO_CMP0127)
92
+ endmacro()
cmake/share/cmake-3.31/Modules/CMakeDetermineASM-ATTCompiler.cmake ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
+ # file Copyright.txt or https://cmake.org/licensing for details.
3
+
4
+
5
+ # determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
6
+
7
+ set(ASM_DIALECT "-ATT")
8
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
9
+ include(CMakeDetermineASMCompiler)
10
+ set(ASM_DIALECT)