1CMAKE-POLICIES(7) CMake CMAKE-POLICIES(7)
2
3
4
6 cmake-policies - CMake Policies Reference
7
9 Policies in CMake are used to preserve backward compatible behavior
10 across multiple releases. When a new policy is introduced, newer CMake
11 versions will begin to warn about the backward compatible behavior. It
12 is possible to disable the warning by explicitly requesting the OLD, or
13 backward compatible behavior using the cmake_policy() command. It is
14 also possible to request NEW, or non-backward compatible behavior for a
15 policy, also avoiding the warning. Each policy can also be set to ei‐
16 ther NEW or OLD behavior explicitly on the command line with the
17 CMAKE_POLICY_DEFAULT_CMP<NNNN> variable.
18
19 A policy is a deprecation mechanism and not a reliable feature toggle.
20 A policy should almost never be set to OLD, except to silence warnings
21 in an otherwise frozen or stable codebase, or temporarily as part of a
22 larger migration path. The OLD behavior of each policy is undesirable
23 and will be replaced with an error condition in a future release.
24
25 The cmake_minimum_required() command does more than report an error if
26 a too-old version of CMake is used to build a project. It also sets
27 all policies introduced in that CMake version or earlier to NEW behav‐
28 ior. To manage policies without increasing the minimum required CMake
29 version, the if(POLICY) command may be used:
30
31 if(POLICY CMP0990)
32 cmake_policy(SET CMP0990 NEW)
33 endif()
34
35 This has the effect of using the NEW behavior with newer CMake releases
36 which users may be using and not issuing a compatibility warning.
37
38 The setting of a policy is confined in some cases to not propagate to
39 the parent scope. For example, if the files read by the include() com‐
40 mand or the find_package() command contain a use of cmake_policy(),
41 that policy setting will not affect the caller by default. Both com‐
42 mands accept an optional NO_POLICY_SCOPE keyword to control this behav‐
43 ior.
44
45 The CMAKE_MINIMUM_REQUIRED_VERSION variable may also be used to deter‐
46 mine whether to report an error on use of deprecated macros or func‐
47 tions.
48
50 CMP0151
51 New in version 3.27.
52
53
54 AUTOMOC include directory is a system include directory by default.
55
56 Headers generated for AUTOMOC are placed in target-specific include di‐
57 rectories. CMake 3.26 and older added these as normal include directo‐
58 ries. CMake 3.27 and newer prefer to add them as system include direc‐
59 tories. This policy provides compatibility for projects that have not
60 been updated to expect this.
61
62 If the AUTOGEN_USE_SYSTEM_INCLUDE target property is set, perhaps via
63 the CMAKE_AUTOGEN_USE_SYSTEM_INCLUDE variable, then its value is used
64 regardless of the setting of this policy.
65
66 The OLD behavior for this policy is to add autogen include directory to
67 the target's include directories. The NEW behavior for this policy is
68 to add autogen include directory to the target's system include direc‐
69 tories.
70
71 This policy was introduced in CMake version 3.27. Use the
72 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
73 policies, CMake version 3.27.7 does not warn when this policy is not
74 set and simply uses OLD behavior.
75
76 NOTE:
77 The OLD behavior of a policy is deprecated by definition and may be
78 removed in a future version of CMake.
79
80 CMP0150
81 New in version 3.27.
82
83
84 ExternalProject_Add() and FetchContent_Declare() commands treat rela‐
85 tive GIT_REPOSITORY paths as being relative to the parent project's re‐
86 mote.
87
88 Earlier versions of these commands always treated relative paths in
89 GIT_REPOSITORY as local paths, but the base directory it was treated as
90 relative to was both undocumented and unintuitive. The OLD behavior
91 for this policy is to interpret relative paths used for GIT_REPOSITORY
92 as local paths relative to the following:
93
94 • The parent directory of SOURCE_DIR for ExternalProject_Add().
95
96 • FETCHCONTENT_BASE_DIR for FetchContent_Declare().
97
98 The NEW behavior is to determine the remote from the parent project and
99 interpret the path relative to that remote. The value of
100 CMAKE_CURRENT_SOURCE_DIR when ExternalProject_Add() or
101 FetchContent_Declare() is called determines the parent project. The
102 remote is selected according to the following (the first match is
103 used):
104
105 • If the parent project is checked out on a branch with an upstream re‐
106 mote defined, use that remote.
107
108 • If only one remote is defined, use that remote.
109
110 • If multiple remotes are defined and one of them is named origin, use
111 origin's remote but also issue a warning.
112
113 If an appropriate remote cannot be determined from the above, a fatal
114 error will be raised.
115
116 This policy was introduced in CMake version 3.27. CMake version 3.27.7
117 warns when a relative path is encountered and the policy is not set,
118 falling back to using OLD behavior. Use the cmake_policy() command to
119 set it to OLD or NEW explicitly.
120
121 NOTE:
122 The OLD behavior of a policy is deprecated by definition and may be
123 removed in a future version of CMake.
124
125 CMP0149
126 New in version 3.27.
127
128
129 Visual Studio Generators select latest Windows SDK by default.
130
131 Visual Studio Generators select a Windows SDK version to put in the
132 WindowsTargetPlatformVersion setting in .vcxproj files. CMake sets the
133 CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable to the selected SDK
134 version.
135
136 Prior to CMake 3.27, the SDK version was always selected by the value
137 of the CMAKE_SYSTEM_VERSION variable. Users or toolchain files could
138 set that variable to one of the exact Windows SDK versions available on
139 the host system. Since CMAKE_SYSTEM_VERSION defaults to
140 CMAKE_HOST_SYSTEM_VERSION, and it is not guaranteed that a matching
141 Windows SDK version is available, CMake had to fall back to using the
142 latest Windows SDK version if no exact match was available. This ap‐
143 proach was problematic:
144
145 • The latest Windows SDK might or might not be selected based on
146 whether the host version of Windows happens to match an available SDK
147 version.
148
149 • An old Windows SDK version might be selected that has not been up‐
150 dated for newer language standards such as C11.
151
152 CMake 3.27 and higher prefer to ignore the exact value of
153 CMAKE_SYSTEM_VERSION and by default select the latest SDK version
154 available. An exact SDK version may be specified explicitly using a
155 version= field in the CMAKE_GENERATOR_PLATFORM variable. See Visual
156 Studio Platform Selection.
157
158 This policy provides compatibility for projects, toolchain files, and
159 build scripts that have not been ported away from using
160 CMAKE_SYSTEM_VERSION to specify an exact SDK version.
161
162 The OLD behavior for this policy is to use the exact value of
163 CMAKE_SYSTEM_VERSION if possible. The NEW behavior for this policy is
164 to ignore it.
165
166 This policy was introduced in CMake version 3.27. Use the
167 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
168 policies, CMake version 3.27.7 does not warn when this policy is not
169 set and simply uses OLD behavior.
170
171 NOTE:
172 The OLD behavior of a policy is deprecated by definition and may be
173 removed in a future version of CMake.
174
175 CMP0148
176 New in version 3.27.
177
178
179 The FindPythonInterp and FindPythonLibs modules are removed.
180
181 These modules have been deprecated since CMake 3.12. CMake 3.27 and
182 above prefer to not provide the modules. This policy provides compati‐
183 bility for projects that have not been ported away from them.
184
185 Projects using the FindPythonInterp and/or FindPythonLibs modules
186 should be updated to use one of their replacements:
187
188 • FindPython3
189
190 • FindPython2
191
192 • FindPython
193
194 The OLD behavior of this policy is for find_package(PythonInterp) and
195 find_package(PythonLibs) to load the deprecated modules. The NEW be‐
196 havior is for uses of the modules to fail as if they do not exist.
197
198 This policy was introduced in CMake version 3.27. CMake version 3.27.7
199 warns when the policy is not set and uses OLD behavior. Use the
200 cmake_policy() command to set it to OLD or NEW explicitly.
201
202 NOTE:
203 The OLD behavior of a policy is deprecated by definition and may be
204 removed in a future version of CMake.
205
206 CMP0147
207 New in version 3.27.
208
209
210 Visual Studio Generators build custom commands in parallel.
211
212 Visual Studio 15.8 (2017) and newer support building custom commands in
213 parallel. CMake 3.27 and above prefer to enable this behavior by
214 adding a BuildInParallel setting to custom commands in .vcxproj files.
215 This policy provides compatibility for projects that have not been up‐
216 dated to expect this, e.g., because their custom commands were acciden‐
217 tally relying on serial execution by MSBuild.
218
219 The OLD behavior for this policy is to not add BuildInParallel. The
220 NEW behavior for this policy is to add BuildInParallel for VS 15.8 and
221 newer.
222
223 This policy was introduced in CMake version 3.27. Use the
224 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
225 policies, CMake version 3.27.7 does not warn when this policy is not
226 set and simply uses OLD behavior.
227
228 NOTE:
229 The OLD behavior of a policy is deprecated by definition and may be
230 removed in a future version of CMake.
231
232 CMP0146
233 New in version 3.27.
234
235
236 The FindCUDA module is removed.
237
238 The FindCUDA module has been deprecated since CMake 3.10. CMake 3.27
239 and above prefer to not provide the module. This policy provides com‐
240 patibility for projects that have not been ported away from it.
241
242 Projects using the FindCUDA module should be updated to use CMake's
243 first-class CUDA language support. List CUDA among the languages named
244 in the top-level call to the project() command, or call the
245 enable_language() command with CUDA. Then one can add CUDA (.cu)
246 sources directly to targets, similar to other languages.
247
248 The OLD behavior of this policy is for find_package(CUDA) to load the
249 deprecated module. The NEW behavior is for uses of the module to fail
250 as if it does not exist.
251
252 This policy was introduced in CMake version 3.27. CMake version 3.27.7
253 warns when the policy is not set and uses OLD behavior. Use the
254 cmake_policy() command to set it to OLD or NEW explicitly.
255
256 NOTE:
257 The OLD behavior of a policy is deprecated by definition and may be
258 removed in a future version of CMake.
259
260 CMP0145
261 New in version 3.27.
262
263
264 The Dart and FindDart modules are removed.
265
266 These modules were added very early in CMake's development to support
267 driving tests with a "DART" tool, but DART has not been distributed or
268 maintained for many years. Projects would include(Dart) to use it, and
269 the Dart module would run find_package(Dart) internally. Since
270 ctest(1) was created, the Dart module has just been a compatibility
271 shim that finds Dart to support some legacy functionality and then for‐
272 wards to the CTest module.
273
274 CMake 3.27 and above prefer to not provide the Dart or FindDart mod‐
275 ules. This policy provides compatibility for projects that have not
276 been ported away from them. Projects using the Dart module should be
277 updated to use the CTest module directly.
278
279 The OLD behavior of this policy is for include(Dart) and find_pack‐
280 age(Dart) to load the deprecated modules. The NEW behavior is for uses
281 of the modules to fail as if they do not exist.
282
283 This policy was introduced in CMake version 3.27. CMake version 3.27.7
284 warns when the policy is not set and uses OLD behavior. Use the
285 cmake_policy() command to set it to OLD or NEW explicitly.
286
287 NOTE:
288 The OLD behavior of a policy is deprecated by definition and may be
289 removed in a future version of CMake.
290
291 CMP0144
292 New in version 3.27.
293
294
295 find_package() uses upper-case <PACKAGENAME>_ROOT variables.
296
297 In CMake 3.27 and above the find_package(<PackageName>) command now
298 searches prefixes specified by the upper-case <PACKAGENAME>_ROOT CMake
299 variable and the <PACKAGENAME>_ROOT environment variable in addition to
300 the case-preserved <PackageName>_ROOT and <PackageName>_ROOT variables
301 used since policy CMP0074. This policy provides compatibility with
302 projects that have not been updated to avoid using <PACKAGENAME>_ROOT
303 variables for other purposes.
304
305 The OLD behavior for this policy is to ignore <PACKAGENAME>_ROOT vari‐
306 ables if the original <PackageName> has lower-case characters. The NEW
307 behavior for this policy is to use <PACKAGENAME>_ROOT variables.
308
309 This policy was introduced in CMake version 3.27. CMake version 3.27.7
310 warns when the policy is not set and uses OLD behavior. Use the
311 cmake_policy() command to set it to OLD or NEW explicitly.
312
313 NOTE:
314 The OLD behavior of a policy is deprecated by definition and may be
315 removed in a future version of CMake.
316
318 CMP0143
319 New in version 3.26.
320
321
322 USE_FOLDERS global property is treated as ON by default.
323
324 When using CMake 3.25 or earlier, USE_FOLDERS is treated as OFF by de‐
325 fault unless projects enable the feature. For example:
326
327 cmake_minimum_required(VERSION 3.25)
328 project(foobar LANGUAGES CXX)
329 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
330
331 CMake 3.26 and later prefer to enable the feature by default.
332
333 Note that it is the policy setting at the end of the top level CMake‐
334 Lists.txt file that matters. The policy setting applies globally to
335 the whole project.
336
337 This policy provides compatibility with projects that have not been up‐
338 dated to expect enabling of folders. Enabling folders causes projects
339 to appear differently in IDEs. The policy was introduced in CMake ver‐
340 sion 3.26. Use the cmake_policy() command to set it to OLD or NEW ex‐
341 plicitly. Unlike many policies, CMake version 3.27.7 does not warn
342 when this policy is not set and simply uses OLD behavior.
343
344 NOTE:
345 The OLD behavior of a policy is deprecated by definition and may be
346 removed in a future version of CMake.
347
349 CMP0142
350 New in version 3.25.
351
352
353 The Xcode generator does not append per-config suffixes to library
354 search paths.
355
356 In CMake 3.24 and below, the Xcode generator preceded each entry of a
357 library search path with a copy of itself appended with $(CONFIGURA‐
358 TION)$(EFFECTIVE_PLATFORM_NAME). This was left from very early ver‐
359 sions of CMake in which per-config directories were not well modeled.
360 Such paths often do not exist, resulting in warnings from the
361 toolchain. CMake 3.25 and above prefer to not add such library search
362 paths. This policy provides compatibility for projects that may have
363 been accidentally relying on the old behavior.
364
365 The OLD behavior for this policy is to append $(CONFIGURATION)$(EFFEC‐
366 TIVE_PLATFORM_NAME) to all library search paths. The NEW behavior is
367 to not modify library search paths.
368
369 This policy was introduced in CMake version 3.25. Use the
370 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
371 policies, CMake version 3.27.7 does not warn when this policy is not
372 set and simply uses OLD behavior.
373
374 NOTE:
375 The OLD behavior of a policy is deprecated by definition and may be
376 removed in a future version of CMake.
377
378 CMP0141
379 New in version 3.25.
380
381
382 MSVC debug information format flags are selected by an abstraction.
383
384 Compilers targeting the MSVC ABI have flags to select the debug infor‐
385 mation format. Debug information format selection typically varies with
386 build configuration.
387
388 In CMake 3.24 and below, debug information format flags are added to
389 the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries by CMake automat‐
390 ically. This allows users to edit their cache entries to adjust the
391 flags. However, the presence of such default flags is problematic for
392 projects that want to choose a different runtime library programmati‐
393 cally. In particular, it requires string editing of the
394 CMAKE_<LANG>_FLAGS_<CONFIG> variables with knowledge of the CMake
395 builtin defaults so they can be replaced.
396
397 CMake 3.25 and above prefer to leave the debug information format flags
398 out of the default CMAKE_<LANG>_FLAGS_<CONFIG> values and instead offer
399 a first-class abstraction. The CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
400 variable and MSVC_DEBUG_INFORMATION_FORMAT target property may be set
401 to select the MSVC debug information format. If they are not set,
402 CMake enables debug information in debug configurations using the de‐
403 fault value $<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>, if sup‐
404 ported by the compiler, and otherwise $<$<CONFIG:Debug,RelWithDe‐
405 bInfo>:Embedded>.
406
407 This policy provides compatibility with projects that have not been up‐
408 dated to be aware of the abstraction. The policy setting takes effect
409 as of the first project() or enable_language() command that enables a
410 language whose compiler targets the MSVC ABI.
411
412 NOTE:
413 Once the policy has taken effect at the top of a project, that
414 choice will be used throughout the tree. In projects that have
415 nested projects in subdirectories, be sure to confirm if everything
416 is working with the selected policy behavior.
417
418 The OLD behavior for this policy is to place MSVC debug information
419 format flags in the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries
420 and ignore the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT abstraction. The
421 NEW behavior for this policy is to not place MSVC debug information
422 format flags in the default cache entries and use the abstraction in‐
423 stead.
424
425 This policy was introduced in CMake version 3.25. Use the
426 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
427 policies, CMake version 3.27.7 does not warn when this policy is not
428 set and simply uses OLD behavior.
429
430 NOTE:
431 The OLD behavior of a policy is deprecated by definition and may be
432 removed in a future version of CMake.
433
434 CMP0140
435 New in version 3.25.
436
437
438 The return() command checks its parameters.
439
440 The OLD behavior for this policy is to ignore any parameters given to
441 the command. The NEW behavior is to check the validity of the parame‐
442 ters.
443
444 This policy was introduced in CMake version 3.25. CMake version 3.27.7
445 warns when the policy is not set and uses OLD behavior. Use the
446 cmake_policy() command to set it to OLD or NEW explicitly.
447
448 NOTE:
449 The OLD behavior of a policy is deprecated by definition and may be
450 removed in a future version of CMake.
451
453 CMP0139
454 New in version 3.24.
455
456
457 The if() command supports path comparisons using PATH_EQUAL operator.
458
459 The OLD behavior for this policy is to ignore the PATH_EQUAL operator.
460 The NEW behavior is to interpret the PATH_EQUAL operator.
461
462 This policy was introduced in CMake version 3.24. CMake version 3.27.7
463 warns when the policy is not set and uses OLD behavior. Use the
464 cmake_policy() command to set it to OLD or NEW explicitly.
465
466 NOTE:
467 The OLD behavior of a policy is deprecated by definition and may be
468 removed in a future version of CMake.
469
470 CMP0138
471 New in version 3.24.
472
473
474 CheckIPOSupported uses flags from calling project.
475
476 The CheckIPOSupported module check_ipo_supported() command compiles a
477 test project to determine whether the toolchain supports
478 INTERPROCEDURAL_OPTIMIZATION. CMake 3.23 and below run the check with
479 the default values of the CMAKE_<LANG>_FLAGS and
480 CMAKE_<LANG>_FLAGS_<CONFIG> variables for the current environment and
481 toolchain settings. However, some projects may modify these flag vari‐
482 ables to add flags that affect availability of the toolchain's IPO fea‐
483 tures. CMake 3.24 and above prefer to honor the calling project's val‐
484 ues for these variables. This policy provides compatibility for
485 projects that have not been updated to expect this behavior.
486
487 The OLD behavior for this policy is to ignore the calling project's
488 values of CMAKE_<LANG>_FLAGS and CMAKE_<LANG>_FLAGS_<CONFIG>. The NEW
489 behavior for this policy is to use the values of those variables as
490 compiler flags in the test project.
491
492 This policy was introduced in CMake version 3.24. Use the
493 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
494 policies, CMake version 3.27.7 does not warn when this policy is not
495 set and simply uses OLD behavior.
496
497 NOTE:
498 The OLD behavior of a policy is deprecated by definition and may be
499 removed in a future version of CMake.
500
501 CMP0137
502 New in version 3.24.
503
504
505 try_compile() passes platform variables in project mode.
506
507 The try_compile() command source file signature propagates CMake vari‐
508 ables containing platform settings, and those specified by the
509 CMAKE_TRY_COMPILE_PLATFORM_VARIABLES variable, into the generated test
510 project. This helps the test project drive the toolchain the same way
511 the calling project will. In CMake 3.23 and below, the whole-project
512 signature does not propagate platform variables automatically. CMake
513 3.24 and above prefer to propagate platform variables in the
514 whole-project signature. This policy provides compatibility with
515 projects that have not been updated to expect the behavior.
516
517 The OLD behavior for this policy is to not pass any additional vari‐
518 ables to the whole-project signature. The NEW behavior for this policy
519 is to pass the same variables that the source file signature does.
520
521 Regardless of the policy setting, the
522 CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES variable may be set to suppress
523 passing the platform variables through either signature.
524
525 This policy was introduced in CMake version 3.24. Use the
526 cmake_policy() command to set this policy to OLD or NEW explicitly. Un‐
527 like many policies, CMake version 3.27.7 does not warn by default when
528 this policy is not set and simply uses OLD behavior.
529
530 NOTE:
531 The OLD behavior of a policy is deprecated by definition and may be
532 removed in a future version of CMake.
533
534 CMP0136
535 New in version 3.24.
536
537
538 Watcom runtime library flags are selected by an abstraction.
539
540 Compilers targeting the Watcom ABI have flags to select the Watcom run‐
541 time library.
542
543 In CMake 3.23 and below, Watcom runtime library selection flags are
544 added to the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries by CMake
545 automatically. This allows users to edit their cache entries to adjust
546 the flags. However, the presence of such default flags is problematic
547 for projects that want to choose a different runtime library program‐
548 matically. In particular, it requires string editing of the
549 CMAKE_<LANG>_FLAGS_<CONFIG> variables with knowledge of the CMake
550 builtin defaults so they can be replaced.
551
552 CMake 3.24 and above prefer to leave the Watcom runtime library selec‐
553 tion flags out of the default CMAKE_<LANG>_FLAGS_<CONFIG> values and
554 instead offer a first-class abstraction. The
555 CMAKE_WATCOM_RUNTIME_LIBRARY variable and WATCOM_RUNTIME_LIBRARY target
556 property may be set to select the Watcom runtime library. If they are
557 not set then CMake uses the default value MultiThreadedDLL on Windows
558 and SingleThreaded on other platforms, which is equivalent to the orig‐
559 inal flags.
560
561 This policy provides compatibility with projects that have not been up‐
562 dated to be aware of the abstraction. The policy setting takes effect
563 as of the first project() or enable_language() command that enables a
564 language whose compiler targets the Watcom ABI.
565
566 NOTE:
567 Once the policy has taken effect at the top of a project, that
568 choice must be used throughout the tree. In projects that have
569 nested projects in subdirectories, be sure to convert everything to‐
570 gether.
571
572 The OLD behavior for this policy is to place Watcom runtime library
573 flags in the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries and ig‐
574 nore the CMAKE_WATCOM_RUNTIME_LIBRARY abstraction. The NEW behavior
575 for this policy is to not place Watcom runtime library flags in the de‐
576 fault cache entries and use the abstraction instead.
577
578 This policy was introduced in CMake version 3.24. Use the
579 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
580 policies, CMake version 3.27.7 does not warn when this policy is not
581 set and simply uses OLD behavior.
582
583 NOTE:
584 The OLD behavior of a policy is deprecated by definition and may be
585 removed in a future version of CMake.
586
587 CMP0135
588 New in version 3.24.
589
590
591 When using the URL download method with the ExternalProject_Add() com‐
592 mand, CMake 3.23 and below sets the timestamps of the extracted con‐
593 tents to the same as the timestamps in the archive. When the URL
594 changes, the new archive is downloaded and extracted, but the time‐
595 stamps of the extracted contents might not be newer than the previous
596 contents. Anything that depends on the extracted contents might not be
597 rebuilt, even though the contents may change.
598
599 CMake 3.24 and above prefers to set the timestamps of all extracted
600 contents to the time of the extraction. This ensures that anything that
601 depends on the extracted contents will be rebuilt whenever the URL
602 changes.
603
604 The DOWNLOAD_EXTRACT_TIMESTAMP option to the ExternalProject_Add() com‐
605 mand can be used to explicitly specify how timestamps should be han‐
606 dled. When DOWNLOAD_EXTRACT_TIMESTAMP is not given, this policy con‐
607 trols the default behavior. The OLD behavior for this policy is to re‐
608 store the timestamps from the archive. The NEW behavior sets the time‐
609 stamps of extracted contents to the time of extraction.
610
611 This policy was introduced in CMake version 3.24. CMake version 3.27.7
612 warns when the policy is not set and uses OLD behavior. Use the
613 cmake_policy() command to set it to OLD or NEW explicitly.
614
615 NOTE:
616 The OLD behavior of a policy is deprecated by definition and may be
617 removed in a future version of CMake.
618
619 CMP0134
620 New in version 3.24.
621
622
623 The default registry view is TARGET for the find_file(), find_path(),
624 find_library(), and find_package() commands and BOTH for the
625 find_program() command.
626
627 The default registry views in CMake 3.23 and below are selected using
628 the following rules:
629
630 • if CMAKE_SIZEOF_VOID_P has value 8:
631
632 • Use view 64 for all find_* commands except find_program() command.
633
634 • Use view 64_32 for find_program() command.
635
636 • if CMAKE_SIZEOF_VOID_P has value 4 or is undefined:
637
638 • Use view 32 for all find_* commands except find_program() command.
639
640 • Use view 32_64 for find_program() command.
641
642 The OLD behavior for this policy is to use registry views 64 and 64_32
643 or 32_64 and 32 as default, depending of CMAKE_SIZEOF_VOID_P variable
644 value. The NEW behavior for this policy is to use registry views TAR‐
645 GET and BOTH as default.
646
647 This policy was introduced in CMake version 3.24. Use the
648 cmake_policy() command to set this policy to OLD or NEW explicitly. Un‐
649 like many policies, CMake version 3.27.7 does not warn when this policy
650 is not set and simply uses OLD behavior.
651
652 NOTE:
653 The OLD behavior of a policy is deprecated by definition and may be
654 removed in a future version of CMake.
655
656 CMP0133
657 New in version 3.24.
658
659
660 The CPack module disables SLA by default in the CPack DragNDrop Genera‐
661 tor.
662
663 The CPack DragNDrop Generator in CMake 3.22 and below attach a Software
664 License Agreement (SLA) to .dmg files using the file specified by
665 CPACK_RESOURCE_FILE_LICENSE, if set to a non-default value. macOS 12.0
666 deprecated the tools used to do this, so CMake 3.23 added the
667 CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE option to control the behavior.
668 CMake 3.23 enables that option by default for compatibility with older
669 versions. CMake 3.24 and above prefer to not enable the
670 CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE option by default. This policy
671 provides compatibility with projects that have not been updated to ac‐
672 count for the lack of a SLA in their .dmg packages.
673
674 The OLD behavior for this policy is to enable
675 CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE by default. The NEW behavior
676 for this policy is to not enable it by default.
677
678 This policy was introduced in CMake version 3.24. Use the
679 cmake_policy() command to set this policy to OLD or NEW explicitly. Un‐
680 like many policies, CMake version 3.27.7 does not warn by default when
681 this policy is not set and simply uses OLD behavior. See documentation
682 of the CMAKE_POLICY_WARNING_CMP0133 variable to control the warning.
683
684 NOTE:
685 The OLD behavior of a policy is deprecated by definition and may be
686 removed in a future version of CMake.
687
688 CMP0132
689 New in version 3.24.
690
691
692 Apart from when using the Xcode generator and some Visual Studio gener‐
693 ators, CMake 3.23 and below will set environment variables like CC,
694 CXX, etc. when the corresponding language is enabled. This only occurs
695 on the very first time CMake is run in a build directory, and the envi‐
696 ronment variables are only defined at configure time, not build time.
697 On subsequent CMake runs, these environment variables are not set,
698 opening up the opportunity for different behavior between the first and
699 subsequent CMake runs. CMake 3.24 and above prefer to not set these en‐
700 vironment variables when a language is enabled, even on the first run
701 in a build directory.
702
703 The OLD behavior for this policy sets the relevant environment variable
704 on the first run when a language is enabled. The NEW behavior for this
705 policy does not set any such environment variables.
706
707 This policy was introduced in CMake version 3.24. Use the
708 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
709 policies, CMake version 3.27.7 does not warn when this policy is not
710 set and simply uses OLD behavior.
711
712 NOTE:
713 The OLD behavior of a policy is deprecated by definition and may be
714 removed in a future version of CMake.
715
716 CMP0131
717 New in version 3.24.
718
719
720 LINK_LIBRARIES supports the $<LINK_ONLY:...> generator expression.
721
722 CMake 3.23 and below documented the $<LINK_ONLY:...> generator expres‐
723 sion only for use in INTERFACE_LINK_LIBRARIES. When used in
724 LINK_LIBRARIES, the content guarded inside $<LINK_ONLY:...> was always
725 used, even when collecting non-linking usage requirements such as
726 INTERFACE_COMPILE_DEFINITIONS.
727
728 CMake 3.24 and above prefer to support $<LINK_ONLY:...>, when used in
729 LINK_LIBRARIES, by using the guarded content only for link dependencies
730 and not other usage requirements. This policy provides compatibility
731 for projects that have not been updated to account for this change.
732
733 The OLD behavior for this policy is to use LINK_LIBRARIES content
734 guarded by $<LINK_ONLY:...> even for non-linking usage requirements.
735 The NEW behavior for this policy is to use the guarded content only for
736 link dependencies.
737
738 This policy was introduced in CMake version 3.24. Use the
739 cmake_policy() command to set this policy to OLD or NEW explicitly.
740 Unlike many policies, CMake version 3.27.7 does not warn when this pol‐
741 icy is not set, and simply uses OLD behavior.
742
743 NOTE:
744 The OLD behavior of a policy is deprecated by definition and may be
745 removed in a future version of CMake.
746
747 CMP0130
748 New in version 3.24.
749
750
751 while() diagnoses condition evaluation errors.
752
753 CMake 3.23 and below accidentally tolerated errors encountered while
754 evaluating the condition passed to the while() command (but not the
755 if() command). For example, the code
756
757 set(paren "(")
758 while(${paren})
759 endwhile()
760
761 creates an unbalanced parenthesis during condition evaluation.
762
763 CMake 3.24 and above prefer to diagnose such errors. This policy pro‐
764 vides compatibility for projects that have not been updated to fix
765 their condition errors.
766
767 The OLD behavior for this policy is to ignore errors in while() condi‐
768 tions. The NEW behavior for this policy is to diagnose errors in
769 while() conditions.
770
771 This policy was introduced in CMake version 3.24. CMake version 3.27.7
772 warns when the policy is not set and uses OLD behavior. Use the
773 cmake_policy() command to set it to OLD or NEW explicitly.
774
775 NOTE:
776 The OLD behavior of a policy is deprecated by definition and may be
777 removed in a future version of CMake.
778
780 CMP0129
781 New in version 3.23.
782
783
784 Compiler id for MCST LCC compilers is now LCC, not GNU.
785
786 CMake 3.23 and above recognize MCST LCC compiler as a different from
787 GNU, with its own command line and set of capabilities. CMake now pre‐
788 fers to present this to projects by setting the
789 CMAKE_<LANG>_COMPILER_ID variable to LCC instead of GNU. However, ex‐
790 isting projects may assume the compiler id for LCC is GNU as it was in
791 CMake versions prior to 3.23. Therefore this policy determines for
792 MCST LCC compiler which compiler id to report in the
793 CMAKE_<LANG>_COMPILER_ID variable after language <LANG> is enabled by
794 the project() or enable_language() command. The policy must be set
795 prior to the invocation of either command.
796
797 The OLD behavior for this policy is to use compiler id GNU (and set
798 CMAKE_<LANG>_COMPILER_VERSION to the supported GNU compiler version.)
799 NEW behavior for this policy is to use compiler id LCC, and set
800 CMAKE_<LANG>_SIMULATE_ID to GNU, and CMAKE_<LANG>_SIMULATE_VERSION to
801 the supported GNU compiler version.
802
803 This policy was introduced in CMake version 3.23. Use the
804 cmake_policy() command to set this policy to OLD or NEW explicitly.
805 Unlike most policies, CMake version 3.27.7 does not warn by default
806 when this policy is not set and simply uses OLD behavior. See documen‐
807 tation of the CMAKE_POLICY_WARNING_CMP0129 variable to control the
808 warning.
809
810 NOTE:
811 The OLD behavior of a policy is deprecated by definition and may be
812 removed in a future version of CMake.
813
815 CMP0128
816 New in version 3.22.
817
818
819 When this policy is set to NEW:
820
821 • <LANG>_EXTENSIONS is initialized to CMAKE_<LANG>_EXTENSIONS if set,
822 otherwise falling back to CMAKE_<LANG>_EXTENSIONS_DEFAULT.
823
824 • Extensions are correctly enabled/disabled if <LANG>_STANDARD is unset
825 or satisfied by the default.
826
827 • Standard mode-affecting flags aren't added unless necessary to
828 achieve the specified mode.
829
830 The OLD behavior:
831
832 • Initializes <LANG>_EXTENSIONS to CMAKE_<LANG>_EXTENSIONS if set, oth‐
833 erwise falling back to ON.
834
835 • Always adds a flag if <LANG>_STANDARD is set and
836 <LANG>_STANDARD_REQUIRED is OFF.
837
838 • If <LANG>_STANDARD is unset:
839
840 • Doesn't disable extensions even if <LANG>_EXTENSIONS is OFF.
841
842 • Fails to enable extensions if <LANG>_EXTENSIONS is ON except for
843 the IAR compiler.
844
845 Code may need to be updated for the NEW behavior in the following
846 cases:
847
848 • If a standard mode flag previously overridden by CMake's and not used
849 during compiler detection now takes effect due to CMake no longer
850 adding one as the default detected is appropriate.
851
852 Such code should be converted to either:
853
854 • Use <LANG>_STANDARD and <LANG>_EXTENSIONS instead of manually
855 adding flags.
856
857 • Or ensure the manually-specified flags are used during compiler de‐
858 tection.
859
860 • If extensions were disabled without <LANG>_STANDARD being set CMake
861 previously wouldn't actually disable extensions.
862
863 Such code should be updated to not disable extensions if they are re‐
864 quired.
865
866 • If extensions were enabled/disabled when <LANG>_STANDARD was satis‐
867 fied by the compiler's default CMake previously wouldn't actually en‐
868 able/disable extensions.
869
870 Such code should be updated to set the correct extensions mode.
871
872 If compiler flags affecting the standard mode are used during compiler
873 detection (for example in a toolchain file using
874 CMAKE_<LANG>_FLAGS_INIT) then they will affect the detected default
875 standard and extensions.
876
877 Unlike many policies, CMake version 3.27.7 does not warn when the pol‐
878 icy is not set and simply uses the OLD behavior. Use the cmake_policy()
879 command to set it to OLD or NEW explicitly. See documentation of the
880 CMAKE_POLICY_WARNING_CMP0128 variable to control the warning.
881
882 NOTE:
883 The OLD behavior of a policy is deprecated by definition and may be
884 removed in a future version of CMake.
885
886 CMP0127
887 New in version 3.22.
888
889
890 cmake_dependent_option() supports full Condition Syntax.
891
892 The <depends> parameter accepts a semicolon-separated list of condi‐
893 tions. CMake 3.21 and lower evaluates each condition as if(${condi‐
894 tion}), which does not properly handle conditions with nested paren
895 groups. CMake 3.22 and above instead prefer to evaluate each condition
896 as if(<condition>), where <condition> is re-parsed as if literally
897 written in a call to if(). This allows expressions like:
898
899 "A AND (B OR C)"
900
901 but requires expressions like:
902
903 "FOO MATCHES (UPPER|lower)"
904
905 to be re-written as:
906
907 "FOO MATCHES \"(UPPER|lower)\""
908
909 Policy CMP0127 provides compatibility for projects that have not been
910 updated to expect the new behavior.
911
912 This policy was introduced in CMake version 3.22. CMake version 3.27.7
913 warns when the policy is not set and uses OLD behavior. Use the
914 cmake_policy() command to set it to OLD or NEW explicitly.
915
916 NOTE:
917 The OLD behavior of a policy is deprecated by definition and may be
918 removed in a future version of CMake.
919
921 CMP0126
922 New in version 3.21.
923
924
925 When this policy is set to NEW, the set(CACHE) command does not remove
926 any normal variable of the same name from the current scope. The OLD
927 behavior removes any normal variable of the same name from the current
928 scope in the following situations:
929
930 • No cache variable of that name existed previously.
931
932 • A cache variable of that name existed previously, but it had no type.
933 This can occur when the variable was set on the command line using a
934 form like cmake -DMYVAR=blah instead of cmake -DMYVAR:STRING=blah.
935
936 • The FORCE or INTERNAL keywords were used when setting the cache vari‐
937 able.
938
939 Note that the NEW behavior has an important difference to the similar
940 NEW behavior of policy CMP0077. The set(CACHE) command always sets the
941 cache variable if it did not exist previously, regardless of the
942 CMP0126 policy setting. The option() command will not set the cache
943 variable if a non-cache variable of the same name already exists and
944 CMP0077 is set to NEW.
945
946 Policy CMP0126 was introduced in CMake version 3.21. Use the
947 cmake_policy() command to set it to OLD or NEW explicitly within a
948 project. Use the CMAKE_POLICY_DEFAULT_CMP0126 variable to set the pol‐
949 icy for a third-party project in a subdirectory without modifying it.
950 Unlike many policies, CMake version 3.27.7 does not warn when the pol‐
951 icy is not set and simply uses OLD behavior. See documentation of the
952 CMAKE_POLICY_WARNING_CMP0126 variable to control the warning.
953
954 NOTE:
955 The OLD behavior of a policy is deprecated by definition and may be
956 removed in a future version of CMake.
957
958 CMP0125
959 New in version 3.21.
960
961
962 The find_file(), find_path(), find_library() and find_program() com‐
963 mands cache their result in the variable specified by their first argu‐
964 ment. Prior to CMake 3.21, if a cache variable of that name already
965 existed before the call but the cache variable had no type, any
966 non-cache variable of the same name would be discarded and the cache
967 variable was always used (see also CMP0126 for a different but similar
968 behavior). This contradicts the convention that a non-cache variable
969 should take precedence over a cache variable of the same name. Such a
970 situation can arise if a user sets a cache variable on the command line
971 without specifying a type, such as cmake -DMYVAR=blah ... instead of
972 cmake -DMYVAR:FILEPATH=blah.
973
974 Related to the above, if a cache variable of the specified name already
975 exists and it does have a type, the various find_...() commands would
976 return that value unchanged. In particular, if it contained a relative
977 path, it would not be converted to an absolute path in this situation.
978
979 When policy CMP0125 is set to OLD or is unset, the behavior is as de‐
980 scribed above. When it is set to NEW, the behavior is as follows:
981
982 • If a non-cache variable of the specified name exists when the
983 find_...() command is called, its value will be used regardless of
984 whether a cache variable of the same name already exists or not. A
985 cache variable will not be created in this case if no such cache
986 variable existed before. If a cache variable of the specified name
987 did already exist, the cache will be updated to match the non-cache
988 variable.
989
990 • The various find...() commands will always provide an absolute path
991 in the result variable, except where a relative path provided by a
992 cache or non-cache variable cannot be resolved to an existing path.
993
994 This policy was introduced in CMake version 3.21. Use the
995 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
996 policies, CMake version 3.27.7 does not warn when the policy is not set
997 and simply uses OLD behavior.
998
999 NOTE:
1000 The OLD behavior of a policy is deprecated by definition and may be
1001 removed in a future version of CMake.
1002
1003 CMP0124
1004 New in version 3.21.
1005
1006
1007 foreach() loop variables are only available in the loop scope.
1008
1009 CMake 3.20 and below always leave the loop variable set at the end of
1010 the loop, either to the value it had before the loop, if any, or to the
1011 empty string. CMake 3.21 and above prefer to leave the loop variable
1012 in the state it had before the loop started, either set or unset. This
1013 policy provides compatibility for projects that expect the loop vari‐
1014 able to always be left set.
1015
1016 The OLD behavior for this policy is to set the loop variable at the end
1017 of the loop, either to its original value, or to an empty value. The
1018 NEW behavior for this policy is to restore the loop variable to the
1019 state it had before the loop started, either set or unset.
1020
1021 For example:
1022
1023 set(items a b c)
1024
1025 set(var1 "value")
1026 unset(var2)
1027
1028 foreach(var1 IN LISTS items)
1029 endforeach()
1030
1031 foreach(var2 IN LISTS items)
1032 endforeach()
1033
1034 if(DEFINED var1)
1035 message("var1: ${var1}")
1036 endif()
1037 if(DEFINED var2)
1038 message("var2: ${var2}")
1039 endif()
1040
1041 Under the OLD behavior, this code prints var1: value and var2:. Under
1042 the NEW behavior, this code prints only var1: value.
1043
1044 This policy was introduced in CMake version 3.21. Use the
1045 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1046 policies, CMake version 3.27.7 does not warn when the policy is not set
1047 and simply uses OLD behavior.
1048
1049 NOTE:
1050 The OLD behavior of a policy is deprecated by definition and may be
1051 removed in a future version of CMake.
1052
1053 CMP0123
1054 New in version 3.21.
1055
1056
1057 ARMClang cpu/arch compile and link flags must be set explicitly.
1058
1059 CMake 3.20 and lower automatically maps the CMAKE_SYSTEM_PROCESSOR
1060 variable and an undocumented CMAKE_SYSTEM_ARCH to compile and link op‐
1061 tions for ARMClang. For example, the -mcpu=cortex-m33 flag is added
1062 when CMAKE_SYSTEM_PROCESSOR equals cortex-m33. CMake requires projects
1063 to set either variable or it raises a fatal error. However, the
1064 project may need to additionally specify CPU features using e.g.
1065 -mcpu=cortex-m33+nodsp, conflicting with the -mcpu=cortex-m33 added by
1066 CMake. This results in either link errors or unusable binaries.
1067
1068 CMake 3.21 and above prefer instead to not add any cpu/arch compile and
1069 link flags automatically. Instead, projects must specify them explic‐
1070 itly. This policy provides compatibility for projects that have not
1071 been updated.
1072
1073 The OLD behavior of this policy requires projects that use ARMClang to
1074 set either CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH and it automati‐
1075 cally adds a compile option -mcpu= or -march= and a link option --cpu=
1076 based on those variables. The NEW behavior does not add compile or
1077 link options, and projects are responsible for setting correct options.
1078
1079 This policy was introduced in CMake version 3.21. CMake version 3.27.7
1080 warns when the policy is not set and uses OLD behavior. Use the
1081 cmake_policy() command to set it to OLD or NEW explicitly.
1082
1083 NOTE:
1084 The OLD behavior of a policy is deprecated by definition and may be
1085 removed in a future version of CMake.
1086
1087 CMP0122
1088 New in version 3.21.
1089
1090
1091 UseSWIG use library name conventions for CSharp language.
1092
1093 Starting with CMake 3.21, UseSWIG generates now a library using default
1094 naming conventions. This policy provides compatibility with projects
1095 that expect the legacy behavior.
1096
1097 This policy was introduced in CMake version 3.21. CMake version 3.27.7
1098 warns when the policy is not set and uses OLD behavior. Use the
1099 cmake_policy() command to set it to OLD or NEW explicitly.
1100
1101 NOTE:
1102 The OLD behavior of a policy is deprecated by definition and may be
1103 removed in a future version of CMake.
1104
1105 CMP0121
1106 New in version 3.21.
1107
1108
1109 The list() command now detects invalid indices.
1110
1111 Prior to CMake version 3.21, the list() command's GET, INSERT, SUBLIST,
1112 and REMOVE_AT subcommands did not detect invalid index arguments.
1113
1114 The OLD behavior of this policy is for invalid indices to be treated as
1115 their integer value (if any) at the start of the string. For example,
1116 2good4you is a 2 and not_an_integer is a 0. The NEW behavior is for in‐
1117 valid indices to trigger an error.
1118
1119 This policy was introduced in CMake version 3.21. CMake version 3.27.7
1120 warns when the policy is not set and uses OLD behavior. Use the
1121 cmake_policy() command to set it to OLD or NEW explicitly.
1122
1123 NOTE:
1124 The OLD behavior of a policy is deprecated by definition and may be
1125 removed in a future version of CMake.
1126
1128 CMP0120
1129 New in version 3.20.
1130
1131
1132 The WriteCompilerDetectionHeader module is removed.
1133
1134 CMake versions 3.1 through 3.19 provide this module to generate a C++
1135 compatibility layer by re-using information from CMake's table of pre‐
1136 processor checks for cmake-compile-features(7). However:
1137
1138 • Those granular features have been superseded by meta-features for
1139 Requiring Language Standards such as cxx_std_11. Therefore no new
1140 granular feature checks will be added and projects will need to use
1141 other means to conditionally use new C++ features.
1142
1143 • The module exposes some of CMake's implementation details directly to
1144 C++ translation units.
1145
1146 • The module's approach effectively provides a header file with CMake,
1147 thus tying the version of the header to the version of CMake. Many
1148 projects found that the WriteCompilerDetectionHeader was best used by
1149 manually generating its header locally with a recent version of CMake
1150 and then bundling it with the project source so that it could be used
1151 with older CMake versions.
1152
1153 For reasons including the above, CMake 3.20 and above prefer to not
1154 provide the WriteCompilerDetectionHeader module. This policy provides
1155 compatibility for projects that have not been ported away from it.
1156 Projects using the module should be updated to stop using it. Alterna‐
1157 tives include:
1158
1159 • Bundle a copy of the generated header in the project's source.
1160
1161 • Use a third-party alternative, such as the CC0-licensed Hedley.
1162
1163 • Drop support for compilers too old to provide the features natively.
1164
1165 The OLD behavior of this policy is for inclusion of the deprecated
1166 WriteCompilerDetectionHeader module to work. The NEW behavior is for
1167 inclusion of the module to fail as if it does not exist.
1168
1169 This policy was introduced in CMake version 3.20. CMake version 3.27.7
1170 warns when the policy is not set and uses OLD behavior. Use the
1171 cmake_policy() command to set it to OLD or NEW explicitly.
1172
1173 NOTE:
1174 The OLD behavior of a policy is deprecated by definition and may be
1175 removed in a future version of CMake.
1176
1177 CMP0119
1178 New in version 3.20.
1179
1180
1181 LANGUAGE source file property explicitly compiles as specified lan‐
1182 guage.
1183
1184 The LANGUAGE source file property is documented to mean that the source
1185 file is written in the specified language. In CMake 3.19 and below,
1186 setting this property causes CMake to compile the source file using the
1187 compiler for the specified language. However, it only passes an ex‐
1188 plicit flag to tell the compiler to treat the source as the specified
1189 language for MSVC-like, XL, and Embarcadero compilers for the CXX lan‐
1190 guage. CMake 3.20 and above prefer to also explicitly tell the com‐
1191 piler to use the specified language using a flag such as -x c on all
1192 compilers for which such flags are known.
1193
1194 This policy provides compatibility for projects that have not been up‐
1195 dated to expect this behavior. For example, some projects were setting
1196 the LANGUAGE property to C on assembly-language .S source files in or‐
1197 der to compile them using the C compiler. Such projects should be up‐
1198 dated to use enable_language(ASM), for which CMake will often choose
1199 the C compiler as the assembler on relevant platforms anyway.
1200
1201 The OLD behavior for this policy is to interpret the LANGUAGE <LANG>
1202 property using its undocumented meaning to "use the <LANG> compiler".
1203 The NEW behavior for this policy is to interpret the LANGUAGE <LANG>
1204 property using its documented meaning to "compile as a <LANG> source".
1205
1206 This policy was introduced in CMake version 3.20. Use the
1207 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1208 policies, CMake version 3.27.7 does not warn when this policy is not
1209 set and simply uses OLD behavior.
1210
1211 NOTE:
1212 The OLD behavior of a policy is deprecated by definition and may be
1213 removed in a future version of CMake.
1214
1215 CMP0118
1216 New in version 3.20.
1217
1218
1219 The GENERATED source file property is now visible in all directories.
1220
1221 Whether or not a source file is generated is an all-or-nothing global
1222 property of the source. Consequently, the associated GENERATED prop‐
1223 erty is now visible from any directory scope, not only from the scope
1224 for which it was set.
1225
1226 Additionally, the GENERATED property may now be set only to boolean
1227 values, and may not be turned off once turned on.
1228
1229 The OLD behavior of this policy is to only allow GENERATED to be visi‐
1230 ble from the directory scope for which it was set. The NEW behavior on
1231 the other hand allows it to be visible from any scope.
1232
1233 This policy was introduced in CMake version 3.20. Use the
1234 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1235 policies, CMake version 3.27.7 does not warn when this policy is not
1236 set and simply uses OLD behavior with regard to visibility of the GEN‐
1237 ERATED property. However, CMake does warn about setting the GENERATED
1238 property to a non-boolean value.
1239
1240 CMP0117
1241 New in version 3.20.
1242
1243
1244 MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default.
1245
1246 When using MSVC-like compilers in CMake 3.19 and below, the RTTI flag
1247 /GR is added to CMAKE_CXX_FLAGS by default. This behavior is left from
1248 support for MSVC versions from Visual Studio 2003 and below that did
1249 not enable RTTI by default. It is no longer necessary. Furthermore,
1250 it is problematic for projects that want to change to /GR- programmati‐
1251 cally. In particular, it requires string editing of the
1252 CMAKE_CXX_FLAGS variable with knowledge of the CMake builtin default so
1253 it can be replaced.
1254
1255 CMake 3.20 and above prefer to leave out /GR from the value of
1256 CMAKE_CXX_FLAGS by default.
1257
1258 This policy provides compatibility with projects that have not been up‐
1259 dated to expect the lack of the /GR flag. The policy setting takes ef‐
1260 fect as of the first project() or enable_language() command that ini‐
1261 tializes CMAKE_CXX_FLAGS.
1262
1263 NOTE:
1264 Once the policy has taken effect at the top of a project for a given
1265 language, that choice must be used throughout the tree for that lan‐
1266 guage. In projects that have nested projects in subdirectories, be
1267 sure to convert everything together.
1268
1269 The OLD behavior for this policy is to place the MSVC /GR flag in the
1270 default CMAKE_CXX_FLAGS cache entry. The NEW behavior for this policy
1271 is to not place the MSVC /GR flag in the default cache entry.
1272
1273 This policy was introduced in CMake version 3.20. Use the
1274 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1275 policies, CMake version 3.27.7 does not warn when this policy is not
1276 set and simply uses OLD behavior.
1277
1278 NOTE:
1279 The OLD behavior of a policy is deprecated by definition and may be
1280 removed in a future version of CMake.
1281
1282 CMP0116
1283 New in version 3.20.
1284
1285
1286 Ninja generators transform DEPFILE s from add_custom_command().
1287
1288 In CMake 3.19 and below, files given to the DEPFILE argument of
1289 add_custom_command() were passed directly to Ninja's depfile variable
1290 without any path resolution. This meant that if add_custom_command()
1291 was called from a subdirectory (created by add_subdirectory()), the
1292 DEPFILE argument would have to be either an absolute path or a path
1293 relative to CMAKE_BINARY_DIR, rather than CMAKE_CURRENT_BINARY_DIR. In
1294 addition, no transformation was done on the file listed in DEPFILE,
1295 which meant that the paths within the DEPFILE had the same restric‐
1296 tions.
1297
1298 Starting with CMake 3.20, the DEPFILE argument is relative to
1299 CMAKE_CURRENT_BINARY_DIR (unless it is absolute), and the paths in the
1300 DEPFILE are also relative to CMAKE_CURRENT_BINARY_DIR. CMake automati‐
1301 cally transforms the paths in the DEPFILE (unless they are absolute)
1302 after the custom command is run. The file listed in DEPFILE is not mod‐
1303 ified in any way. Instead, CMake writes the transformation to its own
1304 internal file, and passes this internal file to Ninja's depfile vari‐
1305 able. This transformation happens regardless of whether or not DEPFILE
1306 is relative, and regardless of whether or not add_custom_command() is
1307 called from a subdirectory.
1308
1309 The OLD behavior for this policy is to pass the DEPFILE to Ninja unal‐
1310 tered. The NEW behavior for this policy is to transform the DEPFILE af‐
1311 ter running the custom command. The status of CMP0116 is recorded at
1312 the time of the custom command's creation, and you can have custom com‐
1313 mands in the same directory with different values for CMP0116 by set‐
1314 ting the policy before each custom command.
1315
1316 This policy was introduced in CMake version 3.20. Unlike most poli‐
1317 cies, CMake version 3.27.7 does not warn by default when this policy is
1318 not set (unless DEPFILE is used in a subdirectory) and simply uses OLD
1319 behavior. See documentation of the CMAKE_POLICY_WARNING_CMP0116 vari‐
1320 able to control the warning.
1321
1322 CMP0115
1323 New in version 3.20.
1324
1325
1326 Source file extensions must be explicit.
1327
1328 In CMake 3.19 and below, if a source file could not be found by the
1329 name specified, it would append a list of known extensions to the name
1330 to see if the file with the extension could be found. For example, this
1331 would allow the user to run:
1332
1333 add_executable(exe main)
1334
1335 and put main.c in the executable without specifying the extension.
1336
1337 Starting in CMake 3.20, CMake prefers all source files to have their
1338 extensions explicitly listed:
1339
1340 add_executable(exe main.c)
1341
1342 The OLD behavior for this policy is to implicitly append known exten‐
1343 sions to source files if they can't be found. The NEW behavior of this
1344 policy is to not append known extensions and require them to be ex‐
1345 plicit.
1346
1347 This policy was introduced in CMake version 3.20. CMake version 3.27.7
1348 warns when the policy is not set and uses OLD behavior. Use the
1349 cmake_policy() command to set it to OLD or NEW explicitly.
1350
1351 NOTE:
1352 The OLD behavior of a policy is deprecated by definition and may be
1353 removed in a future version of CMake.
1354
1356 CMP0114
1357 New in version 3.19.
1358
1359
1360 ExternalProject step targets fully adopt their steps.
1361
1362 The ExternalProject_Add() STEP_TARGETS option, and the
1363 ExternalProject_Add_StepTargets() function, can be used to create build
1364 targets for individual steps of an external project.
1365
1366 In CMake 3.18 and below, step targets have some limitations:
1367
1368 • Step targets always depend on targets named by the
1369 ExternalProject_Add() DEPENDS option even though not all steps need
1370 them. In order to allow step targets to be created without those de‐
1371 pendencies, the ExternalProject_Add() INDEPENDENT_STEP_TARGETS option
1372 or the ExternalProject_Add_StepTargets() NO_DEPENDS option may be
1373 used. However, adding such "independent" step targets makes sense
1374 only for specific steps such as download, update, and patch because
1375 they do not need any of the external project's build dependencies.
1376 Furthermore, it does not make sense to create independent step tar‐
1377 gets for steps that depend on non-independent steps. Such rules are
1378 not enforced, and projects that do not follow them can generate build
1379 systems with confusing and generator-specific behavior.
1380
1381 • Step targets hold copies of the custom commands implementing their
1382 steps that are separate from the copies in the primary target created
1383 by ExternalProject_Add(), and the primary target does not depend on
1384 the step targets. In parallel builds that drive the primary target
1385 and step targets concurrently, multiple copies of the steps' commands
1386 may run concurrently and race each other.
1387
1388 Also, prior to policy CMP0113, the step targets generated by Makefile
1389 Generators also contain all the custom commands on which their step
1390 depends. This can lead to repeated execution of those steps even in
1391 serial builds.
1392
1393 In CMake 3.19 and above, the ExternalProject module prefers a revised
1394 design to address these problems:
1395
1396 • Each step is classified as "independent" if it does not depend on
1397 other targets named by the ExternalProject_Add() DEPENDS. The prede‐
1398 fined steps are automatically classified by default:
1399
1400 • The download, update, and patch steps are independent.
1401
1402 • The configure, build, test, and install steps are not.
1403
1404 For custom steps, the ExternalProject_Add_Step() command provides an
1405 INDEPENDENT option to mark them as independent. It is an error to
1406 mark a step as independent if it depends on other steps that are not.
1407 Note that this use of the term "independent" refers only to indepen‐
1408 dence from external targets and is orthogonal to a step's dependen‐
1409 cies on other steps.
1410
1411 • Step targets created by the ExternalProject_Add() STEP_TARGETS option
1412 or the ExternalProject_Add_Step() function are now independent if and
1413 only if their steps are marked as independent. The
1414 ExternalProject_Add() INDEPENDENT_STEP_TARGETS option and
1415 ExternalProject_Add_StepTargets() NO_DEPENDS option are no longer al‐
1416 lowed.
1417
1418 • Step targets, when created, are fully responsible for holding the
1419 custom commands implementing their steps. The primary target created
1420 by ExternalProject_Add() depends on the step targets, and the step
1421 targets depend on each other. The target-level dependencies match
1422 the file-level dependencies used by the custom commands for each
1423 step.
1424
1425 When the ExternalProject_Add() UPDATE_DISCONNECTED or TEST_EX‐
1426 CLUDE_FROM_MAIN option is used, or the ExternalProject_Add_Step() EX‐
1427 CLUDE_FROM_MAIN option is used for a custom step, some step targets
1428 may be created automatically. These are needed to hold the steps
1429 commonly depended upon by the primary target and the disconnected
1430 step targets.
1431
1432 Policy CMP0114 provides compatibility for projects that have not been
1433 updated to expect the new behavior. The OLD behavior for this policy
1434 is to use the above-documented behavior from 3.18 and below. The NEW
1435 behavior for this policy is to use the above-documented behavior pre‐
1436 ferred by 3.19 and above.
1437
1438 This policy was introduced in CMake version 3.19. CMake version 3.27.7
1439 warns when the policy is not set and uses OLD behavior. Use the
1440 cmake_policy() command to set it to OLD or NEW explicitly.
1441
1442 CMP0113
1443 New in version 3.19.
1444
1445
1446 Makefile Generators do not repeat custom commands from target dependen‐
1447 cies.
1448
1449 Consider a chain of custom commands split across two dependent targets:
1450
1451 add_custom_command(OUTPUT output-not-created
1452 COMMAND ... DEPENDS ...)
1453 set_property(SOURCE output-not-created PROPERTY SYMBOLIC 1)
1454 add_custom_command(OUTPUT output-created
1455 COMMAND ... DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/output-not-created)
1456 add_custom_target(first DEPENDS output-not-created)
1457 add_custom_target(second DEPENDS output-created)
1458 add_dependencies(second first)
1459
1460 In CMake 3.18 and lower, the Makefile generators put a copy of both
1461 custom commands in the Makefile for target second even though its de‐
1462 pendency on target first ensures that the first custom command runs be‐
1463 fore the second. Running make second would cause the first custom com‐
1464 mand to run once in the first target and then again in the second tar‐
1465 get.
1466
1467 CMake 3.19 and above prefer to not duplicate custom commands in a tar‐
1468 get that are already generated in other targets on which the target de‐
1469 pends (directly or indirectly). This policy provides compatibility for
1470 projects that have not been updated to expect the new behavior. In
1471 particular, projects that relied on the duplicate execution or that did
1472 not properly set the SYMBOLIC source file property may be affected.
1473
1474 The OLD behavior for this policy is to duplicate custom commands in de‐
1475 pendent targets. The NEW behavior of this policy is to not duplicate
1476 custom commands in dependent targets.
1477
1478 This policy was introduced in CMake version 3.19. Unlike many poli‐
1479 cies, CMake version 3.27.7 does not warn when this policy is not set
1480 and simply uses OLD behavior.
1481
1482 NOTE:
1483 The OLD behavior of a policy is deprecated by definition and may be
1484 removed in a future version of CMake.
1485
1486 CMP0112
1487 New in version 3.19.
1488
1489
1490 Target file component generator expressions do not add target dependen‐
1491 cies.
1492
1493 The following target-based generator expressions that query for direc‐
1494 tory or file name components no longer add a dependency on the evalu‐
1495 ated target.
1496
1497 • TARGET_FILE_NAME
1498
1499 • TARGET_FILE_DIR
1500
1501 • TARGET_LINKER_FILE_BASE_NAME
1502
1503 • TARGET_LINKER_FILE_NAME
1504
1505 • TARGET_LINKER_FILE_DIR
1506
1507 • TARGET_SONAME_FILE_NAME
1508
1509 • TARGET_SONAME_FILE_DIR
1510
1511 • TARGET_PDB_FILE_NAME
1512
1513 • TARGET_PDB_FILE_DIR
1514
1515 • TARGET_BUNDLE_DIR
1516
1517 • TARGET_BUNDLE_DIR_NAME
1518
1519 • TARGET_BUNDLE_CONTENT_DIR
1520
1521 In CMake 3.18 and lower a dependency on the evaluated target of the
1522 above generator expressions would always be added. CMake 3.19 and
1523 above prefer to not add this dependency. This policy provides compati‐
1524 bility for projects that have not been updated to expect the new behav‐
1525 ior. The policy setting is recorded on each target when it is created,
1526 and decides whether generator expressions referencing that target imply
1527 a dependency on it.
1528
1529 The OLD behavior for this policy is to add a dependency on the evalu‐
1530 ated target for the above generator expressions. The NEW behavior of
1531 this policy is to not add a dependency on the evaluated target for the
1532 above generator expressions.
1533
1534 This policy was introduced in CMake version 3.19. Unlike many poli‐
1535 cies, CMake version 3.27.7 does not warn by default when this policy is
1536 not set and simply uses OLD behavior. See documentation of the
1537 CMAKE_POLICY_WARNING_CMP0112 variable to control the warning.
1538
1539 NOTE:
1540 The OLD behavior of a policy is deprecated by definition and may be
1541 removed in a future version of CMake.
1542
1543 CMP0111
1544 New in version 3.19.
1545
1546
1547 An imported target missing its location property fails during genera‐
1548 tion.
1549
1550 Imported Targets for library files and executables require that their
1551 location on disk is specified in a target property such as
1552 IMPORTED_LOCATION, IMPORTED_IMPLIB, or a per-configuration equivalent.
1553 If a needed location property is not set, CMake 3.18 and below generate
1554 the string <TARGET_NAME>-NOTFOUND in its place, which results in fail‐
1555 ures of the corresponding rules at build time. CMake 3.19 and above
1556 prefer instead to raise an error during generation. This policy pro‐
1557 vides compatibility for projects that have not been updated to expect
1558 the new behavior.
1559
1560 The OLD behavior of this policy is to generate the location of an im‐
1561 ported unknown, static or shared library target as <TARGET_NAME>-NOT‐
1562 FOUND if not set. The NEW behavior is to raise an error.
1563
1564 This policy was introduced in CMake version 3.19. CMake version 3.27.7
1565 warns when the policy is not set and uses OLD behavior. Use the
1566 cmake_policy() command to set it to OLD or NEW explicitly.
1567
1568 NOTE:
1569 The OLD behavior of a policy is deprecated by definition and may be
1570 removed in a future version of CMake.
1571
1572 CMP0110
1573 New in version 3.19.
1574
1575
1576 add_test() supports arbitrary characters in test names.
1577
1578 add_test() can now (officially) create tests with whitespace and other
1579 special characters in its name. Before CMake version 3.19 that was not
1580 allowed, however, it was possible to work around this limitation by ex‐
1581 plicitly putting escaped quotes around the test's name in the add_test
1582 command.
1583
1584 Although never officially supported several projects in the wild found
1585 and implemented this workaround. However, the new change which offi‐
1586 cially allows the add_test command to support whitespace and other spe‐
1587 cial characters in test names now breaks that workaround. In order for
1588 these projects to work smoothly with newer CMake versions, this policy
1589 was introduced.
1590
1591 The OLD behavior of this policy is to still prevent add_test from han‐
1592 dling whitespace and special characters properly (if not using the men‐
1593 tioned workaround). The NEW behavior on the other hand allows names
1594 with whitespace and special characters for tests created by add_test.
1595
1596 This policy was introduced in CMake version 3.19. CMake version 3.27.7
1597 warns when the policy is not set and uses OLD behavior. Use the
1598 cmake_policy() command to set it to OLD or NEW explicitly.
1599
1600 CMP0109
1601 New in version 3.19.
1602
1603
1604 find_program() requires permission to execute but not to read.
1605
1606 In CMake 3.18 and below, the find_program() command on UNIX would find
1607 files that are readable without requiring execute permission, and would
1608 not find files that are executable without read permission. In CMake
1609 3.19 and above, find_program now prefers to require execute permission
1610 but not read permission. This policy provides compatibility with
1611 projects that have not been updated to expect the new behavior.
1612
1613 The OLD behavior for this policy is for find_program to require read
1614 permission but not execute permission. The NEW behavior for this pol‐
1615 icy is for find_program to require execute permission but not read per‐
1616 mission.
1617
1618 This policy was introduced in CMake version 3.19. CMake version 3.27.7
1619 warns when the policy is not set and uses OLD behavior. Use the
1620 cmake_policy() command to set it to OLD or NEW explicitly.
1621
1622 NOTE:
1623 The OLD behavior of a policy is deprecated by definition and may be
1624 removed in a future version of CMake.
1625
1627 CMP0108
1628 New in version 3.18.
1629
1630
1631 A target is not allowed to link to itself even through an ALIAS target.
1632
1633 In CMake 3.17 and below, a target can link to a target aliased to it‐
1634 self.
1635
1636 The OLD behavior for this policy is to allow a target to link to a tar‐
1637 get aliased to itself.
1638
1639 The NEW behavior of this policy is to prevent a target to link to it‐
1640 self through an ALIAS target.
1641
1642 This policy was introduced in CMake version 3.17. Use the
1643 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1644 policies, CMake version 3.27.7 does not warn when this policy is not
1645 set and simply uses OLD behavior.
1646
1647 NOTE:
1648 The OLD behavior of a policy is deprecated by definition and may be
1649 removed in a future version of CMake.
1650
1651 CMP0107
1652 New in version 3.18.
1653
1654
1655 It is not allowed to create an ALIAS target with the same name as an
1656 another target.
1657
1658 In CMake 3.17 and below, an ALIAS target can overwrite silently an ex‐
1659 isting target with the same name.
1660
1661 The OLD behavior for this policy is to allow target overwrite.
1662
1663 The NEW behavior of this policy is to prevent target overwriting.
1664
1665 This policy was introduced in CMake version 3.17. Use the
1666 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1667 policies, CMake version 3.27.7 does not warn when this policy is not
1668 set and simply uses OLD behavior.
1669
1670 NOTE:
1671 The OLD behavior of a policy is deprecated by definition and may be
1672 removed in a future version of CMake.
1673
1674 CMP0106
1675 New in version 3.18.
1676
1677
1678 The Documentation module is removed.
1679
1680 The Documentation was added as a support mechanism for the VTK project
1681 and was tuned for that project. Instead of CMake providing this module
1682 with (now old) VTK patterns for cache variables and required packages,
1683 the module is now deprecated by CMake itself.
1684
1685 The OLD behavior of this policy is for Documentation to add cache vari‐
1686 ables and find VTK documentation dependent packages. The NEW behavior
1687 is to act as an empty module.
1688
1689 This policy was introduced in CMake version 3.18. CMake version 3.27.7
1690 warns when the policy is not set and uses OLD behavior. Use the
1691 cmake_policy() command to set it to OLD or NEW explicitly.
1692
1693 NOTE:
1694 The OLD behavior of a policy is deprecated by definition and may be
1695 removed in a future version of CMake.
1696
1697 CMP0105
1698 New in version 3.18.
1699
1700
1701 LINK_OPTIONS and INTERFACE_LINK_OPTIONS target properties are now used
1702 for the device link step.
1703
1704 In CMake 3.17 and below, link options are not used by the device link
1705 step.
1706
1707 The OLD behavior for this policy is to ignore the link options during
1708 the device link step.
1709
1710 The NEW behavior of this policy is to use the link options during the
1711 device link step.
1712
1713 This policy was introduced in CMake version 3.18. Use the
1714 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1715 policies, CMake version 3.27.7 does not warn when this policy is not
1716 set and simply uses OLD behavior.
1717
1718 NOTE:
1719 The OLD behavior of a policy is deprecated by definition and may be
1720 removed in a future version of CMake.
1721
1722 CMP0104
1723 New in version 3.18.
1724
1725
1726 Initialize CMAKE_CUDA_ARCHITECTURES when CMAKE_CUDA_COMPILER_ID is
1727 NVIDIA. Raise an error if CUDA_ARCHITECTURES is empty.
1728
1729 CMAKE_CUDA_ARCHITECTURES introduced in CMake 3.18 is used to initialize
1730 CUDA_ARCHITECTURES, which passes correct code generation flags to the
1731 CUDA compiler.
1732
1733 Previous to this users had to manually specify the code generation
1734 flags. This policy is for backwards compatibility with manually speci‐
1735 fying code generation flags.
1736
1737 The OLD behavior for this policy is to not initialize
1738 CMAKE_CUDA_ARCHITECTURES when CMAKE_CUDA_COMPILER_ID is NVIDIA. Empty
1739 CUDA_ARCHITECTURES is allowed.
1740
1741 The NEW behavior of this policy is to initialize
1742 CMAKE_CUDA_ARCHITECTURES when CMAKE_CUDA_COMPILER_ID is NVIDIA and
1743 raise an error if CUDA_ARCHITECTURES is empty during generation.
1744
1745 If CUDA_ARCHITECTURES is set to a false value no architectures flags
1746 are passed to the compiler. This is intended to support packagers and
1747 the rare cases where full control over the passed flags is required.
1748
1749 This policy was introduced in CMake version 3.18. CMake version 3.27.7
1750 warns when the policy is not set and uses OLD behavior. Use the
1751 cmake_policy() command to set it to OLD or NEW explicitly.
1752
1753 NOTE:
1754 The OLD behavior of a policy is deprecated by definition and may be
1755 removed in a future version of CMake.
1756
1757 Examples
1758 set_target_properties(tgt PROPERTIES CUDA_ARCHITECTURES "35;50;72")
1759
1760 Generates code for real and virtual architectures 30, 50 and 72.
1761
1762 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual)
1763
1764 Generates code for real architecture 70 and virtual architecture 72.
1765
1766 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF)
1767
1768 CMake will not pass any architecture flags to the compiler.
1769
1770 CMP0103
1771 New in version 3.18.
1772
1773
1774 Multiple calls to export() command with same FILE without APPEND is no
1775 longer allowed.
1776
1777 In CMake 3.17 and below, multiple calls to export() command with the
1778 same FILE without APPEND are accepted silently but only the last occur‐
1779 rence is taken into account during the generation.
1780
1781 The OLD behavior for this policy is to ignore the multiple occurrences
1782 of
1783 export() command except the last one.
1784
1785 The NEW behavior of this policy is to raise an error on second call to
1786 export() command with same FILE without APPEND.
1787
1788 This policy was introduced in CMake version 3.18. CMake version 3.27.7
1789 warns when the policy is not set and uses OLD behavior. Use the
1790 cmake_policy() command to set it to OLD or NEW explicitly.
1791
1792 NOTE:
1793 The OLD behavior of a policy is deprecated by definition and may be
1794 removed in a future version of CMake.
1795
1797 CMP0102
1798 New in version 3.17.
1799
1800
1801 The mark_as_advanced() command no longer creates a cache entry if one
1802 does not already exist.
1803
1804 In CMake 3.16 and below, if a variable was not defined at all or just
1805 defined locally, the mark_as_advanced() command would create a new
1806 cache entry with an UNINITIALIZED type and no value. When a find_path()
1807 (or other similar find_ command) would next run, it would find this un‐
1808 defined cache entry and set it up with an empty string value. This
1809 process would end up deleting the local variable in the process (due to
1810 the way the cache works), effectively clearing any stored find_ results
1811 that were only available in the local scope.
1812
1813 The OLD behavior for this policy is to create the empty cache defini‐
1814 tion. The NEW behavior of this policy is to ignore variables which do
1815 not already exist in the cache.
1816
1817 This policy was introduced in CMake version 3.17. Use the
1818 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1819 policies, CMake version 3.27.7 does not warn when this policy is not
1820 set and simply uses OLD behavior. See documentation of the
1821 CMAKE_POLICY_WARNING_CMP0102 variable to control the warning.
1822
1823 NOTE:
1824 The OLD behavior of a policy is deprecated by definition and may be
1825 removed in a future version of CMake.
1826
1827 CMP0101
1828 New in version 3.17.
1829
1830
1831 target_compile_options() now always honors the BEFORE keyword.
1832
1833 In CMake 3.16 and below, the target_compile_options() command ignores
1834 the BEFORE keyword when inserting items into the COMPILE_OPTIONS target
1835 property (PRIVATE and PUBLIC items). CMake 3.17 and later honors the
1836 BEFORE keyword in all cases. This policy provides compatibility for
1837 projects that have not been updated to expect the new behavior.
1838
1839 The behavior of inserting items into the INTERFACE_COMPILE_OPTIONS tar‐
1840 get property (PUBLIC and INTERFACE items) is not affected by this pol‐
1841 icy. The BEFORE keyword has always been honored when adding items to
1842 INTERFACE_COMPILE_OPTIONS.
1843
1844 The OLD behavior for this policy is to not honor the BEFORE keyword
1845 when inserting into the COMPILE_OPTIONS property. The NEW behavior for
1846 this policy is to honor the BEFORE keyword in all cases.
1847
1848 This policy was introduced in CMake version 3.17. Use the
1849 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1850 policies, CMake version 3.27.7 does not warn when this policy is not
1851 set and simply uses OLD behavior.
1852
1853 NOTE:
1854 The OLD behavior of a policy is deprecated by definition and may be
1855 removed in a future version of CMake.
1856
1857 CMP0100
1858 New in version 3.17.
1859
1860
1861 Let AUTOMOC and AUTOUIC process header files that end with a .hh exten‐
1862 sion.
1863
1864 Since version 3.17, CMake processes header files that end with a .hh
1865 extension in AUTOMOC and AUTOUIC. In earlier CMake versions, these
1866 header files were ignored by AUTOMOC and AUTOUIC.
1867
1868 This policy affects how header files that end with a .hh extension get
1869 treated in AUTOMOC and AUTOUIC.
1870
1871 The OLD behavior for this policy is to ignore .hh header files in
1872 AUTOMOC and AUTOUIC.
1873
1874 The NEW behavior for this policy is to process .hh header files in
1875 AUTOMOC and AUTOUIC just like other header files.
1876
1877 NOTE:
1878 To silence the CMP0100 warning source files can be excluded from
1879 AUTOMOC and AUTOUIC processing by setting the source file properties
1880 SKIP_AUTOMOC, SKIP_AUTOUIC or SKIP_AUTOGEN.
1881
1882 # Source skip example:
1883 set_property(SOURCE /path/to/file1.hh PROPERTY SKIP_AUTOMOC ON)
1884 set_property(SOURCE /path/to/file2.hh PROPERTY SKIP_AUTOUIC ON)
1885 set_property(SOURCE /path/to/file3.hh PROPERTY SKIP_AUTOGEN ON)
1886
1887 This policy was introduced in CMake version 3.17.0. CMake version
1888 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
1889 cmake_policy() command to set it to OLD or NEW explicitly.
1890
1891 NOTE:
1892 The OLD behavior of a policy is deprecated by definition and may be
1893 removed in a future version of CMake.
1894
1895 CMP0099
1896 New in version 3.17.
1897
1898
1899 Target link properties INTERFACE_LINK_OPTIONS,
1900 INTERFACE_LINK_DIRECTORIES and INTERFACE_LINK_DEPENDS are now transi‐
1901 tive over private dependencies of static libraries.
1902
1903 In CMake 3.16 and below the interface link properties attached to li‐
1904 braries are not propagated for private dependencies of static li‐
1905 braries. Only the libraries themselves are propagated to link the de‐
1906 pendent binary. CMake 3.17 and later prefer to propagate all interface
1907 link properties. This policy provides compatibility for projects that
1908 have not been updated to expect the new behavior.
1909
1910 The OLD behavior for this policy is to not propagate interface link
1911 properties. The NEW behavior of this policy is to propagate interface
1912 link properties.
1913
1914 This policy was introduced in CMake version 3.17. Use the
1915 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1916 policies, CMake version 3.27.7 does not warn when this policy is not
1917 set and simply uses OLD behavior.
1918
1919 NOTE:
1920 The OLD behavior of a policy is deprecated by definition and may be
1921 removed in a future version of CMake.
1922
1923 CMP0098
1924 New in version 3.17.
1925
1926
1927 FindFLEX runs flex in directory CMAKE_CURRENT_BINARY_DIR when execut‐
1928 ing.
1929
1930 The module provides a FLEX_TARGET macro which generates FLEX output.
1931 In CMake 3.16 and below the macro would generate a custom command that
1932 runs flex in the current source directory. CMake 3.17 and later prefer
1933 to run it in the build directory and use CMAKE_CURRENT_BINARY_DIR as
1934 the WORKING_DIRECTORY of its add_custom_command() invocation. This en‐
1935 sures that any implicitly generated file is written relative to the
1936 build tree rather than the source tree, unless the generated file is
1937 provided as absolute path.
1938
1939 This policy provides compatibility for projects that have not been up‐
1940 dated to expect the new behavior.
1941
1942 The OLD behavior for this policy is for FLEX_TARGET to use the current
1943 source directory for the WORKING_DIRECTORY and where to generate im‐
1944 plicit files. The NEW behavior of this policy is to use the current bi‐
1945 nary directory for the WORKING_DIRECTORY relative to which implicit
1946 files are generated unless provided as absolute path.
1947
1948 This policy was introduced in CMake version 3.17. Use the
1949 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
1950 policies, CMake version 3.27.7 does not warn when this policy is not
1951 set and simply uses OLD behavior.
1952
1953 NOTE:
1954 The OLD behavior of a policy is deprecated by definition and may be
1955 removed in a future version of CMake.
1956
1958 CMP0097
1959 New in version 3.16.
1960
1961
1962 ExternalProject_Add() with GIT_SUBMODULES "" initializes no submodules.
1963 The policy also applies to FetchContent_Declare(), which uses the same
1964 download and update features as ExternalProject_Add().
1965
1966 The commands provide a GIT_SUBMODULES option which controls what sub‐
1967 modules to initialize and update. Starting with CMake 3.16, explicitly
1968 setting GIT_SUBMODULES to an empty string means no submodules will be
1969 initialized or updated.
1970
1971 This policy provides compatibility for projects that have not been up‐
1972 dated to expect the new behavior.
1973
1974 The OLD behavior for this policy is for GIT_SUBMODULES when set to an
1975 empty string to initialize and update all git submodules. The NEW be‐
1976 havior for this policy is for GIT_SUBMODULES when set to an empty
1977 string to initialize and update no git submodules.
1978
1979 This policy was introduced in CMake version 3.16. Use the
1980 cmake_policy() command to set it to OLD or NEW explicitly. Unlike most
1981 policies, CMake version 3.27.7 does not warn when this policy is not
1982 set and simply uses OLD behavior.
1983
1984 CMP0096
1985 New in version 3.16.
1986
1987
1988 The project() command preserves leading zeros in version components.
1989
1990 When a VERSION <major>[.<minor>[.<patch>[.<tweak>]]]] argument is given
1991 to the project() command, it stores the version string in the
1992 PROJECT_VERSION variable and stores individual integer version compo‐
1993 nents in PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK} variables (see pol‐
1994 icy CMP0048). CMake 3.15 and below dropped leading zeros from each
1995 component. CMake 3.16 and higher prefer to preserve leading zeros.
1996 This policy provides compatibility for projects that have not been up‐
1997 dated to expect the new behavior.
1998
1999 The OLD behavior of this policy drops leading zeros in all components,
2000 e.g. such that version 1.07.06 becomes 1.7.6. The NEW behavior of
2001 this policy preserves the leading zeros in all components, such that
2002 version 1.07.06 remains unchanged.
2003
2004 This policy was introduced in CMake version 3.16. Unlike many poli‐
2005 cies, CMake version 3.27.7 does not warn when this policy is not set
2006 and simply uses the OLD behavior. Use the cmake_policy() command to
2007 set it to OLD or NEW explicitly.
2008
2009 NOTE:
2010 The OLD behavior of a policy is deprecated by definition and may be
2011 removed in a future version of CMake.
2012
2013 CMP0095
2014 New in version 3.16.
2015
2016
2017 RPATH entries are properly escaped in the intermediary CMake install
2018 script.
2019
2020 In CMake 3.15 and earlier, RPATH entries set via CMAKE_INSTALL_RPATH or
2021 via INSTALL_RPATH have not been escaped before being inserted into the
2022 cmake_install.cmake script. Dynamic linkers on ELF-based systems (e.g.
2023 Linux and FreeBSD) allow certain keywords in RPATH entries, such as
2024 ${ORIGIN} (More details are available in the ld.so man pages on those
2025 systems). The syntax of these keywords can match CMake's variable syn‐
2026 tax. In order to not be substituted (usually to an empty string) al‐
2027 ready by the intermediary cmake_install.cmake script, the user had to
2028 double-escape such RPATH keywords, e.g. set(CMAKE_INSTALL_RPATH
2029 "\\\${ORIGIN}/../lib"). Since the intermediary cmake_install.cmake
2030 script is an implementation detail of CMake, CMake 3.16 and later will
2031 make sure RPATH entries are inserted literally by escaping any coinci‐
2032 dental CMake syntax.
2033
2034 The OLD behavior of this policy is to not escape RPATH entries in the
2035 intermediary cmake_install.cmake script. The NEW behavior is to prop‐
2036 erly escape coincidental CMake syntax in RPATH entries when generating
2037 the intermediary cmake_install.cmake script.
2038
2039 This policy was introduced in CMake version 3.16. CMake version 3.27.7
2040 warns when the policy is not set and detected usage of CMake-like syn‐
2041 tax and uses OLD behavior. Use the cmake_policy() command to set it to
2042 OLD or NEW explicitly.
2043
2044 NOTE:
2045 The OLD behavior of a policy is deprecated by definition and may be
2046 removed in a future version of CMake.
2047
2049 CMP0094
2050 New in version 3.15.
2051
2052
2053 Modules FindPython3, FindPython2 and FindPython use LOCATION for lookup
2054 strategy.
2055
2056 Starting with CMake 3.15, Modules FindPython3, FindPython2 and
2057 FindPython set value LOCATION for, respectively, variables
2058 Python3_FIND_STRATEGY, Python2_FIND_STRATEGY and Python_FIND_STRATEGY.
2059 This policy provides compatibility with projects that expect the legacy
2060 behavior.
2061
2062 The OLD behavior for this policy set value VERSION for variables
2063 Python3_FIND_STRATEGY, Python2_FIND_STRATEGY and Python_FIND_STRATEGY.
2064
2065 This policy was introduced in CMake version 3.15. Use the
2066 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
2067 policies, CMake version 3.27.7 does not warn when this policy is not
2068 set and simply uses the OLD behavior.
2069
2070 NOTE:
2071 The OLD behavior of a policy is deprecated by definition and may be
2072 removed in a future version of CMake.
2073
2074 CMP0093
2075 New in version 3.15.
2076
2077
2078 FindBoost reports Boost_VERSION in x.y.z format.
2079
2080 In CMake 3.14 and below the module would report the Boost version num‐
2081 ber as specified in the preprocessor definition BOOST_VERSION in the
2082 boost/version.hpp file. In CMake 3.15 and later it is preferred that
2083 the reported version number matches the x.y.z format reported by the
2084 CMake package shipped with Boost 1.70.0 and later. The macro value is
2085 still reported in the Boost_VERSION_MACRO variable.
2086
2087 The OLD behavior for this policy is for FindBoost to report Boost_VER‐
2088 SION as specified in the preprocessor definition BOOST_VERSION in
2089 boost/version.hpp. The NEW behavior for this policy is for FindBoost to
2090 report Boost_VERSION in x.y.z format.
2091
2092 This policy was introduced in CMake version 3.15. Use the
2093 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
2094 policies, CMake version 3.27.7 does not warn when this policy is not
2095 set and simply uses the OLD behavior.
2096
2097 NOTE:
2098 The OLD behavior of a policy is deprecated by definition and may be
2099 removed in a future version of CMake.
2100
2101 CMP0092
2102 New in version 3.15.
2103
2104
2105 MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.
2106
2107 When using MSVC-like compilers in CMake 3.14 and below, warning flags
2108 like /W3 are added to CMAKE_<LANG>_FLAGS by default. This is problem‐
2109 atic for projects that want to choose a different warning level pro‐
2110 grammatically. In particular, it requires string editing of the
2111 CMAKE_<LANG>_FLAGS variables with knowledge of the CMake builtin de‐
2112 faults so they can be replaced.
2113
2114 CMake 3.15 and above prefer to leave out warning flags from the value
2115 of CMAKE_<LANG>_FLAGS by default.
2116
2117 This policy provides compatibility with projects that have not been up‐
2118 dated to expect the lack of warning flags. The policy setting takes
2119 effect as of the first project() or enable_language() command that ini‐
2120 tializes CMAKE_<LANG>_FLAGS for a given language <LANG>.
2121
2122 NOTE:
2123 Once the policy has taken effect at the top of a project for a given
2124 language, that choice must be used throughout the tree for that lan‐
2125 guage. In projects that have nested projects in subdirectories, be
2126 sure to convert everything together.
2127
2128 The OLD behavior for this policy is to place MSVC warning flags in the
2129 default CMAKE_<LANG>_FLAGS cache entries. The NEW behavior for this
2130 policy is to not place MSVC warning flags in the default cache entries.
2131
2132 This policy was introduced in CMake version 3.15. Use the
2133 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
2134 policies, CMake version 3.27.7 does not warn when this policy is not
2135 set and simply uses OLD behavior.
2136
2137 NOTE:
2138 The OLD behavior of a policy is deprecated by definition and may be
2139 removed in a future version of CMake.
2140
2141 CMP0091
2142 New in version 3.15.
2143
2144
2145 MSVC runtime library flags are selected by an abstraction.
2146
2147 Compilers targeting the MSVC ABI have flags to select the MSVC runtime
2148 library. Runtime library selection typically varies with build config‐
2149 uration because there is a separate runtime library for Debug builds.
2150
2151 In CMake 3.14 and below, MSVC runtime library selection flags are added
2152 to the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries by CMake auto‐
2153 matically. This allows users to edit their cache entries to adjust the
2154 flags. However, the presence of such default flags is problematic for
2155 projects that want to choose a different runtime library programmati‐
2156 cally. In particular, it requires string editing of the
2157 CMAKE_<LANG>_FLAGS_<CONFIG> variables with knowledge of the CMake
2158 builtin defaults so they can be replaced.
2159
2160 CMake 3.15 and above prefer to leave the MSVC runtime library selection
2161 flags out of the default CMAKE_<LANG>_FLAGS_<CONFIG> values and instead
2162 offer a first-class abstraction. The CMAKE_MSVC_RUNTIME_LIBRARY vari‐
2163 able and MSVC_RUNTIME_LIBRARY target property may be set to select the
2164 MSVC runtime library. If they are not set then CMake uses the default
2165 value MultiThreaded$<$<CONFIG:Debug>:Debug>DLL which is equivalent to
2166 the original flags.
2167
2168 This policy provides compatibility with projects that have not been up‐
2169 dated to be aware of the abstraction. The policy setting takes effect
2170 as of the first project() or enable_language() command that enables a
2171 language whose compiler targets the MSVC ABI.
2172
2173 NOTE:
2174 Once the policy has taken effect at the top of a project, that
2175 choice must be used throughout the tree. In projects that have
2176 nested projects in subdirectories, be sure to convert everything to‐
2177 gether.
2178
2179 The OLD behavior for this policy is to place MSVC runtime library flags
2180 in the default CMAKE_<LANG>_FLAGS_<CONFIG> cache entries and ignore the
2181 CMAKE_MSVC_RUNTIME_LIBRARY abstraction. The NEW behavior for this pol‐
2182 icy is to not place MSVC runtime library flags in the default cache en‐
2183 tries and use the abstraction instead.
2184
2185 This policy was introduced in CMake version 3.15. Use the
2186 cmake_policy() command to set it to OLD or NEW explicitly. Unlike many
2187 policies, CMake version 3.27.7 does not warn when this policy is not
2188 set and simply uses OLD behavior.
2189
2190 NOTE:
2191 The OLD behavior of a policy is deprecated by definition and may be
2192 removed in a future version of CMake.
2193
2194 CMP0090
2195 New in version 3.15.
2196
2197
2198 export(PACKAGE) does not populate package registry by default.
2199
2200 In CMake 3.14 and below the export(PACKAGE) command populated the user
2201 package registry by default and users needed to set the
2202 CMAKE_EXPORT_NO_PACKAGE_REGISTRY to disable it, e.g. in automated build
2203 and packaging environments. Since the user package registry is stored
2204 outside the build tree, this side effect should not be enabled by de‐
2205 fault. Therefore CMake 3.15 and above prefer that export(PACKAGE) does
2206 nothing unless an explicit CMAKE_EXPORT_PACKAGE_REGISTRY variable is
2207 set to enable it. This policy provides compatibility with projects
2208 that have not been updated.
2209
2210 The OLD behavior for this policy is for export(PACKAGE) command to pop‐
2211 ulate the user package registry unless CMAKE_EXPORT_NO_PACKAGE_REGISTRY
2212 is enabled. The NEW behavior is for export(PACKAGE) command to do
2213 nothing unless the CMAKE_EXPORT_PACKAGE_REGISTRY is enabled.
2214
2215 This policy was introduced in CMake version 3.15. Use the
2216 cmake_policy() command to set it to OLD or NEW explicitly. Unlike most
2217 policies, CMake version 3.27.7 does not warn when this policy is not
2218 set and simply uses OLD behavior.
2219
2220 NOTE:
2221 The OLD behavior of a policy is deprecated by definition and may be
2222 removed in a future version of CMake.
2223
2224 CMP0089
2225 New in version 3.15.
2226
2227
2228 Compiler id for IBM Clang-based XL compilers is now XLClang.
2229
2230 CMake 3.15 and above recognize that IBM's Clang-based XL compilers that
2231 define __ibmxl__ are a new front-end distinct from xlc with a different
2232 command line and set of capabilities. CMake now prefers to present
2233 this to projects by setting the CMAKE_<LANG>_COMPILER_ID variable to
2234 XLClang instead of XL. However, existing projects may assume the com‐
2235 piler id for Clang-based XL is just XL as it was in CMake versions
2236 prior to 3.15. Therefore this policy determines for Clang-based XL
2237 compilers which compiler id to report in the CMAKE_<LANG>_COMPILER_ID
2238 variable after language <LANG> is enabled by the project() or
2239 enable_language() command. The policy must be set prior to the invoca‐
2240 tion of either command.
2241
2242 The OLD behavior for this policy is to use compiler id XL. The NEW be‐
2243 havior for this policy is to use compiler id XLClang.
2244
2245 This policy was introduced in CMake version 3.15. Use the
2246 cmake_policy() command to set this policy to OLD or NEW explicitly.
2247 Unlike most policies, CMake version 3.27.7 does not warn by default
2248 when this policy is not set and simply uses OLD behavior. See documen‐
2249 tation of the CMAKE_POLICY_WARNING_CMP0089 variable to control the
2250 warning.
2251
2252 NOTE:
2253 The OLD behavior of a policy is deprecated by definition and may be
2254 removed in a future version of CMake.
2255
2257 CMP0088
2258 New in version 3.14.
2259
2260
2261 FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing.
2262
2263 The module provides a BISON_TARGET macro which generates BISON output.
2264 In CMake 3.13 and below the macro would generate a custom command that
2265 runs bison in the source directory. CMake 3.14 and later prefer to run
2266 it in the build directory and use CMAKE_CURRENT_BINARY_DIR as the WORK‐
2267 ING_DIRECTORY of its add_custom_command() invocation. This ensures
2268 that any implicitly generated file is written to the build tree rather
2269 than the source.
2270
2271 This policy provides compatibility for projects that have not been up‐
2272 dated to expect the new behavior.
2273
2274 The OLD behavior for this policy is for BISON_TARGET to use the current
2275 source directory for the WORKING_DIRECTORY and where to generate im‐
2276 plicit files. The NEW behavior of this policy is to use the current bi‐
2277 nary directory for the WORKING_DIRECTORY and where to generate implicit
2278 files.
2279
2280 This policy was introduced in CMake version 3.14. Use the
2281 cmake_policy() command to set it to OLD or NEW explicitly. Unlike most
2282 policies, CMake version 3.27.7 does not warn when this policy is not
2283 set and simply uses OLD behavior.
2284
2285 NOTE:
2286 The OLD behavior of a policy is deprecated by definition and may be
2287 removed in a future version of CMake.
2288
2289 CMP0087
2290 New in version 3.14.
2291
2292
2293 install(CODE) and install(SCRIPT) support generator expressions.
2294
2295 In CMake 3.13 and earlier, install(CODE) and install(SCRIPT) did not
2296 evaluate generator expressions. CMake 3.14 and later will evaluate
2297 generator expressions for install(CODE) and install(SCRIPT).
2298
2299 The OLD behavior of this policy is for install(CODE) and
2300 install(SCRIPT) to not evaluate generator expressions. The NEW behav‐
2301 ior is to evaluate generator expressions for install(CODE) and
2302 install(SCRIPT).
2303
2304 Note that it is the value of this policy setting at the end of the di‐
2305 rectory scope that is important, not its setting at the time of the
2306 call to install(CODE) or install(SCRIPT). This has implications for
2307 calling these commands from places that have their own policy scope but
2308 not their own directory scope (e.g. from files brought in via include()
2309 rather than add_subdirectory()).
2310
2311 This policy was introduced in CMake version 3.14. CMake version 3.27.7
2312 warns when the policy is not set and uses OLD behavior. Use the
2313 cmake_policy() command to set it to OLD or NEW explicitly.
2314
2315 NOTE:
2316 The OLD behavior of a policy is deprecated by definition and may be
2317 removed in a future version of CMake.
2318
2319 CMP0086
2320 New in version 3.14.
2321
2322
2323 UseSWIG honors SWIG_MODULE_NAME via -module flag.
2324
2325 Starting with CMake 3.14, UseSWIG passes option -module <module_name>
2326 to SWIG compiler if the file property SWIG_MODULE_NAME is specified.
2327 This policy provides compatibility with projects that expect the legacy
2328 behavior.
2329
2330 The OLD behavior for this policy is to never pass -module option. The
2331 NEW behavior is to pass -module option to SWIG compiler if SWIG_MOD‐
2332 ULE_NAME is specified.
2333
2334 This policy was introduced in CMake version 3.14. CMake version 3.27.7
2335 warns when the policy is not set and uses OLD behavior. Use the
2336 cmake_policy() command to set it to OLD or NEW explicitly.
2337
2338 NOTE:
2339 The OLD behavior of a policy is deprecated by definition and may be
2340 removed in a future version of CMake.
2341
2342 CMP0085
2343 New in version 3.14.
2344
2345
2346 $<IN_LIST:...> handles empty list items.
2347
2348 In CMake 3.13 and lower, the $<IN_LIST:...> generator expression always
2349 returned 0 if the first argument was empty, even if the list contained
2350 an empty item. This behavior is inconsistent with the IN_LIST behavior
2351 of if(), which this generator expression is meant to emulate. CMake
2352 3.14 and later handles this case correctly.
2353
2354 The OLD behavior of this policy is for $<IN_LIST:...> to always return
2355 0 if the first argument is empty. The NEW behavior is to return 1 if
2356 the first argument is empty and the list contains an empty item.
2357
2358 This policy was introduced in CMake version 3.14. CMake version 3.27.7
2359 warns when the policy is not set and uses OLD behavior. Use the
2360 cmake_policy() command to set it to OLD or NEW explicitly.
2361
2362 NOTE:
2363 The OLD behavior of a policy is deprecated by definition and may be
2364 removed in a future version of CMake.
2365
2366 CMP0084
2367 New in version 3.14.
2368
2369
2370 The FindQt module does not exist for find_package().
2371
2372 The existence of FindQt means that for Qt upstream to provide package
2373 config files that can be found by find_package(Qt), the consuming
2374 project has to explicitly specify find_package(Qt CONFIG). Removing
2375 this module gives Qt a path forward for exporting its own config files
2376 which can easily be found by consuming projects.
2377
2378 This policy pretends that CMake's internal FindQt module does not exist
2379 for find_package(). If a project really wants to use Qt 3 or 4, it can
2380 call find_package(Qt[34]), include(FindQt), or add FindQt to their
2381 CMAKE_MODULE_PATH.
2382
2383 The OLD behavior of this policy is for FindQt to exist for
2384 find_package(). The NEW behavior is to pretend that it doesn't exist
2385 for find_package().
2386
2387 This policy was introduced in CMake version 3.14. CMake version 3.27.7
2388 warns when the policy is not set and uses OLD behavior. Use the
2389 cmake_policy() command to set it to OLD or NEW explicitly.
2390
2391 NOTE:
2392 The OLD behavior of a policy is deprecated by definition and may be
2393 removed in a future version of CMake.
2394
2395 CMP0083
2396 New in version 3.14.
2397
2398
2399 To control generation of Position Independent Executable (PIE) or not,
2400 some flags are required at link time.
2401
2402 CMake 3.13 and lower did not add these link flags when
2403 POSITION_INDEPENDENT_CODE is set.
2404
2405 The OLD behavior for this policy is to not manage PIE link flags. The
2406 NEW behavior is to add link flags if POSITION_INDEPENDENT_CODE is set:
2407
2408 • Set to TRUE: flags to produce a position independent executable are
2409 passed to the linker step. For example -pie for GCC.
2410
2411 • Set to FALSE: flags not to produce a position independent executable
2412 are passed to the linker step. For example -no-pie for GCC.
2413
2414 • Not set: no flags are passed to the linker step.
2415
2416 Since a given linker may not support PIE flags in all environments in
2417 which it is used, it is the project's responsibility to use the
2418 CheckPIESupported module to check for support to ensure that the
2419 POSITION_INDEPENDENT_CODE target property for executables will be hon‐
2420 ored at link time.
2421
2422 This policy was introduced in CMake version 3.14. Use the
2423 cmake_policy() command to set it to OLD or NEW explicitly. Unlike most
2424 policies, CMake version 3.27.7 does not warn when this policy is not
2425 set and simply uses OLD behavior.
2426
2427 NOTE:
2428 Android platform has a special handling of PIE so it is not required
2429 to use the CheckPIESupported module to ensure flags are passed to
2430 the linker.
2431
2432 NOTE:
2433 The OLD behavior of a policy is deprecated by definition and may be
2434 removed in a future version of CMake.
2435
2436 Examples
2437 Behave like CMake 3.13 and do not apply any PIE flags at link stage.
2438
2439 cmake_minimum_required(VERSION 3.13)
2440 project(foo)
2441
2442 # ...
2443
2444 add_executable(foo ...)
2445 set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
2446
2447 Use the CheckPIESupported module to detect whether PIE is supported by
2448 the current linker and environment. Apply PIE flags only if the linker
2449 supports them.
2450
2451 cmake_minimum_required(VERSION 3.14) # CMP0083 NEW
2452 project(foo)
2453
2454 include(CheckPIESupported)
2455 check_pie_supported()
2456
2457 # ...
2458
2459 add_executable(foo ...)
2460 set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
2461
2462 CMP0082
2463 New in version 3.14.
2464
2465
2466 Install rules from add_subdirectory() calls are interleaved with those
2467 in caller.
2468
2469 CMake 3.13 and lower ran the install rules from add_subdirectory() af‐
2470 ter all other install rules, even if add_subdirectory() was called be‐
2471 fore the other install rules. CMake 3.14 and above prefer to inter‐
2472 leave these add_subdirectory() install rules with the others so that
2473 they are run in the order they are declared. This policy provides com‐
2474 patibility for projects that have not been updated to expect the new
2475 behavior.
2476
2477 The OLD behavior for this policy is to run the install rules from
2478 add_subdirectory() after the other install rules. The NEW behavior for
2479 this policy is to run all install rules in the order they are declared.
2480
2481 This policy was introduced in CMake version 3.14. Unlike most poli‐
2482 cies, CMake version 3.27.7 does not warn by default when this policy is
2483 not set and simply uses OLD behavior. See documentation of the
2484 CMAKE_POLICY_WARNING_CMP0082 variable to control the warning.
2485
2486 NOTE:
2487 The OLD behavior of a policy is deprecated by definition and may be
2488 removed in a future version of CMake.
2489
2491 CMP0081
2492 New in version 3.13.
2493
2494
2495 Relative paths not allowed in LINK_DIRECTORIES target property.
2496
2497 CMake 3.12 and lower allowed the LINK_DIRECTORIES directory property to
2498 contain relative paths. The base path for such relative entries is not
2499 well defined. CMake 3.13 and later will issue a FATAL_ERROR if the
2500 LINK_DIRECTORIES target property (which is initialized by the
2501 LINK_DIRECTORIES directory property) contains a relative path.
2502
2503 The OLD behavior for this policy is not to warn about relative paths in
2504 the LINK_DIRECTORIES target property. The NEW behavior for this policy
2505 is to issue a FATAL_ERROR if LINK_DIRECTORIES contains a relative path.
2506
2507 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2508 warns when the policy is not set and uses OLD behavior. Use the
2509 cmake_policy() command to set it to OLD or NEW explicitly.
2510
2511 NOTE:
2512 The OLD behavior of a policy is deprecated by definition and may be
2513 removed in a future version of CMake.
2514
2515 CMP0080
2516 New in version 3.13.
2517
2518
2519 BundleUtilities cannot be included at configure time.
2520
2521 The macros provided by BundleUtilities are intended to be invoked at
2522 install time rather than at configure time, because they depend on the
2523 listed targets already existing at the time they are invoked. If they
2524 are invoked at configure time, the targets haven't been built yet, and
2525 the commands will fail.
2526
2527 This policy restricts the inclusion of BundleUtilities to cmake -P
2528 style scripts and install rules. Specifically, it looks for the pres‐
2529 ence of CMAKE_GENERATOR and throws a fatal error if it exists.
2530
2531 The OLD behavior of this policy is to allow BundleUtilities to be in‐
2532 cluded at configure time. The NEW behavior of this policy is to disal‐
2533 low such inclusion.
2534
2535 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2536 warns when the policy is not set and uses OLD behavior. Use the
2537 cmake_policy() command to set it to OLD or NEW explicitly.
2538
2539 NOTE:
2540 The OLD behavior of a policy is deprecated by definition and may be
2541 removed in a future version of CMake.
2542
2543 CMP0079
2544 New in version 3.13.
2545
2546
2547 target_link_libraries() allows use with targets in other directories.
2548
2549 Prior to CMake 3.13 the target_link_libraries() command did not accept
2550 targets not created in the calling directory as its first argument for
2551 calls that update the LINK_LIBRARIES of the target itself. It did ac‐
2552 cidentally accept targets from other directories on calls that only up‐
2553 date the INTERFACE_LINK_LIBRARIES, but would simply add entries to the
2554 property as if the call were made in the original directory. Thus link
2555 interface libraries specified this way were always looked up by genera‐
2556 tors in the scope of the original target rather than in the scope that
2557 called target_link_libraries().
2558
2559 CMake 3.13 now allows the target_link_libraries() command to be called
2560 from any directory to add link dependencies and link interface li‐
2561 braries to targets created in other directories. The entries are added
2562 to LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES using a special (inter‐
2563 nal) suffix to tell the generators to look up the names in the calling
2564 scope rather than the scope that created the target.
2565
2566 This policy provides compatibility with projects that already use
2567 target_link_libraries() with the INTERFACE keyword on a target in an‐
2568 other directory to add INTERFACE_LINK_LIBRARIES entries to be looked up
2569 in the target's directory. Such projects should be updated to be aware
2570 of the new scoping rules in that case.
2571
2572 The OLD behavior of this policy is to disallow target_link_libraries()
2573 calls naming targets from another directory except in the previously
2574 accidentally allowed case of using the INTERFACE keyword only. The NEW
2575 behavior of this policy is to allow all such calls but use the new
2576 scoping rules.
2577
2578 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2579 warns when the policy is not set and uses OLD behavior. Use the
2580 cmake_policy() command to set it to OLD or NEW explicitly.
2581
2582 NOTE:
2583 The OLD behavior of a policy is deprecated by definition and may be
2584 removed in a future version of CMake.
2585
2586 CMP0078
2587 New in version 3.13.
2588
2589
2590 UseSWIG generates standard target names.
2591
2592 Starting with CMake 3.13, UseSWIG generates now standard target names.
2593 This policy provides compatibility with projects that expect the legacy
2594 behavior.
2595
2596 The OLD behavior for this policy relies on UseSWIG_TARGET_NAME_PREFER‐
2597 ENCE variable that can be used to specify an explicit preference. The
2598 value may be one of:
2599
2600 • LEGACY: legacy strategy is applied. Variable SWIG_MOD‐
2601 ULE_<name>_REAL_NAME must be used to get real target name. This is
2602 the default if not specified.
2603
2604 • STANDARD: target name matches specified name.
2605
2606 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2607 warns when the policy is not set and uses OLD behavior. Use the
2608 cmake_policy() command to set it to OLD or NEW explicitly.
2609
2610 NOTE:
2611 The OLD behavior of a policy is deprecated by definition and may be
2612 removed in a future version of CMake.
2613
2614 CMP0077
2615 New in version 3.13.
2616
2617
2618 option() honors normal variables.
2619
2620 The option() command is typically used to create a cache entry to allow
2621 users to set the option. However, there are cases in which a normal
2622 (non-cached) variable of the same name as the option may be defined by
2623 the project prior to calling the option() command. For example, a
2624 project that embeds another project as a subdirectory may want to
2625 hard-code options of the subproject to build the way it needs.
2626
2627 For historical reasons in CMake 3.12 and below the option() command re‐
2628 moves a normal (non-cached) variable of the same name when:
2629
2630 • a cache entry of the specified name does not exist at all, or
2631
2632 • a cache entry of the specified name exists but has not been given a
2633 type (e.g. via -D<name>=ON on the command line).
2634
2635 In both of these cases (typically on the first run in a new build
2636 tree), the option() command gives the cache entry type BOOL and removes
2637 any normal (non-cached) variable of the same name. In the remaining
2638 case that the cache entry of the specified name already exists and has
2639 a type (typically on later runs in a build tree), the option() command
2640 changes nothing and any normal variable of the same name remains set.
2641
2642 In CMake 3.13 and above the option() command prefers to do nothing when
2643 a normal variable of the given name already exists. It does not create
2644 or update a cache entry or remove the normal variable. The new behav‐
2645 ior is consistent between the first and later runs in a build tree.
2646 This policy provides compatibility with projects that have not been up‐
2647 dated to expect the new behavior.
2648
2649 When the option() command sees a normal variable of the given name:
2650
2651 • The OLD behavior for this policy is to proceed even when a normal
2652 variable of the same name exists. If the cache entry does not al‐
2653 ready exist and have a type then it is created and/or given a type
2654 and the normal variable is removed.
2655
2656 • The NEW behavior for this policy is to do nothing when a normal vari‐
2657 able of the same name exists. The normal variable is not removed.
2658 The cache entry is not created or updated and is ignored if it ex‐
2659 ists.
2660
2661 See CMP0126 for a similar policy for the set(CACHE) command, but note
2662 that there are some differences in NEW behavior between the two poli‐
2663 cies.
2664
2665 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2666 warns when the policy is not set and uses OLD behavior. Use the
2667 cmake_policy() command to set it to OLD or NEW explicitly within a
2668 project. Use the CMAKE_POLICY_DEFAULT_CMP0077 variable to set the pol‐
2669 icy for a third-party project in a subdirectory without modifying it.
2670
2671 NOTE:
2672 The OLD behavior of a policy is deprecated by definition and may be
2673 removed in a future version of CMake.
2674
2675 CMP0076
2676 New in version 3.13.
2677
2678
2679 The target_sources() command converts relative paths to absolute.
2680
2681 In CMake 3.13 and above, the target_sources() command now converts rel‐
2682 ative source file paths to absolute paths in the following cases:
2683
2684 • Source files are added to the target's INTERFACE_SOURCES property.
2685
2686 • The target's SOURCE_DIR property differs from
2687 CMAKE_CURRENT_SOURCE_DIR.
2688
2689 A path that begins with a generator expression is always left unmodi‐
2690 fied.
2691
2692 This policy provides compatibility with projects that have not been up‐
2693 dated to expect this behavior. The OLD behavior for this policy is to
2694 leave all relative source file paths unmodified. The NEW behavior of
2695 this policy is to convert relative paths to absolute according to above
2696 rules.
2697
2698 This policy was introduced in CMake version 3.13. CMake version 3.27.7
2699 warns when the policy is not set and uses OLD behavior. Use the
2700 cmake_policy() command to set it to OLD or NEW explicitly.
2701
2702 NOTE:
2703 The OLD behavior of a policy is deprecated by definition and may be
2704 removed in a future version of CMake.
2705
2707 CMP0075
2708 New in version 3.12.
2709
2710
2711 Include file check macros honor CMAKE_REQUIRED_LIBRARIES.
2712
2713 In CMake 3.12 and above, the
2714
2715 • check_include_file macro in the CheckIncludeFile module, the
2716
2717 • check_include_file_cxx macro in the CheckIncludeFileCXX module, and
2718 the
2719
2720 • check_include_files macro in the CheckIncludeFiles module
2721
2722 now prefer to link the check executable to the libraries listed in the
2723 CMAKE_REQUIRED_LIBRARIES variable. This policy provides compatibility
2724 with projects that have not been updated to expect this behavior.
2725
2726 The OLD behavior for this policy is to ignore CMAKE_REQUIRED_LIBRARIES
2727 in the include file check macros. The NEW behavior of this policy is
2728 to honor CMAKE_REQUIRED_LIBRARIES in the include file check macros.
2729
2730 This policy was introduced in CMake version 3.12. CMake version 3.27.7
2731 warns when the policy is not set and uses OLD behavior. Use the
2732 cmake_policy() command to set it to OLD or NEW explicitly.
2733
2734 NOTE:
2735 The OLD behavior of a policy is deprecated by definition and may be
2736 removed in a future version of CMake.
2737
2738 CMP0074
2739 New in version 3.12.
2740
2741
2742 find_package() uses <PackageName>_ROOT variables.
2743
2744 In CMake 3.12 and above the find_package(<PackageName>) command now
2745 searches prefixes specified by the <PackageName>_ROOT CMake variable
2746 and the <PackageName>_ROOT environment variable. Package roots are
2747 maintained as a stack so nested calls to all find_* commands inside
2748 find modules and config packages also search the roots as prefixes.
2749 This policy provides compatibility with projects that have not been up‐
2750 dated to avoid using <PackageName>_ROOT variables for other purposes.
2751
2752 The OLD behavior for this policy is to ignore <PackageName>_ROOT vari‐
2753 ables. The NEW behavior for this policy is to use <PackageName>_ROOT
2754 variables.
2755
2756 This policy was introduced in CMake version 3.12. CMake version 3.27.7
2757 warns when the policy is not set and uses OLD behavior. Use the
2758 cmake_policy() command to set it to OLD or NEW explicitly.
2759
2760 NOTE:
2761 The OLD behavior of a policy is deprecated by definition and may be
2762 removed in a future version of CMake.
2763
2764 CMP0073
2765 New in version 3.12.
2766
2767
2768 Do not produce legacy _LIB_DEPENDS cache entries.
2769
2770 Ancient CMake versions once used <tgt>_LIB_DEPENDS cache entries to
2771 propagate library link dependencies. This has long been done by other
2772 means, leaving the export_library_dependencies() command as the only
2773 user of these values. That command has long been disallowed by policy
2774 CMP0033, but the <tgt>_LIB_DEPENDS cache entries were left for compati‐
2775 bility with possible non-standard uses by projects.
2776
2777 CMake 3.12 and above now prefer to not produce these cache entries at
2778 all. This policy provides compatibility with projects that have not
2779 been updated to avoid using them.
2780
2781 The OLD behavior for this policy is to set <tgt>_LIB_DEPENDS cache en‐
2782 tries. The NEW behavior for this policy is to not set them.
2783
2784 This policy was introduced in CMake version 3.12. Use the
2785 cmake_policy() command to set it to OLD or NEW explicitly. Unlike most
2786 policies, CMake version 3.27.7 does not warn when this policy is not
2787 set and simply uses OLD behavior.
2788
2789 NOTE:
2790 The OLD behavior of a policy is deprecated by definition and may be
2791 removed in a future version of CMake.
2792
2794 CMP0072
2795 New in version 3.11.
2796
2797
2798 FindOpenGL prefers GLVND by default when available.
2799
2800 The FindOpenGL module provides an OpenGL::GL target and an OPENGL_LI‐
2801 BRARIES variable for projects to use for legacy GL interfaces. When
2802 both a legacy GL library (e.g. libGL.so) and GLVND libraries for OpenGL
2803 and GLX (e.g. libOpenGL.so and libGLX.so) are available, the module
2804 must choose between them. It documents an OpenGL_GL_PREFERENCE vari‐
2805 able that can be used to specify an explicit preference. When no such
2806 preference is set, the module must choose a default preference.
2807
2808 CMake 3.11 and above prefer to choose GLVND libraries. This policy
2809 provides compatibility with projects that expect the legacy GL library
2810 to be used.
2811
2812 The OLD behavior for this policy is to set OpenGL_GL_PREFERENCE to
2813 LEGACY. The NEW behavior for this policy is to set OpenGL_GL_PREFER‐
2814 ENCE to GLVND.
2815
2816 This policy was introduced in CMake version 3.11. CMake version 3.27.7
2817 warns when the policy is not set and uses OLD behavior. Use the
2818 cmake_policy() command to set it to OLD or NEW explicitly.
2819
2820 NOTE:
2821 The OLD behavior of a policy is deprecated by definition and may be
2822 removed in a future version of CMake.
2823
2825 CMP0071
2826 New in version 3.10.
2827
2828
2829 Let AUTOMOC and AUTOUIC process GENERATED files.
2830
2831 Since version 3.10, CMake processes regular and GENERATED source files
2832 in AUTOMOC and AUTOUIC. In earlier CMake versions, only regular source
2833 files were processed. GENERATED source files were ignored silently.
2834
2835 This policy affects how source files that are GENERATED get treated in
2836 AUTOMOC and AUTOUIC.
2837
2838 The OLD behavior for this policy is to ignore GENERATED source files in
2839 AUTOMOC and AUTOUIC.
2840
2841 The NEW behavior for this policy is to process GENERATED source files
2842 in AUTOMOC and AUTOUIC just like regular source files.
2843
2844 NOTE:
2845 To silence the CMP0071 warning source files can be excluded from
2846 AUTOMOC and AUTOUIC processing by setting the source file properties
2847 SKIP_AUTOMOC, SKIP_AUTOUIC or SKIP_AUTOGEN.
2848
2849 Source skip example:
2850
2851 # ...
2852 set_property(SOURCE /path/to/file1.h PROPERTY SKIP_AUTOMOC ON)
2853 set_property(SOURCE /path/to/file2.h PROPERTY SKIP_AUTOUIC ON)
2854 set_property(SOURCE /path/to/file3.h PROPERTY SKIP_AUTOGEN ON)
2855 # ...
2856
2857 This policy was introduced in CMake version 3.10. CMake version 3.27.7
2858 warns when the policy is not set and uses OLD behavior. Use the
2859 cmake_policy() command to set it to OLD or NEW explicitly.
2860
2861 NOTE:
2862 The OLD behavior of a policy is deprecated by definition and may be
2863 removed in a future version of CMake.
2864
2865 CMP0070
2866 New in version 3.10.
2867
2868
2869 Define file(GENERATE) behavior for relative paths.
2870
2871 CMake 3.10 and newer define that relative paths given to INPUT and OUT‐
2872 PUT arguments of file(GENERATE) are interpreted relative to the current
2873 source and binary directories, respectively. CMake 3.9 and lower did
2874 not define any behavior for relative paths but did not diagnose them
2875 either and accidentally treated them relative to the process working
2876 directory. Policy CMP0070 provides compatibility with projects that
2877 used the old undefined behavior.
2878
2879 This policy affects behavior of relative paths given to file(GENERATE).
2880 The OLD behavior for this policy is to treat the paths relative to the
2881 working directory of CMake. The NEW behavior for this policy is to in‐
2882 terpret relative paths with respect to the current source or binary di‐
2883 rectory of the caller.
2884
2885 This policy was introduced in CMake version 3.10. CMake version 3.27.7
2886 warns when the policy is not set and uses OLD behavior. Use the
2887 cmake_policy() command to set it to OLD or NEW explicitly.
2888
2889 NOTE:
2890 The OLD behavior of a policy is deprecated by definition and may be
2891 removed in a future version of CMake.
2892
2894 CMP0069
2895 New in version 3.9.
2896
2897
2898 INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
2899
2900 CMake 3.9 and newer prefer to add IPO flags whenever the
2901 INTERPROCEDURAL_OPTIMIZATION target property is enabled and produce an
2902 error if flags are not known to CMake for the current compiler. Since
2903 a given compiler may not support IPO flags in all environments in which
2904 it is used, it is now the project's responsibility to use the
2905 CheckIPOSupported module to check for support before enabling the
2906 INTERPROCEDURAL_OPTIMIZATION target property. This approach allows a
2907 project to conditionally activate IPO when supported. It also allows
2908 an end user to set the CMAKE_INTERPROCEDURAL_OPTIMIZATION variable in
2909 an environment known to support IPO even if the project does not enable
2910 the property.
2911
2912 Since CMake 3.8 and lower only honored INTERPROCEDURAL_OPTIMIZATION for
2913 the Intel compiler on Linux, some projects may unconditionally enable
2914 the target property. Policy CMP0069 provides compatibility with such
2915 projects.
2916
2917 This policy takes effect whenever the IPO property is enabled. The OLD
2918 behavior for this policy is to add IPO flags only for Intel compiler on
2919 Linux. The NEW behavior for this policy is to add IPO flags for the
2920 current compiler or produce an error if CMake does not know the flags.
2921
2922 This policy was introduced in CMake version 3.9. CMake version 3.27.7
2923 warns when the policy is not set and uses OLD behavior. Use the
2924 cmake_policy() command to set it to OLD or NEW explicitly.
2925
2926 NOTE:
2927 The OLD behavior of a policy is deprecated by definition and may be
2928 removed in a future version of CMake.
2929
2930 Examples
2931 Behave like CMake 3.8 and do not apply any IPO flags except for Intel
2932 compiler on Linux:
2933
2934 cmake_minimum_required(VERSION 3.8)
2935 project(foo)
2936
2937 # ...
2938
2939 set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
2940
2941 Use the CheckIPOSupported module to detect whether IPO is supported by
2942 the current compiler, environment, and CMake version. Produce a fatal
2943 error if support is not available:
2944
2945 cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
2946 project(foo)
2947
2948 include(CheckIPOSupported)
2949 check_ipo_supported()
2950
2951 # ...
2952
2953 set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
2954
2955 Apply IPO flags only if compiler supports it:
2956
2957 cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
2958 project(foo)
2959
2960 include(CheckIPOSupported)
2961
2962 # ...
2963
2964 check_ipo_supported(RESULT result)
2965 if(result)
2966 set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
2967 endif()
2968
2969 Apply IPO flags without any checks. This may lead to build errors if
2970 IPO is not supported by the compiler in the current environment. Pro‐
2971 duce an error if CMake does not know IPO flags for the current com‐
2972 piler:
2973
2974 cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
2975 project(foo)
2976
2977 # ...
2978
2979 set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
2980
2981 CMP0068
2982 New in version 3.9.
2983
2984
2985 RPATH settings on macOS do not affect install_name.
2986
2987 CMake 3.9 and newer remove any effect the following settings may have
2988 on the install_name of a target on macOS:
2989
2990 • BUILD_WITH_INSTALL_RPATH target property
2991
2992 • SKIP_BUILD_RPATH target property
2993
2994 • CMAKE_SKIP_RPATH variable
2995
2996 • CMAKE_SKIP_INSTALL_RPATH variable
2997
2998 Previously, setting BUILD_WITH_INSTALL_RPATH had the effect of setting
2999 both the install_name of a target to INSTALL_NAME_DIR and the RPATH to
3000 INSTALL_RPATH. In CMake 3.9, it only affects setting of RPATH. How‐
3001 ever, if one wants INSTALL_NAME_DIR to apply to the target in the build
3002 tree, one may set BUILD_WITH_INSTALL_NAME_DIR.
3003
3004 If SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH or CMAKE_SKIP_INSTALL_RPATH were
3005 used to strip the directory portion of the install_name of a target,
3006 one may set INSTALL_NAME_DIR="" instead.
3007
3008 The OLD behavior of this policy is to use the RPATH settings for in‐
3009 stall_name on macOS. The NEW behavior of this policy is to ignore the
3010 RPATH settings for install_name on macOS.
3011
3012 This policy was introduced in CMake version 3.9. CMake version 3.27.7
3013 warns when the policy is not set and uses OLD behavior. Use the
3014 cmake_policy() command to set it to OLD or NEW explicitly.
3015
3016 NOTE:
3017 The OLD behavior of a policy is deprecated by definition and may be
3018 removed in a future version of CMake.
3019
3021 CMP0067
3022 New in version 3.8.
3023
3024
3025 Honor language standard in try_compile() source-file signature.
3026
3027 The try_compile() source file signature is intended to allow callers to
3028 check whether they will be able to compile a given source file with the
3029 current toolchain. In order to match compiler behavior, any language
3030 standard mode should match. However, CMake 3.7 and below did not do
3031 this. CMake 3.8 and above prefer to honor the language standard set‐
3032 tings for C, CXX (C++), and CUDA using the values of the variables:
3033
3034 • CMAKE_C_STANDARD
3035
3036 • CMAKE_C_STANDARD_REQUIRED
3037
3038 • CMAKE_C_EXTENSIONS
3039
3040 • CMAKE_CXX_STANDARD
3041
3042 • CMAKE_CXX_STANDARD_REQUIRED
3043
3044 • CMAKE_CXX_EXTENSIONS
3045
3046 • CMAKE_CUDA_STANDARD
3047
3048 • CMAKE_CUDA_STANDARD_REQUIRED
3049
3050 • CMAKE_CUDA_EXTENSIONS
3051
3052 This policy provides compatibility for projects that do not expect the
3053 language standard settings to be used automatically.
3054
3055 The OLD behavior of this policy is to ignore language standard setting
3056 variables when generating the try_compile test project. The NEW behav‐
3057 ior of this policy is to honor language standard setting variables.
3058
3059 This policy was introduced in CMake version 3.8. Unlike most policies,
3060 CMake version 3.27.7 does not warn by default when this policy is not
3061 set and simply uses OLD behavior. See documentation of the
3062 CMAKE_POLICY_WARNING_CMP0067 variable to control the warning.
3063
3064 NOTE:
3065 The OLD behavior of a policy is deprecated by definition and may be
3066 removed in a future version of CMake.
3067
3069 CMP0066
3070 New in version 3.7.
3071
3072
3073 Honor per-config flags in try_compile() source-file signature.
3074
3075 The source file signature of the try_compile() command uses the value
3076 of the CMAKE_<LANG>_FLAGS variable in the test project so that the test
3077 compilation works as it would in the main project. However, CMake 3.6
3078 and below do not also honor config-specific compiler flags such as
3079 those in the CMAKE_<LANG>_FLAGS_DEBUG variable. CMake 3.7 and above
3080 prefer to honor config-specific compiler flags too. This policy pro‐
3081 vides compatibility for projects that do not expect config-specific
3082 compiler flags to be used.
3083
3084 The OLD behavior of this policy is to ignore config-specific flag vari‐
3085 ables like CMAKE_<LANG>_FLAGS_DEBUG and only use CMake's built-in de‐
3086 faults for the current compiler and platform.
3087
3088 The NEW behavior of this policy is to honor config-specific flag vari‐
3089 abldes like CMAKE_<LANG>_FLAGS_DEBUG.
3090
3091 This policy was introduced in CMake version 3.7. Unlike most policies,
3092 CMake version 3.27.7 does not warn by default when this policy is not
3093 set and simply uses OLD behavior. See documentation of the
3094 CMAKE_POLICY_WARNING_CMP0066 variable to control the warning.
3095
3096 NOTE:
3097 The OLD behavior of a policy is deprecated by definition and may be
3098 removed in a future version of CMake.
3099
3101 CMP0065
3102 New in version 3.4.
3103
3104
3105 Do not add flags to export symbols from executables without the
3106 ENABLE_EXPORTS target property.
3107
3108 CMake 3.3 and below, for historical reasons, always linked executables
3109 on some platforms with flags like -rdynamic to export symbols from the
3110 executables for use by any plugins they may load via dlopen. CMake 3.4
3111 and above prefer to do this only for executables that are explicitly
3112 marked with the ENABLE_EXPORTS target property.
3113
3114 The OLD behavior of this policy is to always use the additional link
3115 flags when linking executables regardless of the value of the
3116 ENABLE_EXPORTS target property.
3117
3118 The NEW behavior of this policy is to only use the additional link
3119 flags when linking executables if the ENABLE_EXPORTS target property is
3120 set to True.
3121
3122 This policy was introduced in CMake version 3.4. Unlike most policies,
3123 CMake version 3.27.7 does not warn by default when this policy is not
3124 set and simply uses OLD behavior. See documentation of the
3125 CMAKE_POLICY_WARNING_CMP0065 variable to control the warning.
3126
3127 NOTE:
3128 The OLD behavior of a policy is deprecated by definition and may be
3129 removed in a future version of CMake.
3130
3131 CMP0064
3132 New in version 3.4.
3133
3134
3135 Recognize TEST as a operator for the if() command.
3136
3137 The TEST operator was added to the if() command to determine if a given
3138 test name was created by the add_test() command.
3139
3140 The OLD behavior for this policy is to ignore the TEST operator. The
3141 NEW behavior is to interpret the TEST operator.
3142
3143 This policy was introduced in CMake version 3.4. CMake version 3.27.7
3144 warns when the policy is not set and uses OLD behavior. Use the
3145 cmake_policy() command to set it to OLD or NEW explicitly.
3146
3147 NOTE:
3148 The OLD behavior of a policy is deprecated by definition and may be
3149 removed in a future version of CMake.
3150
3152 CMP0063
3153 New in version 3.3.
3154
3155
3156 Honor visibility properties for all target types.
3157
3158 The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target prop‐
3159 erties affect visibility of symbols during dynamic linking. When first
3160 introduced these properties affected compilation of sources only in
3161 shared libraries, module libraries, and executables with the
3162 ENABLE_EXPORTS property set. This was sufficient for the basic use
3163 cases of shared libraries and executables with plugins. However, some
3164 sources may be compiled as part of static libraries or object libraries
3165 and then linked into a shared library later. CMake 3.3 and above pre‐
3166 fer to honor these properties for sources compiled in all target types.
3167 This policy preserves compatibility for projects expecting the proper‐
3168 ties to work only for some target types.
3169
3170 The OLD behavior for this policy is to ignore the visibility properties
3171 for static libraries, object libraries, and executables without ex‐
3172 ports. The NEW behavior for this policy is to honor the visibility
3173 properties for all target types.
3174
3175 This policy was introduced in CMake version 3.3. CMake version 3.27.7
3176 warns when the policy is not set and uses OLD behavior. Use the
3177 cmake_policy() command to set it to OLD or NEW explicitly.
3178
3179 NOTE:
3180 The OLD behavior of a policy is deprecated by definition and may be
3181 removed in a future version of CMake.
3182
3183 CMP0062
3184 New in version 3.3.
3185
3186
3187 Disallow install() of export() result.
3188
3189 The export() command generates a file containing Imported Targets,
3190 which is suitable for use from the build directory. It is not suitable
3191 for installation because it contains absolute paths to buildsystem lo‐
3192 cations, and is particular to a single build configuration.
3193
3194 The install(EXPORT) generates and installs files which contain Imported
3195 Targets. These files are generated with relative paths (unless the
3196 user specifies absolute paths), and are designed for multi-configura‐
3197 tion use. See Creating Packages for more.
3198
3199 CMake 3.3 no longer allows the use of the install(FILES) command with
3200 the result of the export() command.
3201
3202 The OLD behavior for this policy is to allow installing the result of
3203 an export() command. The NEW behavior for this policy is not to allow
3204 installing the result of an export() command.
3205
3206 This policy was introduced in CMake version 3.3. CMake version 3.27.7
3207 warns when the policy is not set and uses OLD behavior. Use the
3208 cmake_policy() command to set it to OLD or NEW explicitly.
3209
3210 NOTE:
3211 The OLD behavior of a policy is deprecated by definition and may be
3212 removed in a future version of CMake.
3213
3214 CMP0061
3215 New in version 3.3.
3216
3217
3218 CTest does not by default tell make to ignore errors (-i).
3219
3220 The ctest_build() and build_command() commands no longer generate build
3221 commands for Makefile Generators with the -i option. Previously this
3222 was done to help build as much of tested projects as possible. How‐
3223 ever, this behavior is not consistent with other generators and also
3224 causes the return code of the make tool to be meaningless.
3225
3226 Of course users may still add this option manually by setting
3227 CTEST_BUILD_COMMAND or the MAKECOMMAND cache entry. See the CTest
3228 Build Step MakeCommand setting documentation for their effects.
3229
3230 The OLD behavior for this policy is to add -i to make calls in CTest.
3231 The NEW behavior for this policy is to not add -i.
3232
3233 This policy was introduced in CMake version 3.3. Unlike most policies,
3234 CMake version 3.27.7 does not warn when this policy is not set and sim‐
3235 ply uses OLD behavior.
3236
3237 NOTE:
3238 The OLD behavior of a policy is deprecated by definition and may be
3239 removed in a future version of CMake.
3240
3241 CMP0060
3242 New in version 3.3.
3243
3244
3245 Link libraries by full path even in implicit directories.
3246
3247 Policy CMP0003 was introduced with the intention of always linking li‐
3248 brary files by full path when a full path is given to the
3249 target_link_libraries() command. However, on some platforms (e.g.
3250 HP-UX) the compiler front-end adds alternative library search paths for
3251 the current architecture (e.g. /usr/lib/<arch> has alternatives to li‐
3252 braries in /usr/lib for the current architecture). On such platforms
3253 the find_library() may find a library such as /usr/lib/libfoo.so that
3254 does not belong to the current architecture.
3255
3256 Prior to policy CMP0003 projects would still build in such cases be‐
3257 cause the incorrect library path would be converted to -lfoo on the
3258 link line and the linker would find the proper library in the arch-spe‐
3259 cific search path provided by the compiler front-end implicitly. At
3260 the time we chose to remain compatible with such projects by always
3261 converting library files found in implicit link directories to -lfoo
3262 flags to ask the linker to search for them. This approach allowed ex‐
3263 isting projects to continue to build while still linking to libraries
3264 outside implicit link directories via full path (such as those in the
3265 build tree).
3266
3267 CMake does allow projects to override this behavior by using an
3268 IMPORTED library target with its IMPORTED_LOCATION property set to the
3269 desired full path to a library file. In fact, many Find Modules are
3270 learning to provide Imported Targets instead of just the traditional
3271 Foo_LIBRARIES variable listing library files. However, this makes the
3272 link line generated for a library found by a Find Module depend on
3273 whether it is linked through an imported target or not, which is incon‐
3274 sistent. Furthermore, this behavior has been a source of confusion be‐
3275 cause the generated link line for a library file depends on its loca‐
3276 tion. It is also problematic for projects trying to link statically
3277 because flags like -Wl,-Bstatic -lfoo -Wl,-Bdynamic may be used to help
3278 the linker select libfoo.a instead of libfoo.so but then leak dynamic
3279 linking to following libraries. (See the LINK_SEARCH_END_STATIC target
3280 property for a solution typically used for that problem.)
3281
3282 When the special case for libraries in implicit link directories was
3283 first introduced the list of implicit link directories was simply
3284 hard-coded (e.g. /lib, /usr/lib, and a few others). Since that time,
3285 CMake has learned to detect the implicit link directories used by the
3286 compiler front-end. If necessary, the find_library() command could be
3287 taught to use this information to help find libraries of the proper ar‐
3288 chitecture.
3289
3290 For these reasons, CMake 3.3 and above prefer to drop the special case
3291 and link libraries by full path even when they are in implicit link di‐
3292 rectories. Policy CMP0060 provides compatibility for existing
3293 projects.
3294
3295 The OLD behavior for this policy is to ask the linker to search for li‐
3296 braries whose full paths are known to be in implicit link directories.
3297 The NEW behavior for this policy is to link libraries by full path even
3298 if they are in implicit link directories.
3299
3300 This policy was introduced in CMake version 3.3. Unlike most policies,
3301 CMake version 3.27.7 does not warn by default when this policy is not
3302 set and simply uses OLD behavior. See documentation of the
3303 CMAKE_POLICY_WARNING_CMP0060 variable to control the warning.
3304
3305 NOTE:
3306 The OLD behavior of a policy is deprecated by definition and may be
3307 removed in a future version of CMake.
3308
3309 CMP0059
3310 New in version 3.3.
3311
3312
3313 Do not treat DEFINITIONS as a built-in directory property.
3314
3315 CMake 3.3 and above no longer make a list of definitions available
3316 through the DEFINITIONS directory property. The COMPILE_DEFINITIONS
3317 directory property may be used instead.
3318
3319 The OLD behavior for this policy is to provide the list of flags given
3320 so far to the add_definitions() command. The NEW behavior is to behave
3321 as a normal user-defined directory property.
3322
3323 This policy was introduced in CMake version 3.3. CMake version 3.27.7
3324 warns when the policy is not set and uses OLD behavior. Use the
3325 cmake_policy() command to set it to OLD or NEW explicitly.
3326
3327 NOTE:
3328 The OLD behavior of a policy is deprecated by definition and may be
3329 removed in a future version of CMake.
3330
3331 CMP0058
3332 New in version 3.3.
3333
3334
3335 Ninja requires custom command byproducts to be explicit.
3336
3337 When an intermediate file generated during the build is consumed by an
3338 expensive operation or a large tree of dependents, one may reduce the
3339 work needed for an incremental rebuild by updating the file timestamp
3340 only when its content changes. With this approach the generation rule
3341 must have a separate output file that is always updated with a new
3342 timestamp that is newer than any dependencies of the rule so that the
3343 build tool re-runs the rule only when the input changes. We refer to
3344 the separate output file as a rule's witness and the generated file as
3345 a rule's byproduct.
3346
3347 Byproducts may not be listed as outputs because their timestamps are
3348 allowed to be older than the inputs. No build tools (like make) that
3349 existed when CMake was designed have a way to express byproducts.
3350 Therefore CMake versions prior to 3.2 had no way to specify them.
3351 Projects typically left byproducts undeclared in the rules that gener‐
3352 ate them. For example:
3353
3354 add_custom_command(
3355 OUTPUT witness.txt
3356 COMMAND ${CMAKE_COMMAND} -E copy_if_different
3357 ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
3358 byproduct.txt # timestamp may not change
3359 COMMAND ${CMAKE_COMMAND} -E touch witness.txt
3360 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
3361 )
3362 add_custom_target(Provider DEPENDS witness.txt)
3363 add_custom_command(
3364 OUTPUT generated.c
3365 COMMAND expensive-task -i byproduct.txt -o generated.c
3366 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct.txt
3367 )
3368 add_library(Consumer generated.c)
3369 add_dependencies(Consumer Provider)
3370
3371 This works well for all generators except Ninja. The Ninja build tool
3372 sees a rule listing byproduct.txt as a dependency and no rule listing
3373 it as an output. Ninja then complains that there is no way to satisfy
3374 the dependency and stops building even though there are order-only de‐
3375 pendencies that ensure byproduct.txt will exist before its consumers
3376 need it. See discussion of this problem in Ninja Issue 760 for further
3377 details on why Ninja works this way.
3378
3379 Instead of leaving byproducts undeclared in the rules that generate
3380 them, Ninja expects byproducts to be listed along with other outputs.
3381 Such rules may be marked with a restat option that tells Ninja to check
3382 the timestamps of outputs after the rules run. This prevents byprod‐
3383 ucts whose timestamps do not change from causing their dependents to
3384 re-build unnecessarily.
3385
3386 Since the above approach does not tell CMake what custom command gener‐
3387 ates byproduct.txt, the Ninja generator does not have enough informa‐
3388 tion to add the byproduct as an output of any rule. CMake 2.8.12 and
3389 above work around this problem and allow projects using the above ap‐
3390 proach to build by generating phony build rules to tell Ninja to toler‐
3391 ate such missing files. However, this workaround prevents Ninja from
3392 diagnosing a dependency that is really missing. It also works poorly
3393 in in-source builds where every custom command dependency, even on
3394 source files, needs to be treated this way because CMake does not have
3395 enough information to know which files are generated as byproducts of
3396 custom commands.
3397
3398 Introducing Byproducts
3399 CMake 3.2 introduced the BYPRODUCTS option to the add_custom_command()
3400 and add_custom_target() commands. This option allows byproducts to be
3401 specified explicitly:
3402
3403 add_custom_command(
3404 OUTPUT witness.txt
3405 BYPRODUCTS byproduct.txt # explicit byproduct specification
3406 COMMAND ${CMAKE_COMMAND} -E copy_if_different
3407 ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
3408 byproduct.txt # timestamp may not change
3409 ...
3410
3411 The BYPRODUCTS option is used by the Ninja generator to list byproducts
3412 among the outputs of the custom commands that generate them, and is ig‐
3413 nored by other generators.
3414
3415 CMake 3.3 and above prefer to require projects to specify custom com‐
3416 mand byproducts explicitly so that it can avoid using the phony rule
3417 workaround altogether. Policy CMP0058 was introduced to provide com‐
3418 patibility with existing projects that still need the workaround.
3419
3420 This policy has no effect on generators other than Ninja. The OLD be‐
3421 havior for this policy is to generate Ninja phony rules for unknown de‐
3422 pendencies in the build tree. The NEW behavior for this policy is to
3423 not generate these and instead require projects to specify custom com‐
3424 mand BYPRODUCTS explicitly.
3425
3426 This policy was introduced in CMake version 3.3. CMake version 3.27.7
3427 warns when it sees unknown dependencies in out-of-source build trees if
3428 the policy is not set and then uses OLD behavior. Use the
3429 cmake_policy() command to set the policy to OLD or NEW explicitly. The
3430 policy setting must be in scope at the end of the top-level CMake‐
3431 Lists.txt file of the project and has global effect.
3432
3433 NOTE:
3434 The OLD behavior of a policy is deprecated by definition and may be
3435 removed in a future version of CMake.
3436
3437 CMP0057
3438 New in version 3.3.
3439
3440
3441 Support new if() IN_LIST operator.
3442
3443 CMake 3.3 adds support for the new IN_LIST operator.
3444
3445 The OLD behavior for this policy is to ignore the IN_LIST operator.
3446 The NEW behavior is to interpret the IN_LIST operator.
3447
3448 This policy was introduced in CMake version 3.3. CMake version 3.27.7
3449 warns when the policy is not set and uses OLD behavior. Use the
3450 cmake_policy() command to set it to OLD or NEW explicitly.
3451
3452 NOTE:
3453 The OLD behavior of a policy is deprecated by definition and may be
3454 removed in a future version of CMake.
3455
3457 CMP0056
3458 New in version 3.2.
3459
3460
3461 Honor link flags in try_compile() source-file signature.
3462
3463 The try_compile() command source-file signature generates a CMake‐
3464 Lists.txt file to build the source file into an executable. In order
3465 to compile the source the same way as it might be compiled by the call‐
3466 ing project, the generated project sets the value of the
3467 CMAKE_<LANG>_FLAGS variable to that in the calling project. The value
3468 of the CMAKE_EXE_LINKER_FLAGS variable may be needed in some cases too,
3469 but CMake 3.1 and lower did not set it in the generated project. CMake
3470 3.2 and above prefer to set it so that linker flags are honored as well
3471 as compiler flags. This policy provides compatibility with the pre-3.2
3472 behavior.
3473
3474 The OLD behavior for this policy is to not set the value of the
3475 CMAKE_EXE_LINKER_FLAGS variable in the generated test project. The NEW
3476 behavior for this policy is to set the value of the
3477 CMAKE_EXE_LINKER_FLAGS variable in the test project to the same as it
3478 is in the calling project.
3479
3480 If the project code does not set the policy explicitly, users may set
3481 it on the command line by defining the CMAKE_POLICY_DEFAULT_CMP0056
3482 variable in the cache.
3483
3484 This policy was introduced in CMake version 3.2. Unlike most policies,
3485 CMake version 3.27.7 does not warn by default when this policy is not
3486 set and simply uses OLD behavior. See documentation of the
3487 CMAKE_POLICY_WARNING_CMP0056 variable to control the warning.
3488
3489 NOTE:
3490 The OLD behavior of a policy is deprecated by definition and may be
3491 removed in a future version of CMake.
3492
3493 CMP0055
3494 New in version 3.2.
3495
3496
3497 Strict checking for the break() command.
3498
3499 CMake 3.1 and lower allowed calls to the break() command outside of a
3500 loop context and also ignored any given arguments. This was undefined
3501 behavior.
3502
3503 The OLD behavior for this policy is to allow break() to be placed out‐
3504 side of loop contexts and ignores any arguments. The NEW behavior for
3505 this policy is to issue an error if a misplaced break or any arguments
3506 are found.
3507
3508 This policy was introduced in CMake version 3.2. CMake version 3.27.7
3509 warns when the policy is not set and uses OLD behavior. Use the
3510 cmake_policy() command to set it to OLD or NEW explicitly.
3511
3512 NOTE:
3513 The OLD behavior of a policy is deprecated by definition and may be
3514 removed in a future version of CMake.
3515
3517 CMP0054
3518 New in version 3.1.
3519
3520
3521 Only interpret if() arguments as variables or keywords when unquoted.
3522
3523 CMake 3.1 and above no longer implicitly dereference variables or in‐
3524 terpret keywords in an if() command argument when it is a Quoted Argu‐
3525 ment or a Bracket Argument.
3526
3527 The OLD behavior for this policy is to dereference variables and inter‐
3528 pret keywords even if they are quoted or bracketed. The NEW behavior
3529 is to not dereference variables or interpret keywords that have been
3530 quoted or bracketed.
3531
3532 Given the following partial example:
3533
3534 set(A E)
3535 set(E "")
3536
3537 if("${A}" STREQUAL "")
3538 message("Result is TRUE before CMake 3.1 or when CMP0054 is OLD")
3539 else()
3540 message("Result is FALSE in CMake 3.1 and above if CMP0054 is NEW")
3541 endif()
3542
3543 After explicit expansion of variables this gives:
3544
3545 if("E" STREQUAL "")
3546
3547 With the policy set to OLD implicit expansion reduces this semantically
3548 to:
3549
3550 if("" STREQUAL "")
3551
3552 With the policy set to NEW the quoted arguments will not be further
3553 dereferenced:
3554
3555 if("E" STREQUAL "")
3556
3557 This policy was introduced in CMake version 3.1. CMake version 3.27.7
3558 warns when the policy is not set and uses OLD behavior. Use the
3559 cmake_policy() command to set it to OLD or NEW explicitly.
3560
3561 NOTE:
3562 The OLD behavior of a policy is deprecated by definition and may be
3563 removed in a future version of CMake.
3564
3565 CMP0053
3566 New in version 3.1.
3567
3568
3569 Simplify variable reference and escape sequence evaluation.
3570
3571 CMake 3.1 introduced a much faster implementation of evaluation of the
3572 Variable References and Escape Sequences documented in the
3573 cmake-language(7) manual. While the behavior is identical to the
3574 legacy implementation in most cases, some corner cases were cleaned up
3575 to simplify the behavior. Specifically:
3576
3577 • Expansion of @VAR@ reference syntax defined by the configure_file()
3578 and string(CONFIGURE) commands is no longer performed in other con‐
3579 texts.
3580
3581 • Literal ${VAR} reference syntax may contain only alphanumeric charac‐
3582 ters (A-Z, a-z, 0-9) and the characters _, ., /, -, and +. Note that
3583 $ is technically allowed in the NEW behavior, but is invalid for OLD
3584 behavior. This is due to an oversight during the implementation of
3585 CMP0053 and its use as a literal variable reference is discouraged
3586 for this reason. Variables with other characters in their name may
3587 still be referenced indirectly, e.g.
3588
3589 set(varname "otherwise & disallowed $ characters")
3590 message("${${varname}}")
3591
3592 • The setting of policy CMP0010 is not considered, so improper variable
3593 reference syntax is always an error.
3594
3595 • More characters are allowed to be escaped in variable names. Previ‐
3596 ously, only ()#" \@^ were valid characters to escape. Now any non-al‐
3597 phanumeric, non-semicolon, non-NUL character may be escaped following
3598 the escape_identity production in the Escape Sequences section of the
3599 cmake-language(7) manual.
3600
3601 The OLD behavior for this policy is to honor the legacy behavior for
3602 variable references and escape sequences. The NEW behavior is to use
3603 the simpler variable expansion and escape sequence evaluation rules.
3604
3605 This policy was introduced in CMake version 3.1. CMake version 3.27.7
3606 warns when the policy is not set and uses OLD behavior. Use the
3607 cmake_policy() command to set it to OLD or NEW explicitly.
3608
3609 NOTE:
3610 The OLD behavior of a policy is deprecated by definition and may be
3611 removed in a future version of CMake.
3612
3613 CMP0052
3614 New in version 3.1.
3615
3616
3617 Reject source and build dirs in installed
3618 INTERFACE_INCLUDE_DIRECTORIES.
3619
3620 CMake 3.0 and lower allowed subdirectories of the source directory or
3621 build directory to be in the INTERFACE_INCLUDE_DIRECTORIES of installed
3622 and exported targets, if the directory was also a subdirectory of the
3623 installation prefix. This makes the installation depend on the exis‐
3624 tence of the source dir or binary dir, and the installation will be
3625 broken if either are removed after installation.
3626
3627 See Include Directories and Usage Requirements for more on specifying
3628 include directories for targets.
3629
3630 The OLD behavior for this policy is to export the content of the
3631 INTERFACE_INCLUDE_DIRECTORIES with the source or binary directory. The
3632 NEW behavior for this policy is to issue an error if such a directory
3633 is used.
3634
3635 This policy was introduced in CMake version 3.1. CMake version 3.27.7
3636 warns when the policy is not set and uses OLD behavior. Use the
3637 cmake_policy() command to set it to OLD or NEW explicitly.
3638
3639 NOTE:
3640 The OLD behavior of a policy is deprecated by definition and may be
3641 removed in a future version of CMake.
3642
3643 CMP0051
3644 New in version 3.1.
3645
3646
3647 List TARGET_OBJECTS in SOURCES target property.
3648
3649 CMake 3.0 and lower did not include the TARGET_OBJECTS generator ex‐
3650 pression when returning the SOURCES target property.
3651
3652 Configure-time CMake code is not able to handle generator expressions.
3653 If using the SOURCES target property at configure time, it may be nec‐
3654 essary to first remove generator expressions using the
3655 string(GENEX_STRIP) command. Generate-time CMake code such as
3656 file(GENERATE) can handle the content without stripping.
3657
3658 The OLD behavior for this policy is to omit TARGET_OBJECTS expressions
3659 from the SOURCES target property. The NEW behavior for this policy is
3660 to include TARGET_OBJECTS expressions in the output.
3661
3662 This policy was introduced in CMake version 3.1. CMake version 3.27.7
3663 warns when the policy is not set and uses OLD behavior. Use the
3664 cmake_policy() command to set it to OLD or NEW explicitly.
3665
3666 NOTE:
3667 The OLD behavior of a policy is deprecated by definition and may be
3668 removed in a future version of CMake.
3669
3671 CMP0050
3672 Disallow add_custom_command SOURCE signatures.
3673
3674 CMake 2.8.12 and lower allowed a signature for add_custom_command()
3675 which specified an input to a command. This was undocumented behavior.
3676 Modern use of CMake associates custom commands with their output,
3677 rather than their input.
3678
3679 The OLD behavior for this policy is to allow the use of
3680 add_custom_command() SOURCE signatures. The NEW behavior for this pol‐
3681 icy is to issue an error if such a signature is used.
3682
3683 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3684 warns when the policy is not set and uses OLD behavior. Use the
3685 cmake_policy() command to set it to OLD or NEW explicitly.
3686
3687 NOTE:
3688 The OLD behavior of a policy is deprecated by definition and may be
3689 removed in a future version of CMake.
3690
3691 CMP0049
3692 Do not expand variables in target source entries.
3693
3694 CMake 2.8.12 and lower performed an extra layer of variable expansion
3695 when evaluating source file names:
3696
3697 set(a_source foo.c)
3698 add_executable(foo \${a_source})
3699
3700 This was undocumented behavior.
3701
3702 The OLD behavior for this policy is to expand such variables when pro‐
3703 cessing the target sources. The NEW behavior for this policy is to is‐
3704 sue an error if such variables need to be expanded.
3705
3706 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3707 warns when the policy is not set and uses OLD behavior. Use the
3708 cmake_policy() command to set it to OLD or NEW explicitly.
3709
3710 NOTE:
3711 The OLD behavior of a policy is deprecated by definition and may be
3712 removed in a future version of CMake.
3713
3714 CMP0048
3715 The project() command manages VERSION variables.
3716
3717 CMake version 3.0 introduced the VERSION option of the project() com‐
3718 mand to specify a project version as well as the name. In order to
3719 keep PROJECT_VERSION and related variables consistent with variable
3720 PROJECT_NAME it is necessary to set the VERSION variables to the empty
3721 string when no VERSION is given to project(). However, this can change
3722 behavior for existing projects that set VERSION variables themselves
3723 since project() may now clear them. This policy controls the behavior
3724 for compatibility with such projects.
3725
3726 The OLD behavior for this policy is to leave VERSION variables un‐
3727 touched. The NEW behavior for this policy is to set VERSION as docu‐
3728 mented by the project() command.
3729
3730 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3731 warns when the policy is not set and uses OLD behavior. Use the
3732 cmake_policy() command to set it to OLD or NEW explicitly.
3733
3734 NOTE:
3735 The OLD behavior of a policy is deprecated by definition and may be
3736 removed in a future version of CMake.
3737
3738 CMP0047
3739 Use QCC compiler id for the qcc drivers on QNX.
3740
3741 CMake 3.0 and above recognize that the QNX qcc compiler driver is dif‐
3742 ferent from the GNU compiler. CMake now prefers to present this to
3743 projects by setting the CMAKE_<LANG>_COMPILER_ID variable to QCC in‐
3744 stead of GNU. However, existing projects may assume the compiler id
3745 for QNX qcc is just GNU as it was in CMake versions prior to 3.0.
3746 Therefore this policy determines for QNX qcc which compiler id to re‐
3747 port in the CMAKE_<LANG>_COMPILER_ID variable after language <LANG> is
3748 enabled by the project() or enable_language() command. The policy must
3749 be set prior to the invocation of either command.
3750
3751 The OLD behavior for this policy is to use the GNU compiler id for the
3752 qcc and QCC compiler drivers. The NEW behavior for this policy is to
3753 use the QCC compiler id for those drivers.
3754
3755 This policy was introduced in CMake version 3.0. Use the
3756 cmake_policy() command to set this policy to OLD or NEW explicitly.
3757 Unlike most policies, CMake version 3.27.7 does not warn by default
3758 when this policy is not set and simply uses OLD behavior. See documen‐
3759 tation of the CMAKE_POLICY_WARNING_CMP0047 variable to control the
3760 warning.
3761
3762 NOTE:
3763 The OLD behavior of a policy is deprecated by definition and may be
3764 removed in a future version of CMake.
3765
3766 CMP0046
3767 Error on non-existent dependency in add_dependencies.
3768
3769 CMake 2.8.12 and lower silently ignored non-existent dependencies
3770 listed in the add_dependencies() command.
3771
3772 The OLD behavior for this policy is to silently ignore non-existent de‐
3773 pendencies. The NEW behavior for this policy is to report an error if
3774 non-existent dependencies are listed in the add_dependencies() command.
3775
3776 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3777 warns when the policy is not set and uses OLD behavior. Use the
3778 cmake_policy() command to set it to OLD or NEW explicitly.
3779
3780 NOTE:
3781 The OLD behavior of a policy is deprecated by definition and may be
3782 removed in a future version of CMake.
3783
3784 CMP0045
3785 Error on non-existent target in get_target_property.
3786
3787 In CMake 2.8.12 and lower, the get_target_property() command accepted a
3788 non-existent target argument without issuing any error or warning. The
3789 result variable is set to a -NOTFOUND value.
3790
3791 The OLD behavior for this policy is to issue no warning and set the re‐
3792 sult variable to a -NOTFOUND value. The NEW behavior for this policy
3793 is to issue a FATAL_ERROR if the command is called with a non-existent
3794 target.
3795
3796 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3797 warns when the policy is not set and uses OLD behavior. Use the
3798 cmake_policy() command to set it to OLD or NEW explicitly.
3799
3800 NOTE:
3801 The OLD behavior of a policy is deprecated by definition and may be
3802 removed in a future version of CMake.
3803
3804 CMP0044
3805 Case sensitive <LANG>_COMPILER_ID generator expressions
3806
3807 CMake 2.8.12 introduced the <LANG>_COMPILER_ID generator expressions to
3808 allow comparison of the CMAKE_<LANG>_COMPILER_ID with a test value.
3809 The possible valid values are lowercase, but the comparison with the
3810 test value was performed case-insensitively.
3811
3812 The OLD behavior for this policy is to perform a case-insensitive com‐
3813 parison with the value in the <LANG>_COMPILER_ID expression. The NEW
3814 behavior for this policy is to perform a case-sensitive comparison with
3815 the value in the <LANG>_COMPILER_ID expression.
3816
3817 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3818 warns when the policy is not set and uses OLD behavior. Use the
3819 cmake_policy() command to set it to OLD or NEW explicitly.
3820
3821 NOTE:
3822 The OLD behavior of a policy is deprecated by definition and may be
3823 removed in a future version of CMake.
3824
3825 CMP0043
3826 Ignore COMPILE_DEFINITIONS_<Config> properties
3827
3828 CMake 2.8.12 and lower allowed setting the COMPILE_DEFINITIONS_<CONFIG>
3829 target property and COMPILE_DEFINITIONS_<CONFIG> directory property to
3830 apply configuration-specific compile definitions.
3831
3832 Since CMake 2.8.10, the COMPILE_DEFINITIONS property has supported
3833 generator expressions for setting configuration-dependent content. The
3834 continued existence of the suffixed variables is redundant, and causes
3835 a maintenance burden. Population of the COMPILE_DEFINITIONS_DEBUG
3836 property may be replaced with a population of COMPILE_DEFINITIONS di‐
3837 rectly or via target_compile_definitions():
3838
3839 # Old Interfaces:
3840 set_property(TARGET tgt APPEND PROPERTY
3841 COMPILE_DEFINITIONS_DEBUG DEBUG_MODE
3842 )
3843 set_property(DIRECTORY APPEND PROPERTY
3844 COMPILE_DEFINITIONS_DEBUG DIR_DEBUG_MODE
3845 )
3846
3847 # New Interfaces:
3848 set_property(TARGET tgt APPEND PROPERTY
3849 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG_MODE>
3850 )
3851 target_compile_definitions(tgt PRIVATE $<$<CONFIG:Debug>:DEBUG_MODE>)
3852 set_property(DIRECTORY APPEND PROPERTY
3853 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DIR_DEBUG_MODE>
3854 )
3855
3856 The OLD behavior for this policy is to consume the content of the suf‐
3857 fixed COMPILE_DEFINITIONS_<CONFIG> target property when generating the
3858 compilation command. The NEW behavior for this policy is to ignore the
3859 content of the COMPILE_DEFINITIONS_<CONFIG> target property .
3860
3861 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3862 warns when the policy is not set and uses OLD behavior. Use the
3863 cmake_policy() command to set it to OLD or NEW explicitly.
3864
3865 NOTE:
3866 The OLD behavior of a policy is deprecated by definition and may be
3867 removed in a future version of CMake.
3868
3869 CMP0042
3870 MACOSX_RPATH is enabled by default.
3871
3872 CMake 2.8.12 and newer has support for using @rpath in a target's in‐
3873 stall name. This was enabled by setting the target property
3874 MACOSX_RPATH. The @rpath in an install name is a more flexible and
3875 powerful mechanism than @executable_path or @loader_path for locating
3876 shared libraries.
3877
3878 CMake 3.0 and later prefer this property to be ON by default. Projects
3879 wanting @rpath in a target's install name may remove any setting of the
3880 INSTALL_NAME_DIR and CMAKE_INSTALL_NAME_DIR variables.
3881
3882 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3883 warns when the policy is not set and uses OLD behavior. Use the
3884 cmake_policy() command to set it to OLD or NEW explicitly.
3885
3886 NOTE:
3887 The OLD behavior of a policy is deprecated by definition and may be
3888 removed in a future version of CMake.
3889
3890 CMP0041
3891 Error on relative include with generator expression.
3892
3893 Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
3894 INTERFACE_INCLUDE_DIRECTORIES of a target if it contained a generator
3895 expression at any position.
3896
3897 The path entries in that target property should not be relative.
3898 High-level API should ensure that by adding either a source directory
3899 or a install directory prefix, as appropriate.
3900
3901 As an additional diagnostic, the INTERFACE_INCLUDE_DIRECTORIES gener‐
3902 ated on an IMPORTED target for the install location should not contain
3903 paths in the source directory or the build directory.
3904
3905 The OLD behavior for this policy is to ignore relative path entries if
3906 they contain a generator expression. The NEW behavior for this policy
3907 is to report an error if a generator expression appears in another lo‐
3908 cation and the path is relative.
3909
3910 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3911 warns when the policy is not set and uses OLD behavior. Use the
3912 cmake_policy() command to set it to OLD or NEW explicitly.
3913
3914 NOTE:
3915 The OLD behavior of a policy is deprecated by definition and may be
3916 removed in a future version of CMake.
3917
3918 CMP0040
3919 The target in the TARGET signature of add_custom_command() must exist
3920 and must be defined in the current directory.
3921
3922 CMake 2.8.12 and lower silently ignored a custom command created with
3923 the TARGET signature of add_custom_command() if the target is unknown
3924 or was defined outside the current directory.
3925
3926 The OLD behavior for this policy is to ignore custom commands for un‐
3927 known targets. The NEW behavior for this policy is to report an error
3928 if the target referenced in add_custom_command() is unknown or was de‐
3929 fined outside the current directory.
3930
3931 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3932 warns when the policy is not set and uses OLD behavior. Use the
3933 cmake_policy() command to set it to OLD or NEW explicitly.
3934
3935 NOTE:
3936 The OLD behavior of a policy is deprecated by definition and may be
3937 removed in a future version of CMake.
3938
3939 CMP0039
3940 Utility targets may not have link dependencies.
3941
3942 CMake 2.8.12 and lower allowed using utility targets in the left hand
3943 side position of the target_link_libraries() command. This is an indi‐
3944 cator of a bug in user code.
3945
3946 The OLD behavior for this policy is to ignore attempts to set the link
3947 libraries of utility targets. The NEW behavior for this policy is to
3948 report an error if an attempt is made to set the link libraries of a
3949 utility target.
3950
3951 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3952 warns when the policy is not set and uses OLD behavior. Use the
3953 cmake_policy() command to set it to OLD or NEW explicitly.
3954
3955 NOTE:
3956 The OLD behavior of a policy is deprecated by definition and may be
3957 removed in a future version of CMake.
3958
3959 CMP0038
3960 Targets may not link directly to themselves.
3961
3962 CMake 2.8.12 and lower allowed a build target to link to itself di‐
3963 rectly with a target_link_libraries() call. This is an indicator of a
3964 bug in user code.
3965
3966 The OLD behavior for this policy is to ignore targets which list them‐
3967 selves in their own link implementation. The NEW behavior for this
3968 policy is to report an error if a target attempts to link to itself.
3969
3970 This policy was introduced in CMake version 3.0. CMake version 3.27.7
3971 warns when the policy is not set and uses OLD behavior. Use the
3972 cmake_policy() command to set it to OLD or NEW explicitly.
3973
3974 NOTE:
3975 The OLD behavior of a policy is deprecated by definition and may be
3976 removed in a future version of CMake.
3977
3978 CMP0037
3979 Target names should not be reserved and should match a validity pat‐
3980 tern.
3981
3982 CMake 2.8.12 and lower allowed creating targets using add_library(),
3983 add_executable() and add_custom_target() with unrestricted choice for
3984 the target name. Newer cmake features such as
3985 cmake-generator-expressions(7) and some diagnostics expect target names
3986 to match a restricted pattern.
3987
3988 Target names may contain upper and lower case letters, numbers, the un‐
3989 derscore character (_), dot(.), plus(+) and minus(-). As a special
3990 case, ALIAS and IMPORTED targets may contain two consecutive colons.
3991
3992 Target names reserved by one or more CMake generators are not allowed.
3993 Among others these include all, clean, help, and install.
3994
3995 Target names associated with optional features, such as test and pack‐
3996 age, may also be reserved. CMake 3.10 and below always reserve them.
3997 CMake 3.11 and above reserve them only when the corresponding feature
3998 is enabled (e.g. by including the CTest or CPack modules).
3999
4000 The OLD behavior for this policy is to allow creating targets with re‐
4001 served names or which do not match the validity pattern. The NEW be‐
4002 havior for this policy is to report an error if an add_* command is
4003 used with an invalid target name.
4004
4005 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4006 warns when the policy is not set and uses OLD behavior. Use the
4007 cmake_policy() command to set it to OLD or NEW explicitly.
4008
4009 NOTE:
4010 The OLD behavior of a policy is deprecated by definition and may be
4011 removed in a future version of CMake.
4012
4013 CMP0036
4014 The build_name() command should not be called.
4015
4016 This command was added in May 2001 to compute a name for the current
4017 operating system and compiler combination. The command has long been
4018 documented as discouraged and replaced by the CMAKE_SYSTEM and
4019 CMAKE_<LANG>_COMPILER variables.
4020
4021 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4022 ior for this policy is to allow the command to be called. The NEW be‐
4023 havior for this policy is to issue a FATAL_ERROR when the command is
4024 called.
4025
4026 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4027 warns when the policy is not set and uses OLD behavior. Use the
4028 cmake_policy() command to set it to OLD or NEW explicitly.
4029
4030 NOTE:
4031 The OLD behavior of a policy is deprecated by definition and may be
4032 removed in a future version of CMake.
4033
4034 CMP0035
4035 The variable_requires() command should not be called.
4036
4037 This command was introduced in November 2001 to perform some condi‐
4038 tional logic. It has long been replaced by the if() command.
4039
4040 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4041 ior for this policy is to allow the command to be called. The NEW be‐
4042 havior for this policy is to issue a FATAL_ERROR when the command is
4043 called.
4044
4045 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4046 warns when the policy is not set and uses OLD behavior. Use the
4047 cmake_policy() command to set it to OLD or NEW explicitly.
4048
4049 NOTE:
4050 The OLD behavior of a policy is deprecated by definition and may be
4051 removed in a future version of CMake.
4052
4053 CMP0034
4054 The utility_source() command should not be called.
4055
4056 This command was introduced in March 2001 to help build executables
4057 used to generate other files. This approach has long been replaced by
4058 add_executable() combined with add_custom_command().
4059
4060 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4061 ior for this policy is to allow the command to be called. The NEW be‐
4062 havior for this policy is to issue a FATAL_ERROR when the command is
4063 called.
4064
4065 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4066 warns when the policy is not set and uses OLD behavior. Use the
4067 cmake_policy() command to set it to OLD or NEW explicitly.
4068
4069 NOTE:
4070 The OLD behavior of a policy is deprecated by definition and may be
4071 removed in a future version of CMake.
4072
4073 CMP0033
4074 The export_library_dependencies() command should not be called.
4075
4076 This command was added in January 2003 to export <tgt>_LIB_DEPENDS in‐
4077 ternal CMake cache entries to a file for installation with a project.
4078 This was used at the time to allow transitive link dependencies to work
4079 for applications outside of the original build tree of a project. The
4080 functionality has been superseded by the export() and install(EXPORT)
4081 commands.
4082
4083 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4084 ior for this policy is to allow the command to be called. The NEW be‐
4085 havior for this policy is to issue a FATAL_ERROR when the command is
4086 called.
4087
4088 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4089 warns when the policy is not set and uses OLD behavior. Use the
4090 cmake_policy() command to set it to OLD or NEW explicitly.
4091
4092 NOTE:
4093 The OLD behavior of a policy is deprecated by definition and may be
4094 removed in a future version of CMake.
4095
4096 CMP0032
4097 The output_required_files() command should not be called.
4098
4099 This command was added in June 2001 to expose the then-current CMake
4100 implicit dependency scanner. CMake's real implicit dependency scanner
4101 has evolved since then but is not exposed through this command. The
4102 scanning capabilities of this command are very limited and this func‐
4103 tionality is better achieved through dedicated outside tools.
4104
4105 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4106 ior for this policy is to allow the command to be called. The NEW be‐
4107 havior for this policy is to issue a FATAL_ERROR when the command is
4108 called.
4109
4110 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4111 warns when the policy is not set and uses OLD behavior. Use the
4112 cmake_policy() command to set it to OLD or NEW explicitly.
4113
4114 NOTE:
4115 The OLD behavior of a policy is deprecated by definition and may be
4116 removed in a future version of CMake.
4117
4118 CMP0031
4119 The load_command() command should not be called.
4120
4121 This command was added in August 2002 to allow projects to add arbi‐
4122 trary commands implemented in C or C++. However, it does not work when
4123 the toolchain in use does not match the ABI of the CMake process. It
4124 has been mostly superseded by the macro() and function() commands.
4125
4126 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4127 ior for this policy is to allow the command to be called. The NEW be‐
4128 havior for this policy is to issue a FATAL_ERROR when the command is
4129 called.
4130
4131 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4132 warns when the policy is not set and uses OLD behavior. Use the
4133 cmake_policy() command to set it to OLD or NEW explicitly.
4134
4135 NOTE:
4136 The OLD behavior of a policy is deprecated by definition and may be
4137 removed in a future version of CMake.
4138
4139 CMP0030
4140 The use_mangled_mesa() command should not be called.
4141
4142 This command was created in September 2001 to support VTK before modern
4143 CMake language and custom command capabilities. VTK has not used it in
4144 years.
4145
4146 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4147 ior for this policy is to allow the command to be called. The NEW be‐
4148 havior for this policy is to issue a FATAL_ERROR when the command is
4149 called.
4150
4151 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4152 warns when the policy is not set and uses OLD behavior. Use the
4153 cmake_policy() command to set it to OLD or NEW explicitly.
4154
4155 NOTE:
4156 The OLD behavior of a policy is deprecated by definition and may be
4157 removed in a future version of CMake.
4158
4159 CMP0029
4160 The subdir_depends() command should not be called.
4161
4162 The implementation of this command has been empty since December 2001
4163 but was kept in CMake for compatibility for a long time.
4164
4165 CMake >= 3.0 prefer that this command never be called. The OLD behav‐
4166 ior for this policy is to allow the command to be called. The NEW be‐
4167 havior for this policy is to issue a FATAL_ERROR when the command is
4168 called.
4169
4170 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4171 warns when the policy is not set and uses OLD behavior. Use the
4172 cmake_policy() command to set it to OLD or NEW explicitly.
4173
4174 NOTE:
4175 The OLD behavior of a policy is deprecated by definition and may be
4176 removed in a future version of CMake.
4177
4178 CMP0028
4179 Double colon in target name means ALIAS or IMPORTED target.
4180
4181 CMake 2.8.12 and lower allowed the use of targets and files with double
4182 colons in target_link_libraries(), with some buildsystem generators.
4183
4184 The use of double-colons is a common pattern used to namespace IMPORTED
4185 targets and ALIAS targets. When computing the link dependencies of a
4186 target, the name of each dependency could either be a target, or a file
4187 on disk. Previously, if a target was not found with a matching name,
4188 the name was considered to refer to a file on disk. This can lead to
4189 confusing error messages if there is a typo in what should be a target
4190 name.
4191
4192 See also the LINK_LIBRARIES_ONLY_TARGETS target property.
4193
4194 The OLD behavior for this policy is to search for targets, then files
4195 on disk, even if the search term contains double-colons. The NEW be‐
4196 havior for this policy is to issue a FATAL_ERROR if a link dependency
4197 contains double-colons but is not an IMPORTED target or an ALIAS tar‐
4198 get.
4199
4200 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4201 warns when the policy is not set and uses OLD behavior. Use the
4202 cmake_policy() command to set it to OLD or NEW explicitly.
4203
4204 NOTE:
4205 The OLD behavior of a policy is deprecated by definition and may be
4206 removed in a future version of CMake.
4207
4208 CMP0027
4209 Conditionally linked imported targets with missing include directories.
4210
4211 CMake 2.8.11 introduced introduced the concept of
4212 INTERFACE_INCLUDE_DIRECTORIES, and a check at cmake time that the en‐
4213 tries in the INTERFACE_INCLUDE_DIRECTORIES of an IMPORTED target actu‐
4214 ally exist. CMake 2.8.11 also introduced generator expression support
4215 in the target_link_libraries() command. However, if an imported target
4216 is linked as a result of a generator expression evaluation, the entries
4217 in the INTERFACE_INCLUDE_DIRECTORIES of that target were not checked
4218 for existence as they should be.
4219
4220 The OLD behavior of this policy is to report a warning if an entry in
4221 the INTERFACE_INCLUDE_DIRECTORIES of a generator-expression condition‐
4222 ally linked IMPORTED target does not exist.
4223
4224 The NEW behavior of this policy is to report an error if an entry in
4225 the INTERFACE_INCLUDE_DIRECTORIES of a generator-expression condition‐
4226 ally linked IMPORTED target does not exist.
4227
4228 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4229 warns when the policy is not set and uses OLD behavior. Use the
4230 cmake_policy() command to set it to OLD or NEW explicitly.
4231
4232 NOTE:
4233 The OLD behavior of a policy is deprecated by definition and may be
4234 removed in a future version of CMake.
4235
4236 CMP0026
4237 Disallow use of the LOCATION property for build targets.
4238
4239 CMake 2.8.12 and lower allowed reading the LOCATION target property
4240 (and configuration-specific variants) to determine the eventual loca‐
4241 tion of build targets. This relies on the assumption that all neces‐
4242 sary information is available at configure-time to determine the final
4243 location and filename of the target. However, this property is not
4244 fully determined until later at generate-time. At generate time, the
4245 $<TARGET_FILE> generator expression can be used to determine the even‐
4246 tual LOCATION of a target output.
4247
4248 Code which reads the LOCATION target property can be ported to use the
4249 $<TARGET_FILE> generator expression together with the file(GENERATE)
4250 subcommand to generate a file containing the target location.
4251
4252 The OLD behavior for this policy is to allow reading the LOCATION prop‐
4253 erties from build-targets. The NEW behavior for this policy is to not
4254 to allow reading the LOCATION properties from build-targets.
4255
4256 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4257 warns when the policy is not set and uses OLD behavior. Use the
4258 cmake_policy() command to set it to OLD or NEW explicitly.
4259
4260 NOTE:
4261 The OLD behavior of a policy is deprecated by definition and may be
4262 removed in a future version of CMake.
4263
4264 CMP0025
4265 Compiler id for Apple Clang is now AppleClang.
4266
4267 CMake 3.0 and above recognize that Apple Clang is a different compiler
4268 than upstream Clang and that they have different version numbers.
4269 CMake now prefers to present this to projects by setting the
4270 CMAKE_<LANG>_COMPILER_ID variable to AppleClang instead of Clang. How‐
4271 ever, existing projects may assume the compiler id for Apple Clang is
4272 just Clang as it was in CMake versions prior to 3.0. Therefore this
4273 policy determines for Apple Clang which compiler id to report in the
4274 CMAKE_<LANG>_COMPILER_ID variable after language <LANG> is enabled by
4275 the project() or enable_language() command. The policy must be set
4276 prior to the invocation of either command.
4277
4278 The OLD behavior for this policy is to use compiler id Clang. The NEW
4279 behavior for this policy is to use compiler id AppleClang.
4280
4281 This policy was introduced in CMake version 3.0. Use the
4282 cmake_policy() command to set this policy to OLD or NEW explicitly.
4283 Unlike most policies, CMake version 3.27.7 does not warn by default
4284 when this policy is not set and simply uses OLD behavior. See documen‐
4285 tation of the CMAKE_POLICY_WARNING_CMP0025 variable to control the
4286 warning.
4287
4288 NOTE:
4289 The OLD behavior of a policy is deprecated by definition and may be
4290 removed in a future version of CMake.
4291
4292 CMP0024
4293 Disallow include export result.
4294
4295 CMake 2.8.12 and lower allowed use of the include() command with the
4296 result of the export() command. This relies on the assumption that the
4297 export() command has an immediate effect at configure-time during a
4298 cmake run. Certain properties of targets are not fully determined un‐
4299 til later at generate-time, such as the link language and complete list
4300 of link libraries. Future refactoring will change the effect of the
4301 export() command to be executed at generate-time. Use ALIAS targets
4302 instead in cases where the goal is to refer to targets by another name.
4303
4304 The OLD behavior for this policy is to allow including the result of an
4305 export() command. The NEW behavior for this policy is not to allow in‐
4306 cluding the result of an export() command.
4307
4308 This policy was introduced in CMake version 3.0. CMake version 3.27.7
4309 warns when the policy is not set and uses OLD behavior. Use the
4310 cmake_policy() command to set it to OLD or NEW explicitly.
4311
4312 NOTE:
4313 The OLD behavior of a policy is deprecated by definition and may be
4314 removed in a future version of CMake.
4315
4317 CMP0023
4318 Plain and keyword target_link_libraries() signatures cannot be mixed.
4319
4320 CMake 2.8.12 introduced the target_link_libraries() signature using the
4321 PUBLIC, PRIVATE, and INTERFACE keywords to generalize the LINK_PUBLIC
4322 and LINK_PRIVATE keywords introduced in CMake 2.8.7. Use of signatures
4323 with any of these keywords sets the link interface of a target explic‐
4324 itly, even if empty. This produces confusing behavior when used in
4325 combination with the historical behavior of the plain
4326 target_link_libraries() signature. For example, consider the code:
4327
4328 target_link_libraries(mylib A)
4329 target_link_libraries(mylib PRIVATE B)
4330
4331 After the first line the link interface has not been set explicitly so
4332 CMake would use the link implementation, A, as the link interface.
4333 However, the second line sets the link interface to empty. In order to
4334 avoid this subtle behavior CMake now prefers to disallow mixing the
4335 plain and keyword signatures of target_link_libraries() for a single
4336 target.
4337
4338 The OLD behavior for this policy is to allow keyword and plain
4339 target_link_libraries() signatures to be mixed. The NEW behavior for
4340 this policy is to not to allow mixing of the keyword and plain signa‐
4341 tures.
4342
4343 This policy was introduced in CMake version 2.8.12. CMake version
4344 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4345 cmake_policy() command to set it to OLD or NEW explicitly.
4346
4347 NOTE:
4348 The OLD behavior of a policy is deprecated by definition and may be
4349 removed in a future version of CMake.
4350
4351 CMP0022
4352 INTERFACE_LINK_LIBRARIES defines the link interface.
4353
4354 CMake 2.8.11 constructed the 'link interface' of a target from proper‐
4355 ties matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?. The
4356 modern way to specify config-sensitive content is to use generator ex‐
4357 pressions and the IMPORTED_ prefix makes uniform processing of the link
4358 interface with generator expressions impossible. The
4359 INTERFACE_LINK_LIBRARIES target property was introduced as a replace‐
4360 ment in CMake 2.8.12. This new property is named consistently with the
4361 INTERFACE_COMPILE_DEFINITIONS, INTERFACE_INCLUDE_DIRECTORIES and INTER‐
4362 FACE_COMPILE_OPTIONS properties. For in-build targets, CMake will use
4363 the INTERFACE_LINK_LIBRARIES property as the source of the link inter‐
4364 face only if policy CMP0022 is NEW. When exporting a target which has
4365 this policy set to NEW, only the INTERFACE_LINK_LIBRARIES property will
4366 be processed and generated for the IMPORTED target by default. A new
4367 option to the install(EXPORT) and export commands allows export of the
4368 old-style properties for compatibility with downstream users of CMake
4369 versions older than 2.8.12. The target_link_libraries() command will
4370 no longer populate the properties matching LINK_INTERFACE_LI‐
4371 BRARIES(_<CONFIG>)? if this policy is NEW.
4372
4373 Warning-free future-compatible code which works with CMake 2.8.7 on‐
4374 wards can be written by using the LINK_PRIVATE and LINK_PUBLIC keywords
4375 of target_link_libraries().
4376
4377 The OLD behavior for this policy is to ignore the
4378 INTERFACE_LINK_LIBRARIES property for in-build targets. The NEW behav‐
4379 ior for this policy is to use the INTERFACE_LINK_LIBRARIES property for
4380 in-build targets, and ignore the old properties matching (IM‐
4381 PORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?.
4382
4383 This policy was introduced in CMake version 2.8.12. CMake version
4384 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4385 cmake_policy() command to set it to OLD or NEW explicitly.
4386
4387 NOTE:
4388 The OLD behavior of a policy is deprecated by definition and may be
4389 removed in a future version of CMake.
4390
4391 CMP0021
4392 Fatal error on relative paths in INCLUDE_DIRECTORIES target property.
4393
4394 CMake 2.8.10.2 and lower allowed the INCLUDE_DIRECTORIES target prop‐
4395 erty to contain relative paths. The base path for such relative en‐
4396 tries is not well defined. CMake 2.8.12 issues a FATAL_ERROR if the
4397 INCLUDE_DIRECTORIES property contains a relative path.
4398
4399 The OLD behavior for this policy is not to warn about relative paths in
4400 the INCLUDE_DIRECTORIES target property. The NEW behavior for this
4401 policy is to issue a FATAL_ERROR if INCLUDE_DIRECTORIES contains a rel‐
4402 ative path.
4403
4404 This policy was introduced in CMake version 2.8.12. CMake version
4405 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4406 cmake_policy() command to set it to OLD or NEW explicitly.
4407
4408 NOTE:
4409 The OLD behavior of a policy is deprecated by definition and may be
4410 removed in a future version of CMake.
4411
4412 CMP0020
4413 Automatically link Qt executables to qtmain target on Windows.
4414
4415 CMake 2.8.10 and lower required users of Qt to always specify a link
4416 dependency to the qtmain.lib static library manually on Windows. CMake
4417 2.8.11 gained the ability to evaluate generator expressions while de‐
4418 termining the link dependencies from IMPORTED targets. This allows
4419 CMake itself to automatically link executables which link to Qt to the
4420 qtmain.lib library when using IMPORTED Qt targets. For applications
4421 already linking to qtmain.lib, this should have little impact. For ap‐
4422 plications which supply their own alternative WinMain implementation
4423 and for applications which use the QAxServer library, this automatic
4424 linking will need to be disabled as per the documentation.
4425
4426 The OLD behavior for this policy is not to link executables to qt‐
4427 main.lib automatically when they link to the QtCore IMPORTED target.
4428 The NEW behavior for this policy is to link executables to qtmain.lib
4429 automatically when they link to QtCore IMPORTED target.
4430
4431 This policy was introduced in CMake version 2.8.11. CMake version
4432 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4433 cmake_policy() command to set it to OLD or NEW explicitly.
4434
4435 NOTE:
4436 The OLD behavior of a policy is deprecated by definition and may be
4437 removed in a future version of CMake.
4438
4439 CMP0019
4440 Do not re-expand variables in include and link information.
4441
4442 CMake 2.8.10 and lower re-evaluated values given to the include_direc‐
4443 tories, link_directories, and link_libraries commands to expand any
4444 leftover variable references at the end of the configuration step.
4445 This was for strict compatibility with VERY early CMake versions be‐
4446 cause all variable references are now normally evaluated during CMake
4447 language processing. CMake 2.8.11 and higher prefer to skip the extra
4448 evaluation.
4449
4450 The OLD behavior for this policy is to re-evaluate the values for
4451 strict compatibility. The NEW behavior for this policy is to leave the
4452 values untouched.
4453
4454 This policy was introduced in CMake version 2.8.11. CMake version
4455 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4456 cmake_policy() command to set it to OLD or NEW explicitly.
4457
4458 NOTE:
4459 The OLD behavior of a policy is deprecated by definition and may be
4460 removed in a future version of CMake.
4461
4462 CMP0018
4463 Ignore CMAKE_SHARED_LIBRARY_<Lang>_FLAGS variable.
4464
4465 CMake 2.8.8 and lower compiled sources in SHARED and MODULE libraries
4466 using the value of the undocumented CMAKE_SHARED_LIBRARY_<Lang>_FLAGS
4467 platform variable. The variable contained platform-specific flags
4468 needed to compile objects for shared libraries. Typically it included
4469 a flag such as -fPIC for position independent code but also included
4470 other flags needed on certain platforms. CMake 2.8.9 and higher prefer
4471 instead to use the POSITION_INDEPENDENT_CODE target property to deter‐
4472 mine what targets should be position independent, and new undocumented
4473 platform variables to select flags while ignoring CMAKE_SHARED_LI‐
4474 BRARY_<Lang>_FLAGS completely.
4475
4476 The default for either approach produces identical compilation flags,
4477 but if a project modifies CMAKE_SHARED_LIBRARY_<Lang>_FLAGS from its
4478 original value this policy determines which approach to use.
4479
4480 The OLD behavior for this policy is to ignore the
4481 POSITION_INDEPENDENT_CODE property for all targets and use the modified
4482 value of CMAKE_SHARED_LIBRARY_<Lang>_FLAGS for SHARED and MODULE li‐
4483 braries.
4484
4485 The NEW behavior for this policy is to ignore CMAKE_SHARED_LI‐
4486 BRARY_<Lang>_FLAGS whether it is modified or not and honor the
4487 POSITION_INDEPENDENT_CODE target property.
4488
4489 This policy was introduced in CMake version 2.8.9. CMake version
4490 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4491 cmake_policy() command to set it to OLD or NEW explicitly.
4492
4493 NOTE:
4494 The OLD behavior of a policy is deprecated by definition and may be
4495 removed in a future version of CMake.
4496
4497 CMP0017
4498 Prefer files from the CMake module directory when including from there.
4499
4500 Starting with CMake 2.8.4, if a cmake-module shipped with CMake (i.e.
4501 located in the CMake module directory) calls include() or
4502 find_package(), the files located in the CMake module directory are
4503 preferred over the files in CMAKE_MODULE_PATH. This makes sure that
4504 the modules belonging to CMake always get those files included which
4505 they expect, and against which they were developed and tested. In all
4506 other cases, the files found in CMAKE_MODULE_PATH still take precedence
4507 over the ones in the CMake module directory. The OLD behavior is to
4508 always prefer files from CMAKE_MODULE_PATH over files from the CMake
4509 modules directory.
4510
4511 This policy was introduced in CMake version 2.8.4. CMake version
4512 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4513 cmake_policy() command to set it to OLD or NEW explicitly.
4514
4515 NOTE:
4516 The OLD behavior of a policy is deprecated by definition and may be
4517 removed in a future version of CMake.
4518
4519 CMP0016
4520 target_link_libraries() reports error if its only argument is not a
4521 target.
4522
4523 In CMake 2.8.2 and lower the target_link_libraries() command silently
4524 ignored if it was called with only one argument, and this argument
4525 wasn't a valid target. In CMake 2.8.3 and above it reports an error in
4526 this case.
4527
4528 This policy was introduced in CMake version 2.8.3. CMake version
4529 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4530 cmake_policy() command to set it to OLD or NEW explicitly.
4531
4532 NOTE:
4533 The OLD behavior of a policy is deprecated by definition and may be
4534 removed in a future version of CMake.
4535
4536 CMP0015
4537 link_directories() treats paths relative to the source dir.
4538
4539 In CMake 2.8.0 and lower the link_directories() command passed relative
4540 paths unchanged to the linker. In CMake 2.8.1 and above the
4541 link_directories() command prefers to interpret relative paths with re‐
4542 spect to CMAKE_CURRENT_SOURCE_DIR, which is consistent with
4543 include_directories() and other commands. The OLD behavior for this
4544 policy is to use relative paths verbatim in the linker command. The
4545 NEW behavior for this policy is to convert relative paths to absolute
4546 paths by appending the relative path to CMAKE_CURRENT_SOURCE_DIR.
4547
4548 This policy was introduced in CMake version 2.8.1. CMake version
4549 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4550 cmake_policy() command to set it to OLD or NEW explicitly.
4551
4552 NOTE:
4553 The OLD behavior of a policy is deprecated by definition and may be
4554 removed in a future version of CMake.
4555
4556 CMP0014
4557 Input directories must have CMakeLists.txt.
4558
4559 CMake versions before 2.8 silently ignored missing CMakeLists.txt files
4560 in directories referenced by add_subdirectory() or subdirs(), treating
4561 them as if present but empty. In CMake 2.8.0 and above this
4562 cmake_policy() determines whether or not the case is an error. The OLD
4563 behavior for this policy is to silently ignore the problem. The NEW
4564 behavior for this policy is to report an error.
4565
4566 This policy was introduced in CMake version 2.8.0. CMake version
4567 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4568 cmake_policy() command to set it to OLD or NEW explicitly.
4569
4570 NOTE:
4571 The OLD behavior of a policy is deprecated by definition and may be
4572 removed in a future version of CMake.
4573
4574 CMP0013
4575 Duplicate binary directories are not allowed.
4576
4577 CMake 2.6.3 and below silently permitted add_subdirectory() calls to
4578 create the same binary directory multiple times. During build system
4579 generation files would be written and then overwritten in the build
4580 tree and could lead to strange behavior. CMake 2.6.4 and above explic‐
4581 itly detect duplicate binary directories. CMake 2.6.4 always considers
4582 this case an error. In CMake 2.8.0 and above this policy determines
4583 whether or not the case is an error. The OLD behavior for this policy
4584 is to allow duplicate binary directories. The NEW behavior for this
4585 policy is to disallow duplicate binary directories with an error.
4586
4587 This policy was introduced in CMake version 2.8.0. CMake version
4588 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4589 cmake_policy() command to set it to OLD or NEW explicitly.
4590
4591 NOTE:
4592 The OLD behavior of a policy is deprecated by definition and may be
4593 removed in a future version of CMake.
4594
4595 CMP0012
4596 if() recognizes numbers and boolean constants.
4597
4598 In CMake versions 2.6.4 and lower the if() command implicitly derefer‐
4599 enced arguments corresponding to variables, even those named like num‐
4600 bers or boolean constants, except for 0 and 1. Numbers and boolean
4601 constants such as true, false, yes, no, on, off, y, n, notfound, ignore
4602 (all case insensitive) were recognized in some cases but not all. For
4603 example, the code if(TRUE) might have evaluated as false. Numbers such
4604 as 2 were recognized only in boolean expressions like if(NOT 2) (lead‐
4605 ing to false) but not as a single-argument like if(2) (also leading to
4606 false). Later versions of CMake prefer to treat numbers and boolean
4607 constants literally, so they should not be used as variable names.
4608
4609 The OLD behavior for this policy is to implicitly dereference variables
4610 named like numbers and boolean constants. The NEW behavior for this
4611 policy is to recognize numbers and boolean constants without derefer‐
4612 encing variables with such names.
4613
4614 This policy was introduced in CMake version 2.8.0. CMake version
4615 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4616 cmake_policy() command to set it to OLD or NEW explicitly.
4617
4618 NOTE:
4619 The OLD behavior of a policy is deprecated by definition and may be
4620 removed in a future version of CMake.
4621
4623 CMP0011
4624 Included scripts do automatic cmake_policy() PUSH and POP.
4625
4626 In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
4627 the include() and find_package() commands would affect the includer.
4628 Explicit invocations of cmake_policy(PUSH) and cmake_policy(POP) were
4629 required to isolate policy changes and protect the includer. While
4630 some scripts intend to affect the policies of their includer, most do
4631 not. In CMake 2.6.3 and above, include() and find_package() by default
4632 PUSH and POP an entry on the policy stack around an included script,
4633 but provide a NO_POLICY_SCOPE option to disable it. This policy deter‐
4634 mines whether or not to imply NO_POLICY_SCOPE for compatibility. The
4635 OLD behavior for this policy is to imply NO_POLICY_SCOPE for include()
4636 and find_package() commands. The NEW behavior for this policy is to
4637 allow the commands to do their default cmake_policy PUSH and POP.
4638
4639 This policy was introduced in CMake version 2.6.3. CMake version
4640 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4641 cmake_policy() command to set it to OLD or NEW explicitly.
4642
4643 NOTE:
4644 The OLD behavior of a policy is deprecated by definition and may be
4645 removed in a future version of CMake.
4646
4647 CMP0010
4648 Bad variable reference syntax is an error.
4649
4650 In CMake 2.6.2 and below, incorrect variable reference syntax such as a
4651 missing close-brace (${FOO) was reported but did not stop processing of
4652 CMake code. This policy determines whether a bad variable reference is
4653 an error. The OLD behavior for this policy is to warn about the error,
4654 leave the string untouched, and continue. The NEW behavior for this
4655 policy is to report an error.
4656
4657 If CMP0053 is set to NEW, this policy has no effect and is treated as
4658 always being NEW.
4659
4660 This policy was introduced in CMake version 2.6.3. CMake version
4661 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4662 cmake_policy() command to set it to OLD or NEW explicitly.
4663
4664 NOTE:
4665 The OLD behavior of a policy is deprecated by definition and may be
4666 removed in a future version of CMake.
4667
4668 CMP0009
4669 FILE GLOB_RECURSE calls should not follow symlinks by default.
4670
4671 In CMake 2.6.1 and below, file(GLOB_RECURSE) calls would follow through
4672 symlinks, sometimes coming up with unexpectedly large result sets be‐
4673 cause of symlinks to top level directories that contain hundreds of
4674 thousands of files.
4675
4676 This policy determines whether or not to follow symlinks encountered
4677 during a file(GLOB_RECURSE) call. The OLD behavior for this policy is
4678 to follow the symlinks. The NEW behavior for this policy is not to
4679 follow the symlinks by default, but only if FOLLOW_SYMLINKS is given as
4680 an additional argument to the FILE command.
4681
4682 This policy was introduced in CMake version 2.6.2. CMake version
4683 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4684 cmake_policy() command to set it to OLD or NEW explicitly.
4685
4686 NOTE:
4687 The OLD behavior of a policy is deprecated by definition and may be
4688 removed in a future version of CMake.
4689
4690 CMP0008
4691 Libraries linked by full-path must have a valid library file name.
4692
4693 In CMake 2.4 and below it is possible to write code like
4694
4695 target_link_libraries(myexe /full/path/to/somelib)
4696
4697 where somelib is supposed to be a valid library file name such as lib‐
4698 somelib.a or somelib.lib. For Makefile generators this produces an er‐
4699 ror at build time because the dependency on the full path cannot be
4700 found. For Visual Studio Generators IDE and Xcode generators this used
4701 to work by accident because CMake would always split off the library
4702 directory and ask the linker to search for the library by name
4703 (-lsomelib or somelib.lib). Despite the failure with Makefiles, some
4704 projects have code like this and build only with Visual Studio and/or
4705 Xcode. This version of CMake prefers to pass the full path directly to
4706 the native build tool, which will fail in this case because it does not
4707 name a valid library file.
4708
4709 This policy determines what to do with full paths that do not appear to
4710 name a valid library file. The OLD behavior for this policy is to
4711 split the library name from the path and ask the linker to search for
4712 it. The NEW behavior for this policy is to trust the given path and
4713 pass it directly to the native build tool unchanged.
4714
4715 This policy was introduced in CMake version 2.6.1. CMake version
4716 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4717 cmake_policy() command to set it to OLD or NEW explicitly.
4718
4719 NOTE:
4720 The OLD behavior of a policy is deprecated by definition and may be
4721 removed in a future version of CMake.
4722
4723 CMP0007
4724 list command no longer ignores empty elements.
4725
4726 This policy determines whether the list command will ignore empty ele‐
4727 ments in the list. CMake 2.4 and below list commands ignored all empty
4728 elements in the list. For example, a;b;;c would have length 3 and not
4729 4. The OLD behavior for this policy is to ignore empty list elements.
4730 The NEW behavior for this policy is to correctly count empty elements
4731 in a list.
4732
4733 This policy was introduced in CMake version 2.6.0. CMake version
4734 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4735 cmake_policy() command to set it to OLD or NEW explicitly.
4736
4737 NOTE:
4738 The OLD behavior of a policy is deprecated by definition and may be
4739 removed in a future version of CMake.
4740
4741 CMP0006
4742 Installing MACOSX_BUNDLE targets requires a BUNDLE DESTINATION.
4743
4744 This policy determines whether the install(TARGETS) command must be
4745 given a BUNDLE DESTINATION when asked to install a target with the
4746 MACOSX_BUNDLE property set. CMake 2.4 and below did not distinguish
4747 application bundles from normal executables when installing targets.
4748 CMake 2.6 provides a BUNDLE option to the install(TARGETS) command that
4749 specifies rules specific to application bundles on the Mac. Projects
4750 should use this option when installing a target with the MACOSX_BUNDLE
4751 property set.
4752
4753 The OLD behavior for this policy is to fall back to the RUNTIME DESTI‐
4754 NATION if a BUNDLE DESTINATION is not given. The NEW behavior for this
4755 policy is to produce an error if a bundle target is installed without a
4756 BUNDLE DESTINATION.
4757
4758 This policy was introduced in CMake version 2.6.0. CMake version
4759 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4760 cmake_policy() command to set it to OLD or NEW explicitly.
4761
4762 NOTE:
4763 The OLD behavior of a policy is deprecated by definition and may be
4764 removed in a future version of CMake.
4765
4766 CMP0005
4767 Preprocessor definition values are now escaped automatically.
4768
4769 This policy determines whether or not CMake should generate escaped
4770 preprocessor definition values added via add_definitions. CMake ver‐
4771 sions 2.4 and below assumed that only trivial values would be given for
4772 macros in add_definitions calls. It did not attempt to escape
4773 non-trivial values such as string literals in generated build rules.
4774 CMake versions 2.6 and above support escaping of most values, but can‐
4775 not assume the user has not added escapes already in an attempt to work
4776 around limitations in earlier versions.
4777
4778 The OLD behavior for this policy is to place definition values given to
4779 add_definitions directly in the generated build rules without attempt‐
4780 ing to escape anything. The NEW behavior for this policy is to gener‐
4781 ate correct escapes for all native build tools automatically. See doc‐
4782 umentation of the COMPILE_DEFINITIONS target property for limitations
4783 of the escaping implementation.
4784
4785 This policy was introduced in CMake version 2.6.0. CMake version
4786 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4787 cmake_policy() command to set it to OLD or NEW explicitly.
4788
4789 NOTE:
4790 The OLD behavior of a policy is deprecated by definition and may be
4791 removed in a future version of CMake.
4792
4793 CMP0004
4794 Libraries linked may not have leading or trailing whitespace.
4795
4796 CMake versions 2.4 and below silently removed leading and trailing
4797 whitespace from libraries linked with code like
4798
4799 target_link_libraries(myexe " A ")
4800
4801 This could lead to subtle errors in user projects.
4802
4803 The OLD behavior for this policy is to silently remove leading and
4804 trailing whitespace. The NEW behavior for this policy is to diagnose
4805 the existence of such whitespace as an error. The setting for this
4806 policy used when checking the library names is that in effect when the
4807 target is created by an add_executable() or add_library() command.
4808
4809 This policy was introduced in CMake version 2.6.0. CMake version
4810 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4811 cmake_policy() command to set it to OLD or NEW explicitly.
4812
4813 NOTE:
4814 The OLD behavior of a policy is deprecated by definition and may be
4815 removed in a future version of CMake.
4816
4817 CMP0003
4818 Libraries linked via full path no longer produce linker search paths.
4819
4820 This policy affects how libraries whose full paths are NOT known are
4821 found at link time, but was created due to a change in how CMake deals
4822 with libraries whose full paths are known. Consider the code
4823
4824 target_link_libraries(myexe /path/to/libA.so)
4825
4826 CMake 2.4 and below implemented linking to libraries whose full paths
4827 are known by splitting them on the link line into separate components
4828 consisting of the linker search path and the library name. The example
4829 code might have produced something like
4830
4831 ... -L/path/to -lA ...
4832
4833 in order to link to library A. An analysis was performed to order mul‐
4834 tiple link directories such that the linker would find library A in the
4835 desired location, but there are cases in which this does not work.
4836 CMake versions 2.6 and above use the more reliable approach of passing
4837 the full path to libraries directly to the linker in most cases. The
4838 example code now produces something like
4839
4840 ... /path/to/libA.so ....
4841
4842 Unfortunately this change can break code like
4843
4844 target_link_libraries(myexe /path/to/libA.so B)
4845
4846 where B is meant to find /path/to/libB.so. This code is wrong because
4847 the user is asking the linker to find library B but has not provided a
4848 linker search path (which may be added with the link_directories com‐
4849 mand). However, with the old linking implementation the code would
4850 work accidentally because the linker search path added for library A
4851 allowed library B to be found.
4852
4853 In order to support projects depending on linker search paths added by
4854 linking to libraries with known full paths, the OLD behavior for this
4855 policy will add the linker search paths even though they are not needed
4856 for their own libraries. When this policy is set to OLD, CMake will
4857 produce a link line such as
4858
4859 ... -L/path/to /path/to/libA.so -lB ...
4860
4861 which will allow library B to be found as it was previously. When this
4862 policy is set to NEW, CMake will produce a link line such as
4863
4864 ... /path/to/libA.so -lB ...
4865
4866 which more accurately matches what the project specified.
4867
4868 The setting for this policy used when generating the link line is that
4869 in effect when the target is created by an add_executable or add_li‐
4870 brary command. For the example described above, the code
4871
4872 cmake_policy(SET CMP0003 OLD) # or cmake_policy(VERSION 2.4)
4873 add_executable(myexe myexe.c)
4874 target_link_libraries(myexe /path/to/libA.so B)
4875
4876 will work and suppress the warning for this policy. It may also be up‐
4877 dated to work with the corrected linking approach:
4878
4879 cmake_policy(SET CMP0003 NEW) # or cmake_policy(VERSION 2.6)
4880 link_directories(/path/to) # needed to find library B
4881 add_executable(myexe myexe.c)
4882 target_link_libraries(myexe /path/to/libA.so B)
4883
4884 Even better, library B may be specified with a full path:
4885
4886 add_executable(myexe myexe.c)
4887 target_link_libraries(myexe /path/to/libA.so /path/to/libB.so)
4888
4889 When all items on the link line have known paths CMake does not check
4890 this policy so it has no effect.
4891
4892 Note that the warning for this policy will be issued for at most one
4893 target. This avoids flooding users with messages for every target when
4894 setting the policy once will probably fix all targets.
4895
4896 This policy was introduced in CMake version 2.6.0. CMake version
4897 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4898 cmake_policy() command to set it to OLD or NEW explicitly.
4899
4900 NOTE:
4901 The OLD behavior of a policy is deprecated by definition and may be
4902 removed in a future version of CMake.
4903
4904 CMP0002
4905 Logical target names must be globally unique.
4906
4907 Targets names created with add_executable(), add_library(), or
4908 add_custom_target() are logical build target names. Logical target
4909 names must be globally unique because:
4910
4911 - Unique names may be referenced unambiguously both in CMake
4912 code and on make tool command lines.
4913 - Logical names are used by Xcode and VS IDE generators
4914 to produce meaningful project names for the targets.
4915
4916 The logical name of executable and library targets does not have to
4917 correspond to the physical file names built. Consider using the
4918 OUTPUT_NAME target property to create two targets with the same physi‐
4919 cal name while keeping logical names distinct. Custom targets must
4920 simply have globally unique names (unless one uses the global property
4921 ALLOW_DUPLICATE_CUSTOM_TARGETS with a Makefiles generator).
4922
4923 This policy was introduced in CMake version 2.6.0. CMake version
4924 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4925 cmake_policy() command to set it to OLD or NEW explicitly.
4926
4927 NOTE:
4928 The OLD behavior of a policy is deprecated by definition and may be
4929 removed in a future version of CMake.
4930
4931 CMP0001
4932 CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.
4933
4934 The behavior is to check CMAKE_BACKWARDS_COMPATIBILITY and present it
4935 to the user. The NEW behavior is to ignore CMAKE_BACKWARDS_COMPATIBIL‐
4936 ITY completely.
4937
4938 In CMake 2.4 and below the variable CMAKE_BACKWARDS_COMPATIBILITY was
4939 used to request compatibility with earlier versions of CMake. In CMake
4940 2.6 and above all compatibility issues are handled by policies and the
4941 cmake_policy() command. However, CMake must still check CMAKE_BACK‐
4942 WARDS_COMPATIBILITY for projects written for CMake 2.4 and below.
4943
4944 This policy was introduced in CMake version 2.6.0. CMake version
4945 3.27.7 warns when the policy is not set and uses OLD behavior. Use the
4946 cmake_policy() command to set it to OLD or NEW explicitly.
4947
4948 NOTE:
4949 The OLD behavior of a policy is deprecated by definition and may be
4950 removed in a future version of CMake.
4951
4952 CMP0000
4953 A minimum required CMake version must be specified.
4954
4955 CMake requires that projects specify the version of CMake to which they
4956 have been written. This policy has been put in place so users trying
4957 to build the project may be told when they need to update their CMake.
4958 Specifying a version also helps the project build with CMake versions
4959 newer than that specified. Use the cmake_minimum_required() command at
4960 the top of your main CMakeLists.txt file:
4961
4962 cmake_minimum_required(VERSION <major>.<minor>)
4963
4964 where <major>.<minor> is the version of CMake you want to support (such
4965 as 3.14). The command will ensure that at least the given version of
4966 CMake is running and help newer versions be compatible with the
4967 project. See documentation of cmake_minimum_required() for details.
4968
4969 Note that the command invocation must appear in the CMakeLists.txt file
4970 itself; a call in an included file is not sufficient. However, the
4971 cmake_policy() command may be called to set policy CMP0000 to OLD or
4972 NEW behavior explicitly. The OLD behavior is to silently ignore the
4973 missing invocation. The NEW behavior is to issue an error instead of a
4974 warning. An included file may set CMP0000 explicitly to affect how
4975 this policy is enforced for the main CMakeLists.txt file.
4976
4977 This policy was introduced in CMake version 2.6.0.
4978
4979 NOTE:
4980 The OLD behavior of a policy is deprecated by definition and may be
4981 removed in a future version of CMake.
4982
4984 2000-2023 Kitware, Inc. and Contributors
4985
4986
4987
4988
49893.27.7 Oct 07, 2023 CMAKE-POLICIES(7)