1CMAKE-PROPERTIES(7) CMake CMAKE-PROPERTIES(7)
2
3
4
6 cmake-properties - CMake Properties Reference
7
9 ALLOW_DUPLICATE_CUSTOM_TARGETS
10 Allow duplicate custom targets to be created.
11
12 Normally CMake requires that all targets built in a project have glob‐
13 ally unique logical names (see policy CMP0002). This is necessary to
14 generate meaningful project file names in Xcode and Visual Studio Gen‐
15 erators IDE generators. It also allows the target names to be refer‐
16 enced unambiguously.
17
18 Makefile generators are capable of supporting duplicate add_custom_tar‐
19 get() names. For projects that care only about Makefile Generators and
20 do not wish to support Xcode or Visual Studio Generators IDE genera‐
21 tors, one may set this property to True to allow duplicate custom tar‐
22 gets. The property allows multiple add_custom_target() command calls
23 in different directories to specify the same target name. However,
24 setting this property will cause non-Makefile generators to produce an
25 error and refuse to generate the project.
26
27 AUTOGEN_SOURCE_GROUP
28 New in version 3.9.
29
30
31 Name of the source_group() for AUTOMOC, AUTORCC and AUTOUIC generated
32 files.
33
34 Files generated by AUTOMOC, AUTORCC and AUTOUIC are not always known at
35 configure time and therefore can't be passed to source_group().
36 AUTOGEN_SOURCE_GROUP can be used instead to generate or select a source
37 group for AUTOMOC, AUTORCC and AUTOUIC generated files.
38
39 For AUTOMOC, AUTORCC and AUTOUIC specific overrides see AUTO‐
40 MOC_SOURCE_GROUP, AUTORCC_SOURCE_GROUP and AUTOUIC_SOURCE_GROUP respec‐
41 tively.
42
43 AUTOGEN_TARGETS_FOLDER
44 Name of FOLDER for *_autogen targets that are added automatically by
45 CMake for targets for which AUTOMOC is enabled.
46
47 If not set, CMake uses the FOLDER property of the parent target as a
48 default value for this property. See also the documentation for the
49 FOLDER target property and the AUTOMOC target property.
50
51 AUTOMOC_SOURCE_GROUP
52 New in version 3.9.
53
54
55 Name of the source_group() for AUTOMOC generated files.
56
57 When set this is used instead of AUTOGEN_SOURCE_GROUP for files gener‐
58 ated by AUTOMOC.
59
60 AUTOMOC_TARGETS_FOLDER
61 Name of FOLDER for *_autogen targets that are added automatically by
62 CMake for targets for which AUTOMOC is enabled.
63
64 This property is obsolete. Use AUTOGEN_TARGETS_FOLDER instead.
65
66 If not set, CMake uses the FOLDER property of the parent target as a
67 default value for this property. See also the documentation for the
68 FOLDER target property and the AUTOMOC target property.
69
70 AUTORCC_SOURCE_GROUP
71 New in version 3.9.
72
73
74 Name of the source_group() for AUTORCC generated files.
75
76 When set this is used instead of AUTOGEN_SOURCE_GROUP for files gener‐
77 ated by AUTORCC.
78
79 AUTOUIC_SOURCE_GROUP
80 New in version 3.21.
81
82
83 Name of the source_group() for AUTOUIC generated files.
84
85 When set this is used instead of AUTOGEN_SOURCE_GROUP for files gener‐
86 ated by AUTOUIC.
87
88 CMAKE_C_KNOWN_FEATURES
89 New in version 3.1.
90
91
92 List of C features known to this version of CMake.
93
94 The features listed in this global property may be known to be avail‐
95 able to the C compiler. If the feature is available with the C com‐
96 piler, it will be listed in the CMAKE_C_COMPILE_FEATURES variable.
97
98 The features listed here may be used with the target_compile_features()
99 command. See the cmake-compile-features(7) manual for information on
100 compile features and a list of supported compilers.
101
102 The features known to this version of CMake are listed below.
103
104 High level meta features indicating C standard support
105 New in version 3.8.
106
107
108 c_std_90
109 Compiler mode is at least C 90.
110
111 c_std_99
112 Compiler mode is at least C 99.
113
114 c_std_11
115 Compiler mode is at least C 11.
116
117 c_std_17
118 New in version 3.21.
119
120
121 Compiler mode is at least C 17.
122
123 c_std_23
124 New in version 3.21.
125
126
127 Compiler mode is at least C 23.
128
129 Low level individual compile features
130 c_function_prototypes
131 Function prototypes, as defined in ISO/IEC 9899:1990.
132
133 c_restrict
134 restrict keyword, as defined in ISO/IEC 9899:1999.
135
136 c_static_assert
137 Static assert, as defined in ISO/IEC 9899:2011.
138
139 c_variadic_macros
140 Variadic macros, as defined in ISO/IEC 9899:1999.
141
142 CMAKE_CUDA_KNOWN_FEATURES
143 New in version 3.17.
144
145
146 List of CUDA features known to this version of CMake.
147
148 The features listed in this global property may be known to be avail‐
149 able to the CUDA compiler. If the feature is available with the C++
150 compiler, it will be listed in the CMAKE_CUDA_COMPILE_FEATURES vari‐
151 able.
152
153 The features listed here may be used with the target_compile_features()
154 command. See the cmake-compile-features(7) manual for information on
155 compile features and a list of supported compilers.
156
157 The features known to this version of CMake are:
158
159 cuda_std_03
160 Compiler mode is at least CUDA/C++ 03.
161
162 cuda_std_11
163 Compiler mode is at least CUDA/C++ 11.
164
165 cuda_std_14
166 Compiler mode is at least CUDA/C++ 14.
167
168 cuda_std_17
169 Compiler mode is at least CUDA/C++ 17.
170
171 cuda_std_20
172 Compiler mode is at least CUDA/C++ 20.
173
174 cuda_std_23
175 New in version 3.20.
176
177
178 Compiler mode is at least CUDA/C++ 23.
179
180 CMAKE_CXX_KNOWN_FEATURES
181 New in version 3.1.
182
183
184 List of C++ features known to this version of CMake.
185
186 The features listed in this global property may be known to be avail‐
187 able to the C++ compiler. If the feature is available with the C++
188 compiler, it will be listed in the CMAKE_CXX_COMPILE_FEATURES variable.
189
190 The features listed here may be used with the target_compile_features()
191 command. See the cmake-compile-features(7) manual for information on
192 compile features and a list of supported compilers.
193
194 The features known to this version of CMake are listed below.
195
196 High level meta features indicating C++ standard support
197 New in version 3.8.
198
199
200 The following meta features indicate general support for the associated
201 language standard. It reflects the language support claimed by the
202 compiler, but it does not necessarily imply complete conformance to
203 that standard.
204
205 cxx_std_98
206 Compiler mode is at least C++ 98.
207
208 cxx_std_11
209 Compiler mode is at least C++ 11.
210
211 cxx_std_14
212 Compiler mode is at least C++ 14.
213
214 cxx_std_17
215 Compiler mode is at least C++ 17.
216
217 cxx_std_20
218 New in version 3.12.
219
220
221 Compiler mode is at least C++ 20.
222
223 cxx_std_23
224 New in version 3.20.
225
226
227 Compiler mode is at least C++ 23.
228
229 Low level individual compile features
230 For C++ 11 and C++ 14, compilers were sometimes slow to implement cer‐
231 tain language features. CMake provided some individual compile fea‐
232 tures to help projects determine whether specific features were avail‐
233 able. These individual features are now less relevant and projects
234 should generally prefer to use the high level meta features instead.
235 Individual compile features are not provided for C++ 17 or later.
236
237 See the cmake-compile-features(7) manual for further discussion of the
238 use of individual compile features.
239
240 Individual features from C++ 98
241 cxx_template_template_parameters
242 Template template parameters, as defined in ISO/IEC 14882:1998.
243
244 Individual features from C++ 11
245 cxx_alias_templates
246 Template aliases, as defined in N2258.
247
248 cxx_alignas
249 Alignment control alignas, as defined in N2341.
250
251 cxx_alignof
252 Alignment control alignof, as defined in N2341.
253
254 cxx_attributes
255 Generic attributes, as defined in N2761.
256
257 cxx_auto_type
258 Automatic type deduction, as defined in N1984.
259
260 cxx_constexpr
261 Constant expressions, as defined in N2235.
262
263 cxx_decltype_incomplete_return_types
264 Decltype on incomplete return types, as defined in N3276.
265
266 cxx_decltype
267 Decltype, as defined in N2343.
268
269 cxx_default_function_template_args
270 Default template arguments for function templates, as defined in
271 DR226
272
273 cxx_defaulted_functions
274 Defaulted functions, as defined in N2346.
275
276 cxx_defaulted_move_initializers
277 Defaulted move initializers, as defined in N3053.
278
279 cxx_delegating_constructors
280 Delegating constructors, as defined in N1986.
281
282 cxx_deleted_functions
283 Deleted functions, as defined in N2346.
284
285 cxx_enum_forward_declarations
286 Enum forward declarations, as defined in N2764.
287
288 cxx_explicit_conversions
289 Explicit conversion operators, as defined in N2437.
290
291 cxx_extended_friend_declarations
292 Extended friend declarations, as defined in N1791.
293
294 cxx_extern_templates
295 Extern templates, as defined in N1987.
296
297 cxx_final
298 Override control final keyword, as defined in N2928, N3206 and
299 N3272.
300
301 cxx_func_identifier
302 Predefined __func__ identifier, as defined in N2340.
303
304 cxx_generalized_initializers
305 Initializer lists, as defined in N2672.
306
307 cxx_inheriting_constructors
308 Inheriting constructors, as defined in N2540.
309
310 cxx_inline_namespaces
311 Inline namespaces, as defined in N2535.
312
313 cxx_lambdas
314 Lambda functions, as defined in N2927.
315
316 cxx_local_type_template_args
317 Local and unnamed types as template arguments, as defined in
318 N2657.
319
320 cxx_long_long_type
321 long long type, as defined in N1811.
322
323 cxx_noexcept
324 Exception specifications, as defined in N3050.
325
326 cxx_nonstatic_member_init
327 Non-static data member initialization, as defined in N2756.
328
329 cxx_nullptr
330 Null pointer, as defined in N2431.
331
332 cxx_override
333 Override control override keyword, as defined in N2928, N3206
334 and N3272.
335
336 cxx_range_for
337 Range-based for, as defined in N2930.
338
339 cxx_raw_string_literals
340 Raw string literals, as defined in N2442.
341
342 cxx_reference_qualified_functions
343 Reference qualified functions, as defined in N2439.
344
345 cxx_right_angle_brackets
346 Right angle bracket parsing, as defined in N1757.
347
348 cxx_rvalue_references
349 R-value references, as defined in N2118.
350
351 cxx_sizeof_member
352 Size of non-static data members, as defined in N2253.
353
354 cxx_static_assert
355 Static assert, as defined in N1720.
356
357 cxx_strong_enums
358 Strongly typed enums, as defined in N2347.
359
360 cxx_thread_local
361 Thread-local variables, as defined in N2659.
362
363 cxx_trailing_return_types
364 Automatic function return type, as defined in N2541.
365
366 cxx_unicode_literals
367 Unicode string literals, as defined in N2442.
368
369 cxx_uniform_initialization
370 Uniform initialization, as defined in N2640.
371
372 cxx_unrestricted_unions
373 Unrestricted unions, as defined in N2544.
374
375 cxx_user_literals
376 User-defined literals, as defined in N2765.
377
378 cxx_variadic_macros
379 Variadic macros, as defined in N1653.
380
381 cxx_variadic_templates
382 Variadic templates, as defined in N2242.
383
384 Individual features from C++ 14
385 cxx_aggregate_default_initializers
386 Aggregate default initializers, as defined in N3605.
387
388 cxx_attribute_deprecated
389 [[deprecated]] attribute, as defined in N3760.
390
391 cxx_binary_literals
392 Binary literals, as defined in N3472.
393
394 cxx_contextual_conversions
395 Contextual conversions, as defined in N3323.
396
397 cxx_decltype_auto
398 decltype(auto) semantics, as defined in N3638.
399
400 cxx_digit_separators
401 Digit separators, as defined in N3781.
402
403 cxx_generic_lambdas
404 Generic lambdas, as defined in N3649.
405
406 cxx_lambda_init_captures
407 Initialized lambda captures, as defined in N3648.
408
409 cxx_relaxed_constexpr
410 Relaxed constexpr, as defined in N3652.
411
412 cxx_return_type_deduction
413 Return type deduction on normal functions, as defined in N3386.
414
415 cxx_variable_templates
416 Variable templates, as defined in N3651.
417
418 CMAKE_ROLE
419 New in version 3.14.
420
421
422 Tells what mode the current running script is in. Could be one of sev‐
423 eral values:
424
425 PROJECT
426 Running in project mode (processing a CMakeLists.txt file).
427
428 SCRIPT Running in -P script mode.
429
430 FIND_PACKAGE
431 Running in --find-package mode.
432
433 CTEST Running in CTest script mode.
434
435 CPACK Running in CPack.
436
437 DEBUG_CONFIGURATIONS
438 Specify which configurations are for debugging.
439
440 The value must be a semi-colon separated list of configuration names.
441 Currently this property is used only by the target_link_libraries()
442 command. Additional uses may be defined in the future.
443
444 This property must be set at the top level of the project and before
445 the first target_link_libraries() command invocation. If any entry in
446 the list does not match a valid configuration for the project the be‐
447 havior is undefined.
448
449 DISABLED_FEATURES
450 List of features which are disabled during the CMake run.
451
452 List of features which are disabled during the CMake run. By default
453 it contains the names of all packages which were not found. This is
454 determined using the <NAME>_FOUND variables. Packages which are
455 searched QUIET are not listed. A project can add its own features to
456 this list. This property is used by the macros in FeatureSum‐
457 mary.cmake.
458
459 ECLIPSE_EXTRA_CPROJECT_CONTENTS
460 New in version 3.12.
461
462
463 Additional contents to be inserted into the generated Eclipse cproject
464 file.
465
466 The cproject file defines the CDT specific information. Some third
467 party IDE's are based on Eclipse with the addition of other information
468 specific to that IDE. Through this property, it is possible to add
469 this additional contents to the generated project. It is expected to
470 contain valid XML.
471
472 Also see the ECLIPSE_EXTRA_NATURES property.
473
474 ECLIPSE_EXTRA_NATURES
475 List of natures to add to the generated Eclipse project file.
476
477 Eclipse projects specify language plugins by using natures. This prop‐
478 erty should be set to the unique identifier for a nature (which looks
479 like a Java package name).
480
481 Also see the ECLIPSE_EXTRA_CPROJECT_CONTENTS property.
482
483 ENABLED_FEATURES
484 List of features which are enabled during the CMake run.
485
486 List of features which are enabled during the CMake run. By default it
487 contains the names of all packages which were found. This is deter‐
488 mined using the <NAME>_FOUND variables. Packages which are searched
489 QUIET are not listed. A project can add its own features to this list.
490 This property is used by the macros in FeatureSummary.cmake.
491
492 ENABLED_LANGUAGES
493 Read-only property that contains the list of currently enabled lan‐
494 guages
495
496 Set to list of currently enabled languages.
497
498 FIND_LIBRARY_USE_LIB32_PATHS
499 New in version 3.7.
500
501
502 Whether the find_library() command should automatically search lib32
503 directories.
504
505 FIND_LIBRARY_USE_LIB32_PATHS is a boolean specifying whether the
506 find_library() command should automatically search the lib32 variant of
507 directories called lib in the search path when building 32-bit bina‐
508 ries.
509
510 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
511
512 FIND_LIBRARY_USE_LIB64_PATHS
513 Whether find_library() should automatically search lib64 directories.
514
515 FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the
516 find_library() command should automatically search the lib64 variant of
517 directories called lib in the search path when building 64-bit bina‐
518 ries.
519
520 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
521
522 FIND_LIBRARY_USE_LIBX32_PATHS
523 New in version 3.9.
524
525
526 Whether the find_library() command should automatically search libx32
527 directories.
528
529 FIND_LIBRARY_USE_LIBX32_PATHS is a boolean specifying whether the
530 find_library() command should automatically search the libx32 variant
531 of directories called lib in the search path when building x32-abi bi‐
532 naries.
533
534 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
535
536 FIND_LIBRARY_USE_OPENBSD_VERSIONING
537 Whether find_library() should find OpenBSD-style shared libraries.
538
539 This property is a boolean specifying whether the find_library() com‐
540 mand should find shared libraries with OpenBSD-style versioned exten‐
541 sion: ".so.<major>.<minor>". The property is set to true on OpenBSD
542 and false on other platforms.
543
544 GENERATOR_IS_MULTI_CONFIG
545 New in version 3.9.
546
547
548 Read-only property that is true on multi-configuration generators.
549
550 True when using a multi-configuration generator such as:
551
552 • Ninja Multi-Config
553
554 • Visual Studio Generators
555
556 • Xcode
557
558 Multi-config generators use CMAKE_CONFIGURATION_TYPES as the set of
559 configurations and ignore CMAKE_BUILD_TYPE.
560
561 GLOBAL_DEPENDS_DEBUG_MODE
562 Enable global target dependency graph debug mode.
563
564 CMake automatically analyzes the global inter-target dependency graph
565 at the beginning of native build system generation. This property
566 causes it to display details of its analysis to stderr.
567
568 GLOBAL_DEPENDS_NO_CYCLES
569 Disallow global target dependency graph cycles.
570
571 CMake automatically analyzes the global inter-target dependency graph
572 at the beginning of native build system generation. It reports an er‐
573 ror if the dependency graph contains a cycle that does not consist of
574 all STATIC library targets. This property tells CMake to disallow all
575 cycles completely, even among static libraries.
576
577 IN_TRY_COMPILE
578 Read-only property that is true during a try-compile configuration.
579
580 True when building a project inside a try_compile() or try_run() com‐
581 mand.
582
583 JOB_POOLS
584 Ninja only: List of available pools.
585
586 A pool is a named integer property and defines the maximum number of
587 concurrent jobs which can be started by a rule assigned to the pool.
588 The JOB_POOLS property is a semicolon-separated list of pairs using the
589 syntax NAME=integer (without a space after the equality sign).
590
591 For instance:
592
593 set_property(GLOBAL PROPERTY JOB_POOLS two_jobs=2 ten_jobs=10)
594
595 Defined pools could be used globally by setting CMAKE_JOB_POOL_COMPILE
596 and CMAKE_JOB_POOL_LINK or per target by setting the target properties
597 JOB_POOL_COMPILE and JOB_POOL_LINK. Custom commands and custom targets
598 can specify pools using the option JOB_POOL. Using a pool that is not
599 defined by JOB_POOLS causes an error by ninja at build time.
600
601 If not set, this property uses the value of the CMAKE_JOB_POOLS vari‐
602 able.
603
604 Build targets provided by CMake that are meant for individual interac‐
605 tive use, such as install, are placed in the console pool automati‐
606 cally.
607
608 PACKAGES_FOUND
609 List of packages which were found during the CMake run.
610
611 List of packages which were found during the CMake run. Whether a
612 package has been found is determined using the <NAME>_FOUND variables.
613
614 PACKAGES_NOT_FOUND
615 List of packages which were not found during the CMake run.
616
617 List of packages which were not found during the CMake run. Whether a
618 package has been found is determined using the <NAME>_FOUND variables.
619
620 PREDEFINED_TARGETS_FOLDER
621 Name of FOLDER for targets that are added automatically by CMake.
622
623 If not set, CMake uses "CMakePredefinedTargets" as a default value for
624 this property. Targets such as INSTALL, PACKAGE and RUN_TESTS will be
625 organized into this FOLDER. See also the documentation for the FOLDER
626 target property.
627
628 REPORT_UNDEFINED_PROPERTIES
629 If set, report any undefined properties to this file.
630
631 If this property is set to a filename then when CMake runs it will re‐
632 port any properties or variables that were accessed but not defined
633 into the filename specified in this property.
634
635 RULE_LAUNCH_COMPILE
636 Specify a launcher for compile rules.
637
638 Makefile Generators and the Ninja generator prefix compiler commands
639 with the given launcher command line. This is intended to allow
640 launchers to intercept build problems with high granularity. Other
641 generators ignore this property because their underlying build systems
642 provide no hook to wrap individual commands with a launcher.
643
644 RULE_LAUNCH_CUSTOM
645 Specify a launcher for custom rules.
646
647 Makefile Generators and the Ninja generator prefix custom commands with
648 the given launcher command line. This is intended to allow launchers
649 to intercept build problems with high granularity. Other generators
650 ignore this property because their underlying build systems provide no
651 hook to wrap individual commands with a launcher.
652
653 RULE_LAUNCH_LINK
654 Specify a launcher for link rules.
655
656 Makefile Generators and the Ninja generator prefix link and archive
657 commands with the given launcher command line. This is intended to al‐
658 low launchers to intercept build problems with high granularity. Other
659 generators ignore this property because their underlying build systems
660 provide no hook to wrap individual commands with a launcher.
661
662 RULE_MESSAGES
663 Specify whether to report a message for each make rule.
664
665 This property specifies whether Makefile generators should add a
666 progress message describing what each build rule does. If the property
667 is not set the default is ON. Set the property to OFF to disable gran‐
668 ular messages and report only as each target completes. This is in‐
669 tended to allow scripted builds to avoid the build time cost of de‐
670 tailed reports. If a CMAKE_RULE_MESSAGES cache entry exists its value
671 initializes the value of this property. Non-Makefile generators cur‐
672 rently ignore this property.
673
674 TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
675 Set if shared libraries may be named like archives.
676
677 On AIX shared libraries may be named "lib<name>.a". This property is
678 set to true on such platforms.
679
680 TARGET_MESSAGES
681 New in version 3.4.
682
683
684 Specify whether to report the completion of each target.
685
686 This property specifies whether Makefile Generators should add a
687 progress message describing that each target has been completed. If
688 the property is not set the default is ON. Set the property to OFF to
689 disable target completion messages.
690
691 This option is intended to reduce build output when little or no work
692 needs to be done to bring the build tree up to date.
693
694 If a CMAKE_TARGET_MESSAGES cache entry exists its value initializes the
695 value of this property.
696
697 Non-Makefile generators currently ignore this property.
698
699 See the counterpart property RULE_MESSAGES to disable everything except
700 for target completion messages.
701
702 TARGET_SUPPORTS_SHARED_LIBS
703 Does the target platform support shared libraries.
704
705 TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the target
706 platform supports shared libraries. Basically all current general gen‐
707 eral purpose OS do so, the exception are usually embedded systems with
708 no or special OSs.
709
710 USE_FOLDERS
711 Use the FOLDER target property to organize targets into folders.
712
713 If not set, CMake treats this property as OFF by default. CMake gener‐
714 ators that are capable of organizing into a hierarchy of folders use
715 the values of the FOLDER target property to name those folders. See
716 also the documentation for the FOLDER target property.
717
718 XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
719 New in version 3.8.
720
721
722 Control emission of EFFECTIVE_PLATFORM_NAME by the Xcode generator.
723
724 It is required for building the same target with multiple SDKs. A com‐
725 mon use case is the parallel use of iphoneos and iphonesimulator SDKs.
726
727 Three different states possible that control when the Xcode generator
728 emits the EFFECTIVE_PLATFORM_NAME variable:
729
730 • If set to ON it will always be emitted
731
732 • If set to OFF it will never be emitted
733
734 • If unset (the default) it will only be emitted when the project was
735 configured for an embedded Xcode SDK like iOS, tvOS, watchOS or any
736 of the simulators.
737
738 NOTE:
739 When this behavior is enable for generated Xcode projects, the EF‐
740 FECTIVE_PLATFORM_NAME variable will leak into Generator expressions
741 like TARGET_FILE and will render those mostly unusable.
742
744 ADDITIONAL_CLEAN_FILES
745 New in version 3.15.
746
747
748 A ;-list of files or directories that will be removed as a part of the
749 global clean target. It is useful for specifying generated files or
750 directories that are used by multiple targets or by CMake itself, or
751 that are generated in ways which cannot be captured as outputs or
752 byproducts of custom commands.
753
754 If an additional clean file is specific to a single target only, then
755 the ADDITIONAL_CLEAN_FILES target property would usually be a better
756 choice than this directory property.
757
758 Relative paths are allowed and are interpreted relative to the current
759 binary directory.
760
761 Contents of ADDITIONAL_CLEAN_FILES may use generator expressions.
762
763 This property only works for the Ninja and the Makefile generators. It
764 is ignored by other generators.
765
766 BINARY_DIR
767 New in version 3.7.
768
769
770 This read-only directory property reports absolute path to the binary
771 directory corresponding to the source on which it is read.
772
773 BUILDSYSTEM_TARGETS
774 New in version 3.7.
775
776
777 This read-only directory property contains a semicolon-separated list
778 of buildsystem targets added in the directory by calls to the add_li‐
779 brary(), add_executable(), and add_custom_target() commands. The list
780 does not include any Imported Targets or Alias Targets, but does in‐
781 clude Interface Libraries. Each entry in the list is the logical name
782 of a target, suitable to pass to the get_property() command TARGET op‐
783 tion.
784
785 See also the IMPORTED_TARGETS directory property.
786
787 CACHE_VARIABLES
788 List of cache variables available in the current directory.
789
790 This read-only property specifies the list of CMake cache variables
791 currently defined. It is intended for debugging purposes.
792
793 CLEAN_NO_CUSTOM
794 Set to true to tell Makefile Generators not to remove the outputs of
795 custom commands for this directory during the make clean operation.
796 This is ignored on other generators because it is not possible to im‐
797 plement.
798
799 CMAKE_CONFIGURE_DEPENDS
800 Tell CMake about additional input files to the configuration process.
801 If any named file is modified the build system will re-run CMake to
802 re-configure the file and generate the build system again.
803
804 Specify files as a semicolon-separated list of paths. Relative paths
805 are interpreted as relative to the current source directory.
806
807 COMPILE_DEFINITIONS
808 Preprocessor definitions for compiling a directory's sources.
809
810 This property specifies the list of options given so far to the
811 add_compile_definitions() (or add_definitions()) command.
812
813 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
814 list of preprocessor definitions using the syntax VAR or VAR=value.
815 Function-style definitions are not supported. CMake will automatically
816 escape the value correctly for the native build system (note that CMake
817 language syntax may require escapes to specify some values).
818
819 This property will be initialized in each directory by its value in the
820 directory's parent.
821
822 CMake will automatically drop some definitions that are not supported
823 by the native build tool.
824
825 Disclaimer: Most native build tools have poor support for escaping cer‐
826 tain values. CMake has work-arounds for many cases but some values may
827 just not be possible to pass correctly. If a value does not seem to be
828 escaped correctly, do not attempt to work-around the problem by adding
829 escape sequences to the value. Your work-around may break in a future
830 version of CMake that has improved escape support. Instead consider
831 defining the macro in a (configured) header file. Then report the lim‐
832 itation. Known limitations include:
833
834 # - broken almost everywhere
835 ; - broken in VS IDE 7.0 and Borland Makefiles
836 , - broken in VS IDE
837 % - broken in some cases in NMake
838 & | - broken in some cases on MinGW
839 ^ < > \" - broken in most Make tools on Windows
840
841 CMake does not reject these values outright because they do work in
842 some cases. Use with caution.
843
844 Contents of COMPILE_DEFINITIONS may use "generator expressions" with
845 the syntax $<...>. See the cmake-generator-expressions(7) manual for
846 available expressions. See the cmake-buildsystem(7) manual for more on
847 defining buildsystem properties.
848
849 The corresponding COMPILE_DEFINITIONS_<CONFIG> property may be set to
850 specify per-configuration definitions. Generator expressions should be
851 preferred instead of setting the alternative property.
852
853 COMPILE_OPTIONS
854 List of options to pass to the compiler.
855
856 This property holds a semicolon-separated list of options given so far
857 to the add_compile_options() command.
858
859 This property is used to initialize the COMPILE_OPTIONS target property
860 when a target is created, which is used by the generators to set the
861 options for the compiler.
862
863 Contents of COMPILE_OPTIONS may use "generator expressions" with the
864 syntax $<...>. See the cmake-generator-expressions(7) manual for
865 available expressions. See the cmake-buildsystem(7) manual for more on
866 defining buildsystem properties.
867
868 DEFINITIONS
869 For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.
870
871 This read-only property specifies the list of flags given so far to the
872 add_definitions() command. It is intended for debugging purposes. Use
873 the COMPILE_DEFINITIONS directory property instead.
874
875 This built-in read-only property does not exist if policy CMP0059 is
876 set to NEW.
877
878 EXCLUDE_FROM_ALL
879 Set this directory property to a true value on a subdirectory to ex‐
880 clude its targets from the "all" target of its ancestors. If excluded,
881 running e.g. make in the parent directory will not build targets the
882 subdirectory by default. This does not affect the "all" target of the
883 subdirectory itself. Running e.g. make inside the subdirectory will
884 still build its targets.
885
886 If the EXCLUDE_FROM_ALL target property is set on a target then its
887 value determines whether the target is included in the "all" target of
888 this directory and its ancestors.
889
890 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
891 Specify #include line transforms for dependencies in a directory.
892
893 This property specifies rules to transform macro-like #include lines
894 during implicit dependency scanning of C and C++ source files. The
895 list of rules must be semicolon-separated with each entry of the form
896 A_MACRO(%)=value-with-% (the % must be literal). During dependency
897 scanning occurrences of A_MACRO(...) on #include lines will be replaced
898 by the value given with the macro argument substituted for %. For ex‐
899 ample, the entry
900
901 MYDIR(%)=<mydir/%>
902
903 will convert lines of the form
904
905 #include MYDIR(myheader.h)
906
907 to
908
909 #include <mydir/myheader.h>
910
911 allowing the dependency to be followed.
912
913 This property applies to sources in all targets within a directory.
914 The property value is initialized in each directory by its value in the
915 directory's parent.
916
917 IMPORTED_TARGETS
918 New in version 3.21.
919
920
921 This read-only directory property contains a semicolon-separated list
922 of Imported Targets added in the directory by calls to the add_li‐
923 brary() and add_executable() commands. Each entry in the list is the
924 logical name of a target, suitable to pass to the get_property() com‐
925 mand TARGET option when called in the same directory.
926
927 See also the BUILDSYSTEM_TARGETS directory property.
928
929 INCLUDE_DIRECTORIES
930 List of preprocessor include file search directories.
931
932 This property specifies the list of directories given so far to the in‐
933 clude_directories() command.
934
935 This property is used to populate the INCLUDE_DIRECTORIES target prop‐
936 erty, which is used by the generators to set the include directories
937 for the compiler.
938
939 In addition to accepting values from that command, values may be set
940 directly on any directory using the set_property() command, and can be
941 set on the current directory using the set_directory_properties() com‐
942 mand. A directory gets its initial value from its parent directory if
943 it has one. The initial value of the INCLUDE_DIRECTORIES target prop‐
944 erty comes from the value of this property. Both directory and target
945 property values are adjusted by calls to the include_directories() com‐
946 mand. Calls to set_property() or set_directory_properties(), however,
947 will update the directory property value without updating target prop‐
948 erty values. Therefore direct property updates must be made before
949 calls to add_executable() or add_library() for targets they are meant
950 to affect.
951
952 The target property values are used by the generators to set the in‐
953 clude paths for the compiler.
954
955 Contents of INCLUDE_DIRECTORIES may use "generator expressions" with
956 the syntax $<...>. See the cmake-generator-expressions(7) manual for
957 available expressions. See the cmake-buildsystem(7) manual for more on
958 defining buildsystem properties.
959
960 INCLUDE_REGULAR_EXPRESSION
961 Include file scanning regular expression.
962
963 This property specifies the regular expression used during dependency
964 scanning to match include files that should be followed. See the in‐
965 clude_regular_expression() command for a high-level interface to set
966 this property.
967
968 INTERPROCEDURAL_OPTIMIZATION
969 Enable interprocedural optimization for targets in a directory.
970
971 If set to true, enables interprocedural optimizations if they are known
972 to be supported by the compiler.
973
974 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
975 Per-configuration interprocedural optimization for a directory.
976
977 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.
978 If set, this property overrides the generic property for the named con‐
979 figuration.
980
981 LABELS
982 New in version 3.10.
983
984
985 Specify a list of text labels associated with a directory and all of
986 its subdirectories. This is equivalent to setting the LABELS target
987 property and the LABELS test property on all targets and tests in the
988 current directory and subdirectories. Note: Launchers must enabled to
989 propagate labels to targets.
990
991 The CMAKE_DIRECTORY_LABELS variable can be used to initialize this
992 property.
993
994 The list is reported in dashboard submissions.
995
996 LINK_DIRECTORIES
997 List of linker search directories.
998
999 This property holds a semicolon-separated list of directories and is
1000 typically populated using the link_directories() command. It gets its
1001 initial value from its parent directory, if it has one.
1002
1003 The directory property is used to initialize the LINK_DIRECTORIES tar‐
1004 get property when a target is created. That target property is used by
1005 the generators to set the library search directories for the linker.
1006
1007 Contents of LINK_DIRECTORIES may use "generator expressions" with the
1008 syntax $<...>. See the cmake-generator-expressions(7) manual for
1009 available expressions. See the cmake-buildsystem(7) manual for more on
1010 defining buildsystem properties.
1011
1012 LINK_OPTIONS
1013 New in version 3.13.
1014
1015
1016 List of options to use for the link step of shared library, module and
1017 executable targets as well as the device link step.
1018
1019 This property holds a semicolon-separated list of options given so far
1020 to the add_link_options() command.
1021
1022 This property is used to initialize the LINK_OPTIONS target property
1023 when a target is created, which is used by the generators to set the
1024 options for the compiler.
1025
1026 Contents of LINK_OPTIONS may use "generator expressions" with the syn‐
1027 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
1028 able expressions. See the cmake-buildsystem(7) manual for more on
1029 defining buildsystem properties.
1030
1031 LISTFILE_STACK
1032 The current stack of listfiles being processed.
1033
1034 This property is mainly useful when trying to debug errors in your
1035 CMake scripts. It returns a list of what list files are currently be‐
1036 ing processed, in order. So if one listfile does an include() command
1037 then that is effectively pushing the included listfile onto the stack.
1038
1039 MACROS
1040 List of macro commands available in the current directory.
1041
1042 This read-only property specifies the list of CMake macros currently
1043 defined. It is intended for debugging purposes. See the macro() com‐
1044 mand.
1045
1046 PARENT_DIRECTORY
1047 Source directory that added current subdirectory.
1048
1049 This read-only property specifies the source directory that added the
1050 current source directory as a subdirectory of the build. In the
1051 top-level directory the value is the empty-string.
1052
1053 RULE_LAUNCH_COMPILE
1054 Specify a launcher for compile rules.
1055
1056 See the global property of the same name for details. This overrides
1057 the global property for a directory.
1058
1059 RULE_LAUNCH_CUSTOM
1060 Specify a launcher for custom rules.
1061
1062 See the global property of the same name for details. This overrides
1063 the global property for a directory.
1064
1065 RULE_LAUNCH_LINK
1066 Specify a launcher for link rules.
1067
1068 See the global property of the same name for details. This overrides
1069 the global property for a directory.
1070
1071 SOURCE_DIR
1072 New in version 3.7.
1073
1074
1075 This read-only directory property reports absolute path to the source
1076 directory on which it is read.
1077
1078 SUBDIRECTORIES
1079 New in version 3.7.
1080
1081
1082 This read-only directory property contains a semicolon-separated list
1083 of subdirectories processed so far by the add_subdirectory() or sub‐
1084 dirs() commands. Each entry is the absolute path to the source direc‐
1085 tory (containing the CMakeLists.txt file). This is suitable to pass to
1086 the get_property() command DIRECTORY option.
1087
1088 NOTE:
1089 The subdirs() command does not process its arguments until after the
1090 calling directory is fully processed. Therefore looking up this
1091 property in the current directory will not see them.
1092
1093 TESTS
1094 New in version 3.12.
1095
1096
1097 List of tests.
1098
1099 This read-only property holds a semicolon-separated list of tests de‐
1100 fined so far, in the current directory, by the add_test() command.
1101
1102 TEST_INCLUDE_FILES
1103 New in version 3.10.
1104
1105
1106 A list of cmake files that will be included when ctest is run.
1107
1108 If you specify TEST_INCLUDE_FILES, those files will be included and
1109 processed when ctest is run on the directory.
1110
1111 VARIABLES
1112 List of variables defined in the current directory.
1113
1114 This read-only property specifies the list of CMake variables currently
1115 defined. It is intended for debugging purposes.
1116
1117 VS_GLOBAL_SECTION_POST_<section>
1118 Specify a postSolution global section in Visual Studio.
1119
1120 Setting a property like this generates an entry of the following form
1121 in the solution file:
1122
1123 GlobalSection(<section>) = postSolution
1124 <contents based on property value>
1125 EndGlobalSection
1126
1127 The property must be set to a semicolon-separated list of key=value
1128 pairs. Each such pair will be transformed into an entry in the solu‐
1129 tion global section. Whitespace around key and value is ignored. List
1130 elements which do not contain an equal sign are skipped.
1131
1132 This property only works for Visual Studio 9 and above; it is ignored
1133 on other generators. The property only applies when set on a directory
1134 whose CMakeLists.txt contains a project() command.
1135
1136 Note that CMake generates postSolution sections ExtensibilityGlobals
1137 and ExtensibilityAddIns by default. If you set the corresponding prop‐
1138 erty, it will override the default section. For example, setting
1139 VS_GLOBAL_SECTION_POST_ExtensibilityGlobals will override the default
1140 contents of the ExtensibilityGlobals section, while keeping Extensibil‐
1141 ityAddIns on its default. However, CMake will always add a Solu‐
1142 tionGuid to the ExtensibilityGlobals section if it is not specified ex‐
1143 plicitly.
1144
1145 VS_GLOBAL_SECTION_PRE_<section>
1146 Specify a preSolution global section in Visual Studio.
1147
1148 Setting a property like this generates an entry of the following form
1149 in the solution file:
1150
1151 GlobalSection(<section>) = preSolution
1152 <contents based on property value>
1153 EndGlobalSection
1154
1155 The property must be set to a semicolon-separated list of key=value
1156 pairs. Each such pair will be transformed into an entry in the solu‐
1157 tion global section. Whitespace around key and value is ignored. List
1158 elements which do not contain an equal sign are skipped.
1159
1160 This property only works for Visual Studio 9 and above; it is ignored
1161 on other generators. The property only applies when set on a directory
1162 whose CMakeLists.txt contains a project() command.
1163
1164 VS_STARTUP_PROJECT
1165 New in version 3.6.
1166
1167
1168 Specify the default startup project in a Visual Studio solution.
1169
1170 The Visual Studio Generators create a .sln file for each directory
1171 whose CMakeLists.txt file calls the project() command. Set this prop‐
1172 erty in the same directory as a project() command call (e.g. in the
1173 top-level CMakeLists.txt file) to specify the default startup project
1174 for the corresponding solution file.
1175
1176 The property must be set to the name of an existing target. This will
1177 cause that project to be listed first in the generated solution file
1178 causing Visual Studio to make it the startup project if the solution
1179 has never been opened before.
1180
1181 If this property is not specified, then the ALL_BUILD project will be
1182 the default.
1183
1185 ADDITIONAL_CLEAN_FILES
1186 New in version 3.15.
1187
1188
1189 A ;-list of files or directories that will be removed as a part of the
1190 global clean target. It can be used to specify files and directories
1191 that are generated as part of building the target or that are directly
1192 associated with the target in some way (e.g. created as a result of
1193 running the target).
1194
1195 For custom targets, if such files can be captured as outputs or byprod‐
1196 ucts instead, then that should be preferred over adding them to this
1197 property. If an additional clean file is used by multiple targets or
1198 isn't target-specific, then the ADDITIONAL_CLEAN_FILES directory prop‐
1199 erty may be the more appropriate property to use.
1200
1201 Relative paths are allowed and are interpreted relative to the current
1202 binary directory.
1203
1204 Contents of ADDITIONAL_CLEAN_FILES may use generator expressions.
1205
1206 This property only works for the Ninja and the Makefile generators. It
1207 is ignored by other generators.
1208
1209 AIX_EXPORT_ALL_SYMBOLS
1210 New in version 3.17.
1211
1212
1213 On AIX, CMake automatically exports all symbols from shared libraries,
1214 and from executables with the ENABLE_EXPORTS target property set. Ex‐
1215 plicitly disable this boolean property to suppress the behavior and ex‐
1216 port no symbols by default. In this case it is expected that the
1217 project will use other means to export some symbols.
1218
1219 This property is initialized by the value of the CMAKE_AIX_EX‐
1220 PORT_ALL_SYMBOLS variable if it is set when a target is created.
1221
1222 ALIAS_GLOBAL
1223 New in version 3.18.
1224
1225
1226 Read-only property indicating of whether an ALIAS target is globally
1227 visible.
1228
1229 The boolean value of this property is TRUE for aliases to IMPORTED tar‐
1230 gets created with the GLOBAL options to add_executable() or add_li‐
1231 brary(), FALSE otherwise. It is undefined for targets built within the
1232 project.
1233
1234 NOTE:
1235 Promoting an IMPORTED target from LOCAL to GLOBAL scope by changing
1236 the value or IMPORTED_GLOBAL target property do not change the scope
1237 of local aliases.
1238
1239 ALIASED_TARGET
1240 Name of target aliased by this target.
1241
1242 If this is an Alias Target, this property contains the name of the tar‐
1243 get aliased.
1244
1245 ANDROID_ANT_ADDITIONAL_OPTIONS
1246 New in version 3.4.
1247
1248
1249 Set the additional options for Android Ant build system. This is a
1250 string value containing all command line options for the Ant build.
1251 This property is initialized by the value of the CMAKE_ANDROID_ANT_AD‐
1252 DITIONAL_OPTIONS variable if it is set when a target is created.
1253
1254 ANDROID_API
1255 New in version 3.1.
1256
1257
1258 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1259 Edition, this property sets the Android target API version (e.g. 15).
1260 The version number must be a positive decimal integer. This property
1261 is initialized by the value of the CMAKE_ANDROID_API variable if it is
1262 set when a target is created.
1263
1264 ANDROID_API_MIN
1265 New in version 3.2.
1266
1267
1268 Set the Android MIN API version (e.g. 9). The version number must be a
1269 positive decimal integer. This property is initialized by the value of
1270 the CMAKE_ANDROID_API_MIN variable if it is set when a target is cre‐
1271 ated. Native code builds using this API version.
1272
1273 ANDROID_ARCH
1274 New in version 3.4.
1275
1276
1277 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1278 Edition, this property sets the Android target architecture.
1279
1280 This is a string property that could be set to the one of the following
1281 values:
1282
1283 • armv7-a: "ARMv7-A (armv7-a)"
1284
1285 • armv7-a-hard: "ARMv7-A, hard-float ABI (armv7-a)"
1286
1287 • arm64-v8a: "ARMv8-A, 64bit (arm64-v8a)"
1288
1289 • x86: "x86 (x86)"
1290
1291 • x86_64: "x86_64 (x86_64)"
1292
1293 This property is initialized by the value of the CMAKE_ANDROID_ARCH
1294 variable if it is set when a target is created.
1295
1296 ANDROID_ASSETS_DIRECTORIES
1297 New in version 3.4.
1298
1299
1300 Set the Android assets directories to copy into the main assets folder
1301 before build. This a string property that contains the directory paths
1302 separated by semicolon. This property is initialized by the value of
1303 the CMAKE_ANDROID_ASSETS_DIRECTORIES variable if it is set when a tar‐
1304 get is created.
1305
1306 ANDROID_GUI
1307 New in version 3.1.
1308
1309
1310 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1311 Edition, this property specifies whether to build an executable as an
1312 application package on Android.
1313
1314 When this property is set to true the executable when built for Android
1315 will be created as an application package. This property is initial‐
1316 ized by the value of the CMAKE_ANDROID_GUI variable if it is set when a
1317 target is created.
1318
1319 Add the AndroidManifest.xml source file explicitly to the target
1320 add_executable() command invocation to specify the root directory of
1321 the application package source.
1322
1323 ANDROID_JAR_DEPENDENCIES
1324 New in version 3.4.
1325
1326
1327 Set the Android property that specifies JAR dependencies. This is a
1328 string value property. This property is initialized by the value of the
1329 CMAKE_ANDROID_JAR_DEPENDENCIES variable if it is set when a target is
1330 created.
1331
1332 ANDROID_JAR_DIRECTORIES
1333 New in version 3.4.
1334
1335
1336 Set the Android property that specifies directories to search for the
1337 JAR libraries.
1338
1339 This a string property that contains the directory paths separated by
1340 semicolons. This property is initialized by the value of the CMAKE_AN‐
1341 DROID_JAR_DIRECTORIES variable if it is set when a target is created.
1342
1343 Contents of ANDROID_JAR_DIRECTORIES may use "generator expressions"
1344 with the syntax $<...>. See the cmake-generator-expressions(7) manual
1345 for available expressions.
1346
1347 ANDROID_JAVA_SOURCE_DIR
1348 New in version 3.4.
1349
1350
1351 Set the Android property that defines the Java source code root direc‐
1352 tories. This a string property that contains the directory paths sepa‐
1353 rated by semicolon. This property is initialized by the value of the
1354 CMAKE_ANDROID_JAVA_SOURCE_DIR variable if it is set when a target is
1355 created.
1356
1357 ANDROID_NATIVE_LIB_DEPENDENCIES
1358 New in version 3.4.
1359
1360
1361 Set the Android property that specifies the .so dependencies. This is
1362 a string property.
1363
1364 This property is initialized by the value of the CMAKE_ANDROID_NA‐
1365 TIVE_LIB_DEPENDENCIES variable if it is set when a target is created.
1366
1367 Contents of ANDROID_NATIVE_LIB_DEPENDENCIES may use "generator expres‐
1368 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
1369 manual for available expressions.
1370
1371 ANDROID_NATIVE_LIB_DIRECTORIES
1372 New in version 3.4.
1373
1374
1375 Set the Android property that specifies directories to search for the
1376 .so libraries.
1377
1378 This a string property that contains the directory paths separated by
1379 semicolons.
1380
1381 This property is initialized by the value of the CMAKE_ANDROID_NA‐
1382 TIVE_LIB_DIRECTORIES variable if it is set when a target is created.
1383
1384 Contents of ANDROID_NATIVE_LIB_DIRECTORIES may use "generator expres‐
1385 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
1386 manual for available expressions.
1387
1388 ANDROID_PROCESS_MAX
1389 New in version 3.4.
1390
1391
1392 Set the Android property that defines the maximum number of a parallel
1393 Android NDK compiler processes (e.g. 4). This property is initialized
1394 by the value of the CMAKE_ANDROID_PROCESS_MAX variable if it is set
1395 when a target is created.
1396
1397 ANDROID_PROGUARD
1398 New in version 3.4.
1399
1400
1401 When this property is set to true that enables the ProGuard tool to
1402 shrink, optimize, and obfuscate the code by removing unused code and
1403 renaming classes, fields, and methods with semantically obscure names.
1404 This property is initialized by the value of the CMAKE_ANDROID_PROGUARD
1405 variable if it is set when a target is created.
1406
1407 ANDROID_PROGUARD_CONFIG_PATH
1408 New in version 3.4.
1409
1410
1411 Set the Android property that specifies the location of the ProGuard
1412 config file. Leave empty to use the default one. This a string prop‐
1413 erty that contains the path to ProGuard config file. This property is
1414 initialized by the value of the CMAKE_ANDROID_PROGUARD_CONFIG_PATH
1415 variable if it is set when a target is created.
1416
1417 ANDROID_SECURE_PROPS_PATH
1418 New in version 3.4.
1419
1420
1421 Set the Android property that states the location of the secure proper‐
1422 ties file. This is a string property that contains the file path.
1423 This property is initialized by the value of the CMAKE_ANDROID_SE‐
1424 CURE_PROPS_PATH variable if it is set when a target is created.
1425
1426 ANDROID_SKIP_ANT_STEP
1427 New in version 3.4.
1428
1429
1430 Set the Android property that defines whether or not to skip the Ant
1431 build step. This is a boolean property initialized by the value of the
1432 CMAKE_ANDROID_SKIP_ANT_STEP variable if it is set when a target is cre‐
1433 ated.
1434
1435 ANDROID_STL_TYPE
1436 New in version 3.4.
1437
1438
1439 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1440 Edition, this property specifies the type of STL support for the
1441 project. This is a string property that could set to the one of the
1442 following values:
1443
1444 none No C++ Support
1445
1446 system Minimal C++ without STL
1447
1448 gabi++_static
1449 GAbi++ Static
1450
1451 gabi++_shared
1452 GAbi++ Shared
1453
1454 gnustl_static
1455 GNU libstdc++ Static
1456
1457 gnustl_shared
1458 GNU libstdc++ Shared
1459
1460 stlport_static
1461 STLport Static
1462
1463 stlport_shared
1464 STLport Shared
1465
1466 This property is initialized by the value of the CMAKE_ANDROID_STL_TYPE
1467 variable if it is set when a target is created.
1468
1469 ARCHIVE_OUTPUT_DIRECTORY
1470 Output directory in which to build ARCHIVE target files.
1471
1472 This property specifies the directory into which archive target files
1473 should be built. The property value may use generator expressions.
1474 Multi-configuration generators (Visual Studio, Xcode, Ninja Multi-Con‐
1475 fig) append a per-configuration subdirectory to the specified directory
1476 unless a generator expression is used.
1477
1478 This property is initialized by the value of the CMAKE_ARCHIVE_OUT‐
1479 PUT_DIRECTORY variable if it is set when a target is created.
1480
1481 See also the ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> target property.
1482
1483 ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
1484 Per-configuration output directory for ARCHIVE target files.
1485
1486 This is a per-configuration version of the ARCHIVE_OUTPUT_DIRECTORY
1487 target property, but multi-configuration generators (VS, Xcode) do NOT
1488 append a per-configuration subdirectory to the specified directory.
1489 This property is initialized by the value of the CMAKE_ARCHIVE_OUT‐
1490 PUT_DIRECTORY_<CONFIG> variable if it is set when a target is created.
1491
1492 Contents of ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
1493 sions.
1494
1495 ARCHIVE_OUTPUT_NAME
1496 Output name for ARCHIVE target files.
1497
1498 This property specifies the base name for archive target files. It
1499 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
1500
1501 See also the ARCHIVE_OUTPUT_NAME_<CONFIG> target property.
1502
1503 ARCHIVE_OUTPUT_NAME_<CONFIG>
1504 Per-configuration output name for ARCHIVE target files.
1505
1506 This is the configuration-specific version of the ARCHIVE_OUTPUT_NAME
1507 target property.
1508
1509 AUTOGEN_BUILD_DIR
1510 New in version 3.9.
1511
1512
1513 Directory where AUTOMOC, AUTOUIC and AUTORCC generate files for the
1514 target.
1515
1516 The directory is created on demand and automatically added to the ADDI‐
1517 TIONAL_CLEAN_FILES target property.
1518
1519 When unset or empty the directory <dir>/<target-name>_autogen is used
1520 where <dir> is CMAKE_CURRENT_BINARY_DIR and <target-name> is NAME.
1521
1522 By default AUTOGEN_BUILD_DIR is unset.
1523
1524 See the cmake-qt(7) manual for more information on using CMake with Qt.
1525
1526 AUTOGEN_ORIGIN_DEPENDS
1527 New in version 3.14.
1528
1529
1530 Switch for forwarding origin target dependencies to the corresponding
1531 _autogen target.
1532
1533 Targets which have their AUTOMOC or AUTOUIC property ON have a corre‐
1534 sponding _autogen target which generates moc and uic files. As this
1535 _autogen target is created at generate-time, it is not possible to de‐
1536 fine dependencies of it using e.g. add_dependencies(). Instead the
1537 AUTOGEN_ORIGIN_DEPENDS target property decides whether the origin tar‐
1538 get dependencies should be forwarded to the _autogen target or not.
1539
1540 By default AUTOGEN_ORIGIN_DEPENDS is initialized from CMAKE_AUTO‐
1541 GEN_ORIGIN_DEPENDS which is ON by default.
1542
1543 In total the dependencies of the _autogen target are composed from
1544
1545 • forwarded origin target dependencies (enabled by default via
1546 AUTOGEN_ORIGIN_DEPENDS)
1547
1548 • additional user defined dependencies from AUTOGEN_TARGET_DEPENDS
1549
1550 See the cmake-qt(7) manual for more information on using CMake with Qt.
1551
1552 Note
1553 Disabling AUTOGEN_ORIGIN_DEPENDS is useful to avoid building of origin
1554 target dependencies when building the _autogen target only. This is
1555 especially interesting when a global autogen target is enabled.
1556
1557 When the _autogen target doesn't require all the origin target's depen‐
1558 dencies, and AUTOGEN_ORIGIN_DEPENDS is disabled, it might be necessary
1559 to extend AUTOGEN_TARGET_DEPENDS to add missing dependencies.
1560
1561 AUTOGEN_PARALLEL
1562 New in version 3.11.
1563
1564
1565 Number of parallel moc or uic processes to start when using AUTOMOC and
1566 AUTOUIC.
1567
1568 The custom <origin>_autogen target starts a number of threads of which
1569 each one parses a source file and on demand starts a moc or uic
1570 process. AUTOGEN_PARALLEL controls how many parallel threads (and
1571 therefore moc or uic processes) are started.
1572
1573 • An empty (or unset) value or the string AUTO sets the number of
1574 threads/processes to the number of physical CPUs on the host system.
1575
1576 • A positive non zero integer value sets the exact thread/process
1577 count.
1578
1579 • Otherwise a single thread/process is started.
1580
1581 By default AUTOGEN_PARALLEL is initialized from CMAKE_AUTOGEN_PARALLEL.
1582
1583 See the cmake-qt(7) manual for more information on using CMake with Qt.
1584
1585 AUTOGEN_TARGET_DEPENDS
1586 Additional target dependencies of the corresponding _autogen target.
1587
1588 Targets which have their AUTOMOC or AUTOUIC property ON have a corre‐
1589 sponding _autogen target which generates moc and uic files. As this
1590 _autogen target is created at generate-time, it is not possible to de‐
1591 fine dependencies of it using e.g. add_dependencies(). Instead the
1592 AUTOGEN_TARGET_DEPENDS target property can be set to a ;-list of addi‐
1593 tional dependencies for the _autogen target. Dependencies can be tar‐
1594 get names or file names.
1595
1596 In total the dependencies of the _autogen target are composed from
1597
1598 • forwarded origin target dependencies (enabled by default via AUTO‐
1599 GEN_ORIGIN_DEPENDS)
1600
1601 • additional user defined dependencies from AUTOGEN_TARGET_DEPENDS
1602
1603 See the cmake-qt(7) manual for more information on using CMake with Qt.
1604
1605 Use cases
1606 If AUTOMOC or AUTOUIC depends on a file that is either
1607
1608 • a GENERATED non C++ file (e.g. a GENERATED .json or .ui file) or
1609
1610 • a GENERATED C++ file that isn't recognized by AUTOMOC and AUTOUIC be‐
1611 cause it's skipped by SKIP_AUTOMOC, SKIP_AUTOUIC, SKIP_AUTOGEN or
1612 CMP0071 or
1613
1614 • a file that isn't in the origin target's sources
1615
1616 it must be added to AUTOGEN_TARGET_DEPENDS.
1617
1618 AUTOMOC
1619 Should the target be processed with auto-moc (for Qt projects).
1620
1621 AUTOMOC is a boolean specifying whether CMake will handle the Qt moc
1622 preprocessor automatically, i.e. without having to use commands like
1623 QT4_WRAP_CPP(), QT5_WRAP_CPP(), etc. Currently, Qt versions 4 to 6 are
1624 supported.
1625
1626 This property is initialized by the value of the CMAKE_AUTOMOC variable
1627 if it is set when a target is created.
1628
1629 When this property is set ON, CMake will scan the header and source
1630 files at build time and invoke moc accordingly.
1631
1632 Header file processing
1633 At configuration time, a list of header files that should be scanned by
1634 AUTOMOC is computed from the target's sources.
1635
1636 • All header files in the target's sources are added to the scan list.
1637
1638 • For all C++ source files <source_base>.<source_extension> in the tar‐
1639 get's sources, CMake searches for
1640
1641 • a regular header with the same base name (<source_base>.<header_ex‐
1642 tention>) and
1643
1644 • a private header with the same base name and a _p suffix
1645 (<source_base>_p.<header_extention>)
1646
1647 and adds these to the scan list.
1648
1649 At build time, CMake scans each unknown or modified header file from
1650 the list and searches for
1651
1652 • a Qt macro from AUTOMOC_MACRO_NAMES,
1653
1654 • additional file dependencies from the FILE argument of a
1655 Q_PLUGIN_METADATA macro and
1656
1657 • additional file dependencies detected by filters defined in AUTO‐
1658 MOC_DEPEND_FILTERS.
1659
1660 If a Qt macro is found, then the header will be compiled by the moc to
1661 the output file moc_<base_name>.cpp. The complete output file path is
1662 described in the section Output file location.
1663
1664 The header will be moc compiled again if a file from the additional
1665 file dependencies changes.
1666
1667 Header moc output files moc_<base_name>.cpp can be included in source
1668 files. In the section Including header moc files in sources there is
1669 more information on that topic.
1670
1671 Source file processing
1672 At build time, CMake scans each unknown or modified C++ source file
1673 from the target's sources for
1674
1675 • a Qt macro from AUTOMOC_MACRO_NAMES,
1676
1677 • includes of header moc files (see Including header moc files in
1678 sources),
1679
1680 • additional file dependencies from the FILE argument of a
1681 Q_PLUGIN_METADATA macro and
1682
1683 • additional file dependencies detected by filters defined in AUTO‐
1684 MOC_DEPEND_FILTERS.
1685
1686 If a Qt macro is found, then the C++ source file <base>.<source_exten‐
1687 sion> is expected to as well contain an include statement
1688
1689 #include <<base>.moc> // or
1690 #include "<base>.moc"
1691
1692 The source file then will be compiled by the moc to the output file
1693 <base>.moc. A description of the complete output file path is in sec‐
1694 tion Output file location.
1695
1696 The source will be moc compiled again if a file from the additional
1697 file dependencies changes.
1698
1699 Including header moc files in sources
1700 A source file can include the moc output file of a header
1701 <header_base>.<header_extension> by using an include statement of the
1702 form
1703
1704 #include <moc_<header_base>.cpp> // or
1705 #include "moc_<header_base>.cpp"
1706
1707 If the moc output file of a header is included by a source, it will be
1708 generated in a different location than if it was not included. This is
1709 described in the section Output file location.
1710
1711 Output file location
1712 Included moc output files
1713 moc output files that are included by a source file will be generated
1714 in
1715
1716 • <AUTOGEN_BUILD_DIR>/include for single configuration generators or in
1717
1718 • <AUTOGEN_BUILD_DIR>/include_<CONFIG> for multi configuration genera‐
1719 tors.
1720
1721 Where <AUTOGEN_BUILD_DIR> is the value of the target property AUTO‐
1722 GEN_BUILD_DIR.
1723
1724 The include directory is automatically added to the target's IN‐
1725 CLUDE_DIRECTORIES.
1726
1727 Not included moc output files
1728 moc output files that are not included in a source file will be gener‐
1729 ated in
1730
1731 • <AUTOGEN_BUILD_DIR>/<SOURCE_DIR_CHECKSUM> for single configuration
1732 generators or in,
1733
1734 • <AUTOGEN_BUILD_DIR>/include_<CONFIG>/<SOURCE_DIR_CHECKSUM> for multi
1735 configuration generators.
1736
1737 Where <SOURCE_DIR_CHECKSUM> is a checksum computed from the relative
1738 parent directory path of the moc input file. This scheme allows to
1739 have moc input files with the same name in different directories.
1740
1741 All not included moc output files will be included automatically by the
1742 CMake generated file
1743
1744 • <AUTOGEN_BUILD_DIR>/mocs_compilation.cpp, or
1745
1746 • <AUTOGEN_BUILD_DIR>/mocs_compilation_$<CONFIG>.cpp,
1747
1748 which is added to the target's sources.
1749
1750 Qt version detection
1751 AUTOMOC enabled targets need to know the Qt major and minor version
1752 they're working with. The major version usually is provided by the IN‐
1753 TERFACE_QT_MAJOR_VERSION property of the Qt[456]Core library, that the
1754 target links to. To find the minor version, CMake builds a list of
1755 available Qt versions from
1756
1757 • Qt6Core_VERSION_MAJOR and Qt6Core_VERSION_MINOR variables (usually
1758 set by find_package(Qt6...))
1759
1760 • Qt6Core_VERSION_MAJOR and Qt6Core_VERSION_MINOR directory properties
1761
1762 • Qt5Core_VERSION_MAJOR and Qt5Core_VERSION_MINOR variables (usually
1763 set by find_package(Qt5...))
1764
1765 • Qt5Core_VERSION_MAJOR and Qt5Core_VERSION_MINOR directory properties
1766
1767 • QT_VERSION_MAJOR and QT_VERSION_MINOR variables (usually set by
1768 find_package(Qt4...))
1769
1770 • QT_VERSION_MAJOR and QT_VERSION_MINOR directory properties
1771
1772 in the context of the add_executable() or add_library() call.
1773
1774 Assumed INTERFACE_QT_MAJOR_VERSION is a valid number, the first entry
1775 in the list with a matching major version is taken. If no matching ma‐
1776 jor version was found, an error is generated. If INTERFACE_QT_MA‐
1777 JOR_VERSION is not a valid number, the first entry in the list is
1778 taken.
1779
1780 A find_package(Qt[456]...) call sets the QT/Qt[56]Core_VERSION_MA‐
1781 JOR/MINOR variables. If the call is in a different context than the
1782 add_executable() or add_library() call, e.g. in a function, then the
1783 version variables might not be available to the AUTOMOC enabled target.
1784 In that case the version variables can be forwarded from the find_pack‐
1785 age(Qt[456]...) calling context to the add_executable() or add_li‐
1786 brary() calling context as directory properties. The following Qt5 ex‐
1787 ample demonstrates the procedure.
1788
1789 function (add_qt5_client)
1790 find_package(Qt5 REQUIRED QUIET COMPONENTS Core Widgets)
1791 ...
1792 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
1793 PROPERTY Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}")
1794 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
1795 PROPERTY Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MAJOR}")
1796 ...
1797 endfunction ()
1798 ...
1799 add_qt5_client()
1800 add_executable(myTarget main.cpp)
1801 target_link_libraries(myTarget Qt5::QtWidgets)
1802 set_property(TARGET myTarget PROPERTY AUTOMOC ON)
1803
1804 Modifiers
1805 AUTOMOC_EXECUTABLE: The moc executable will be detected automatically,
1806 but can be forced to a certain binary using this target property.
1807
1808 AUTOMOC_MOC_OPTIONS: Additional command line options for moc can be set
1809 in this target property.
1810
1811 AUTOMOC_MACRO_NAMES: This list of Qt macro names can be extended to
1812 search for additional macros in headers and sources.
1813
1814 AUTOMOC_DEPEND_FILTERS: moc dependency file names can be extracted from
1815 headers or sources by defining file name filters in this target prop‐
1816 erty.
1817
1818 AUTOMOC_COMPILER_PREDEFINES: Compiler pre definitions for moc are writ‐
1819 ten to the moc_predefs.h file. The generation of this file can be en‐
1820 abled or disabled in this target property.
1821
1822 SKIP_AUTOMOC: Sources and headers can be excluded from AUTOMOC process‐
1823 ing by setting this source file property.
1824
1825 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
1826 AUTORCC processing by setting this source file property.
1827
1828 AUTOGEN_SOURCE_GROUP: This global property can be used to group files
1829 generated by AUTOMOC or AUTORCC together in an IDE, e.g. in MSVS.
1830
1831 AUTOGEN_TARGETS_FOLDER: This global property can be used to group
1832 AUTOMOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
1833
1834 CMAKE_GLOBAL_AUTOGEN_TARGET: A global autogen target, that depends on
1835 all AUTOMOC or AUTOUIC generated <ORIGIN>_autogen targets in the
1836 project, will be generated when this variable is ON.
1837
1838 AUTOGEN_PARALLEL: This target property controls the number of moc or
1839 uic processes to start in parallel during builds.
1840
1841 See the cmake-qt(7) manual for more information on using CMake with Qt.
1842
1843 AUTOMOC_COMPILER_PREDEFINES
1844 New in version 3.10.
1845
1846
1847 Boolean value used by AUTOMOC to determine if the compiler pre defini‐
1848 tions file moc_predefs.h should be generated.
1849
1850 CMake generates a moc_predefs.h file with compiler pre definitions from
1851 the output of the command defined in CMAKE_CXX_COMPILER_PREDEFINES_COM‐
1852 MAND when
1853
1854 • AUTOMOC is enabled,
1855
1856 • AUTOMOC_COMPILER_PREDEFINES is enabled,
1857
1858 • CMAKE_CXX_COMPILER_PREDEFINES_COMMAND isn't empty and
1859
1860 • the Qt version is greater or equal 5.8.
1861
1862 The moc_predefs.h file, which is generated in AUTOGEN_BUILD_DIR, is
1863 passed to moc as the argument to the --include option.
1864
1865 By default AUTOMOC_COMPILER_PREDEFINES is initialized from CMAKE_AUTO‐
1866 MOC_COMPILER_PREDEFINES, which is ON by default.
1867
1868 See the cmake-qt(7) manual for more information on using CMake with Qt.
1869
1870 AUTOMOC_DEPEND_FILTERS
1871 New in version 3.9.
1872
1873
1874 Filter definitions used by AUTOMOC to extract file names from a source
1875 file that are registered as additional dependencies for the moc file of
1876 the source file.
1877
1878 Filters are defined as KEYWORD;REGULAR_EXPRESSION pairs. First the file
1879 content is searched for KEYWORD. If it is found at least once, then
1880 file names are extracted by successively searching for REGULAR_EXPRES‐
1881 SION and taking the first match group.
1882
1883 The file name found in the first match group is searched for
1884
1885 • first in the vicinity of the source file
1886
1887 • and afterwards in the target's INCLUDE_DIRECTORIES.
1888
1889 If any of the extracted files changes, then the moc file for the source
1890 file gets rebuilt even when the source file itself doesn't change.
1891
1892 If any of the extracted files is GENERATED or if it is not in the tar‐
1893 get's sources, then it might be necessary to add it to the _autogen
1894 target dependencies. See AUTOGEN_TARGET_DEPENDS for reference.
1895
1896 By default AUTOMOC_DEPEND_FILTERS is initialized from CMAKE_AUTOMOC_DE‐
1897 PEND_FILTERS, which is empty by default.
1898
1899 From Qt 5.15.0 on this variable is ignored as moc is able to output the
1900 correct dependencies.
1901
1902 See the cmake-qt(7) manual for more information on using CMake with Qt.
1903
1904 Example 1
1905 A header file my_class.hpp uses a custom macro JSON_FILE_MACRO which is
1906 defined in an other header macros.hpp. We want the moc file of
1907 my_class.hpp to depend on the file name argument of JSON_FILE_MACRO:
1908
1909 // my_class.hpp
1910 class My_Class : public QObject
1911 {
1912 Q_OBJECT
1913 JSON_FILE_MACRO ( "info.json" )
1914 ...
1915 };
1916
1917 In CMakeLists.txt we add a filter to CMAKE_AUTOMOC_DEPEND_FILTERS like
1918 this:
1919
1920 list( APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
1921 "JSON_FILE_MACRO"
1922 "[\n][ \t]*JSON_FILE_MACRO[ \t]*\\([ \t]*\"([^\"]+)\""
1923 )
1924
1925 We assume info.json is a plain (not GENERATED) file that is listed in
1926 the target's source. Therefore we do not need to add it to AUTO‐
1927 GEN_TARGET_DEPENDS.
1928
1929 Example 2
1930 In the target my_target a header file complex_class.hpp uses a custom
1931 macro JSON_BASED_CLASS which is defined in an other header macros.hpp:
1932
1933 // macros.hpp
1934 ...
1935 #define JSON_BASED_CLASS(name, json) \
1936 class name : public QObject \
1937 { \
1938 Q_OBJECT \
1939 Q_PLUGIN_METADATA(IID "demo" FILE json) \
1940 name() {} \
1941 };
1942 ...
1943
1944 // complex_class.hpp
1945 #pragma once
1946 JSON_BASED_CLASS(Complex_Class, "meta.json")
1947 // end of file
1948
1949 Since complex_class.hpp doesn't contain a Q_OBJECT macro it would be
1950 ignored by AUTOMOC. We change this by adding JSON_BASED_CLASS to
1951 CMAKE_AUTOMOC_MACRO_NAMES:
1952
1953 list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "JSON_BASED_CLASS")
1954
1955 We want the moc file of complex_class.hpp to depend on meta.json. So
1956 we add a filter to CMAKE_AUTOMOC_DEPEND_FILTERS:
1957
1958 list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
1959 "JSON_BASED_CLASS"
1960 "[\n^][ \t]*JSON_BASED_CLASS[ \t]*\\([^,]*,[ \t]*\"([^\"]+)\""
1961 )
1962
1963 Additionally we assume meta.json is GENERATED which is why we have to
1964 add it to AUTOGEN_TARGET_DEPENDS:
1965
1966 set_property(TARGET my_target APPEND PROPERTY AUTOGEN_TARGET_DEPENDS "meta.json")
1967
1968 AUTOMOC_EXECUTABLE
1969 New in version 3.14.
1970
1971
1972 AUTOMOC_EXECUTABLE is file path pointing to the moc executable to use
1973 for AUTOMOC enabled files. Setting this property will make CMake skip
1974 the automatic detection of the moc binary as well as the sanity-tests
1975 normally run to ensure that the binary is available and working as ex‐
1976 pected.
1977
1978 Usually this property does not need to be set. Only consider this prop‐
1979 erty if auto-detection of moc can not work -- e.g. because you are
1980 building the moc binary as part of your project.
1981
1982 See the cmake-qt(7) manual for more information on using CMake with Qt.
1983
1984 AUTOMOC_MACRO_NAMES
1985 New in version 3.10.
1986
1987
1988 A semicolon-separated list list of macro names used by AUTOMOC to de‐
1989 termine if a C++ file needs to be processed by moc.
1990
1991 This property is only used if the AUTOMOC property is ON for this tar‐
1992 get.
1993
1994 When running AUTOMOC, CMake searches for the strings listed in
1995 AUTOMOC_MACRO_NAMES in C++ source and header files. If any of the
1996 strings is found
1997
1998 • as the first non space string on a new line or
1999
2000 • as the first non space string after a { on a new line,
2001
2002 then the file will be processed by moc.
2003
2004 By default AUTOMOC_MACRO_NAMES is initialized from CMAKE_AUTO‐
2005 MOC_MACRO_NAMES.
2006
2007 See the cmake-qt(7) manual for more information on using CMake with Qt.
2008
2009 Example
2010 In this case the Q_OBJECT macro is hidden inside another macro called
2011 CUSTOM_MACRO. To let CMake know that source files that contain CUS‐
2012 TOM_MACRO need to be moc processed, we call:
2013
2014 set_property(TARGET tgt APPEND PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
2015
2016 AUTOMOC_MOC_OPTIONS
2017 Additional options for moc when using AUTOMOC
2018
2019 This property is only used if the AUTOMOC property is ON for this tar‐
2020 get. In this case, it holds additional command line options which will
2021 be used when moc is executed during the build, i.e. it is equivalent
2022 to the optional OPTIONS argument of the qt4_wrap_cpp() macro.
2023
2024 This property is initialized by the value of the CMAKE_AUTOMOC_MOC_OP‐
2025 TIONS variable if it is set when a target is created, or an empty
2026 string otherwise.
2027
2028 See the cmake-qt(7) manual for more information on using CMake with Qt.
2029
2030 AUTOMOC_PATH_PREFIX
2031 New in version 3.16.
2032
2033
2034 When this property is ON, CMake will generate the -p path prefix option
2035 for moc on AUTOMOC enabled Qt targets.
2036
2037 To generate the path prefix, CMake tests if the header compiled by moc
2038 is in any of the target include directories. If so, CMake will compute
2039 the relative path accordingly. If the header is not in the include di‐
2040 rectories, CMake will omit the -p path prefix option. moc usually gen‐
2041 erates a relative include path in that case.
2042
2043 AUTOMOC_PATH_PREFIX is initialized from the variable CMAKE_AUTO‐
2044 MOC_PATH_PREFIX, which is OFF by default.
2045
2046 See the cmake-qt(7) manual for more information on using CMake with Qt.
2047
2048 Reproducible builds
2049 For reproducible builds it is recommended to keep headers that are moc
2050 compiled in one of the target include directories and set
2051 AUTOMOC_PATH_PREFIX to ON. This ensures that:
2052
2053 • moc output files are identical on different build setups,
2054
2055 • moc output files will compile correctly when the source and/or build
2056 directory is a symbolic link.
2057
2058 AUTORCC
2059 Should the target be processed with auto-rcc (for Qt projects).
2060
2061 AUTORCC is a boolean specifying whether CMake will handle the Qt rcc
2062 code generator automatically, i.e. without having to use commands like
2063 QT4_ADD_RESOURCES(), QT5_ADD_RESOURCES(), etc. Currently, Qt versions
2064 4 to 6 are supported.
2065
2066 When this property is ON, CMake will handle .qrc files added as target
2067 sources at build time and invoke rcc accordingly. This property is
2068 initialized by the value of the CMAKE_AUTORCC variable if it is set
2069 when a target is created.
2070
2071 By default AUTORCC is processed by a custom command. If the .qrc file
2072 is GENERATED, a custom target is used instead.
2073
2074 When there are multiple .qrc files with the same name, CMake will gen‐
2075 erate unspecified unique output file names for rcc. Therefore, if
2076 Q_INIT_RESOURCE() or Q_CLEANUP_RESOURCE() need to be used, the .qrc
2077 file name must be unique.
2078
2079 Modifiers
2080 AUTORCC_EXECUTABLE: The rcc executable will be detected automatically,
2081 but can be forced to a certain binary by setting this target property.
2082
2083 AUTORCC_OPTIONS: Additional command line options for rcc can be set via
2084 this target property. The corresponding AUTORCC_OPTIONS source file
2085 property can be used to specify options to be applied only to a spe‐
2086 cific .qrc file.
2087
2088 SKIP_AUTORCC: .qrc files can be excluded from AUTORCC processing by
2089 setting this source file property.
2090
2091 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
2092 AUTORCC processing by setting this source file property.
2093
2094 AUTOGEN_SOURCE_GROUP: This global property can be used to group files
2095 generated by AUTOMOC or AUTORCC together in an IDE, e.g. in MSVS.
2096
2097 AUTOGEN_TARGETS_FOLDER: This global property can be used to group AUTO‐
2098 MOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
2099
2100 CMAKE_GLOBAL_AUTORCC_TARGET: A global autorcc target that depends on
2101 all AUTORCC targets in the project will be generated when this variable
2102 is ON.
2103
2104 See the cmake-qt(7) manual for more information on using CMake with Qt.
2105
2106 AUTORCC_EXECUTABLE
2107 New in version 3.14.
2108
2109
2110 AUTORCC_EXECUTABLE is file path pointing to the rcc executable to use
2111 for AUTORCC enabled files. Setting this property will make CMake skip
2112 the automatic detection of the rcc binary as well as the sanity-tests
2113 normally run to ensure that the binary is available and working as ex‐
2114 pected.
2115
2116 Usually this property does not need to be set. Only consider this prop‐
2117 erty if auto-detection of rcc can not work -- e.g. because you are
2118 building the rcc binary as part of your project.
2119
2120 See the cmake-qt(7) manual for more information on using CMake with Qt.
2121
2122 AUTORCC_OPTIONS
2123 Additional options for rcc when using AUTORCC
2124
2125 This property holds additional command line options which will be used
2126 when rcc is executed during the build via AUTORCC, i.e. it is equiva‐
2127 lent to the optional OPTIONS argument of the qt4_add_resources() macro.
2128
2129 This property is initialized by the value of the CMAKE_AUTORCC_OPTIONS
2130 variable if it is set when a target is created, or an empty string oth‐
2131 erwise.
2132
2133 The options set on the target may be overridden by AUTORCC_OPTIONS set
2134 on the .qrc source file.
2135
2136 See the cmake-qt(7) manual for more information on using CMake with Qt.
2137
2138 EXAMPLE
2139 # ...
2140 set_property(TARGET tgt PROPERTY AUTORCC_OPTIONS "--compress;9")
2141 # ...
2142
2143 AUTOUIC
2144 Should the target be processed with auto-uic (for Qt projects).
2145
2146 AUTOUIC is a boolean specifying whether CMake will handle the Qt uic
2147 code generator automatically, i.e. without having to use commands like
2148 QT4_WRAP_UI(), QT5_WRAP_UI(), etc. Currently, Qt versions 4 to 6 are
2149 supported.
2150
2151 This property is initialized by the value of the CMAKE_AUTOUIC variable
2152 if it is set when a target is created.
2153
2154 When this property is ON, CMake will scan the header and source files
2155 at build time and invoke uic accordingly.
2156
2157 Header and source file processing
2158 At build time, CMake scans each header and source file from the tar‐
2159 get's sources for include statements of the form
2160
2161 #include "ui_<ui_base>.h"
2162
2163 Once such an include statement is found in a file, CMake searches for
2164 the uic input file <ui_base>.ui
2165
2166 • in the vicinity of the file and
2167
2168 • in the AUTOUIC_SEARCH_PATHS of the target.
2169
2170 If the <ui_base>.ui file was found, uic is called on it to generate
2171 ui_<ui_base>.h in the directory
2172
2173 • <AUTOGEN_BUILD_DIR>/include for single configuration generators or in
2174
2175 • <AUTOGEN_BUILD_DIR>/include_<CONFIG> for multi configuration genera‐
2176 tors.
2177
2178 Where <AUTOGEN_BUILD_DIR> is the value of the target property AUTO‐
2179 GEN_BUILD_DIR.
2180
2181 The include directory is automatically added to the target's IN‐
2182 CLUDE_DIRECTORIES.
2183
2184 Modifiers
2185 AUTOUIC_EXECUTABLE: The uic executable will be detected automatically,
2186 but can be forced to a certain binary using this target property.
2187
2188 AUTOUIC_OPTIONS: Additional command line options for uic can be set via
2189 this target property. The corresponding AUTOUIC_OPTIONS source file
2190 property can be used to specify options to be applied only to a spe‐
2191 cific <base_name>.ui file.
2192
2193 SKIP_AUTOUIC: Source files can be excluded from AUTOUIC processing by
2194 setting this source file property.
2195
2196 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
2197 AUTORCC processing by setting this source file property.
2198
2199 AUTOGEN_TARGETS_FOLDER: This global property can be used to group AUTO‐
2200 MOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
2201
2202 CMAKE_GLOBAL_AUTOGEN_TARGET: A global autogen target, that depends on
2203 all AUTOMOC or AUTOUIC generated <ORIGIN>_autogen targets in the
2204 project, will be generated when this variable is ON.
2205
2206 AUTOGEN_PARALLEL: This target property controls the number of moc or
2207 uic processes to start in parallel during builds.
2208
2209 See the cmake-qt(7) manual for more information on using CMake with Qt.
2210
2211 AUTOUIC_EXECUTABLE
2212 New in version 3.14.
2213
2214
2215 AUTOUIC_EXECUTABLE is file path pointing to the uic executable to use
2216 for AUTOUIC enabled files. Setting this property will make CMake skip
2217 the automatic detection of the uic binary as well as the sanity-tests
2218 normally run to ensure that the binary is available and working as ex‐
2219 pected.
2220
2221 Usually this property does not need to be set. Only consider this prop‐
2222 erty if auto-detection of uic can not work -- e.g. because you are
2223 building the uic binary as part of your project.
2224
2225 See the cmake-qt(7) manual for more information on using CMake with Qt.
2226
2227 AUTOUIC_OPTIONS
2228 Additional options for uic when using AUTOUIC
2229
2230 This property holds additional command line options which will be used
2231 when uic is executed during the build via AUTOUIC, i.e. it is equiva‐
2232 lent to the optional OPTIONS argument of the qt4_wrap_ui() macro.
2233
2234 This property is initialized by the value of the CMAKE_AUTOUIC_OPTIONS
2235 variable if it is set when a target is created, or an empty string oth‐
2236 erwise.
2237
2238 The options set on the target may be overridden by AUTOUIC_OPTIONS set
2239 on the .ui source file.
2240
2241 This property may use "generator expressions" with the syntax $<...>.
2242 See the cmake-generator-expressions(7) manual for available expres‐
2243 sions.
2244
2245 See the cmake-qt(7) manual for more information on using CMake with Qt.
2246
2247 EXAMPLE
2248 # ...
2249 set_property(TARGET tgt PROPERTY AUTOUIC_OPTIONS "--no-protection")
2250 # ...
2251
2252 AUTOUIC_SEARCH_PATHS
2253 New in version 3.9.
2254
2255
2256 Search path list used by AUTOUIC to find included .ui files.
2257
2258 This property is initialized by the value of the
2259 CMAKE_AUTOUIC_SEARCH_PATHS variable if it is set when a target is cre‐
2260 ated. Otherwise it is empty.
2261
2262 See the cmake-qt(7) manual for more information on using CMake with Qt.
2263
2264 BINARY_DIR
2265 New in version 3.4.
2266
2267
2268 This read-only property reports the value of the CMAKE_CURRENT_BI‐
2269 NARY_DIR variable in the directory in which the target was defined.
2270
2271 BUILD_RPATH
2272 New in version 3.8.
2273
2274
2275 A semicolon-separated list specifying runtime path (RPATH) entries to
2276 add to binaries linked in the build tree (for platforms that support
2277 it). The entries will not be used for binaries in the install tree.
2278 See also the INSTALL_RPATH target property.
2279
2280 This property is initialized by the value of the variable
2281 CMAKE_BUILD_RPATH if it is set when a target is created.
2282
2283 This property supports generator expressions.
2284
2285 BUILD_RPATH_USE_ORIGIN
2286 New in version 3.14.
2287
2288
2289 Whether to use relative paths for the build RPATH.
2290
2291 This property is initialized by the value of the variable
2292 CMAKE_BUILD_RPATH_USE_ORIGIN.
2293
2294 On platforms that support runtime paths (RPATH) with the $ORIGIN token,
2295 setting this property to TRUE enables relative paths in the build RPATH
2296 for executables and shared libraries that point to shared libraries in
2297 the same build tree.
2298
2299 Normally the build RPATH of a binary contains absolute paths to the di‐
2300 rectory of each shared library it links to. The RPATH entries for di‐
2301 rectories contained within the build tree can be made relative to en‐
2302 able relocatable builds and to help achieve reproducible builds by
2303 omitting the build directory from the build environment.
2304
2305 This property has no effect on platforms that do not support the $ORI‐
2306 GIN token in RPATH, or when the CMAKE_SKIP_RPATH variable is set. The
2307 runtime path set through the BUILD_RPATH target property is also unaf‐
2308 fected by this property.
2309
2310 BUILD_WITH_INSTALL_NAME_DIR
2311 New in version 3.9.
2312
2313
2314 BUILD_WITH_INSTALL_NAME_DIR is a boolean specifying whether the macOS
2315 install_name of a target in the build tree uses the directory given by
2316 INSTALL_NAME_DIR. This setting only applies to targets on macOS.
2317
2318 This property is initialized by the value of the variable
2319 CMAKE_BUILD_WITH_INSTALL_NAME_DIR if it is set when a target is cre‐
2320 ated.
2321
2322 If this property is not set and policy CMP0068 is not NEW, the value of
2323 BUILD_WITH_INSTALL_RPATH is used in its place.
2324
2325 BUILD_WITH_INSTALL_RPATH
2326 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the
2327 target in the build tree with the INSTALL_RPATH. This takes precedence
2328 over SKIP_BUILD_RPATH and avoids the need for relinking before instal‐
2329 lation.
2330
2331 This property is initialized by the value of the CMAKE_BUILD_WITH_IN‐
2332 STALL_RPATH variable if it is set when a target is created.
2333
2334 If policy CMP0068 is not NEW, this property also controls use of IN‐
2335 STALL_NAME_DIR in the build tree on macOS. Either way, the
2336 BUILD_WITH_INSTALL_NAME_DIR target property takes precedence.
2337
2338 BUNDLE
2339 This target is a CFBundle on the macOS.
2340
2341 If a module library target has this property set to true it will be
2342 built as a CFBundle when built on the mac. It will have the directory
2343 structure required for a CFBundle and will be suitable to be used for
2344 creating Browser Plugins or other application resources.
2345
2346 BUNDLE_EXTENSION
2347 The file extension used to name a BUNDLE, a FRAMEWORK, or a MACOSX_BUN‐
2348 DLE target on the macOS and iOS.
2349
2350 The default value is bundle, framework, or app for the respective tar‐
2351 get types.
2352
2353 C_EXTENSIONS
2354 New in version 3.1.
2355
2356
2357 Boolean specifying whether compiler specific extensions are requested.
2358
2359 This property specifies whether compiler specific extensions should be
2360 used. For some compilers, this results in adding a flag such as
2361 -std=gnu11 instead of -std=c11 to the compile line. This property is
2362 ON by default. The basic C standard level is controlled by the C_STAN‐
2363 DARD target property.
2364
2365 See the cmake-compile-features(7) manual for information on compile
2366 features and a list of supported compilers.
2367
2368 This property is initialized by the value of the CMAKE_C_EXTENSIONS
2369 variable if set when a target is created and otherwise by the value of
2370 CMAKE_C_EXTENSIONS_DEFAULT (see CMP0128).
2371
2372 C_STANDARD
2373 New in version 3.1.
2374
2375
2376 The C standard whose features are requested to build this target.
2377
2378 This property specifies the C standard whose features are requested to
2379 build this target. For some compilers, this results in adding a flag
2380 such as -std=gnu11 to the compile line. For compilers that have no no‐
2381 tion of a C standard level, such as Microsoft Visual C++ before VS
2382 16.7, this property has no effect.
2383
2384 Supported values are:
2385
2386 90 C89/C90
2387
2388 99 C99
2389
2390 11 C11
2391
2392 17 New in version 3.21.
2393
2394
2395 C17
2396
2397 23 New in version 3.21.
2398
2399
2400 C23
2401
2402 If the value requested does not result in a compile flag being added
2403 for the compiler in use, a previous standard flag will be added in‐
2404 stead. This means that using:
2405
2406 set_property(TARGET tgt PROPERTY C_STANDARD 11)
2407
2408 with a compiler which does not support -std=gnu11 or an equivalent flag
2409 will not result in an error or warning, but will instead add the
2410 -std=gnu99 or -std=gnu90 flag if supported. This "decay" behavior may
2411 be controlled with the C_STANDARD_REQUIRED target property. Addition‐
2412 ally, the C_EXTENSIONS target property may be used to control whether
2413 compiler-specific extensions are enabled on a per-target basis.
2414
2415 See the cmake-compile-features(7) manual for information on compile
2416 features and a list of supported compilers.
2417
2418 This property is initialized by the value of the CMAKE_C_STANDARD vari‐
2419 able if it is set when a target is created.
2420
2421 C_STANDARD_REQUIRED
2422 New in version 3.1.
2423
2424
2425 Boolean describing whether the value of C_STANDARD is a requirement.
2426
2427 If this property is set to ON, then the value of the C_STANDARD target
2428 property is treated as a requirement. If this property is OFF or un‐
2429 set, the C_STANDARD target property is treated as optional and may "de‐
2430 cay" to a previous standard if the requested is not available. For
2431 compilers that have no notion of a C standard level, such as Microsoft
2432 Visual C++ before VS 16.7, this property has no effect.
2433
2434 See the cmake-compile-features(7) manual for information on compile
2435 features and a list of supported compilers.
2436
2437 This property is initialized by the value of the CMAKE_C_STANDARD_RE‐
2438 QUIRED variable if it is set when a target is created.
2439
2440 COMMON_LANGUAGE_RUNTIME
2441 New in version 3.12.
2442
2443
2444 By setting this target property, the target is configured to build with
2445 C++/CLI support.
2446
2447 The Visual Studio generator defines the clr parameter depending on the
2448 value of COMMON_LANGUAGE_RUNTIME:
2449
2450 • property not set: native C++ (i.e. default)
2451
2452 • property set but empty: mixed unmanaged/managed C++
2453
2454 • property set to any non empty value: managed C++
2455
2456 Supported values: "", "pure", "safe"
2457
2458 This property is only evaluated Visual Studio Generators for VS 2010
2459 and above.
2460
2461 To be able to build managed C++ targets with VS 2017 and above the com‐
2462 ponent C++/CLI support must be installed, which may not be done by de‐
2463 fault.
2464
2465 See also IMPORTED_COMMON_LANGUAGE_RUNTIME
2466
2467 COMPATIBLE_INTERFACE_BOOL
2468 Properties which must be compatible with their link interface
2469
2470 The COMPATIBLE_INTERFACE_BOOL property may contain a list of properties
2471 for this target which must be consistent when evaluated as a boolean
2472 with the INTERFACE variant of the property in all linked dependees.
2473 For example, if a property FOO appears in the list, then for each de‐
2474 pendee, the INTERFACE_FOO property content in all of its dependencies
2475 must be consistent with each other, and with the FOO property in the
2476 depender.
2477
2478 Consistency in this sense has the meaning that if the property is set,
2479 then it must have the same boolean value as all others, and if the
2480 property is not set, then it is ignored.
2481
2482 Note that for each dependee, the set of properties specified in this
2483 property must not intersect with the set specified in any of the other
2484 Compatible Interface Properties.
2485
2486 COMPATIBLE_INTERFACE_NUMBER_MAX
2487 Properties whose maximum value from the link interface will be used.
2488
2489 The COMPATIBLE_INTERFACE_NUMBER_MAX property may contain a list of
2490 properties for this target whose maximum value may be read at generate
2491 time when evaluated in the INTERFACE variant of the property in all
2492 linked dependees. For example, if a property FOO appears in the list,
2493 then for each dependee, the INTERFACE_FOO property content in all of
2494 its dependencies will be compared with each other and with the FOO
2495 property in the depender. When reading the FOO property at generate
2496 time, the maximum value will be returned. If the property is not set,
2497 then it is ignored.
2498
2499 Note that for each dependee, the set of properties specified in this
2500 property must not intersect with the set specified in any of the other
2501 Compatible Interface Properties.
2502
2503 COMPATIBLE_INTERFACE_NUMBER_MIN
2504 Properties whose maximum value from the link interface will be used.
2505
2506 The COMPATIBLE_INTERFACE_NUMBER_MIN property may contain a list of
2507 properties for this target whose minimum value may be read at generate
2508 time when evaluated in the INTERFACE variant of the property of all
2509 linked dependees. For example, if a property FOO appears in the list,
2510 then for each dependee, the INTERFACE_FOO property content in all of
2511 its dependencies will be compared with each other and with the FOO
2512 property in the depender. When reading the FOO property at generate
2513 time, the minimum value will be returned. If the property is not set,
2514 then it is ignored.
2515
2516 Note that for each dependee, the set of properties specified in this
2517 property must not intersect with the set specified in any of the other
2518 Compatible Interface Properties.
2519
2520 COMPATIBLE_INTERFACE_STRING
2521 Properties which must be string-compatible with their link interface
2522
2523 The COMPATIBLE_INTERFACE_STRING property may contain a list of proper‐
2524 ties for this target which must be the same when evaluated as a string
2525 in the INTERFACE variant of the property all linked dependees. For ex‐
2526 ample, if a property FOO appears in the list, then for each dependee,
2527 the INTERFACE_FOO property content in all of its dependencies must be
2528 equal with each other, and with the FOO property in the depender. If
2529 the property is not set, then it is ignored.
2530
2531 Note that for each dependee, the set of properties specified in this
2532 property must not intersect with the set specified in any of the other
2533 Compatible Interface Properties.
2534
2535 COMPILE_DEFINITIONS
2536 Preprocessor definitions for compiling a target's sources.
2537
2538 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
2539 list of preprocessor definitions using the syntax VAR or VAR=value.
2540 Function-style definitions are not supported. CMake will automatically
2541 escape the value correctly for the native build system (note that CMake
2542 language syntax may require escapes to specify some values).
2543
2544 CMake will automatically drop some definitions that are not supported
2545 by the native build tool.
2546
2547 Disclaimer: Most native build tools have poor support for escaping cer‐
2548 tain values. CMake has work-arounds for many cases but some values may
2549 just not be possible to pass correctly. If a value does not seem to be
2550 escaped correctly, do not attempt to work-around the problem by adding
2551 escape sequences to the value. Your work-around may break in a future
2552 version of CMake that has improved escape support. Instead consider
2553 defining the macro in a (configured) header file. Then report the lim‐
2554 itation. Known limitations include:
2555
2556 # - broken almost everywhere
2557 ; - broken in VS IDE 7.0 and Borland Makefiles
2558 , - broken in VS IDE
2559 % - broken in some cases in NMake
2560 & | - broken in some cases on MinGW
2561 ^ < > \" - broken in most Make tools on Windows
2562
2563 CMake does not reject these values outright because they do work in
2564 some cases. Use with caution.
2565
2566 Contents of COMPILE_DEFINITIONS may use "generator expressions" with
2567 the syntax $<...>. See the cmake-generator-expressions(7) manual for
2568 available expressions. See the cmake-buildsystem(7) manual for more on
2569 defining buildsystem properties.
2570
2571 The corresponding COMPILE_DEFINITIONS_<CONFIG> property may be set to
2572 specify per-configuration definitions. Generator expressions should be
2573 preferred instead of setting the alternative property.
2574
2575 COMPILE_FEATURES
2576 New in version 3.1.
2577
2578
2579 Compiler features enabled for this target.
2580
2581 The list of features in this property are a subset of the features
2582 listed in the CMAKE_C_COMPILE_FEATURES, CMAKE_CUDA_COMPILE_FEATURES,
2583 and CMAKE_CXX_COMPILE_FEATURES variables.
2584
2585 Contents of COMPILE_FEATURES may use "generator expressions" with the
2586 syntax $<...>. See the cmake-generator-expressions(7) manual for
2587 available expressions. See the cmake-compile-features(7) manual for
2588 information on compile features and a list of supported compilers.
2589
2590 COMPILE_FLAGS
2591 Additional flags to use when compiling this target's sources.
2592
2593 The COMPILE_FLAGS property sets additional compiler flags used to build
2594 sources within the target. Use COMPILE_DEFINITIONS to pass additional
2595 preprocessor definitions.
2596
2597 This property is deprecated. Use the COMPILE_OPTIONS property or the
2598 target_compile_options() command instead.
2599
2600 COMPILE_OPTIONS
2601 List of options to pass to the compiler.
2602
2603 This property holds a semicolon-separated list of options specified so
2604 far for its target. Use the target_compile_options() command to append
2605 more options. The options will be added after after flags in the
2606 CMAKE_<LANG>_FLAGS and CMAKE_<LANG>_FLAGS_<CONFIG> variables, but be‐
2607 fore those propagated from dependencies by the INTERFACE_COMPILE_OP‐
2608 TIONS property.
2609
2610 This property is initialized by the COMPILE_OPTIONS directory property
2611 when a target is created, and is used by the generators to set the op‐
2612 tions for the compiler.
2613
2614 Contents of COMPILE_OPTIONS may use "generator expressions" with the
2615 syntax $<...>. See the cmake-generator-expressions(7) manual for
2616 available expressions. See the cmake-buildsystem(7) manual for more on
2617 defining buildsystem properties.
2618
2619 Option De-duplication
2620 The final set of options used for a target is constructed by accumulat‐
2621 ing options from the current target and the usage requirements of its
2622 dependencies. The set of options is de-duplicated to avoid repetition.
2623
2624 New in version 3.12: While beneficial for individual options, the
2625 de-duplication step can break up option groups. For example, -option A
2626 -option B becomes -option A B. One may specify a group of options us‐
2627 ing shell-like quoting along with a SHELL: prefix. The SHELL: prefix
2628 is dropped, and the rest of the option string is parsed using the sepa‐
2629 rate_arguments() UNIX_COMMAND mode. For example, "SHELL:-option A"
2630 "SHELL:-option B" becomes -option A -option B.
2631
2632
2633 COMPILE_PDB_NAME
2634 New in version 3.1.
2635
2636
2637 Output name for the MS debug symbol .pdb file generated by the compiler
2638 while building source files.
2639
2640 This property specifies the base name for the debug symbols file. If
2641 not set, the default is unspecified.
2642
2643 NOTE:
2644 The compiler-generated program database files are specified by the
2645 /Fd compiler flag and are not the same as linker-generated program
2646 database files specified by the /pdb linker flag. Use the PDB_NAME
2647 property to specify the latter.
2648
2649 COMPILE_PDB_NAME_<CONFIG>
2650 New in version 3.1.
2651
2652
2653 Per-configuration output name for the MS debug symbol .pdb file gener‐
2654 ated by the compiler while building source files.
2655
2656 This is the configuration-specific version of COMPILE_PDB_NAME.
2657
2658 NOTE:
2659 The compiler-generated program database files are specified by the
2660 /Fd compiler flag and are not the same as linker-generated program
2661 database files specified by the /pdb linker flag. Use the
2662 PDB_NAME_<CONFIG> property to specify the latter.
2663
2664 COMPILE_PDB_OUTPUT_DIRECTORY
2665 New in version 3.1.
2666
2667
2668 Output directory for the MS debug symbol .pdb file generated by the
2669 compiler while building source files.
2670
2671 This property specifies the directory into which the MS debug symbols
2672 will be placed by the compiler. This property is initialized by the
2673 value of the CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY variable if it is set
2674 when a target is created.
2675
2676 NOTE:
2677 The compiler-generated program database files are specified by the
2678 /Fd compiler flag and are not the same as linker-generated program
2679 database files specified by the /pdb linker flag. Use the PDB_OUT‐
2680 PUT_DIRECTORY property to specify the latter.
2681
2682 COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
2683 New in version 3.1.
2684
2685
2686 Per-configuration output directory for the MS debug symbol .pdb file
2687 generated by the compiler while building source files.
2688
2689 This is a per-configuration version of COMPILE_PDB_OUTPUT_DIRECTORY,
2690 but multi-configuration generators (Visual Studio, Xcode) do NOT append
2691 a per-configuration subdirectory to the specified directory. This
2692 property is initialized by the value of the CMAKE_COMPILE_PDB_OUT‐
2693 PUT_DIRECTORY_<CONFIG> variable if it is set when a target is created.
2694
2695 NOTE:
2696 The compiler-generated program database files are specified by the
2697 /Fd compiler flag and are not the same as linker-generated program
2698 database files specified by the /pdb linker flag. Use the PDB_OUT‐
2699 PUT_DIRECTORY_<CONFIG> property to specify the latter.
2700
2701 <CONFIG>_OUTPUT_NAME
2702 Old per-configuration target file base name. Use OUTPUT_NAME_<CONFIG>
2703 instead.
2704
2705 This is a configuration-specific version of the OUTPUT_NAME target
2706 property.
2707
2708 <CONFIG>_POSTFIX
2709 Postfix to append to the target file name for configuration <CONFIG>.
2710
2711 When building with configuration <CONFIG> the value of this property is
2712 appended to the target file name built on disk. For non-executable
2713 targets, this property is initialized by the value of the variable
2714 CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This
2715 property is ignored on the Mac for Frameworks and App Bundles.
2716
2717 For macOS see also the FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> target
2718 property.
2719
2720 CROSSCOMPILING_EMULATOR
2721 New in version 3.3.
2722
2723
2724 Use the given emulator to run executables created when crosscompiling.
2725 This command will be added as a prefix to add_test(), add_custom_com‐
2726 mand(), and add_custom_target() commands for built target system exe‐
2727 cutables.
2728
2729 If this property contains a semicolon-separated list, then the first
2730 value is the command and remaining values are its arguments.
2731
2732 This property is initialized by the value of the CMAKE_CROSSCOMPIL‐
2733 ING_EMULATOR variable if it is set when a target is created.
2734
2735 CUDA_ARCHITECTURES
2736 New in version 3.18.
2737
2738
2739 List of architectures to generate device code for.
2740
2741 An architecture can be suffixed by either -real or -virtual to specify
2742 the kind of architecture to generate code for. If no suffix is given
2743 then code is generated for both real and virtual architectures.
2744
2745 A non-empty false value (e.g. OFF) disables adding architectures. This
2746 is intended to support packagers and rare cases where full control over
2747 the passed flags is required.
2748
2749 This property is initialized by the value of the CMAKE_CUDA_ARCHITEC‐
2750 TURES variable if it is set when a target is created.
2751
2752 The CUDA_ARCHITECTURES target property must be set to a non-empty value
2753 on targets that compile CUDA sources, or it is an error. See policy
2754 CMP0104.
2755
2756 Examples
2757 set_target_properties(tgt PROPERTIES CUDA_ARCHITECTURES "35;50;72")
2758
2759 Generates code for real and virtual architectures 30, 50 and 72.
2760
2761 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 70-real 72-virtual)
2762
2763 Generates code for real architecture 70 and virtual architecture 72.
2764
2765 set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES OFF)
2766
2767 CMake will not pass any architecture flags to the compiler.
2768
2769 CUDA_EXTENSIONS
2770 New in version 3.8.
2771
2772
2773 Boolean specifying whether compiler specific extensions are requested.
2774
2775 This property specifies whether compiler specific extensions should be
2776 used. For some compilers, this results in adding a flag such as
2777 -std=gnu++11 instead of -std=c++11 to the compile line. This property
2778 is ON by default. The basic CUDA/C++ standard level is controlled by
2779 the CUDA_STANDARD target property.
2780
2781 See the cmake-compile-features(7) manual for information on compile
2782 features and a list of supported compilers.
2783
2784 This property is initialized by the value of the CMAKE_CUDA_EXTENSIONS
2785 variable if set when a target is created and otherwise by the value of
2786 CMAKE_CUDA_EXTENSIONS_DEFAULT (see CMP0128).
2787
2788 CUDA_PTX_COMPILATION
2789 New in version 3.9.
2790
2791
2792 Compile CUDA sources to .ptx files instead of .obj files within Object
2793 Libraries.
2794
2795 For example:
2796
2797 add_library(myptx OBJECT a.cu b.cu)
2798 set_property(TARGET myptx PROPERTY CUDA_PTX_COMPILATION ON)
2799
2800 CUDA_RESOLVE_DEVICE_SYMBOLS
2801 New in version 3.9.
2802
2803
2804 CUDA only: Enables device linking for the specific library target where
2805 required.
2806
2807 If set, this will tell the required compilers to enable device linking
2808 on the library target. Device linking is an additional link step re‐
2809 quired by some CUDA compilers when CUDA_SEPARABLE_COMPILATION is en‐
2810 abled. Normally device linking is deferred until a shared library or
2811 executable is generated, allowing for multiple static libraries to re‐
2812 solve device symbols at the same time when they are used by a shared
2813 library or executable.
2814
2815 By default static library targets have this property is disabled, while
2816 shared, module, and executable targets have this property enabled.
2817
2818 Note that device linking is not supported for Object Libraries.
2819
2820 For instance:
2821
2822 set_property(TARGET mystaticlib PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
2823
2824 CUDA_RUNTIME_LIBRARY
2825 New in version 3.17.
2826
2827
2828 Select the CUDA runtime library for use by compilers targeting the CUDA
2829 language.
2830
2831 The allowed case insensitive values are:
2832
2833 None Link with -cudart=none or equivalent flag(s) to use no CUDA run‐
2834 time library.
2835
2836 Shared Link with -cudart=shared or equivalent flag(s) to use a dynami‐
2837 cally-linked CUDA runtime library.
2838
2839 Static Link with -cudart=static or equivalent flag(s) to use a stati‐
2840 cally-linked CUDA runtime library.
2841
2842 Contents of CUDA_RUNTIME_LIBRARY may use generator expressions.
2843
2844 If that property is not set then CMake uses an appropriate default
2845 value based on the compiler to select the CUDA runtime library.
2846
2847 NOTE:
2848 This property has effect only when the CUDA language is enabled. To
2849 control the CUDA runtime linking when only using the CUDA SDK with
2850 the C or C++ language we recommend using the FindCUDAToolkit module.
2851
2852 CUDA_SEPARABLE_COMPILATION
2853 New in version 3.8.
2854
2855
2856 CUDA only: Enables separate compilation of device code
2857
2858 If set this will enable separable compilation for all CUDA files for
2859 the given target.
2860
2861 For instance:
2862
2863 set_property(TARGET myexe PROPERTY CUDA_SEPARABLE_COMPILATION ON)
2864
2865 This property is initialized by the value of the CMAKE_CUDA_SEPARA‐
2866 BLE_COMPILATION variable if it is set when a target is created.
2867
2868 CUDA_STANDARD
2869 New in version 3.8.
2870
2871
2872 The CUDA/C++ standard whose features are requested to build this tar‐
2873 get.
2874
2875 This property specifies the CUDA/C++ standard whose features are re‐
2876 quested to build this target. For some compilers, this results in
2877 adding a flag such as -std=gnu++11 to the compile line.
2878
2879 Supported values are:
2880
2881 98 CUDA C++98. Note that this maps to the same as 03 internally.
2882
2883 03 CUDA C++03
2884
2885 11 CUDA C++11
2886
2887 14 CUDA C++14. While CMake 3.8 and later recognize 14 as a valid
2888 value, CMake 3.9 was the first version to include support for
2889 any compiler.
2890
2891 17 CUDA C++17. While CMake 3.8 and later recognize 17 as a valid
2892 value, CMake 3.18 was the first version to include support for
2893 any compiler.
2894
2895 20 New in version 3.12.
2896
2897
2898 CUDA C++20. While CMake 3.12 and later recognize 20 as a valid
2899 value, CMake 3.18 was the first version to include support for
2900 any compiler.
2901
2902 23 New in version 3.20.
2903
2904
2905 CUDA C++23
2906
2907 If the value requested does not result in a compile flag being added
2908 for the compiler in use, a previous standard flag will be added in‐
2909 stead. This means that using:
2910
2911 set_property(TARGET tgt PROPERTY CUDA_STANDARD 11)
2912
2913 with a compiler which does not support -std=gnu++11 or an equivalent
2914 flag will not result in an error or warning, but will instead add the
2915 -std=gnu++03 flag if supported. This "decay" behavior may be con‐
2916 trolled with the CUDA_STANDARD_REQUIRED target property. Additionally,
2917 the CUDA_EXTENSIONS target property may be used to control whether com‐
2918 piler-specific extensions are enabled on a per-target basis.
2919
2920 See the cmake-compile-features(7) manual for information on compile
2921 features and a list of supported compilers.
2922
2923 This property is initialized by the value of the CMAKE_CUDA_STANDARD
2924 variable if it is set when a target is created.
2925
2926 CUDA_STANDARD_REQUIRED
2927 New in version 3.8.
2928
2929
2930 Boolean describing whether the value of CUDA_STANDARD is a requirement.
2931
2932 If this property is set to ON, then the value of the CUDA_STANDARD tar‐
2933 get property is treated as a requirement. If this property is OFF or
2934 unset, the CUDA_STANDARD target property is treated as optional and may
2935 "decay" to a previous standard if the requested is not available. For
2936 compilers that have no notion of a standard level, such as MSVC 1800
2937 (Visual Studio 2013) and lower, this has no effect.
2938
2939 See the cmake-compile-features(7) manual for information on compile
2940 features and a list of supported compilers.
2941
2942 This property is initialized by the value of the CMAKE_CUDA_STAN‐
2943 DARD_REQUIRED variable if it is set when a target is created.
2944
2945 CXX_EXTENSIONS
2946 New in version 3.1.
2947
2948
2949 Boolean specifying whether compiler specific extensions are requested.
2950
2951 This property specifies whether compiler specific extensions should be
2952 used. For some compilers, this results in adding a flag such as
2953 -std=gnu++11 instead of -std=c++11 to the compile line. This property
2954 is ON by default. The basic C++ standard level is controlled by the
2955 CXX_STANDARD target property.
2956
2957 See the cmake-compile-features(7) manual for information on compile
2958 features and a list of supported compilers.
2959
2960 This property is initialized by the value of the CMAKE_CXX_EXTENSIONS
2961 variable if set when a target is created and otherwise by the value of
2962 CMAKE_CXX_EXTENSIONS_DEFAULT (see CMP0128).
2963
2964 CXX_STANDARD
2965 New in version 3.1.
2966
2967
2968 The C++ standard whose features are requested to build this target.
2969
2970 This property specifies the C++ standard whose features are requested
2971 to build this target. For some compilers, this results in adding a
2972 flag such as -std=gnu++11 to the compile line. For compilers that have
2973 no notion of a standard level, such as Microsoft Visual C++ before 2015
2974 Update 3, this has no effect.
2975
2976 Supported values are:
2977
2978 98 C++98
2979
2980 11 C++11
2981
2982 14 C++14
2983
2984 17 New in version 3.8.
2985
2986
2987 C++17
2988
2989 20 New in version 3.12.
2990
2991
2992 C++20
2993
2994 23 New in version 3.20.
2995
2996
2997 C++23
2998
2999 If the value requested does not result in a compile flag being added
3000 for the compiler in use, a previous standard flag will be added in‐
3001 stead. This means that using:
3002
3003 set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
3004
3005 with a compiler which does not support -std=gnu++11 or an equivalent
3006 flag will not result in an error or warning, but will instead add the
3007 -std=gnu++98 flag if supported. This "decay" behavior may be con‐
3008 trolled with the CXX_STANDARD_REQUIRED target property. Additionally,
3009 the CXX_EXTENSIONS target property may be used to control whether com‐
3010 piler-specific extensions are enabled on a per-target basis.
3011
3012 See the cmake-compile-features(7) manual for information on compile
3013 features and a list of supported compilers.
3014
3015 This property is initialized by the value of the CMAKE_CXX_STANDARD
3016 variable if it is set when a target is created.
3017
3018 CXX_STANDARD_REQUIRED
3019 New in version 3.1.
3020
3021
3022 Boolean describing whether the value of CXX_STANDARD is a requirement.
3023
3024 If this property is set to ON, then the value of the CXX_STANDARD tar‐
3025 get property is treated as a requirement. If this property is OFF or
3026 unset, the CXX_STANDARD target property is treated as optional and may
3027 "decay" to a previous standard if the requested is not available. For
3028 compilers that have no notion of a standard level, such as MSVC 1800
3029 (Visual Studio 2013) and lower, this has no effect.
3030
3031 See the cmake-compile-features(7) manual for information on compile
3032 features and a list of supported compilers.
3033
3034 This property is initialized by the value of the CMAKE_CXX_STANDARD_RE‐
3035 QUIRED variable if it is set when a target is created.
3036
3037 DEBUG_POSTFIX
3038 See target property <CONFIG>_POSTFIX.
3039
3040 This property is a special case of the more-general <CONFIG>_POSTFIX
3041 property for the DEBUG configuration.
3042
3043 DEFINE_SYMBOL
3044 Define a symbol when compiling this target's sources.
3045
3046 DEFINE_SYMBOL sets the name of the preprocessor symbol defined when
3047 compiling sources in a shared library. If not set here then it is set
3048 to target_EXPORTS by default (with some substitutions if the target is
3049 not a valid C identifier). This is useful for headers to know whether
3050 they are being included from inside their library or outside to prop‐
3051 erly setup dllexport/dllimport decorations.
3052
3053 DEPLOYMENT_ADDITIONAL_FILES
3054 New in version 3.13.
3055
3056
3057 Set the WinCE project AdditionalFiles in DeploymentTool in .vcproj
3058 files generated by the Visual Studio 9 2008 generator. This is useful
3059 when you want to debug on remote WinCE device. Specify additional
3060 files that will be copied to the device. For example:
3061
3062 set_property(TARGET ${TARGET} PROPERTY
3063 DEPLOYMENT_ADDITIONAL_FILES "english.lng|local_folder|remote_folder|0"
3064 "german.lng|local_folder|remote_folder|0")
3065
3066 produces:
3067
3068 <DeploymentTool AdditionalFiles="english.lng|local_folder|remote_folder|0;german.lng|local_folder|remote_folder|0" ... />
3069
3070 DEPLOYMENT_REMOTE_DIRECTORY
3071 New in version 3.6.
3072
3073
3074 Set the WinCE project RemoteDirectory in DeploymentTool and RemoteExe‐
3075 cutable in DebuggerTool in .vcproj files generated by the Visual Studio
3076 9 2008 generator. This is useful when you want to debug on remote
3077 WinCE device. For example:
3078
3079 set_property(TARGET ${TARGET} PROPERTY
3080 DEPLOYMENT_REMOTE_DIRECTORY "\\FlashStorage")
3081
3082 produces:
3083
3084 <DeploymentTool RemoteDirectory="\FlashStorage" ... />
3085 <DebuggerTool RemoteExecutable="\FlashStorage\target_file" ... />
3086
3087 DEPRECATION
3088 New in version 3.17.
3089
3090
3091 Deprecation message from imported target's developer.
3092
3093 DEPRECATION is the message regarding a deprecation status to be dis‐
3094 played to downstream users of a target.
3095
3096 DISABLE_PRECOMPILE_HEADERS
3097 New in version 3.16.
3098
3099
3100 Disables the precompilation of header files specified by PRECOM‐
3101 PILE_HEADERS property.
3102
3103 If the property is not set, CMake will use the value provided by
3104 CMAKE_DISABLE_PRECOMPILE_HEADERS.
3105
3106 DOTNET_TARGET_FRAMEWORK
3107 New in version 3.17.
3108
3109
3110 Specify the .NET target framework.
3111
3112 Used to specify the .NET target framework for C++/CLI and C#. For ex‐
3113 ample: netcoreapp2.1.
3114
3115 This property is only evaluated for Visual Studio Generators VS 2010
3116 and above.
3117
3118 Can be initialized for all targets using the variable CMAKE_DOTNET_TAR‐
3119 GET_FRAMEWORK.
3120
3121 DOTNET_TARGET_FRAMEWORK_VERSION
3122 New in version 3.12.
3123
3124
3125 Specify the .NET target framework version.
3126
3127 Used to specify the .NET target framework version for C++/CLI and C#.
3128 For example: v4.5.
3129
3130 This property is only evaluated for Visual Studio Generators VS 2010
3131 and above.
3132
3133 To initialize this variable for all targets set CMAKE_DOTNET_TAR‐
3134 GET_FRAMEWORK or CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION. If both are
3135 set, the latter is ignored.
3136
3137 EchoString
3138 A message to be displayed when the target is built.
3139
3140 A message to display on some generators (such as Makefile Generators)
3141 when the target is built.
3142
3143 ENABLE_EXPORTS
3144 Specify whether an executable exports symbols for loadable modules.
3145
3146 Normally an executable does not export any symbols because it is the
3147 final program. It is possible for an executable to export symbols to
3148 be used by loadable modules. When this property is set to true CMake
3149 will allow other targets to "link" to the executable with the tar‐
3150 get_link_libraries() command. On all platforms a target-level depen‐
3151 dency on the executable is created for targets that link to it. Han‐
3152 dling of the executable on the link lines of the loadable modules
3153 varies by platform:
3154
3155 • On Windows-based systems (including Cygwin) an "import library" is
3156 created along with the executable to list the exported symbols.
3157 Loadable modules link to the import library to get the symbols.
3158
3159 • On macOS, loadable modules link to the executable itself using the
3160 -bundle_loader flag.
3161
3162 • On AIX, a linker "import file" is created along with the executable
3163 to list the exported symbols for import when linking other targets.
3164 Loadable modules link to the import file to get the symbols.
3165
3166 • On other platforms, loadable modules are simply linked without refer‐
3167 encing the executable since the dynamic loader will automatically
3168 bind symbols when the module is loaded.
3169
3170 This property is initialized by the value of the variable CMAKE_EN‐
3171 ABLE_EXPORTS if it is set when a target is created.
3172
3173 EXCLUDE_FROM_ALL
3174 Set this target property to a true (or false) value to exclude (or in‐
3175 clude) the target from the "all" target of the containing directory and
3176 its ancestors. If excluded, running e.g. make in the containing direc‐
3177 tory or its ancestors will not build the target by default.
3178
3179 If this target property is not set then the target will be included in
3180 the "all" target of the containing directory. Furthermore, it will be
3181 included in the "all" target of its ancestor directories unless the EX‐
3182 CLUDE_FROM_ALL directory property is set.
3183
3184 With EXCLUDE_FROM_ALL set to false or not set at all, the target will
3185 be brought up to date as part of doing a make install or its equivalent
3186 for the CMake generator being used.
3187
3188 If a target has EXCLUDE_FROM_ALL set to true, it may still be listed in
3189 an install(TARGETS) command, but the user is responsible for ensuring
3190 that the target's build artifacts are not missing or outdated when an
3191 install is performed.
3192
3193 This property may use "generator expressions" with the syntax $<...>.
3194 See the cmake-generator-expressions(7) manual for available expres‐
3195 sions.
3196
3197 Only the "Ninja Multi-Config" generator supports a property value that
3198 varies by configuration. For all other generators the value of this
3199 property must be the same for all configurations.
3200
3201 EXCLUDE_FROM_DEFAULT_BUILD
3202 Exclude target from Build Solution.
3203
3204 This property is only used by Visual Studio generators. When set to
3205 TRUE, the target will not be built when you press Build Solution.
3206
3207 EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
3208 Per-configuration version of target exclusion from Build Solution.
3209
3210 This is the configuration-specific version of EXCLUDE_FROM_DE‐
3211 FAULT_BUILD. If the generic EXCLUDE_FROM_DEFAULT_BUILD is also set on
3212 a target, EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG> takes precedence in con‐
3213 figurations for which it has a value.
3214
3215 EXPORT_COMPILE_COMMANDS
3216 New in version 3.20.
3217
3218
3219 Enable/Disable output of compile commands during generation for a tar‐
3220 get.
3221
3222 This property is initialized by the value of the variable CMAKE_EX‐
3223 PORT_COMPILE_COMMANDS if it is set when a target is created.
3224
3225 EXPORT_NAME
3226 Exported name for target files.
3227
3228 This sets the name for the IMPORTED target generated by the install(EX‐
3229 PORT) and export() commands. If not set, the logical target name is
3230 used by default.
3231
3232 EXPORT_PROPERTIES
3233 New in version 3.12.
3234
3235
3236 List additional properties to export for a target.
3237
3238 This property contains a list of property names that should be exported
3239 by the install(EXPORT) and export() commands. By default only a lim‐
3240 ited number of properties are exported. This property can be used to
3241 additionally export other properties as well.
3242
3243 Properties starting with INTERFACE_ or IMPORTED_ are not allowed as
3244 they are reserved for internal CMake use.
3245
3246 Properties containing generator expressions are also not allowed.
3247
3248 NOTE:
3249 Since CMake 3.19, Interface Libraries may have arbitrary target
3250 properties. If a project exports an interface library with custom
3251 properties, the resulting package may not work with dependents con‐
3252 figured by older versions of CMake that reject the custom proper‐
3253 ties.
3254
3255 FOLDER
3256 Set the folder name. Use to organize targets in an IDE.
3257
3258 Targets with no FOLDER property will appear as top level entities in
3259 IDEs like Visual Studio. Targets with the same FOLDER property value
3260 will appear next to each other in a folder of that name. To nest fold‐
3261 ers, use FOLDER values such as 'GUI/Dialogs' with '/' characters sepa‐
3262 rating folder levels.
3263
3264 This property is initialized by the value of the variable CMAKE_FOLDER
3265 if it is set when a target is created.
3266
3267 Fortran_BUILDING_INSTRINSIC_MODULES
3268 New in version 3.22.
3269
3270
3271 Instructs the CMake Fortran preprocessor that the target is building
3272 Fortran intrinsics for building a Fortran compiler.
3273
3274 This property is off by default and should be turned only on projects
3275 that build a Fortran compiler. It should not be turned on for projects
3276 that use a Fortran compiler.
3277
3278 Turning this property on will correctly add dependencies for building
3279 Fortran intrinsic modules whereas turning the property off will ignore
3280 Fortran intrinsic modules in the dependency graph as they are supplied
3281 by the compiler itself.
3282
3283 Fortran_FORMAT
3284 Set to FIXED or FREE to indicate the Fortran source layout.
3285
3286 This property tells CMake whether the Fortran source files in a target
3287 use fixed-format or free-format. CMake will pass the corresponding
3288 format flag to the compiler. Use the source-specific Fortran_FORMAT
3289 property to change the format of a specific source file. If the vari‐
3290 able CMAKE_Fortran_FORMAT is set when a target is created its value is
3291 used to initialize this property.
3292
3293 Fortran_MODULE_DIRECTORY
3294 Specify output directory for Fortran modules provided by the target.
3295
3296 If the target contains Fortran source files that provide modules and
3297 the compiler supports a module output directory this specifies the di‐
3298 rectory in which the modules will be placed. When this property is not
3299 set the modules will be placed in the build directory corresponding to
3300 the target's source directory. If the variable CMAKE_Fortran_MOD‐
3301 ULE_DIRECTORY is set when a target is created its value is used to ini‐
3302 tialize this property.
3303
3304 When using one of the Visual Studio Generators with the Intel Fortran
3305 plugin installed in Visual Studio, a subdirectory named after the con‐
3306 figuration will be appended to the path where modules are created. For
3307 example, if Fortran_MODULE_DIRECTORY is set to C:/some/path, modules
3308 will end up in C:/some/path/Debug (or C:/some/path/Release etc.) when
3309 an Intel Fortran .vfproj file is generated, and in C:/some/path when
3310 any other generator is used.
3311
3312 Note that some compilers will automatically search the module output
3313 directory for modules USEd during compilation but others will not. If
3314 your sources USE modules their location must be specified by IN‐
3315 CLUDE_DIRECTORIES regardless of this property.
3316
3317 Fortran_PREPROCESS
3318 New in version 3.18.
3319
3320
3321 Control whether the Fortran source file should be unconditionally pre‐
3322 processed.
3323
3324 If unset or empty, rely on the compiler to determine whether the file
3325 should be preprocessed. If explicitly set to OFF then the file does not
3326 need to be preprocessed. If explicitly set to ON, then the file does
3327 need to be preprocessed as part of the compilation step.
3328
3329 When using the Ninja generator, all source files are first preprocessed
3330 in order to generate module dependency information. Setting this prop‐
3331 erty to OFF will make Ninja skip this step.
3332
3333 Use the source-specific Fortran_PREPROCESS property if a single file
3334 needs to be preprocessed. If the variable CMAKE_Fortran_PREPROCESS is
3335 set when a target is created its value is used to initialize this prop‐
3336 erty.
3337
3338 NOTE:
3339 For some compilers, NAG, PGI and Solaris Studio, setting this to OFF
3340 will have no effect.
3341
3342 FRAMEWORK
3343 Build SHARED or STATIC library as Framework Bundle on the macOS and
3344 iOS.
3345
3346 If such a library target has this property set to TRUE it will be built
3347 as a framework when built on the macOS and iOS. It will have the di‐
3348 rectory structure required for a framework and will be suitable to be
3349 used with the -framework option. This property is initialized by the
3350 value of the CMAKE_FRAMEWORK variable if it is set when a target is
3351 created.
3352
3353 To customize Info.plist file in the framework, use MACOSX_FRAME‐
3354 WORK_INFO_PLIST target property.
3355
3356 For macOS see also the FRAMEWORK_VERSION target property.
3357
3358 Example of creation dynamicFramework:
3359
3360 add_library(dynamicFramework SHARED
3361 dynamicFramework.c
3362 dynamicFramework.h
3363 )
3364 set_target_properties(dynamicFramework PROPERTIES
3365 FRAMEWORK TRUE
3366 FRAMEWORK_VERSION C
3367 MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework
3368 MACOSX_FRAMEWORK_INFO_PLIST Info.plist
3369 # "current version" in semantic format in Mach-O binary file
3370 VERSION 16.4.0
3371 # "compatibility version" in semantic format in Mach-O binary file
3372 SOVERSION 1.0.0
3373 PUBLIC_HEADER dynamicFramework.h
3374 XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
3375 )
3376
3377 FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
3378 New in version 3.18.
3379
3380
3381 Postfix to append to the framework file name for configuration <CON‐
3382 FIG>, when using a multi-config generator (like Xcode and Ninja
3383 Multi-Config).
3384
3385 When building with configuration <CONFIG> the value of this property is
3386 appended to the framework file name built on disk.
3387
3388 For example, given a framework called my_fw, a value of _debug for the
3389 FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG property, and Debug;Release in
3390 CMAKE_CONFIGURATION_TYPES, the following relevant files would be cre‐
3391 ated for the Debug and Release configurations:
3392
3393 • Release/my_fw.framework/my_fw
3394
3395 • Release/my_fw.framework/Versions/A/my_fw
3396
3397 • Debug/my_fw.framework/my_fw_debug
3398
3399 • Debug/my_fw.framework/Versions/A/my_fw_debug
3400
3401 For framework targets, this property is initialized by the value of the
3402 CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> variable if it is set
3403 when a target is created.
3404
3405 This property is ignored for non-framework targets, and when using sin‐
3406 gle config generators.
3407
3408 FRAMEWORK_VERSION
3409 New in version 3.4.
3410
3411
3412 Version of a framework created using the FRAMEWORK target property
3413 (e.g. A).
3414
3415 This property only affects macOS, as iOS doesn't have versioned direc‐
3416 tory structure.
3417
3418 GENERATOR_FILE_NAME
3419 Generator's file for this target.
3420
3421 An internal property used by some generators to record the name of the
3422 project or dsp file associated with this target. Note that at config‐
3423 ure time, this property is only set for targets created by include_ex‐
3424 ternal_msproject().
3425
3426 GHS_INTEGRITY_APP
3427 New in version 3.14.
3428
3429
3430 ON / OFF boolean to determine if an executable target should be treated
3431 as an Integrity Application.
3432
3433 If no value is set and if a .int file is added as a source file to the
3434 executable target it will be treated as an Integrity Application.
3435
3436 Supported on Green Hills MULTI.
3437
3438 GHS_NO_SOURCE_GROUP_FILE
3439 New in version 3.14.
3440
3441
3442 ON / OFF boolean to control if the project file for a target should be
3443 one single file or multiple files.
3444
3445 The default behavior or when the property is OFF is to generate a
3446 project file for the target and then a sub-project file for each source
3447 group.
3448
3449 When this property is ON or if CMAKE_GHS_NO_SOURCE_GROUP_FILE is ON
3450 then only a single project file is generated for the target.
3451
3452 Supported on Green Hills MULTI.
3453
3454 GNUtoMS
3455 Convert GNU import library (.dll.a) to MS format (.lib).
3456
3457 When linking a shared library or executable that exports symbols using
3458 GNU tools on Windows (MinGW/MSYS) with Visual Studio installed convert
3459 the import library (.dll.a) from GNU to MS format (.lib). Both import
3460 libraries will be installed by install(TARGETS) and exported by in‐
3461 stall(EXPORT) and export() to be linked by applications with either
3462 GNU- or MS-compatible tools.
3463
3464 If the variable CMAKE_GNUtoMS is set when a target is created its value
3465 is used to initialize this property. The variable must be set prior to
3466 the first command that enables a language such as project() or en‐
3467 able_language(). CMake provides the variable as an option to the user
3468 automatically when configuring on Windows with GNU tools.
3469
3470 HAS_CXX
3471 Link the target using the C++ linker tool (obsolete).
3472
3473 This is equivalent to setting the LINKER_LANGUAGE property to CXX.
3474
3475 HIP_ARCHITECTURES
3476 New in version 3.21.
3477
3478
3479 List of AMD GPU architectures to generate device code for.
3480
3481 A non-empty false value (e.g. OFF) disables adding architectures. This
3482 is intended to support packagers and rare cases where full control over
3483 the passed flags is required.
3484
3485 This property is initialized by the value of the CMAKE_HIP_ARCHITEC‐
3486 TURES variable if it is set when a target is created.
3487
3488 The HIP compilation model has two modes: whole and separable. Whole
3489 compilation generates device code at compile time. Separable compila‐
3490 tion generates device code at link time. Therefore the HIP_ARCHITEC‐
3491 TURES target property should be set on targets that compile or link
3492 with any HIP sources.
3493
3494 Examples
3495 set_property(TARGET tgt PROPERTY HIP_ARCHITECTURES gfx801 gfx900)
3496
3497 Generates code for both gfx801 and gfx900.
3498
3499 HIP_EXTENSIONS
3500 New in version 3.21.
3501
3502
3503 Boolean specifying whether compiler specific extensions are requested.
3504
3505 This property specifies whether compiler specific extensions should be
3506 used. For some compilers, this results in adding a flag such as
3507 -std=gnu++11 instead of -std=c++11 to the compile line. This property
3508 is ON by default. The basic HIP/C++ standard level is controlled by the
3509 HIP_STANDARD target property.
3510
3511 See the cmake-compile-features(7) manual for information on compile
3512 features and a list of supported compilers.
3513
3514 This property is initialized by the value of the CMAKE_HIP_EXTENSIONS
3515 variable if set when a target is created and otherwise by the value of
3516 CMAKE_HIP_EXTENSIONS_DEFAULT (see CMP0128).
3517
3518 HIP_STANDARD
3519 New in version 3.21.
3520
3521
3522 The HIP/C++ standard requested to build this target.
3523
3524 Supported values are:
3525
3526 98 HIP C++98
3527
3528 11 HIP C++11
3529
3530 14 HIP C++14
3531
3532 17 HIP C++17
3533
3534 20 HIP C++20
3535
3536 23 HIP C++23
3537
3538 If the value requested does not result in a compile flag being added
3539 for the compiler in use, a previous standard flag will be added in‐
3540 stead. This means that using:
3541
3542 set_property(TARGET tgt PROPERTY HIP_STANDARD 11)
3543
3544 with a compiler which does not support -std=gnu++11 or an equivalent
3545 flag will not result in an error or warning, but will instead add the
3546 -std=gnu++98 flag if supported. This "decay" behavior may be con‐
3547 trolled with the HIP_STANDARD_REQUIRED target property. Additionally,
3548 the HIP_EXTENSIONS target property may be used to control whether com‐
3549 piler-specific extensions are enabled on a per-target basis.
3550
3551 See the cmake-compile-features(7) manual for information on compile
3552 features and a list of supported compilers.
3553
3554 This property is initialized by the value of the CMAKE_HIP_STANDARD
3555 variable if it is set when a target is created.
3556
3557 HIP_STANDARD_REQUIRED
3558 New in version 3.21.
3559
3560
3561 Boolean describing whether the value of HIP_STANDARD is a requirement.
3562
3563 If this property is set to ON, then the value of the HIP_STANDARD tar‐
3564 get property is treated as a requirement. If this property is OFF or
3565 unset, the HIP_STANDARD target property is treated as optional and may
3566 "decay" to a previous standard if the requested is not available.
3567
3568 See the cmake-compile-features(7) manual for information on compile
3569 features and a list of supported compilers.
3570
3571 This property is initialized by the value of the CMAKE_HIP_STANDARD_RE‐
3572 QUIRED variable if it is set when a target is created.
3573
3574 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
3575 Specify #include line transforms for dependencies in a target.
3576
3577 This property specifies rules to transform macro-like #include lines
3578 during implicit dependency scanning of C and C++ source files. The
3579 list of rules must be semicolon-separated with each entry of the form
3580 A_MACRO(%)=value-with-% (the % must be literal). During dependency
3581 scanning occurrences of A_MACRO(...) on #include lines will be replaced
3582 by the value given with the macro argument substituted for %. For ex‐
3583 ample, the entry
3584
3585 MYDIR(%)=<mydir/%>
3586
3587 will convert lines of the form
3588
3589 #include MYDIR(myheader.h)
3590
3591 to
3592
3593 #include <mydir/myheader.h>
3594
3595 allowing the dependency to be followed.
3596
3597 This property applies to sources in the target on which it is set.
3598
3599 IMPORTED
3600 Read-only indication of whether a target is IMPORTED.
3601
3602 The boolean value of this property is True for targets created with the
3603 IMPORTED option to add_executable() or add_library(). It is False for
3604 targets built within the project.
3605
3606 IMPORTED_COMMON_LANGUAGE_RUNTIME
3607 New in version 3.12.
3608
3609
3610 Property to define if the target uses C++/CLI.
3611
3612 Ignored for non-imported targets.
3613
3614 See also the COMMON_LANGUAGE_RUNTIME target property.
3615
3616 IMPORTED_CONFIGURATIONS
3617 Configurations provided for an IMPORTED target.
3618
3619 Set this to the list of configuration names available for an IMPORTED
3620 target. The names correspond to configurations defined in the project
3621 from which the target is imported. If the importing project uses a
3622 different set of configurations the names may be mapped using the
3623 MAP_IMPORTED_CONFIG_<CONFIG> property. Ignored for non-imported tar‐
3624 gets.
3625
3626 IMPORTED_GLOBAL
3627 New in version 3.11.
3628
3629
3630 Indication of whether an IMPORTED target is globally visible.
3631
3632 The boolean value of this property is True for targets created with the
3633 IMPORTED GLOBAL options to add_executable() or add_library(). It is al‐
3634 ways False for targets built within the project.
3635
3636 For targets created with the IMPORTED option to add_executable() or
3637 add_library() but without the additional option GLOBAL this is False,
3638 too. However, setting this property for such a locally IMPORTED target
3639 to True promotes that target to global scope. This promotion can only
3640 be done in the same directory where that IMPORTED target was created in
3641 the first place.
3642
3643 NOTE:
3644 Once an imported target has been made global, it cannot be changed
3645 back to non-global. Therefore, if a project sets this property, it
3646 may only provide a value of True. CMake will issue an error if the
3647 project tries to set the property to a non-True value, even if the
3648 value was already False.
3649
3650 NOTE:
3651 Local ALIAS targets created before promoting an IMPORTED target from
3652 LOCAL to GLOBAL, keep their initial scope (see ALIAS_GLOBAL target
3653 property).
3654
3655 IMPORTED_IMPLIB
3656 Full path to the import library for an IMPORTED target.
3657
3658 Set this to the location of the .lib part of a Windows DLL, or on AIX
3659 set it to an import file created for executables that export symbols
3660 (see the ENABLE_EXPORTS target property). Ignored for non-imported
3661 targets.
3662
3663 IMPORTED_IMPLIB_<CONFIG>
3664 <CONFIG>-specific version of IMPORTED_IMPLIB property.
3665
3666 Configuration names correspond to those provided by the project from
3667 which the target is imported.
3668
3669 IMPORTED_LIBNAME
3670 New in version 3.8.
3671
3672
3673 Specify the link library name for an imported Interface Library.
3674
3675 An interface library builds no library file itself but does specify us‐
3676 age requirements for its consumers. The IMPORTED_LIBNAME property may
3677 be set to specify a single library name to be placed on the link line
3678 in place of the interface library target name as a requirement for us‐
3679 ing the interface.
3680
3681 This property is intended for use in naming libraries provided by a
3682 platform SDK for which the full path to a library file may not be
3683 known. The value may be a plain library name such as foo but may not
3684 be a path (e.g. /usr/lib/libfoo.so) or a flag (e.g. -Wl,...). The name
3685 is never treated as a library target name even if it happens to name
3686 one.
3687
3688 The IMPORTED_LIBNAME property is allowed only on imported Interface Li‐
3689 braries and is rejected on targets of other types (for which the IM‐
3690 PORTED_LOCATION target property may be used).
3691
3692 IMPORTED_LIBNAME_<CONFIG>
3693 New in version 3.8.
3694
3695
3696 <CONFIG>-specific version of IMPORTED_LIBNAME property.
3697
3698 Configuration names correspond to those provided by the project from
3699 which the target is imported.
3700
3701 IMPORTED_LINK_DEPENDENT_LIBRARIES
3702 Dependent shared libraries of an imported shared library.
3703
3704 Shared libraries may be linked to other shared libraries as part of
3705 their implementation. On some platforms the linker searches for the
3706 dependent libraries of shared libraries they are including in the link.
3707 Set this property to the list of dependent shared libraries of an im‐
3708 ported library. The list should be disjoint from the list of interface
3709 libraries in the INTERFACE_LINK_LIBRARIES property. On platforms re‐
3710 quiring dependent shared libraries to be found at link time CMake uses
3711 this list to add appropriate files or paths to the link command line.
3712 Ignored for non-imported targets.
3713
3714 IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
3715 <CONFIG>-specific version of IMPORTED_LINK_DEPENDENT_LIBRARIES.
3716
3717 Configuration names correspond to those provided by the project from
3718 which the target is imported. If set, this property completely over‐
3719 rides the generic property for the named configuration.
3720
3721 IMPORTED_LINK_INTERFACE_LANGUAGES
3722 Languages compiled into an IMPORTED static library.
3723
3724 Set this to the list of languages of source files compiled to produce a
3725 STATIC IMPORTED library (such as C or CXX). CMake accounts for these
3726 languages when computing how to link a target to the imported library.
3727 For example, when a C executable links to an imported C++ static li‐
3728 brary CMake chooses the C++ linker to satisfy language runtime depen‐
3729 dencies of the static library.
3730
3731 This property is ignored for targets that are not STATIC libraries.
3732 This property is ignored for non-imported targets.
3733
3734 IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
3735 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LANGUAGES.
3736
3737 Configuration names correspond to those provided by the project from
3738 which the target is imported. If set, this property completely over‐
3739 rides the generic property for the named configuration.
3740
3741 IMPORTED_LINK_INTERFACE_LIBRARIES
3742 Transitive link interface of an IMPORTED target.
3743
3744 Set this to the list of libraries whose interface is included when an
3745 IMPORTED library target is linked to another target. The libraries
3746 will be included on the link line for the target. Unlike the LINK_IN‐
3747 TERFACE_LIBRARIES property, this property applies to all imported tar‐
3748 get types, including STATIC libraries. This property is ignored for
3749 non-imported targets.
3750
3751 This property is ignored if the target also has a non-empty INTER‐
3752 FACE_LINK_LIBRARIES property.
3753
3754 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3755
3756 IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>
3757 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LIBRARIES.
3758
3759 Configuration names correspond to those provided by the project from
3760 which the target is imported. If set, this property completely over‐
3761 rides the generic property for the named configuration.
3762
3763 This property is ignored if the target also has a non-empty INTER‐
3764 FACE_LINK_LIBRARIES property.
3765
3766 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3767
3768 IMPORTED_LINK_INTERFACE_MULTIPLICITY
3769 Repetition count for cycles of IMPORTED static libraries.
3770
3771 This is LINK_INTERFACE_MULTIPLICITY for IMPORTED targets.
3772
3773 IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>
3774 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_MULTIPLICITY.
3775
3776 If set, this property completely overrides the generic property for the
3777 named configuration.
3778
3779 IMPORTED_LOCATION
3780 Full path to the main file on disk for an IMPORTED target.
3781
3782 Set this to the location of an IMPORTED target file on disk. For exe‐
3783 cutables this is the location of the executable file. For STATIC li‐
3784 braries and modules this is the location of the library or module. For
3785 SHARED libraries on non-DLL platforms this is the location of the
3786 shared library. For application bundles on macOS this is the location
3787 of the executable file inside Contents/MacOS within the bundle folder.
3788 For frameworks on macOS this is the location of the library file sym‐
3789 link just inside the framework folder. For DLLs this is the location
3790 of the .dll part of the library. For UNKNOWN libraries this is the lo‐
3791 cation of the file to be linked. Ignored for non-imported targets.
3792
3793 The IMPORTED_LOCATION target property may be overridden for a given
3794 configuration <CONFIG> by the configuration-specific IMPORTED_LOCA‐
3795 TION_<CONFIG> target property. Furthermore, the MAP_IMPORTED_CON‐
3796 FIG_<CONFIG> target property may be used to map between a project's
3797 configurations and those of an imported target. If none of these is
3798 set then the name of any other configuration listed in the IM‐
3799 PORTED_CONFIGURATIONS target property may be selected and its IM‐
3800 PORTED_LOCATION_<CONFIG> value used.
3801
3802 To get the location of an imported target read one of the LOCATION or
3803 LOCATION_<CONFIG> properties.
3804
3805 For platforms with import libraries (e.g. Windows) see also IM‐
3806 PORTED_IMPLIB.
3807
3808 IMPORTED_LOCATION_<CONFIG>
3809 <CONFIG>-specific version of IMPORTED_LOCATION property.
3810
3811 Configuration names correspond to those provided by the project from
3812 which the target is imported.
3813
3814 IMPORTED_NO_SONAME
3815 Specifies that an IMPORTED shared library target has no soname.
3816
3817 Set this property to true for an imported shared library file that has
3818 no soname field. CMake may adjust generated link commands for some
3819 platforms to prevent the linker from using the path to the library in
3820 place of its missing soname. Ignored for non-imported targets.
3821
3822 IMPORTED_NO_SONAME_<CONFIG>
3823 <CONFIG>-specific version of IMPORTED_NO_SONAME property.
3824
3825 Configuration names correspond to those provided by the project from
3826 which the target is imported.
3827
3828 IMPORTED_OBJECTS
3829 New in version 3.9.
3830
3831
3832 A semicolon-separated list of absolute paths to the object files on
3833 disk for an imported object library.
3834
3835 Ignored for non-imported targets.
3836
3837 Projects may skip IMPORTED_OBJECTS if the configuration-specific prop‐
3838 erty IMPORTED_OBJECTS_<CONFIG> is set instead, except in situations as
3839 noted in the section below.
3840
3841 Xcode Generator Considerations
3842 New in version 3.20.
3843
3844
3845 For Apple platforms, a project may be built for more than one architec‐
3846 ture. This is controlled by the CMAKE_OSX_ARCHITECTURES variable. For
3847 all but the Xcode generator, CMake invokes compilers once per source
3848 file and passes multiple -arch flags, leading to a single object file
3849 which will be a universal binary. Such object files work well when
3850 listed in the IMPORTED_OBJECTS of a separate CMake build, even for the
3851 Xcode generator. But producing such object files with the Xcode gener‐
3852 ator is more difficult, since it invokes the compiler once per archi‐
3853 tecture for each source file. Unlike the other generators, it does not
3854 generate universal object file binaries.
3855
3856 A further complication with the Xcode generator is that when targeting
3857 device platforms (iOS, tvOS or watchOS), the Xcode generator has the
3858 ability to use either the device or simulator SDK without needing CMake
3859 to be re-run. The SDK can be selected at build time. But since some
3860 architectures can be supported by both the device and the simulator
3861 SDKs (e.g. arm64 with Xcode 12 or later), not all combinations can be
3862 represented in a single universal binary. The only solution in this
3863 case is to have multiple object files.
3864
3865 IMPORTED_OBJECTS doesn't support generator expressions, so every file
3866 it lists needs to be valid for every architecture and SDK. If incorpo‐
3867 rating object files that are not universal binaries, the path and/or
3868 file name of each object file has to somehow encapsulate the different
3869 architectures and SDKs. With the Xcode generator, Xcode variables of
3870 the form $(...) can be used to represent these aspects and Xcode will
3871 substitute the appropriate values at build time. CMake doesn't inter‐
3872 pret these variables and embeds them unchanged in the Xcode project
3873 file. $(CURRENT_ARCH) can be used to represent the architecture, while
3874 $(EFFECTIVE_PLATFORM_NAME) can be used to differentiate between SDKs.
3875
3876 The following shows one example of how these two variables can be used
3877 to refer to an object file whose location depends on both the SDK and
3878 the architecture:
3879
3880 add_library(someObjs OBJECT IMPORTED)
3881
3882 set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS
3883 # Quotes are required because of the ()
3884 "/path/to/somewhere/objects$(EFFECTIVE_PLATFORM_NAME)/$(CURRENT_ARCH)/func.o"
3885 )
3886
3887 # Example paths:
3888 # /path/to/somewhere/objects-iphoneos/arm64/func.o
3889 # /path/to/somewhere/objects-iphonesimulator/x86_64/func.o
3890
3891 In some cases, you may want to have configuration-specific object files
3892 as well. The $(CONFIGURATION) Xcode variable is often used for this
3893 and can be used in conjunction with the others mentioned above:
3894
3895 add_library(someObjs OBJECT IMPORTED)
3896 set_property(TARGET someObjs PROPERTY IMPORTED_OBJECTS
3897 "/path/to/somewhere/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/$(CURRENT_ARCH)/func.o"
3898 )
3899
3900 # Example paths:
3901 # /path/to/somewhere/Release-iphoneos/arm64/func.o
3902 # /path/to/somewhere/Debug-iphonesimulator/x86_64/func.o
3903
3904 When any Xcode variable is used, CMake is not able to fully evaluate
3905 the path(s) at configure time. One consequence of this is that the
3906 configuration-specific IMPORTED_OBJECTS_<CONFIG> properties cannot be
3907 used, since CMake cannot determine whether an object file exists at a
3908 particular <CONFIG> location. The IMPORTED_OBJECTS property must be
3909 used for these situations and the configuration-specific aspects of the
3910 path should be handled by the $(CONFIGURATION) Xcode variable.
3911
3912 IMPORTED_OBJECTS_<CONFIG>
3913 New in version 3.9.
3914
3915
3916 <CONFIG>-specific version of IMPORTED_OBJECTS property.
3917
3918 Configuration names correspond to those provided by the project from
3919 which the target is imported.
3920
3921 Xcode Generator Considerations
3922 Do not use this <CONFIG>-specific property if you need to use Xcode
3923 variables like $(CURRENT_ARCH) or $(EFFECTIVE_PLATFORM_NAME) in the
3924 value. The <CONFIG>-specific properties will be ignored in such cases
3925 because CMake cannot determine whether a file exists at the configura‐
3926 tion-specific path at configuration time. For such cases, use IM‐
3927 PORTED_OBJECTS instead.
3928
3929 IMPORTED_SONAME
3930 The soname of an IMPORTED target of shared library type.
3931
3932 Set this to the soname embedded in an imported shared library. This is
3933 meaningful only on platforms supporting the feature. Ignored for
3934 non-imported targets.
3935
3936 IMPORTED_SONAME_<CONFIG>
3937 <CONFIG>-specific version of IMPORTED_SONAME property.
3938
3939 Configuration names correspond to those provided by the project from
3940 which the target is imported.
3941
3942 IMPORT_PREFIX
3943 What comes before the import library name.
3944
3945 Similar to the target property PREFIX, but used for import libraries
3946 (typically corresponding to a DLL) instead of regular libraries. A
3947 target property that can be set to override the prefix (such as lib) on
3948 an import library name.
3949
3950 IMPORT_SUFFIX
3951 What comes after the import library name.
3952
3953 Similar to the target property SUFFIX, but used for import libraries
3954 (typically corresponding to a DLL) instead of regular libraries. A
3955 target property that can be set to override the suffix (such as .lib)
3956 on an import library name.
3957
3958 INCLUDE_DIRECTORIES
3959 List of preprocessor include file search directories.
3960
3961 This property specifies the list of directories given so far to the
3962 target_include_directories() command. In addition to accepting values
3963 from that command, values may be set directly on any target using the
3964 set_property() command. A target gets its initial value for this prop‐
3965 erty from the value of the INCLUDE_DIRECTORIES directory property.
3966 Both directory and target property values are adjusted by calls to the
3967 include_directories() command.
3968
3969 The value of this property is used by the generators to set the include
3970 paths for the compiler.
3971
3972 Relative paths should not be added to this property directly. Use one
3973 of the commands above instead to handle relative paths.
3974
3975 Contents of INCLUDE_DIRECTORIES may use cmake-generator-expressions(7)
3976 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3977 for available expressions. See the cmake-buildsystem(7) manual for
3978 more on defining buildsystem properties.
3979
3980 INSTALL_NAME_DIR
3981 Directory name for installed targets on Apple platforms.
3982
3983 INSTALL_NAME_DIR is a string specifying the directory portion of the
3984 "install_name" field of shared libraries on Apple platforms for in‐
3985 stalled targets. When not set, the default directory used is deter‐
3986 mined by MACOSX_RPATH. Policies CMP0068 and CMP0042 are also relevant.
3987
3988 This property is initialized by the value of the variable CMAKE_IN‐
3989 STALL_NAME_DIR if it is set when a target is created.
3990
3991 This property supports generator expressions. In particular, the $<IN‐
3992 STALL_PREFIX> generator expression can be used to set the directory
3993 relative to the install-time prefix.
3994
3995 INSTALL_REMOVE_ENVIRONMENT_RPATH
3996 New in version 3.16.
3997
3998
3999 Controls whether toolchain-defined rpaths should be removed during in‐
4000 stallation.
4001
4002 When a target is being installed, CMake may need to rewrite its rpath
4003 information. This occurs when the install rpath (as specified by the
4004 INSTALL_RPATH target property) has different contents to the rpath that
4005 the target was built with. Some toolchains insert their own rpath con‐
4006 tents into the binary as part of the build. By default, CMake will
4007 preserve those extra inserted contents in the install rpath. For those
4008 scenarios where such toolchain-inserted entries need to be discarded
4009 during install, set the INSTALL_REMOVE_ENVIRONMENT_RPATH target prop‐
4010 erty to true.
4011
4012 This property is initialized by the value of CMAKE_INSTALL_REMOVE_ENVI‐
4013 RONMENT_RPATH when the target is created.
4014
4015 INSTALL_RPATH
4016 The rpath to use for installed targets.
4017
4018 A semicolon-separated list specifying the rpath to use in installed
4019 targets (for platforms that support it). This property is initialized
4020 by the value of the variable CMAKE_INSTALL_RPATH if it is set when a
4021 target is created.
4022
4023 Because the rpath may contain ${ORIGIN}, which coincides with CMake
4024 syntax, the contents of INSTALL_RPATH are properly escaped in the
4025 cmake_install.cmake script (see policy CMP0095.)
4026
4027 This property supports generator expressions.
4028
4029 INSTALL_RPATH_USE_LINK_PATH
4030 Add paths to linker search and installed rpath.
4031
4032 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to True will ap‐
4033 pend to the runtime search path (rpath) of installed binaries any di‐
4034 rectories outside the project that are in the linker search path or
4035 contain linked library files. The directories are appended after the
4036 value of the INSTALL_RPATH target property.
4037
4038 This property is initialized by the value of the variable CMAKE_IN‐
4039 STALL_RPATH_USE_LINK_PATH if it is set when a target is created.
4040
4041 INTERFACE_AUTOUIC_OPTIONS
4042 List of interface options to pass to uic.
4043
4044 Targets may populate this property to publish the options required to
4045 use when invoking uic. Consuming targets can add entries to their own
4046 AUTOUIC_OPTIONS property such as $<TARGET_PROPERTY:foo,INTER‐
4047 FACE_AUTOUIC_OPTIONS> to use the uic options specified in the interface
4048 of foo. This is done automatically by the target_link_libraries() com‐
4049 mand.
4050
4051 This property supports generator expressions. See the cmake-genera‐
4052 tor-expressions(7) manual for available expressions.
4053
4054 INTERFACE_COMPILE_DEFINITIONS
4055 List of public compile definitions requirements for a library.
4056
4057 Targets may populate this property to publish the compile definitions
4058 required to compile against the headers for the target. The tar‐
4059 get_compile_definitions() command populates this property with values
4060 given to the PUBLIC and INTERFACE keywords. Projects may also get and
4061 set the property directly.
4062
4063 When target dependencies are specified using target_link_libraries(),
4064 CMake will read this property from all target dependencies to determine
4065 the build properties of the consumer.
4066
4067 Contents of INTERFACE_COMPILE_DEFINITIONS may use "generator expres‐
4068 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
4069 manual for available expressions. See the cmake-buildsystem(7) -manual
4070 for more on defining buildsystem properties.
4071
4072 INTERFACE_COMPILE_FEATURES
4073 New in version 3.1.
4074
4075
4076 List of public compile features requirements for a library.
4077
4078 Targets may populate this property to publish the compile features re‐
4079 quired to compile against the headers for the target. The target_com‐
4080 pile_features() command populates this property with values given to
4081 the PUBLIC and INTERFACE keywords. Projects may also get and set the
4082 property directly.
4083
4084 When target dependencies are specified using target_link_libraries(),
4085 CMake will read this property from all target dependencies to determine
4086 the build properties of the consumer.
4087
4088 Contents of INTERFACE_COMPILE_FEATURES may use "generator expressions"
4089 with the syntax $<...>. See the cmake-generator-expressions(7) manual
4090 for available expressions. See the cmake-buildsystem(7) -manual for
4091 more on defining buildsystem properties.
4092
4093 See the cmake-compile-features(7) manual for information on compile
4094 features and a list of supported compilers.
4095
4096 INTERFACE_COMPILE_OPTIONS
4097 List of public compile options requirements for a library.
4098
4099 Targets may populate this property to publish the compile options re‐
4100 quired to compile against the headers for the target. The target_com‐
4101 pile_options() command populates this property with values given to the
4102 PUBLIC and INTERFACE keywords. Projects may also get and set the prop‐
4103 erty directly.
4104
4105 When target dependencies are specified using target_link_libraries(),
4106 CMake will read this property from all target dependencies to determine
4107 the build properties of the consumer.
4108
4109 Contents of INTERFACE_COMPILE_OPTIONS may use "generator expressions"
4110 with the syntax $<...>. See the cmake-generator-expressions(7) manual
4111 for available expressions. See the cmake-buildsystem(7) -manual for
4112 more on defining buildsystem properties.
4113
4114 INTERFACE_INCLUDE_DIRECTORIES
4115 List of public include directories requirements for a library.
4116
4117 Targets may populate this property to publish the include directories
4118 required to compile against the headers for the target. The target_in‐
4119 clude_directories() command populates this property with values given
4120 to the PUBLIC and INTERFACE keywords. Projects may also get and set
4121 the property directly.
4122
4123 When target dependencies are specified using target_link_libraries(),
4124 CMake will read this property from all target dependencies to determine
4125 the build properties of the consumer.
4126
4127 Contents of INTERFACE_INCLUDE_DIRECTORIES may use "generator expres‐
4128 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
4129 manual for available expressions. See the cmake-buildsystem(7) -manual
4130 for more on defining buildsystem properties.
4131
4132 Include directories usage requirements commonly differ between the
4133 build-tree and the install-tree. The BUILD_INTERFACE and INSTALL_IN‐
4134 TERFACE generator expressions can be used to describe separate usage
4135 requirements based on the usage location. Relative paths are allowed
4136 within the INSTALL_INTERFACE expression and are interpreted relative to
4137 the installation prefix. For example:
4138
4139 target_include_directories(mylib INTERFACE
4140 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
4141 $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
4142 )
4143
4144 Creating Relocatable Packages
4145 Note that it is not advisable to populate the INSTALL_INTERFACE of the
4146 INTERFACE_INCLUDE_DIRECTORIES of a target with absolute paths to the
4147 include directories of dependencies. That would hard-code into in‐
4148 stalled packages the include directory paths for dependencies as found
4149 on the machine the package was made on.
4150
4151 The INSTALL_INTERFACE of the INTERFACE_INCLUDE_DIRECTORIES is only
4152 suitable for specifying the required include directories for headers
4153 provided with the target itself, not those provided by the transitive
4154 dependencies listed in its INTERFACE_LINK_LIBRARIES target property.
4155 Those dependencies should themselves be targets that specify their own
4156 header locations in INTERFACE_INCLUDE_DIRECTORIES.
4157
4158 See the Creating Relocatable Packages section of the cmake-packages(7)
4159 manual for discussion of additional care that must be taken when speci‐
4160 fying usage requirements while creating packages for redistribution.
4161
4162 INTERFACE_LINK_DEPENDS
4163 New in version 3.13.
4164
4165
4166 Additional public interface files on which a target binary depends for
4167 linking.
4168
4169 This property is supported only by Ninja and Makefile Generators. It
4170 is intended to specify dependencies on "linker scripts" for custom
4171 Makefile link rules.
4172
4173 When target dependencies are specified using target_link_libraries(),
4174 CMake will read this property from all target dependencies to determine
4175 the build properties of the consumer.
4176
4177 Contents of INTERFACE_LINK_DEPENDS may use "generator expressions" with
4178 the syntax $<...>. See the cmake-generator-expressions(7) manual for
4179 available expressions. See the cmake-buildsystem(7) -manual for more
4180 on defining buildsystem properties.
4181
4182 Link dependency files usage requirements commonly differ between the
4183 build-tree and the install-tree. The BUILD_INTERFACE and INSTALL_IN‐
4184 TERFACE generator expressions can be used to describe separate usage
4185 requirements based on the usage location. Relative paths are allowed
4186 within the INSTALL_INTERFACE expression and are interpreted relative to
4187 the installation prefix. For example:
4188
4189 set_property(TARGET mylib PROPERTY INTERFACE_LINK_DEPENDS
4190 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/mylinkscript>
4191 $<INSTALL_INTERFACE:mylinkscript> # <prefix>/mylinkscript
4192 )
4193
4194 INTERFACE_LINK_DIRECTORIES
4195 New in version 3.13.
4196
4197
4198 List of public link directories requirements for a library.
4199
4200 Targets may populate this property to publish the link directories re‐
4201 quired to compile against the headers for the target. The tar‐
4202 get_link_directories() command populates this property with values
4203 given to the PUBLIC and INTERFACE keywords. Projects may also get and
4204 set the property directly.
4205
4206 When target dependencies are specified using target_link_libraries(),
4207 CMake will read this property from all target dependencies to determine
4208 the build properties of the consumer.
4209
4210 Contents of INTERFACE_LINK_DIRECTORIES may use "generator expressions"
4211 with the syntax $<...>. See the cmake-generator-expressions(7) manual
4212 for available expressions. See the cmake-buildsystem(7) -manual for
4213 more on defining buildsystem properties.
4214
4215 INTERFACE_LINK_LIBRARIES
4216 List public interface libraries for a library.
4217
4218 This property contains the list of transitive link dependencies. When
4219 the target is linked into another target using the target_link_li‐
4220 braries() command, the libraries listed (and recursively their link in‐
4221 terface libraries) will be provided to the other target also. This
4222 property is overridden by the LINK_INTERFACE_LIBRARIES or LINK_INTER‐
4223 FACE_LIBRARIES_<CONFIG> property if policy CMP0022 is OLD or unset.
4224
4225 Contents of INTERFACE_LINK_LIBRARIES may use "generator expressions"
4226 with the syntax $<...>. See the cmake-generator-expressions(7) manual
4227 for available expressions. See the cmake-buildsystem(7) manual for
4228 more on defining buildsystem properties.
4229
4230 NOTE:
4231 A call to target_link_libraries(<target> ...) may update this prop‐
4232 erty on <target>. If <target> was not created in the same directory
4233 as the call then target_link_libraries() will wrap each entry with
4234 the form ::@(directory-id);...;::@, where the ::@ is literal and the
4235 (directory-id) is unspecified. This tells the generators that the
4236 named libraries must be looked up in the scope of the caller rather
4237 than in the scope in which the <target> was created. Valid direc‐
4238 tory ids are stripped on export by the install(EXPORT) and export()
4239 commands.
4240
4241 Creating Relocatable Packages
4242 Note that it is not advisable to populate the INTERFACE_LINK_LIBRARIES
4243 of a target with absolute paths to dependencies. That would hard-code
4244 into installed packages the library file paths for dependencies as
4245 found on the machine the package was made on.
4246
4247 See the Creating Relocatable Packages section of the cmake-packages(7)
4248 manual for discussion of additional care that must be taken when speci‐
4249 fying usage requirements while creating packages for redistribution.
4250
4251 INTERFACE_LINK_OPTIONS
4252 New in version 3.13.
4253
4254
4255 List of public link options requirements for a library.
4256
4257 Targets may populate this property to publish the link options required
4258 to compile against the headers for the target. The target_link_op‐
4259 tions() command populates this property with values given to the PUBLIC
4260 and INTERFACE keywords. Projects may also get and set the property di‐
4261 rectly.
4262
4263 When target dependencies are specified using target_link_libraries(),
4264 CMake will read this property from all target dependencies to determine
4265 the build properties of the consumer.
4266
4267 Contents of INTERFACE_LINK_OPTIONS may use "generator expressions" with
4268 the syntax $<...>. See the cmake-generator-expressions(7) manual for
4269 available expressions. See the cmake-buildsystem(7) -manual for more
4270 on defining buildsystem properties.
4271
4272 INTERFACE_POSITION_INDEPENDENT_CODE
4273 Whether consumers need to create a position-independent target
4274
4275 The INTERFACE_POSITION_INDEPENDENT_CODE property informs consumers of
4276 this target whether they must set their POSITION_INDEPENDENT_CODE prop‐
4277 erty to ON. If this property is set to ON, then the POSITION_INDEPEN‐
4278 DENT_CODE property on all consumers will be set to ON. Similarly, if
4279 this property is set to OFF, then the POSITION_INDEPENDENT_CODE prop‐
4280 erty on all consumers will be set to OFF. If this property is unde‐
4281 fined, then consumers will determine their POSITION_INDEPENDENT_CODE
4282 property by other means. Consumers must ensure that the targets that
4283 they link to have a consistent requirement for their INTERFACE_POSI‐
4284 TION_INDEPENDENT_CODE property.
4285
4286 Contents of INTERFACE_POSITION_INDEPENDENT_CODE may use "generator ex‐
4287 pressions" with the syntax $<...>. See the cmake-generator-expres‐
4288 sions(7) manual for available expressions. See the cmake-buildsys‐
4289 tem(7) manual for more on defining buildsystem properties.
4290
4291 INTERFACE_PRECOMPILE_HEADERS
4292 New in version 3.16.
4293
4294
4295 List of interface header files to precompile into consuming targets.
4296
4297 Targets may populate this property to publish the header files for con‐
4298 suming targets to precompile. The target_precompile_headers() command
4299 populates this property with values given to the PUBLIC and INTERFACE
4300 keywords. Projects may also get and set the property directly. See
4301 the discussion in target_precompile_headers() for guidance on appropri‐
4302 ate use of this property for installed or exported targets.
4303
4304 Contents of INTERFACE_PRECOMPILE_HEADERS may use "generator expres‐
4305 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
4306 manual for available expressions. See the cmake-buildsystem(7) manual
4307 for more on defining buildsystem properties.
4308
4309 INTERFACE_SOURCES
4310 New in version 3.1.
4311
4312
4313 List of interface sources to compile into consuming targets.
4314
4315 Targets may populate this property to publish the sources for consuming
4316 targets to compile. The target_sources() command populates this prop‐
4317 erty with values given to the PUBLIC and INTERFACE keywords. Projects
4318 may also get and set the property directly.
4319
4320 When target dependencies are specified using target_link_libraries(),
4321 CMake will read this property from all target dependencies to determine
4322 the sources of the consumer.
4323
4324 Contents of INTERFACE_SOURCES may use "generator expressions" with the
4325 syntax $<...>. See the cmake-generator-expressions(7) manual for
4326 available expressions. See the cmake-buildsystem(7) manual for more on
4327 defining buildsystem properties.
4328
4329 INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
4330 List of public system include directories for a library.
4331
4332 Targets may populate this property to publish the include directories
4333 which contain system headers, and therefore should not result in com‐
4334 piler warnings. The target_include_directories(SYSTEM) command signa‐
4335 ture populates this property with values given to the PUBLIC and INTER‐
4336 FACE keywords.
4337
4338 Projects may also get and set the property directly, but must be aware
4339 that adding directories to this property does not make those directo‐
4340 ries used during compilation. Adding directories to this property
4341 marks directories as SYSTEM which otherwise would be used in a non-SYS‐
4342 TEM manner. This can appear similar to 'duplication', so prefer the
4343 high-level target_include_directories(SYSTEM) command and avoid setting
4344 the property by low-level means.
4345
4346 When target dependencies are specified using target_link_libraries(),
4347 CMake will read this property from all target dependencies to mark the
4348 same include directories as containing system headers.
4349
4350 Contents of INTERFACE_SYSTEM_INCLUDE_DIRECTORIES may use "generator ex‐
4351 pressions" with the syntax $<...>. See the cmake-generator-expres‐
4352 sions(7) manual for available expressions. See the cmake-buildsys‐
4353 tem(7) manual for more on defining buildsystem properties.
4354
4355 INTERPROCEDURAL_OPTIMIZATION
4356 Enable interprocedural optimization for a target.
4357
4358 If set to true, enables interprocedural optimizations if they are known
4359 to be supported by the compiler. Depending on value of policy CMP0069,
4360 the error will be reported or ignored, if interprocedural optimization
4361 is enabled but not supported.
4362
4363 This property is initialized by the CMAKE_INTERPROCEDURAL_OPTIMIZATION
4364 variable if it is set when a target is created.
4365
4366 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
4367 Per-configuration interprocedural optimization for a target.
4368
4369 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.
4370 If set, this property overrides the generic property for the named con‐
4371 figuration.
4372
4373 This property is initialized by the CMAKE_INTERPROCEDURAL_OPTIMIZA‐
4374 TION_<CONFIG> variable if it is set when a target is created.
4375
4376 IOS_INSTALL_COMBINED
4377 New in version 3.5.
4378
4379
4380 Build a combined (device and simulator) target when installing.
4381
4382 When this property is set to set to false (which is the default) then
4383 it will either be built with the device SDK or the simulator SDK de‐
4384 pending on the SDK set. But if this property is set to true then the
4385 target will at install time also be built for the corresponding SDK and
4386 combined into one library.
4387
4388 NOTE:
4389 If a selected architecture is available for both: device SDK and
4390 simulator SDK it will be built for the SDK selected by
4391 CMAKE_OSX_SYSROOT and removed from the corresponding SDK.
4392
4393 This feature requires at least Xcode version 6.
4394
4395 ISPC_HEADER_DIRECTORY
4396 New in version 3.19.
4397
4398
4399 Specify relative output directory for ISPC headers provided by the tar‐
4400 get.
4401
4402 If the target contains ISPC source files, this specifies the directory
4403 in which the generated headers will be placed. Relative paths are
4404 treated with respect to the value of CMAKE_CURRENT_BINARY_DIR. When
4405 this property is not set, the headers will be placed a generator de‐
4406 fined build directory. If the variable CMAKE_ISPC_HEADER_DIRECTORY is
4407 set when a target is created its value is used to initialize this prop‐
4408 erty.
4409
4410 ISPC_HEADER_SUFFIX
4411 New in version 3.19.2.
4412
4413
4414 Specify output suffix to be used for ISPC generated headers provided by
4415 the target.
4416
4417 This property is initialized by the value of the CMAKE_ISPC_HEADER_SUF‐
4418 FIX variable if it is set when a target is created.
4419
4420 If the target contains ISPC source files, this specifies the header
4421 suffix to be used for the generated headers.
4422
4423 The default value is _ispc.h.
4424
4425 ISPC_INSTRUCTION_SETS
4426 New in version 3.19.
4427
4428
4429 List of instruction set architectures to generate code for.
4430
4431 This property is initialized by the value of the CMAKE_ISPC_INSTRUC‐
4432 TION_SETS variable if it is set when a target is created.
4433
4434 The ISPC_INSTRUCTION_SETS target property must be used when generating
4435 for multiple instruction sets so that CMake can track what object files
4436 will be generated.
4437
4438 Examples
4439 set_property(TARGET tgt PROPERTY ISPC_INSTRUCTION_SETS avx2-i32x4 avx512skx-i32x835)
4440
4441 Generates code for avx2 and avx512skx target architectures.
4442
4443 JOB_POOL_COMPILE
4444 Ninja only: Pool used for compiling.
4445
4446 The number of parallel compile processes could be limited by defining
4447 pools with the global JOB_POOLS property and then specifying here the
4448 pool name.
4449
4450 For instance:
4451
4452 set_property(TARGET myexe PROPERTY JOB_POOL_COMPILE ten_jobs)
4453
4454 This property is initialized by the value of CMAKE_JOB_POOL_COMPILE.
4455
4456 JOB_POOL_LINK
4457 Ninja only: Pool used for linking.
4458
4459 The number of parallel link processes could be limited by defining
4460 pools with the global JOB_POOLS property and then specifying here the
4461 pool name.
4462
4463 For instance:
4464
4465 set_property(TARGET myexe PROPERTY JOB_POOL_LINK two_jobs)
4466
4467 This property is initialized by the value of CMAKE_JOB_POOL_LINK.
4468
4469 JOB_POOL_PRECOMPILE_HEADER
4470 New in version 3.17.
4471
4472
4473 Ninja only: Pool used for generating pre-compiled headers.
4474
4475 The number of parallel compile processes could be limited by defining
4476 pools with the global JOB_POOLS property and then specifying here the
4477 pool name.
4478
4479 For instance:
4480
4481 set_property(TARGET myexe PROPERTY JOB_POOL_PRECOMPILE_HEADER two_jobs)
4482
4483 This property is initialized by the value of CMAKE_JOB_POOL_PRECOM‐
4484 PILE_HEADER.
4485
4486 If neither JOB_POOL_PRECOMPILE_HEADER nor CMAKE_JOB_POOL_PRECOM‐
4487 PILE_HEADER are set then JOB_POOL_COMPILE will be used for this task.
4488
4489 LABELS
4490 Specify a list of text labels associated with a target.
4491
4492 Target label semantics are currently unspecified.
4493
4494 <LANG>_CLANG_TIDY
4495 New in version 3.6.
4496
4497
4498 This property is implemented only when <LANG> is C, CXX, OBJC or OB‐
4499 JCXX.
4500
4501 Specify a semicolon-separated list containing a command line for the
4502 clang-tidy tool. The Makefile Generators and the Ninja generator will
4503 run this tool along with the compiler and report a warning if the tool
4504 reports any problems.
4505
4506 This property is initialized by the value of the
4507 CMAKE_<LANG>_CLANG_TIDY variable if it is set when a target is created.
4508
4509 <LANG>_COMPILER_LAUNCHER
4510 New in version 3.4.
4511
4512
4513 This property is implemented only when <LANG> is C, CXX, Fortran, HIP,
4514 ISPC, OBJC, OBJCXX, or CUDA.
4515
4516 Specify a semicolon-separated list containing a command line for a com‐
4517 piler launching tool. The Makefile Generators and the Ninja generator
4518 will run this tool and pass the compiler and its arguments to the tool.
4519 Some example tools are distcc and ccache.
4520
4521 This property is initialized by the value of the CMAKE_<LANG>_COM‐
4522 PILER_LAUNCHER variable if it is set when a target is created.
4523
4524 <LANG>_CPPCHECK
4525 New in version 3.10.
4526
4527
4528 This property is supported only when <LANG> is C or CXX.
4529
4530 Specify a semicolon-separated list containing a command line for the
4531 cppcheck static analysis tool. The Makefile Generators and the Ninja
4532 generator will run cppcheck along with the compiler and report any
4533 problems. If the command-line specifies the exit code options to cp‐
4534 pcheck then the build will fail if the tool returns non-zero.
4535
4536 This property is initialized by the value of the CMAKE_<LANG>_CPPCHECK
4537 variable if it is set when a target is created.
4538
4539 <LANG>_CPPLINT
4540 New in version 3.8.
4541
4542
4543 This property is supported only when <LANG> is C or CXX.
4544
4545 Specify a semicolon-separated list containing a command line for the
4546 cpplint style checker. The Makefile Generators and the Ninja generator
4547 will run cpplint along with the compiler and report any problems.
4548
4549 This property is initialized by the value of the CMAKE_<LANG>_CPPLINT
4550 variable if it is set when a target is created.
4551
4552 <LANG>_EXTENSIONS
4553 The variations are:
4554
4555 • C_EXTENSIONS
4556
4557 • CXX_EXTENSIONS
4558
4559 • CUDA_EXTENSIONS
4560
4561 • HIP_EXTENSIONS
4562
4563 • OBJC_EXTENSIONS
4564
4565 • OBJCXX_EXTENSIONS
4566
4567 These properties specify whether compiler-specific extensions are re‐
4568 quested.
4569
4570 These properties are initialized by the value of the CMAKE_<LANG>_EX‐
4571 TENSIONS variable if it is set when a target is created and otherwise
4572 by the value of CMAKE_<LANG>_EXTENSIONS_DEFAULT (see CMP0128).
4573
4574 For supported CMake versions see the respective pages. To control lan‐
4575 guage standard versions see <LANG>_STANDARD.
4576
4577 See the cmake-compile-features(7) manual for information on compile
4578 features and a list of supported compilers.
4579
4580 <LANG>_INCLUDE_WHAT_YOU_USE
4581 New in version 3.3.
4582
4583
4584 This property is implemented only when <LANG> is C or CXX.
4585
4586 Specify a semicolon-separated list containing a command line for the
4587 include-what-you-use tool. The Makefile Generators and the Ninja gen‐
4588 erator will run this tool along with the compiler and report a warning
4589 if the tool reports any problems.
4590
4591 This property is initialized by the value of the CMAKE_<LANG>_IN‐
4592 CLUDE_WHAT_YOU_USE variable if it is set when a target is created.
4593
4594 <LANG>_LINKER_LAUNCHER
4595 New in version 3.21.
4596
4597
4598 This property is implemented only when <LANG> is C, CXX, OBJC, or OB‐
4599 JCXX
4600
4601 Specify a semicolon-separated list containing a command line for a
4602 linker launching tool. The Makefile Generators and the Ninja generator
4603 will run this tool and pass the linker and its arguments to the tool.
4604 This is useful for tools such as static analyzers.
4605
4606 This property is initialized by the value of the
4607 CMAKE_<LANG>_LINKER_LAUNCHER variable if it is set when a target is
4608 created.
4609
4610 <LANG>_STANDARD
4611 The variations are:
4612
4613 • C_STANDARD
4614
4615 • CXX_STANDARD
4616
4617 • CUDA_STANDARD
4618
4619 • HIP_STANDARD
4620
4621 • OBJC_STANDARD
4622
4623 • OBJCXX_STANDARD
4624
4625 These properties specify language standard versions which are re‐
4626 quested. When a newer standard is specified than is supported by the
4627 compiler, then it will fallback to the latest supported standard. This
4628 "decay" behavior may be controlled with the <LANG>_STANDARD_REQUIRED
4629 target property.
4630
4631 These properties are initialized by the value of the CMAKE_<LANG>_STAN‐
4632 DARD variable if it is set when a target is created.
4633
4634 For supported values and CMake versions see the respective pages. To
4635 control compiler-specific extensions see <LANG>_EXTENSIONS.
4636
4637 See the cmake-compile-features(7) manual for information on compile
4638 features and a list of supported compilers.
4639
4640 <LANG>_STANDARD_REQUIRED
4641 The variations are:
4642
4643 • C_STANDARD_REQUIRED
4644
4645 • CXX_STANDARD_REQUIRED
4646
4647 • CUDA_STANDARD_REQUIRED
4648
4649 • HIP_STANDARD_REQUIRED
4650
4651 • OBJC_STANDARD_REQUIRED
4652
4653 • OBJCXX_STANDARD_REQUIRED
4654
4655 These properties specify whether the value of <LANG>_STANDARD is a re‐
4656 quirement. When OFF or unset, the <LANG>_STANDARD target property is
4657 treated as optional and may "decay" to a previous standard if the re‐
4658 quested is not available.
4659
4660 These properties are initialized by the value of the CMAKE_<LANG>_STAN‐
4661 DARD_REQUIRED variable if it is set when a target is created.
4662
4663 For supported CMake versions see the respective pages. To control lan‐
4664 guage standard versions see <LANG>_STANDARD.
4665
4666 See the cmake-compile-features(7) manual for information on compile
4667 features and a list of supported compilers.
4668
4669 <LANG>_VISIBILITY_PRESET
4670 Value for symbol visibility compile flags
4671
4672 The <LANG>_VISIBILITY_PRESET property determines the value passed in a
4673 visibility related compile option, such as -fvisibility= for <LANG>.
4674 This property affects compilation in sources of all types of targets
4675 (subject to policy CMP0063).
4676
4677 This property is initialized by the value of the CMAKE_<LANG>_VISIBIL‐
4678 ITY_PRESET variable if it is set when a target is created.
4679
4680 LIBRARY_OUTPUT_DIRECTORY
4681 Output directory in which to build LIBRARY target files.
4682
4683 This property specifies the directory into which library target files
4684 should be built. The property value may use generator expressions.
4685 Multi-configuration generators (Visual Studio, Xcode, Ninja Multi-Con‐
4686 fig) append a per-configuration subdirectory to the specified directory
4687 unless a generator expression is used.
4688
4689 This property is initialized by the value of the CMAKE_LIBRARY_OUT‐
4690 PUT_DIRECTORY variable if it is set when a target is created.
4691
4692 See also the LIBRARY_OUTPUT_DIRECTORY_<CONFIG> target property.
4693
4694 LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
4695 Per-configuration output directory for LIBRARY target files.
4696
4697 This is a per-configuration version of the LIBRARY_OUTPUT_DIRECTORY
4698 target property, but multi-configuration generators (Visual Studio Gen‐
4699 erators, Xcode) do NOT append a per-configuration subdirectory to the
4700 specified directory. This property is initialized by the value of the
4701 CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> variable if it is set when a
4702 target is created.
4703
4704 Contents of LIBRARY_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
4705 sions.
4706
4707 LIBRARY_OUTPUT_NAME
4708 Output name for LIBRARY target files.
4709
4710 This property specifies the base name for library target files. It
4711 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
4712
4713 See also the LIBRARY_OUTPUT_NAME_<CONFIG> target property.
4714
4715 LIBRARY_OUTPUT_NAME_<CONFIG>
4716 Per-configuration output name for LIBRARY target files.
4717
4718 This is the configuration-specific version of the LIBRARY_OUTPUT_NAME
4719 target property.
4720
4721 LINK_DEPENDS
4722 Additional files on which a target binary depends for linking.
4723
4724 Specifies a semicolon-separated list of full-paths to files on which
4725 the link rule for this target depends. The target binary will be
4726 linked if any of the named files is newer than it.
4727
4728 This property is supported only by Ninja and Makefile Generators. It
4729 is intended to specify dependencies on "linker scripts" for custom
4730 Makefile link rules.
4731
4732 Contents of LINK_DEPENDS may use "generator expressions" with the syn‐
4733 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
4734 able expressions. See the cmake-buildsystem(7) manual for more on
4735 defining buildsystem properties.
4736
4737 LINK_DEPENDS_NO_SHARED
4738 Do not depend on linked shared library files.
4739
4740 Set this property to true to tell CMake generators not to add
4741 file-level dependencies on the shared library files linked by this tar‐
4742 get. Modification to the shared libraries will not be sufficient to
4743 re-link this target. Logical target-level dependencies will not be af‐
4744 fected so the linked shared libraries will still be brought up to date
4745 before this target is built.
4746
4747 This property is initialized by the value of the CMAKE_LINK_DE‐
4748 PENDS_NO_SHARED variable if it is set when a target is created.
4749
4750 LINK_DIRECTORIES
4751 New in version 3.13.
4752
4753
4754 List of directories to use for the link step of shared library, module
4755 and executable targets.
4756
4757 This property holds a semicolon-separated list of directories specified
4758 so far for its target. Use the target_link_directories() command to
4759 append more search directories.
4760
4761 This property is initialized by the LINK_DIRECTORIES directory property
4762 when a target is created, and is used by the generators to set the
4763 search directories for the linker.
4764
4765 Contents of LINK_DIRECTORIES may use "generator expressions" with the
4766 syntax $<...>. See the cmake-generator-expressions(7) manual for
4767 available expressions. See the cmake-buildsystem(7) manual for more on
4768 defining buildsystem properties.
4769
4770 LINK_FLAGS
4771 Additional flags to use when linking this target if it is a shared li‐
4772 brary, module library, or an executable. Static libraries need to use
4773 STATIC_LIBRARY_OPTIONS or STATIC_LIBRARY_FLAGS properties.
4774
4775 The LINK_FLAGS property, managed as a string, can be used to add extra
4776 flags to the link step of a target. LINK_FLAGS_<CONFIG> will add to
4777 the configuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
4778 RELWITHDEBINFO, ...
4779
4780 NOTE:
4781 This property has been superseded by LINK_OPTIONS property.
4782
4783 LINK_FLAGS_<CONFIG>
4784 Per-configuration linker flags for a SHARED library, MODULE or EXE‐
4785 CUTABLE target.
4786
4787 This is the configuration-specific version of LINK_FLAGS.
4788
4789 NOTE:
4790 This property has been superseded by LINK_OPTIONS property.
4791
4792 LINK_INTERFACE_LIBRARIES
4793 List public interface libraries for a shared library or executable.
4794
4795 By default linking to a shared library target transitively links to
4796 targets with which the library itself was linked. For an executable
4797 with exports (see the ENABLE_EXPORTS target property) no default tran‐
4798 sitive link dependencies are used. This property replaces the default
4799 transitive link dependencies with an explicit list. When the target is
4800 linked into another target using the target_link_libraries() command,
4801 the libraries listed (and recursively their link interface libraries)
4802 will be provided to the other target also. If the list is empty then
4803 no transitive link dependencies will be incorporated when this target
4804 is linked into another target even if the default set is non-empty.
4805 This property is initialized by the value of the CMAKE_LINK_INTER‐
4806 FACE_LIBRARIES variable if it is set when a target is created. This
4807 property is ignored for STATIC libraries.
4808
4809 This property is overridden by the INTERFACE_LINK_LIBRARIES property if
4810 policy CMP0022 is NEW.
4811
4812 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
4813
4814 Creating Relocatable Packages
4815 Note that it is not advisable to populate the LINK_INTERFACE_LIBRARIES
4816 of a target with absolute paths to dependencies. That would hard-code
4817 into installed packages the library file paths for dependencies as
4818 found on the machine the package was made on.
4819
4820 See the Creating Relocatable Packages section of the cmake-packages(7)
4821 manual for discussion of additional care that must be taken when speci‐
4822 fying usage requirements while creating packages for redistribution.
4823
4824 LINK_INTERFACE_LIBRARIES_<CONFIG>
4825 Per-configuration list of public interface libraries for a target.
4826
4827 This is the configuration-specific version of LINK_INTERFACE_LIBRARIES.
4828 If set, this property completely overrides the generic property for the
4829 named configuration.
4830
4831 This property is overridden by the INTERFACE_LINK_LIBRARIES property if
4832 policy CMP0022 is NEW.
4833
4834 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
4835
4836 Creating Relocatable Packages
4837 Note that it is not advisable to populate the LINK_INTERFACE_LI‐
4838 BRARIES_<CONFIG> of a target with absolute paths to dependencies. That
4839 would hard-code into installed packages the library file paths for de‐
4840 pendencies as found on the machine the package was made on.
4841
4842 See the Creating Relocatable Packages section of the cmake-packages(7)
4843 manual for discussion of additional care that must be taken when speci‐
4844 fying usage requirements while creating packages for redistribution.
4845
4846 LINK_INTERFACE_MULTIPLICITY
4847 Repetition count for STATIC libraries with cyclic dependencies.
4848
4849 When linking to a STATIC library target with cyclic dependencies the
4850 linker may need to scan more than once through the archives in the
4851 strongly connected component of the dependency graph. CMake by default
4852 constructs the link line so that the linker will scan through the com‐
4853 ponent at least twice. This property specifies the minimum number of
4854 scans if it is larger than the default. CMake uses the largest value
4855 specified by any target in a component.
4856
4857 LINK_INTERFACE_MULTIPLICITY_<CONFIG>
4858 Per-configuration repetition count for cycles of STATIC libraries.
4859
4860 This is the configuration-specific version of LINK_INTERFACE_MULTIPLIC‐
4861 ITY. If set, this property completely overrides the generic property
4862 for the named configuration.
4863
4864 LINK_LIBRARIES
4865 List of direct link dependencies.
4866
4867 This property specifies the list of libraries or targets which will be
4868 used for linking. In addition to accepting values from the tar‐
4869 get_link_libraries() command, values may be set directly on any target
4870 using the set_property() command.
4871
4872 The value of this property is used by the generators to set the link
4873 libraries for the compiler.
4874
4875 Contents of LINK_LIBRARIES may use "generator expressions" with the
4876 syntax $<...>. See the cmake-generator-expressions(7) manual for
4877 available expressions. See the cmake-buildsystem(7) manual for more on
4878 defining buildsystem properties.
4879
4880 NOTE:
4881 A call to target_link_libraries(<target> ...) may update this prop‐
4882 erty on <target>. If <target> was not created in the same directory
4883 as the call then target_link_libraries() will wrap each entry with
4884 the form ::@(directory-id);...;::@, where the ::@ is literal and the
4885 (directory-id) is unspecified. This tells the generators that the
4886 named libraries must be looked up in the scope of the caller rather
4887 than in the scope in which the <target> was created. Valid direc‐
4888 tory ids are stripped on export by the install(EXPORT) and export()
4889 commands.
4890
4891 LINK_OPTIONS
4892 New in version 3.13.
4893
4894
4895 List of options to use for the link step of shared library, module and
4896 executable targets as well as the device link step. Targets that are
4897 static libraries need to use the STATIC_LIBRARY_OPTIONS target prop‐
4898 erty.
4899
4900 These options are used for both normal linking and device linking (see
4901 policy CMP0105). To control link options for normal and device link
4902 steps, $<HOST_LINK> and $<DEVICE_LINK> generator expressions can be
4903 used.
4904
4905 This property holds a semicolon-separated list of options specified so
4906 far for its target. Use the target_link_options() command to append
4907 more options.
4908
4909 This property is initialized by the LINK_OPTIONS directory property
4910 when a target is created, and is used by the generators to set the op‐
4911 tions for the compiler.
4912
4913 Contents of LINK_OPTIONS may use "generator expressions" with the syn‐
4914 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
4915 able expressions. See the cmake-buildsystem(7) manual for more on
4916 defining buildsystem properties.
4917
4918 NOTE:
4919 This property must be used in preference to LINK_FLAGS property.
4920
4921 Host And Device Specific Link Options
4922 New in version 3.18: When a device link step is involved, which is con‐
4923 trolled by CUDA_SEPARABLE_COMPILATION and CUDA_RESOLVE_DEVICE_SYMBOLS
4924 properties and policy CMP0105, the raw options will be delivered to the
4925 host and device link steps (wrapped in -Xcompiler or equivalent for de‐
4926 vice link). Options wrapped with $<DEVICE_LINK:...> generator expres‐
4927 sion will be used only for the device link step. Options wrapped with
4928 $<HOST_LINK:...> generator expression will be used only for the host
4929 link step.
4930
4931
4932 Option De-duplication
4933 The final set of options used for a target is constructed by accumulat‐
4934 ing options from the current target and the usage requirements of its
4935 dependencies. The set of options is de-duplicated to avoid repetition.
4936
4937 New in version 3.12: While beneficial for individual options, the
4938 de-duplication step can break up option groups. For example, -option A
4939 -option B becomes -option A B. One may specify a group of options us‐
4940 ing shell-like quoting along with a SHELL: prefix. The SHELL: prefix
4941 is dropped, and the rest of the option string is parsed using the sepa‐
4942 rate_arguments() UNIX_COMMAND mode. For example, "SHELL:-option A"
4943 "SHELL:-option B" becomes -option A -option B.
4944
4945
4946 Handling Compiler Driver Differences
4947 To pass options to the linker tool, each compiler driver has its own
4948 syntax. The LINKER: prefix and , separator can be used to specify, in
4949 a portable way, options to pass to the linker tool. LINKER: is replaced
4950 by the appropriate driver option and , by the appropriate driver sepa‐
4951 rator. The driver prefix and driver separator are given by the values
4952 of the CMAKE_<LANG>_LINKER_WRAPPER_FLAG and CMAKE_<LANG>_LINKER_WRAP‐
4953 PER_FLAG_SEP variables.
4954
4955 For example, "LINKER:-z,defs" becomes -Xlinker -z -Xlinker defs for
4956 Clang and -Wl,-z,defs for GNU GCC.
4957
4958 The LINKER: prefix can be specified as part of a SHELL: prefix expres‐
4959 sion.
4960
4961 The LINKER: prefix supports, as an alternative syntax, specification of
4962 arguments using the SHELL: prefix and space as separator. The previous
4963 example then becomes "LINKER:SHELL:-z defs".
4964
4965 NOTE:
4966 Specifying the SHELL: prefix anywhere other than at the beginning of
4967 the LINKER: prefix is not supported.
4968
4969 LINK_SEARCH_END_STATIC
4970 End a link line such that static system libraries are used.
4971
4972 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
4973 mine whether to use static or shared libraries for -lXXX options.
4974 CMake uses these options to set the link type for libraries whose full
4975 paths are not known or (in some cases) are in implicit link directories
4976 for the platform. By default CMake adds an option at the end of the
4977 library list (if necessary) to set the linker search type back to its
4978 starting type. This property switches the final linker search type to
4979 -Bstatic regardless of how it started.
4980
4981 This property is initialized by the value of the variable
4982 CMAKE_LINK_SEARCH_END_STATIC if it is set when a target is created.
4983
4984 See also LINK_SEARCH_START_STATIC.
4985
4986 LINK_SEARCH_START_STATIC
4987 Assume the linker looks for static libraries by default.
4988
4989 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
4990 mine whether to use static or shared libraries for -lXXX options.
4991 CMake uses these options to set the link type for libraries whose full
4992 paths are not known or (in some cases) are in implicit link directories
4993 for the platform. By default the linker search type is assumed to be
4994 -Bdynamic at the beginning of the library list. This property switches
4995 the assumption to -Bstatic. It is intended for use when linking an ex‐
4996 ecutable statically (e.g. with the GNU -static option).
4997
4998 This property is initialized by the value of the variable
4999 CMAKE_LINK_SEARCH_START_STATIC if it is set when a target is
5000 created.
5001
5002 See also LINK_SEARCH_END_STATIC.
5003
5004 LINK_WHAT_YOU_USE
5005 New in version 3.7.
5006
5007
5008 This is a boolean option that, when set to TRUE, will automatically run
5009 contents of variable CMAKE_LINK_WHAT_YOU_USE_CHECK on the target after
5010 it is linked. In addition, the linker flag specified by variable
5011 CMAKE_<LANG>_LINK_WHAT_YOU_USE_FLAG will be passed to the target with
5012 the link command so that all libraries specified on the command line
5013 will be linked into the target. This will result in the link producing
5014 a list of libraries that provide no symbols used by this target but are
5015 being linked to it.
5016
5017 NOTE:
5018 For now, it is only supported for ELF platforms and is only applica‐
5019 ble to executable and shared or module library targets. This prop‐
5020 erty will be ignored for any other targets and configurations.
5021
5022 This property is initialized by the value of the
5023 CMAKE_LINK_WHAT_YOU_USE variable if it is set when a target is created.
5024
5025 LINKER_LANGUAGE
5026 Specifies language whose compiler will invoke the linker.
5027
5028 For executables, shared libraries, and modules, this sets the language
5029 whose compiler is used to link the target (such as "C" or "CXX"). A
5030 typical value for an executable is the language of the source file pro‐
5031 viding the program entry point (main). If not set, the language with
5032 the highest linker preference value is the default. See documentation
5033 of CMAKE_<LANG>_LINKER_PREFERENCE variables.
5034
5035 If this property is not set by the user, it will be calculated at gen‐
5036 erate-time by CMake.
5037
5038 LOCATION
5039 Read-only location of a target on disk.
5040
5041 For an imported target, this read-only property returns the value of
5042 the LOCATION_<CONFIG> property for an unspecified configuration <CON‐
5043 FIG> provided by the target.
5044
5045 For a non-imported target, this property is provided for compatibility
5046 with CMake 2.4 and below. It was meant to get the location of an exe‐
5047 cutable target's output file for use in add_custom_command(). The path
5048 may contain a build-system-specific portion that is replaced at build
5049 time with the configuration getting built (such as $(ConfigurationName)
5050 in VS). In CMake 2.6 and above add_custom_command() automatically rec‐
5051 ognizes a target name in its COMMAND and DEPENDS options and computes
5052 the target location. In CMake 2.8.4 and above add_custom_command()
5053 recognizes generator expressions to refer to target locations anywhere
5054 in the command. Therefore this property is not needed for creating
5055 custom commands.
5056
5057 Do not set properties that affect the location of a target after read‐
5058 ing this property. These include properties whose names match (RUN‐
5059 TIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?, (IM‐
5060 PLIB_)?(PREFIX|SUFFIX), or "LINKER_LANGUAGE". Failure to follow this
5061 rule is not diagnosed and leaves the location of the target undefined.
5062
5063 LOCATION_<CONFIG>
5064 Read-only property providing a target location on disk.
5065
5066 A read-only property that indicates where a target's main file is lo‐
5067 cated on disk for the configuration <CONFIG>. The property is defined
5068 only for library and executable targets. An imported target may pro‐
5069 vide a set of configurations different from that of the importing
5070 project. By default CMake looks for an exact-match but otherwise uses
5071 an arbitrary available configuration. Use the MAP_IMPORTED_CON‐
5072 FIG_<CONFIG> property to map imported configurations explicitly.
5073
5074 Do not set properties that affect the location of a target after read‐
5075 ing this property. These include properties whose names match (RUN‐
5076 TIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?, (IM‐
5077 PLIB_)?(PREFIX|SUFFIX), or LINKER_LANGUAGE. Failure to follow this
5078 rule is not diagnosed and leaves the location of the target undefined.
5079
5080 MACHO_COMPATIBILITY_VERSION
5081 New in version 3.17.
5082
5083
5084 What compatibility version number is this target for Mach-O binaries.
5085
5086 For shared libraries on Mach-O systems (e.g. macOS, iOS) the MACHO_COM‐
5087 PATIBILITY_VERSION property corresponds to the compatibility version
5088 and MACHO_CURRENT_VERSION corresponds to the current version. These
5089 are both embedded in the shared library binary and can be checked with
5090 the otool -L <binary> command.
5091
5092 It should be noted that the MACHO_CURRENT_VERSION and MACHO_COMPATIBIL‐
5093 ITY_VERSION properties do not affect the file names or version-related
5094 symlinks that CMake generates for the library. The VERSION and SOVER‐
5095 SION target properties still control the file and symlink names. The
5096 install_name is also still controlled by SOVERSION.
5097
5098 When MACHO_CURRENT_VERSION and MACHO_COMPATIBILITY_VERSION are not
5099 given, VERSION and SOVERSION are used for the version details to be em‐
5100 bedded in the binaries respectively. The MACHO_CURRENT_VERSION and MA‐
5101 CHO_COMPATIBILITY_VERSION properties only need to be given if the
5102 project needs to decouple the file and symlink naming from the version
5103 details embedded in the binaries (e.g. to match libtool conventions).
5104
5105 MACHO_CURRENT_VERSION
5106 New in version 3.17.
5107
5108
5109 What current version number is this target for Mach-O binaries.
5110
5111 For shared libraries on Mach-O systems (e.g. macOS, iOS) the MACHO_COM‐
5112 PATIBILITY_VERSION property corresponds to the compatibility version
5113 and MACHO_CURRENT_VERSION corresponds to the current version. These
5114 are both embedded in the shared library binary and can be checked with
5115 the otool -L <binary> command.
5116
5117 It should be noted that the MACHO_CURRENT_VERSION and MACHO_COMPATIBIL‐
5118 ITY_VERSION properties do not affect the file names or version-related
5119 symlinks that CMake generates for the library. The VERSION and SOVER‐
5120 SION target properties still control the file and symlink names. The
5121 install_name is also still controlled by SOVERSION.
5122
5123 When MACHO_CURRENT_VERSION and MACHO_COMPATIBILITY_VERSION are not
5124 given, VERSION and SOVERSION are used for the version details to be em‐
5125 bedded in the binaries respectively. The MACHO_CURRENT_VERSION and MA‐
5126 CHO_COMPATIBILITY_VERSION properties only need to be given if the
5127 project needs to decouple the file and symlink naming from the version
5128 details embedded in the binaries (e.g. to match libtool conventions).
5129
5130 MACOSX_BUNDLE
5131 Build an executable as an Application Bundle on macOS or iOS.
5132
5133 When this property is set to TRUE the executable when built on macOS or
5134 iOS will be created as an application bundle. This makes it a GUI exe‐
5135 cutable that can be launched from the Finder. See the MACOSX_BUN‐
5136 DLE_INFO_PLIST target property for information about creation of the
5137 Info.plist file for the application bundle. This property is initial‐
5138 ized by the value of the variable CMAKE_MACOSX_BUNDLE if it is set when
5139 a target is created.
5140
5141 MACOSX_BUNDLE_INFO_PLIST
5142 Specify a custom Info.plist template for a macOS and iOS Application
5143 Bundle.
5144
5145 An executable target with MACOSX_BUNDLE enabled will be built as an ap‐
5146 plication bundle on macOS. By default its Info.plist file is created
5147 by configuring a template called MacOSXBundleInfo.plist.in located in
5148 the CMAKE_MODULE_PATH. This property specifies an alternative template
5149 file name which may be a full path.
5150
5151 The following target properties may be set to specify content to be
5152 configured into the file:
5153
5154 MACOSX_BUNDLE_BUNDLE_NAME
5155 Sets CFBundleName.
5156
5157 MACOSX_BUNDLE_BUNDLE_VERSION
5158 Sets CFBundleVersion.
5159
5160 MACOSX_BUNDLE_COPYRIGHT
5161 Sets NSHumanReadableCopyright.
5162
5163 MACOSX_BUNDLE_GUI_IDENTIFIER
5164 Sets CFBundleIdentifier.
5165
5166 MACOSX_BUNDLE_ICON_FILE
5167 Sets CFBundleIconFile.
5168
5169 MACOSX_BUNDLE_INFO_STRING
5170 Sets CFBundleGetInfoString.
5171
5172 MACOSX_BUNDLE_LONG_VERSION_STRING
5173 Sets CFBundleLongVersionString.
5174
5175 MACOSX_BUNDLE_SHORT_VERSION_STRING
5176 Sets CFBundleShortVersionString.
5177
5178 CMake variables of the same name may be set to affect all targets in a
5179 directory that do not have each specific property set. If a custom
5180 Info.plist is specified by this property it may of course hard-code all
5181 the settings instead of using the target properties.
5182
5183 MACOSX_FRAMEWORK_INFO_PLIST
5184 Specify a custom Info.plist template for a macOS and iOS Framework.
5185
5186 A library target with FRAMEWORK enabled will be built as a framework on
5187 macOS. By default its Info.plist file is created by configuring a tem‐
5188 plate called MacOSXFrameworkInfo.plist.in located in the CMAKE_MOD‐
5189 ULE_PATH. This property specifies an alternative template file name
5190 which may be a full path.
5191
5192 The following target properties may be set to specify content to be
5193 configured into the file:
5194
5195 MACOSX_FRAMEWORK_BUNDLE_VERSION
5196 Sets CFBundleVersion.
5197
5198 MACOSX_FRAMEWORK_ICON_FILE
5199 Sets CFBundleIconFile.
5200
5201 MACOSX_FRAMEWORK_IDENTIFIER
5202 Sets CFBundleIdentifier.
5203
5204 MACOSX_FRAMEWORK_SHORT_VERSION_STRING
5205 Sets CFBundleShortVersionString.
5206
5207 CMake variables of the same name may be set to affect all targets in a
5208 directory that do not have each specific property set. If a custom
5209 Info.plist is specified by this property it may of course hard-code all
5210 the settings instead of using the target properties.
5211
5212 MACOSX_RPATH
5213 Whether this target on macOS or iOS is located at runtime using rpaths.
5214
5215 When this property is set to TRUE, the directory portion of the in‐
5216 stall_name field of this shared library will be @rpath unless overrid‐
5217 den by INSTALL_NAME_DIR. This indicates the shared library is to be
5218 found at runtime using runtime paths (rpaths).
5219
5220 This property is initialized by the value of the variable CMAKE_MA‐
5221 COSX_RPATH if it is set when a target is created.
5222
5223 Runtime paths will also be embedded in binaries using this target and
5224 can be controlled by the INSTALL_RPATH target property on the target
5225 linking to this target.
5226
5227 Policy CMP0042 was introduced to change the default value of MA‐
5228 COSX_RPATH to TRUE. This is because use of @rpath is a more flexible
5229 and powerful alternative to @executable_path and @loader_path.
5230
5231 MANUALLY_ADDED_DEPENDENCIES
5232 New in version 3.8.
5233
5234
5235 Get manually added dependencies to other top-level targets.
5236
5237 This read-only property can be used to query all dependencies that were
5238 added for this target with the add_dependencies() command.
5239
5240 MAP_IMPORTED_CONFIG_<CONFIG>
5241 Map from project configuration to imported target's configuration.
5242
5243 Set this to the list of configurations of an imported target that may
5244 be used for the current project's <CONFIG> configuration. Targets im‐
5245 ported from another project may not provide the same set of configura‐
5246 tion names available in the current project. Setting this property
5247 tells CMake what imported configurations are suitable for use when
5248 building the <CONFIG> configuration. The first configuration in the
5249 list found to be provided by the imported target (i.e. via IMPORTED_LO‐
5250 CATION_<CONFIG> for the mapped-to <CONFIG>) is selected. As a special
5251 case, an empty list element refers to the configuration-less imported
5252 target location (i.e. IMPORTED_LOCATION).
5253
5254 If this property is set and no matching configurations are available,
5255 then the imported target is considered to be not found. This property
5256 is ignored for non-imported targets.
5257
5258 This property is initialized by the value of the CMAKE_MAP_IM‐
5259 PORTED_CONFIG_<CONFIG> variable if it is set when a target is created.
5260
5261 Example
5262 For example creating imported C++ library foo:
5263
5264 add_library(foo STATIC IMPORTED)
5265
5266 Use foo_debug path for Debug build type:
5267
5268 set_property(
5269 TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
5270 )
5271
5272 set_target_properties(foo PROPERTIES
5273 IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
5274 IMPORTED_LOCATION_DEBUG "${foo_debug}"
5275 )
5276
5277 Use foo_release path for Release build type:
5278
5279 set_property(
5280 TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE
5281 )
5282
5283 set_target_properties(foo PROPERTIES
5284 IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
5285 IMPORTED_LOCATION_RELEASE "${foo_release}"
5286 )
5287
5288 Use Release version of library for MinSizeRel and RelWithDebInfo build
5289 types:
5290
5291 set_target_properties(foo PROPERTIES
5292 MAP_IMPORTED_CONFIG_MINSIZEREL Release
5293 MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release
5294 )
5295
5296 MSVC_RUNTIME_LIBRARY
5297 New in version 3.15.
5298
5299
5300 Select the MSVC runtime library for use by compilers targeting the MSVC
5301 ABI.
5302
5303 The allowed values are:
5304
5305 MultiThreaded
5306 Compile with -MT or equivalent flag(s) to use a multi-threaded
5307 statically-linked runtime library.
5308
5309 MultiThreadedDLL
5310 Compile with -MD or equivalent flag(s) to use a multi-threaded
5311 dynamically-linked runtime library.
5312
5313 MultiThreadedDebug
5314 Compile with -MTd or equivalent flag(s) to use a multi-threaded
5315 statically-linked runtime library.
5316
5317 MultiThreadedDebugDLL
5318 Compile with -MDd or equivalent flag(s) to use a multi-threaded
5319 dynamically-linked runtime library.
5320
5321 The value is ignored on non-MSVC compilers but an unsupported value
5322 will be rejected as an error when using a compiler targeting the MSVC
5323 ABI.
5324
5325 The value may also be the empty string ("") in which case no runtime
5326 library selection flag will be added explicitly by CMake. Note that
5327 with Visual Studio Generators the native build system may choose to add
5328 its own default runtime library selection flag.
5329
5330 Use generator expressions to support per-configuration specification.
5331 For example, the code:
5332
5333 add_executable(foo foo.c)
5334 set_property(TARGET foo PROPERTY
5335 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
5336
5337 selects for the target foo a multi-threaded statically-linked runtime
5338 library with or without debug information depending on the configura‐
5339 tion.
5340
5341 If this property is not set then CMake uses the default value Multi‐
5342 Threaded$<$<CONFIG:Debug>:Debug>DLL to select a MSVC runtime library.
5343
5344 NOTE:
5345 This property has effect only when policy CMP0091 is set to NEW
5346 prior to the first project() or enable_language() command that en‐
5347 ables a language using a compiler targeting the MSVC ABI.
5348
5349 NAME
5350 Logical name for the target.
5351
5352 Read-only logical name for the target as used by CMake.
5353
5354 NO_SONAME
5355 Whether to set soname when linking a shared library.
5356
5357 Enable this boolean property if a generated SHARED library should not
5358 have soname set. Default is to set soname on all shared libraries as
5359 long as the platform supports it. Generally, use this property only
5360 for leaf private libraries or plugins. If you use it on normal shared
5361 libraries which other targets link against, on some platforms a linker
5362 will insert a full path to the library (as specified at link time) into
5363 the dynamic section of the dependent binary. Therefore, once in‐
5364 stalled, dynamic loader may eventually fail to locate the library for
5365 the binary.
5366
5367 NO_SYSTEM_FROM_IMPORTED
5368 Do not treat include directories from the interfaces of consumed im‐
5369 ported targets as SYSTEM.
5370
5371 The contents of the INTERFACE_INCLUDE_DIRECTORIES target property of
5372 imported targets are treated as SYSTEM includes by default. If this
5373 property is enabled on a target, compilation of sources in that target
5374 will not treat the contents of the INTERFACE_INCLUDE_DIRECTORIES of
5375 consumed imported targets as system includes.
5376
5377 This property is initialized by the value of the CMAKE_NO_SYS‐
5378 TEM_FROM_IMPORTED variable if it is set when a target is created.
5379
5380 OBJC_EXTENSIONS
5381 New in version 3.16.
5382
5383
5384 Boolean specifying whether compiler specific extensions are requested.
5385
5386 This property specifies whether compiler specific extensions should be
5387 used. For some compilers, this results in adding a flag such as
5388 -std=gnu11 instead of -std=c11 to the compile line. This property is
5389 ON by default. The basic OBJC standard level is controlled by the
5390 OBJC_STANDARD target property.
5391
5392 If the property is not set, and the project has set the C_EXTENSIONS,
5393 the value of C_EXTENSIONS is set for OBJC_EXTENSIONS.
5394
5395 See the cmake-compile-features(7) manual for information on compile
5396 features and a list of supported compilers.
5397
5398 This property is initialized by the value of the CMAKE_OBJC_EXTENSIONS
5399 variable if set when a target is created and otherwise by the value of
5400 CMAKE_OBJC_EXTENSIONS_DEFAULT (see CMP0128).
5401
5402 OBJC_STANDARD
5403 New in version 3.16.
5404
5405
5406 The OBJC standard whose features are requested to build this target.
5407
5408 This property specifies the OBJC standard whose features are requested
5409 to build this target. For some compilers, this results in adding a
5410 flag such as -std=gnu11 to the compile line.
5411
5412 Supported values are:
5413
5414 90 Objective C89/C90
5415
5416 99 Objective C99
5417
5418 11 Objective C11
5419
5420 If the value requested does not result in a compile flag being added
5421 for the compiler in use, a previous standard flag will be added in‐
5422 stead. This means that using:
5423
5424 set_property(TARGET tgt PROPERTY OBJC_STANDARD 11)
5425
5426 with a compiler which does not support -std=gnu11 or an equivalent flag
5427 will not result in an error or warning, but will instead add the
5428 -std=gnu99 or -std=gnu90 flag if supported. This "decay" behavior may
5429 be controlled with the OBJC_STANDARD_REQUIRED target property. Addi‐
5430 tionally, the OBJC_EXTENSIONS target property may be used to control
5431 whether compiler-specific extensions are enabled on a per-target basis.
5432
5433 If the property is not set, and the project has set the C_STANDARD, the
5434 value of C_STANDARD is set for OBJC_STANDARD.
5435
5436 See the cmake-compile-features(7) manual for information on compile
5437 features and a list of supported compilers.
5438
5439 This property is initialized by the value of the CMAKE_OBJC_STANDARD
5440 variable if it is set when a target is created.
5441
5442 OBJC_STANDARD_REQUIRED
5443 New in version 3.16.
5444
5445
5446 Boolean describing whether the value of OBJC_STANDARD is a requirement.
5447
5448 If this property is set to ON, then the value of the OBJC_STANDARD tar‐
5449 get property is treated as a requirement. If this property is OFF or
5450 unset, the OBJC_STANDARD target property is treated as optional and may
5451 "decay" to a previous standard if the requested is not available.
5452
5453 If the property is not set, and the project has set the C_STANDARD_RE‐
5454 QUIRED, the value of C_STANDARD_REQUIRED is set for
5455 OBJC_STANDARD_REQUIRED.
5456
5457 See the cmake-compile-features(7) manual for information on compile
5458 features and a list of supported compilers.
5459
5460 This property is initialized by the value of the CMAKE_OBJC_STAN‐
5461 DARD_REQUIRED variable if it is set when a target is created.
5462
5463 OBJCXX_EXTENSIONS
5464 New in version 3.16.
5465
5466
5467 Boolean specifying whether compiler specific extensions are requested.
5468
5469 This property specifies whether compiler specific extensions should be
5470 used. For some compilers, this results in adding a flag such as
5471 -std=gnu++11 instead of -std=c++11 to the compile line. This property
5472 is ON by default. The basic ObjC++ standard level is controlled by the
5473 OBJCXX_STANDARD target property.
5474
5475 See the cmake-compile-features(7) manual for information on compile
5476 features and a list of supported compilers.
5477
5478 If the property is not set, and the project has set the CXX_EXTENSIONS,
5479 the value of CXX_EXTENSIONS is set for OBJCXX_EXTENSIONS.
5480
5481 This property is initialized by the value of the CMAKE_OBJCXX_EXTEN‐
5482 SIONS variable if set when a target is created and otherwise by the
5483 value of CMAKE_OBJCXX_EXTENSIONS_DEFAULT (see CMP0128).
5484
5485 OBJCXX_STANDARD
5486 New in version 3.16.
5487
5488
5489 The ObjC++ standard whose features are requested to build this target.
5490
5491 This property specifies the ObjC++ standard whose features are re‐
5492 quested to build this target. For some compilers, this results in
5493 adding a flag such as -std=gnu++11 to the compile line.
5494
5495 Supported values are:
5496
5497 98 Objective C++98
5498
5499 11 Objective C++11
5500
5501 14 Objective C++14
5502
5503 17 Objective C++17
5504
5505 20 Objective C++20
5506
5507 23 New in version 3.20.
5508
5509
5510 Objective C++23
5511
5512 If the value requested does not result in a compile flag being added
5513 for the compiler in use, a previous standard flag will be added in‐
5514 stead. This means that using:
5515
5516 set_property(TARGET tgt PROPERTY OBJCXX_STANDARD 11)
5517
5518 with a compiler which does not support -std=gnu++11 or an equivalent
5519 flag will not result in an error or warning, but will instead add the
5520 -std=gnu++98 flag if supported. This "decay" behavior may be con‐
5521 trolled with the OBJCXX_STANDARD_REQUIRED target property. Addition‐
5522 ally, the OBJCXX_EXTENSIONS target property may be used to control
5523 whether compiler-specific extensions are enabled on a per-target basis.
5524
5525 If the property is not set, and the project has set the CXX_STANDARD,
5526 the value of CXX_STANDARD is set for OBJCXX_STANDARD.
5527
5528 See the cmake-compile-features(7) manual for information on compile
5529 features and a list of supported compilers.
5530
5531 This property is initialized by the value of the CMAKE_OBJCXX_STANDARD
5532 variable if it is set when a target is created.
5533
5534 OBJCXX_STANDARD_REQUIRED
5535 New in version 3.16.
5536
5537
5538 Boolean describing whether the value of OBJCXX_STANDARD is a require‐
5539 ment.
5540
5541 If this property is set to ON, then the value of the OBJCXX_STANDARD
5542 target property is treated as a requirement. If this property is OFF
5543 or unset, the OBJCXX_STANDARD target property is treated as optional
5544 and may "decay" to a previous standard if the requested is not avail‐
5545 able.
5546
5547 If the property is not set, and the project has set the CXX_STAN‐
5548 DARD_REQUIRED, the value of CXX_STANDARD_REQUIRED is set for
5549 OBJCXX_STANDARD_REQUIRED.
5550
5551 See the cmake-compile-features(7) manual for information on compile
5552 features and a list of supported compilers.
5553
5554 This property is initialized by the value of the CMAKE_OBJCXX_STAN‐
5555 DARD_REQUIRED variable if it is set when a target is created.
5556
5557 OPTIMIZE_DEPENDENCIES
5558 New in version 3.19.
5559
5560
5561 Activates dependency optimization of static and object libraries.
5562
5563 When this property is set to true, some dependencies for a static or
5564 object library may be removed at generation time if they are not neces‐
5565 sary to build the library, since static and object libraries don't ac‐
5566 tually link against anything.
5567
5568 If a static or object library has dependency optimization enabled, it
5569 first discards all dependencies. Then, it looks through all of the di‐
5570 rect and indirect dependencies that it initially had, and adds them
5571 back if they meet any of the following criteria:
5572
5573 • The dependency was added to the library by add_dependencies().
5574
5575 • The dependency was added to the library through a source file in the
5576 library generated by a custom command that uses the dependency.
5577
5578 • The dependency has any PRE_BUILD, PRE_LINK, or POST_BUILD custom com‐
5579 mands associated with it.
5580
5581 • The dependency contains any source files that were generated by a
5582 custom command.
5583
5584 • The dependency contains any languages which produce side effects that
5585 are relevant to the library. Currently, all languages except C, C++,
5586 Objective-C, Objective-C++, assembly, and CUDA are assumed to produce
5587 side effects. However, side effects from one language are assumed
5588 not to be relevant to another (for example, a Fortran library is as‐
5589 sumed to not have any side effects that are relevant for a Swift li‐
5590 brary.)
5591
5592 As an example, assume you have a static Fortran library which depends
5593 on a static C library, which in turn depends on a static Fortran li‐
5594 brary. The top-level Fortran library has optimization enabled, but the
5595 middle C library does not. If you build the top Fortran library, the
5596 bottom Fortran library will also build, but not the middle C library,
5597 since the C library does not have any side effects that are relevant
5598 for the Fortran library. However, if you build the middle C library,
5599 the bottom Fortran library will also build, even though it does not
5600 have any side effects that are relevant to the C library, since the C
5601 library does not have optimization enabled.
5602
5603 This property is initialized by the value of the CMAKE_OPTIMIZE_DEPEN‐
5604 DENCIES variable when the target is created.
5605
5606 OSX_ARCHITECTURES
5607 Target specific architectures for macOS.
5608
5609 The OSX_ARCHITECTURES property sets the target binary architecture for
5610 targets on macOS (-arch). This property is initialized by the value of
5611 the variable CMAKE_OSX_ARCHITECTURES if it is set when a target is cre‐
5612 ated. Use OSX_ARCHITECTURES_<CONFIG> to set the binary architectures
5613 on a per-configuration basis, where <CONFIG> is an upper-case name
5614 (e.g. OSX_ARCHITECTURES_DEBUG).
5615
5616 OSX_ARCHITECTURES_<CONFIG>
5617 Per-configuration macOS and iOS binary architectures for a target.
5618
5619 This property is the configuration-specific version of OSX_ARCHITEC‐
5620 TURES.
5621
5622 OUTPUT_NAME
5623 Output name for target files.
5624
5625 This sets the base name for output files created for an executable or
5626 library target. If not set, the logical target name is used by default
5627 during generation. The value is not set by default during configura‐
5628 tion.
5629
5630 Contents of OUTPUT_NAME and the variants listed below may use generator
5631 expressions.
5632
5633 See also the variants:
5634
5635 • OUTPUT_NAME_<CONFIG>
5636
5637 • ARCHIVE_OUTPUT_NAME_<CONFIG>
5638
5639 • ARCHIVE_OUTPUT_NAME
5640
5641 • LIBRARY_OUTPUT_NAME_<CONFIG>
5642
5643 • LIBRARY_OUTPUT_NAME
5644
5645 • RUNTIME_OUTPUT_NAME_<CONFIG>
5646
5647 • RUNTIME_OUTPUT_NAME
5648
5649 OUTPUT_NAME_<CONFIG>
5650 Per-configuration target file base name.
5651
5652 This is the configuration-specific version of the OUTPUT_NAME target
5653 property.
5654
5655 PCH_WARN_INVALID
5656 New in version 3.18.
5657
5658
5659 When this property is set to true, the precompile header compiler op‐
5660 tions will contain a compiler flag which should warn about invalid pre‐
5661 compiled headers e.g. -Winvalid-pch for GNU compiler.
5662
5663 This property is initialized by the value of the CMAKE_PCH_WARN_INVALID
5664 variable if it is set when a target is created. If that variable is
5665 not set, the property defaults to ON.
5666
5667 PCH_INSTANTIATE_TEMPLATES
5668 New in version 3.19.
5669
5670
5671 When this property is set to true, the precompiled header compiler op‐
5672 tions will contain a flag to instantiate templates during the genera‐
5673 tion of the PCH if supported. This can significantly improve compile
5674 times. Supported in Clang since version 11.
5675
5676 This property is initialized by the value of the CMAKE_PCH_INSTANTI‐
5677 ATE_TEMPLATES variable if it is set when a target is created. If that
5678 variable is not set, the property defaults to ON.
5679
5680 PDB_NAME
5681 Output name for the MS debug symbol .pdb file generated by the linker
5682 for an executable or shared library target.
5683
5684 This property specifies the base name for the debug symbols file. If
5685 not set, the OUTPUT_NAME target property value or logical target name
5686 is used by default.
5687
5688 NOTE:
5689 This property does not apply to STATIC library targets because no
5690 linker is invoked to produce them so they have no linker-generated
5691 .pdb file containing debug symbols.
5692
5693 The linker-generated program database files are specified by the
5694 /pdb linker flag and are not the same as compiler-generated program
5695 database files specified by the /Fd compiler flag. Use the COM‐
5696 PILE_PDB_NAME property to specify the latter.
5697
5698 PDB_NAME_<CONFIG>
5699 Per-configuration output name for the MS debug symbol .pdb file gener‐
5700 ated by the linker for an executable or shared library target.
5701
5702 This is the configuration-specific version of PDB_NAME.
5703
5704 NOTE:
5705 This property does not apply to STATIC library targets because no
5706 linker is invoked to produce them so they have no linker-generated
5707 .pdb file containing debug symbols.
5708
5709 The linker-generated program database files are specified by the
5710 /pdb linker flag and are not the same as compiler-generated program
5711 database files specified by the /Fd compiler flag. Use the COM‐
5712 PILE_PDB_NAME_<CONFIG> property to specify the latter.
5713
5714 PDB_OUTPUT_DIRECTORY
5715 Output directory for the MS debug symbols .pdb file generated by the
5716 linker for an executable or shared library target.
5717
5718 This property specifies the directory into which the MS debug symbols
5719 will be placed by the linker. The property value may use generator ex‐
5720 pressions. Multi-configuration generators append a per-configuration
5721 subdirectory to the specified directory unless a generator expression
5722 is used.
5723
5724 This property is initialized by the value of the CMAKE_PDB_OUTPUT_DI‐
5725 RECTORY variable if it is set when a target is created.
5726
5727 NOTE:
5728 This property does not apply to STATIC library targets because no
5729 linker is invoked to produce them so they have no linker-generated
5730 .pdb file containing debug symbols.
5731
5732 The linker-generated program database files are specified by the
5733 /pdb linker flag and are not the same as compiler-generated program
5734 database files specified by the /Fd compiler flag. Use the COM‐
5735 PILE_PDB_OUTPUT_DIRECTORY property to specify the latter.
5736
5737 PDB_OUTPUT_DIRECTORY_<CONFIG>
5738 Per-configuration output directory for the MS debug symbol .pdb file
5739 generated by the linker for an executable or shared library target.
5740
5741 This is a per-configuration version of PDB_OUTPUT_DIRECTORY, but
5742 multi-configuration generators (Visual Studio Generators, Xcode) do NOT
5743 append a per-configuration subdirectory to the specified directory.
5744 This property is initialized by the value of the CMAKE_PDB_OUTPUT_DI‐
5745 RECTORY_<CONFIG> variable if it is set when a target is created.
5746
5747 Contents of PDB_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
5748 sions.
5749
5750 NOTE:
5751 This property does not apply to STATIC library targets because no
5752 linker is invoked to produce them so they have no linker-generated
5753 .pdb file containing debug symbols.
5754
5755 The linker-generated program database files are specified by the
5756 /pdb linker flag and are not the same as compiler-generated program
5757 database files specified by the /Fd compiler flag. Use the COM‐
5758 PILE_PDB_OUTPUT_DIRECTORY_<CONFIG> property to specify the latter.
5759
5760 POSITION_INDEPENDENT_CODE
5761 Whether to create a position-independent target
5762
5763 The POSITION_INDEPENDENT_CODE property determines whether position in‐
5764 dependent executables or shared libraries will be created. This prop‐
5765 erty is True by default for SHARED and MODULE library targets and False
5766 otherwise. This property is initialized by the value of the CMAKE_PO‐
5767 SITION_INDEPENDENT_CODE variable if it is set when a target is cre‐
5768 ated.
5769
5770 NOTE:
5771 For executable targets, the link step is controlled by the CMP0083
5772 policy and the CheckPIESupported module.
5773
5774 PRECOMPILE_HEADERS
5775 New in version 3.16.
5776
5777
5778 List of header files to precompile.
5779
5780 This property holds a semicolon-separated list of header files to pre‐
5781 compile specified so far for its target. Use the target_precom‐
5782 pile_headers() command to append more header files.
5783
5784 This property supports generator expressions.
5785
5786 PRECOMPILE_HEADERS_REUSE_FROM
5787 New in version 3.16.
5788
5789
5790 Target from which to reuse the precompiled headers build artifact.
5791
5792 See the second signature of target_precompile_headers() command for
5793 more detailed information.
5794
5795 PREFIX
5796 What comes before the library name.
5797
5798 A target property that can be set to override the prefix (such as lib)
5799 on a library name.
5800
5801 PRIVATE_HEADER
5802 Specify private header files in a FRAMEWORK shared library target.
5803
5804 Shared library targets marked with the FRAMEWORK property generate
5805 frameworks on macOS, iOS and normal shared libraries on other plat‐
5806 forms. This property may be set to a list of header files to be placed
5807 in the PrivateHeaders directory inside the framework folder. On
5808 non-Apple platforms these headers may be installed using the PRI‐
5809 VATE_HEADER option to the install(TARGETS) command.
5810
5811 PROJECT_LABEL
5812 Change the name of a target in an IDE.
5813
5814 Can be used to change the name of the target in an IDE like Visual Stu‐
5815 dio.
5816
5817 PUBLIC_HEADER
5818 Specify public header files in a FRAMEWORK shared library target.
5819
5820 Shared library targets marked with the FRAMEWORK property generate
5821 frameworks on macOS, iOS and normal shared libraries on other plat‐
5822 forms. This property may be set to a list of header files to be placed
5823 in the Headers directory inside the framework folder. On non-Apple
5824 platforms these headers may be installed using the PUBLIC_HEADER option
5825 to the install(TARGETS) command.
5826
5827 RESOURCE
5828 Specify resource files in a FRAMEWORK or BUNDLE.
5829
5830 Target marked with the FRAMEWORK or BUNDLE property generate framework
5831 or application bundle (both macOS and iOS is supported) or normal
5832 shared libraries on other platforms. This property may be set to a
5833 list of files to be placed in the corresponding directory (eg. Re‐
5834 sources directory for macOS) inside the bundle. On non-Apple platforms
5835 these files may be installed using the RESOURCE option to the in‐
5836 stall(TARGETS) command.
5837
5838 Following example of Application Bundle:
5839
5840 add_executable(ExecutableTarget
5841 addDemo.c
5842 resourcefile.txt
5843 appresourcedir/appres.txt)
5844
5845 target_link_libraries(ExecutableTarget heymath mul)
5846
5847 set(RESOURCE_FILES
5848 resourcefile.txt
5849 appresourcedir/appres.txt)
5850
5851 set_target_properties(ExecutableTarget PROPERTIES
5852 MACOSX_BUNDLE TRUE
5853 MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
5854 RESOURCE "${RESOURCE_FILES}")
5855
5856 will produce flat structure for iOS systems:
5857
5858 ExecutableTarget.app
5859 appres.txt
5860 ExecutableTarget
5861 Info.plist
5862 resourcefile.txt
5863
5864 For macOS systems it will produce following directory structure:
5865
5866 ExecutableTarget.app/
5867 Contents
5868 Info.plist
5869 MacOS
5870 ExecutableTarget
5871 Resources
5872 appres.txt
5873 resourcefile.txt
5874
5875 For Linux, such CMake script produce following files:
5876
5877 ExecutableTarget
5878 Resources
5879 appres.txt
5880 resourcefile.txt
5881
5882 RULE_LAUNCH_COMPILE
5883 Specify a launcher for compile rules.
5884
5885 See the global property of the same name for details. This overrides
5886 the global and directory property for a target.
5887
5888 RULE_LAUNCH_CUSTOM
5889 Specify a launcher for custom rules.
5890
5891 See the global property of the same name for details. This overrides
5892 the global and directory property for a target.
5893
5894 RULE_LAUNCH_LINK
5895 Specify a launcher for link rules.
5896
5897 See the global property of the same name for details. This overrides
5898 the global and directory property for a target.
5899
5900 RUNTIME_OUTPUT_DIRECTORY
5901 Output directory in which to build RUNTIME target files.
5902
5903 This property specifies the directory into which runtime target files
5904 should be built. The property value may use generator expressions.
5905 Multi-configuration generators (Visual Studio, Xcode, Ninja Multi-Con‐
5906 fig) append a per-configuration subdirectory to the specified directory
5907 unless a generator expression is used.
5908
5909 This property is initialized by the value of the CMAKE_RUNTIME_OUT‐
5910 PUT_DIRECTORY variable if it is set when a target is created.
5911
5912 See also the RUNTIME_OUTPUT_DIRECTORY_<CONFIG> target property.
5913
5914 RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
5915 Per-configuration output directory for RUNTIME target files.
5916
5917 This is a per-configuration version of the RUNTIME_OUTPUT_DIRECTORY
5918 target property, but multi-configuration generators (Visual Studio Gen‐
5919 erators, Xcode) do NOT append a per-configuration subdirectory to the
5920 specified directory. This property is initialized by the value of the
5921 CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> variable if it is set when a
5922 target is created.
5923
5924 Contents of RUNTIME_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
5925 sions.
5926
5927 RUNTIME_OUTPUT_NAME
5928 Output name for RUNTIME target files.
5929
5930 This property specifies the base name for runtime target files. It
5931 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
5932
5933 See also the RUNTIME_OUTPUT_NAME_<CONFIG> target property.
5934
5935 RUNTIME_OUTPUT_NAME_<CONFIG>
5936 Per-configuration output name for RUNTIME target files.
5937
5938 This is the configuration-specific version of the RUNTIME_OUTPUT_NAME
5939 target property.
5940
5941 SKIP_BUILD_RPATH
5942 Should rpaths be used for the build tree.
5943
5944 SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic gen‐
5945 eration of an rpath allowing the target to run from the build tree.
5946 This property is initialized by the value of the variable
5947 CMAKE_SKIP_BUILD_RPATH if it is set when a target is created.
5948
5949 SOURCE_DIR
5950 New in version 3.4.
5951
5952
5953 This read-only property reports the value of the CMAKE_CUR‐
5954 RENT_SOURCE_DIR variable in the directory in which the target was de‐
5955 fined.
5956
5957 SOURCES
5958 Source names specified for a target.
5959
5960 List of sources specified for a target.
5961
5962 SOVERSION
5963 What version number is this target.
5964
5965 For shared libraries VERSION and SOVERSION can be used to specify the
5966 build version and API version respectively. When building or in‐
5967 stalling appropriate symlinks are created if the platform supports sym‐
5968 links and the linker supports so-names. If only one of both is speci‐
5969 fied the missing is assumed to have the same version number. SOVERSION
5970 is ignored if NO_SONAME property is set.
5971
5972 Windows Versions
5973 For shared libraries and executables on Windows the VERSION attribute
5974 is parsed to extract a <major>.<minor> version number. These numbers
5975 are used as the image version of the binary.
5976
5977 Mach-O Versions
5978 For shared libraries and executables on Mach-O systems (e.g. macOS,
5979 iOS), the SOVERSION property corresponds to the compatibility version
5980 and VERSION corresponds to the current version (unless Mach-O specific
5981 overrides are provided, as discussed below). See the FRAMEWORK target
5982 property for an example.
5983
5984 For shared libraries, the MACHO_COMPATIBILITY_VERSION and MACHO_CUR‐
5985 RENT_VERSION properties can be used to override the compatibility ver‐
5986 sion and current version respectively. Note that SOVERSION will still
5987 be used to form the install_name and both SOVERSION and VERSION may
5988 also affect the file and symlink names.
5989
5990 Versions of Mach-O binaries may be checked with the otool -L <binary>
5991 command.
5992
5993 STATIC_LIBRARY_FLAGS
5994 Archiver (or MSVC librarian) flags for a static library target. Tar‐
5995 gets that are shared libraries, modules, or executables need to use the
5996 LINK_OPTIONS or LINK_FLAGS target properties.
5997
5998 The STATIC_LIBRARY_FLAGS property, managed as a string, can be used to
5999 add extra flags to the link step of a static library target.
6000 STATIC_LIBRARY_FLAGS_<CONFIG> will add to the configuration <CONFIG>,
6001 for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO, ...
6002
6003 NOTE:
6004 This property has been superseded by STATIC_LIBRARY_OPTIONS prop‐
6005 erty.
6006
6007 STATIC_LIBRARY_FLAGS_<CONFIG>
6008 Per-configuration archiver (or MSVC librarian) flags for a static li‐
6009 brary target.
6010
6011 This is the configuration-specific version of STATIC_LIBRARY_FLAGS.
6012
6013 NOTE:
6014 This property has been superseded by STATIC_LIBRARY_OPTIONS prop‐
6015 erty.
6016
6017 STATIC_LIBRARY_OPTIONS
6018 New in version 3.13.
6019
6020
6021 Archiver (or MSVC librarian) flags for a static library target. Tar‐
6022 gets that are shared libraries, modules, or executables need to use the
6023 LINK_OPTIONS target property.
6024
6025 This property holds a semicolon-separated list of options specified so
6026 far for its target. Use set_target_properties() or set_property() com‐
6027 mands to set its content.
6028
6029 Contents of STATIC_LIBRARY_OPTIONS may use "generator expressions" with
6030 the syntax $<...>. See the cmake-generator-expressions(7) manual for
6031 available expressions. See the cmake-buildsystem(7) manual for more on
6032 defining buildsystem properties.
6033
6034 NOTE:
6035 This property must be used in preference to STATIC_LIBRARY_FLAGS
6036 property.
6037
6038 Option De-duplication
6039 The final set of options used for a target is constructed by accumulat‐
6040 ing options from the current target and the usage requirements of its
6041 dependencies. The set of options is de-duplicated to avoid repetition.
6042
6043 New in version 3.12: While beneficial for individual options, the
6044 de-duplication step can break up option groups. For example, -option A
6045 -option B becomes -option A B. One may specify a group of options us‐
6046 ing shell-like quoting along with a SHELL: prefix. The SHELL: prefix
6047 is dropped, and the rest of the option string is parsed using the sepa‐
6048 rate_arguments() UNIX_COMMAND mode. For example, "SHELL:-option A"
6049 "SHELL:-option B" becomes -option A -option B.
6050
6051
6052 SUFFIX
6053 What comes after the target name.
6054
6055 A target property that can be set to override the suffix (such as .so
6056 or .exe) on the name of a library, module or executable.
6057
6058 Swift_DEPENDENCIES_FILE
6059 New in version 3.15.
6060
6061
6062 This property sets the path for the Swift dependency file (swiftdep)
6063 for the target. If one is not specified, it will default to <TAR‐
6064 GET>.swiftdeps.
6065
6066 Swift_LANGUAGE_VERSION
6067 New in version 3.16.
6068
6069
6070 This property sets the language version for the Swift sources in the
6071 target. If one is not specified, it will default to <CMAKE_Swift_LAN‐
6072 GUAGE_VERSION> if specified, otherwise it is the latest version sup‐
6073 ported by the compiler.
6074
6075 Swift_MODULE_DIRECTORY
6076 New in version 3.15.
6077
6078
6079 Specify output directory for Swift modules provided by the target.
6080
6081 If the target contains Swift source files, this specifies the directory
6082 in which the modules will be placed. When this property is not set,
6083 the modules will be placed in the build directory corresponding to the
6084 target's source directory. If the variable CMAKE_Swift_MODULE_DIREC‐
6085 TORY is set when a target is created its value is used to initialize
6086 this property.
6087
6088 Swift_MODULE_NAME
6089 New in version 3.15.
6090
6091
6092 This property specifies the name of the Swift module. It is defaulted
6093 to the name of the target.
6094
6095 TYPE
6096 The type of the target.
6097
6098 This read-only property can be used to test the type of the given tar‐
6099 get. It will be one of STATIC_LIBRARY, MODULE_LIBRARY, SHARED_LIBRARY,
6100 OBJECT_LIBRARY, INTERFACE_LIBRARY, EXECUTABLE or one of the internal
6101 target types.
6102
6103 UNITY_BUILD
6104 New in version 3.16.
6105
6106
6107 When this property is set to true, the target source files will be com‐
6108 bined into batches for faster compilation. This is done by creating a
6109 (set of) unity sources which #include the original sources, then com‐
6110 piling these unity sources instead of the originals. This is known as
6111 a Unity or Jumbo build.
6112
6113 CMake provides different algorithms for selecting which sources are
6114 grouped together into a bucket. Algorithm selection is decided by the
6115 UNITY_BUILD_MODE target property, which has the following acceptable
6116 values:
6117
6118 • BATCH When in this mode CMake determines which files are grouped to‐
6119 gether. The UNITY_BUILD_BATCH_SIZE property controls the upper limit
6120 on how many sources can be combined per unity source file.
6121
6122 • GROUP When in this mode each target explicitly specifies how to group
6123 source files. Each source file that has the same UNITY_GROUP value
6124 will be grouped together. Any sources that don't have this property
6125 will be compiled individually. The UNITY_BUILD_BATCH_SIZE property is
6126 ignored when using this mode.
6127
6128 If no explicit UNITY_BUILD_MODE has been specified, CMake will default
6129 to BATCH.
6130
6131 Unity builds are not currently supported for all languages. CMake ver‐
6132 sion 3.22.0 supports combining C and CXX source files. For targets
6133 that mix source files from more than one language, CMake will separate
6134 the languages such that each generated unity source file only contains
6135 sources for a single language.
6136
6137 This property is initialized by the value of the CMAKE_UNITY_BUILD
6138 variable when a target is created.
6139
6140 NOTE:
6141 Projects should not directly set the UNITY_BUILD property or its as‐
6142 sociated CMAKE_UNITY_BUILD variable to true. Depending on the capa‐
6143 bilities of the build machine and compiler used, it might or might
6144 not be appropriate to enable unity builds. Therefore, this feature
6145 should be under developer control, which would normally be through
6146 the developer choosing whether or not to set the CMAKE_UNITY_BUILD
6147 variable on the cmake(1) command line or some other equivalent
6148 method. However, it IS recommended to set the UNITY_BUILD target
6149 property to false if it is known that enabling unity builds for the
6150 target can lead to problems.
6151
6152 ODR (One definition rule) errors
6153 When multiple source files are included into one source file, as is
6154 done for unity builds, it can potentially lead to ODR errors. CMake
6155 provides a number of measures to help address such problems:
6156
6157 • Any source file that has a non-empty COMPILE_OPTIONS, COMPILE_DEFINI‐
6158 TIONS, COMPILE_FLAGS, or INCLUDE_DIRECTORIES source property will not
6159 be combined into a unity source.
6160
6161 • Projects can prevent an individual source file from being combined
6162 into a unity source by setting its SKIP_UNITY_BUILD_INCLUSION source
6163 property to true. This can be a more effective way to prevent prob‐
6164 lems with specific files than disabling unity builds for an entire
6165 target.
6166
6167 • Projects can set UNITY_BUILD_UNIQUE_ID to cause a valid C-identifier
6168 to be generated which is unique per file in a unity build. This can
6169 be used to avoid problems with anonymous namespaces in unity builds.
6170
6171 • The UNITY_BUILD_CODE_BEFORE_INCLUDE and UNITY_BUILD_CODE_AFTER_IN‐
6172 CLUDE target properties can be used to inject code into the unity
6173 source files before and after every #include statement.
6174
6175 • The order of source files added to the target via commands like
6176 add_library(), add_executable() or target_sources() will be preserved
6177 in the generated unity source files. This can be used to manually
6178 enforce a specific grouping based on the UNITY_BUILD_BATCH_SIZE tar‐
6179 get property.
6180
6181 UNITY_BUILD_BATCH_SIZE
6182 New in version 3.16.
6183
6184
6185 Specifies the maximum number of source files that can be combined into
6186 any one unity source file when unity builds are enabled by the
6187 UNITY_BUILD target property. The original source files will be dis‐
6188 tributed across as many unity source files as necessary to honor this
6189 limit.
6190
6191 The initial value for this property is taken from the
6192 CMAKE_UNITY_BUILD_BATCH_SIZE variable when the target is created. If
6193 that variable has not been set, the initial value will be 8.
6194
6195 The batch size needs to be selected carefully. If set too high, the
6196 size of the combined source files could result in the compiler using
6197 excessive memory or hitting other similar limits. In extreme cases,
6198 this can even result in build failure. On the other hand, if the batch
6199 size is too low, there will be little gain in build performance.
6200
6201 Although strongly discouraged, the batch size may be set to a value of
6202 0 to combine all the sources for the target into a single unity file,
6203 regardless of how many sources are involved. This runs the risk of
6204 creating an excessively large unity source file and negatively impact‐
6205 ing the build performance, so a value of 0 is not generally recom‐
6206 mended.
6207
6208 UNITY_BUILD_CODE_AFTER_INCLUDE
6209 New in version 3.16.
6210
6211
6212 Code snippet which is included verbatim by the UNITY_BUILD feature just
6213 after every #include statement in the generated unity source files.
6214 For example:
6215
6216 set(after [[
6217 #if defined(NOMINMAX)
6218 #undef NOMINMAX
6219 #endif
6220 ]])
6221 set_target_properties(myTarget PROPERTIES
6222 UNITY_BUILD_CODE_AFTER_INCLUDE "${after}"
6223 )
6224
6225 See also UNITY_BUILD_CODE_BEFORE_INCLUDE.
6226
6227 UNITY_BUILD_CODE_BEFORE_INCLUDE
6228 New in version 3.16.
6229
6230
6231 Code snippet which is included verbatim by the UNITY_BUILD feature just
6232 before every #include statement in the generated unity source files.
6233 For example:
6234
6235 set(before [[
6236 #if !defined(NOMINMAX)
6237 #define NOMINMAX
6238 #endif
6239 ]])
6240 set_target_properties(myTarget PROPERTIES
6241 UNITY_BUILD_CODE_BEFORE_INCLUDE "${before}"
6242 )
6243
6244 See also UNITY_BUILD_CODE_AFTER_INCLUDE.
6245
6246 UNITY_BUILD_MODE
6247 New in version 3.18.
6248
6249
6250 CMake provides different algorithms for selecting which sources are
6251 grouped together into a bucket. Selection is decided by this property,
6252 which has the following acceptable values:
6253
6254 BATCH When in this mode CMake determines which files are grouped to‐
6255 gether. The UNITY_BUILD_BATCH_SIZE property controls the upper
6256 limit on how many sources can be combined per unity source file.
6257
6258 Example usage:
6259
6260 add_library(example_library
6261 source1.cxx
6262 source2.cxx
6263 source3.cxx
6264 source4.cxx)
6265
6266 set_target_properties(example_library PROPERTIES
6267 UNITY_BUILD_MODE BATCH
6268 UNITY_BUILD_BATCH_SIZE 2
6269 )
6270
6271 GROUP When in this mode each target explicitly specifies how to group
6272 source files. Each source file that has the same UNITY_GROUP
6273 value will be grouped together. Any sources that don't have this
6274 property will be compiled individually. The
6275 UNITY_BUILD_BATCH_SIZE property is ignored when using this mode.
6276
6277 Example usage:
6278
6279 add_library(example_library
6280 source1.cxx
6281 source2.cxx
6282 source3.cxx
6283 source4.cxx)
6284
6285 set_target_properties(example_library PROPERTIES
6286 UNITY_BUILD_MODE GROUP
6287 )
6288
6289 set_source_files_properties(source1.cxx source2.cxx source3.cxx
6290 PROPERTIES UNITY_GROUP "bucket1"
6291 )
6292 set_source_files_properties(source4.cxx
6293 PROPERTIES UNITY_GROUP "bucket2"
6294 )
6295
6296 If no explicit UNITY_BUILD_MODE has been specified, CMake will default
6297 to BATCH.
6298
6299 UNITY_BUILD_UNIQUE_ID
6300 New in version 3.20.
6301
6302
6303 The name of a valid C-identifier which is set to a unique per-file
6304 value during unity builds.
6305
6306 When this property is populated and when UNITY_BUILD is true, the prop‐
6307 erty value is used to define a compiler definition of the specified
6308 name. The value of the defined symbol is unspecified, but it is unique
6309 per file path.
6310
6311 Given:
6312
6313 set_target_properties(myTarget PROPERTIES
6314 UNITY_BUILD "ON"
6315 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID"
6316 )
6317
6318 the MY_UNITY_ID symbol is defined to a unique per-file value.
6319
6320 One known use case for this identifier is to disambiguate the variables
6321 in an anonymous namespace in a limited scope. Anonymous namespaces
6322 present a problem for unity builds because they are used to ensure that
6323 certain variables and declarations are scoped to a translation unit
6324 which is approximated by a single source file. When source files are
6325 combined in a unity build file, those variables in different files are
6326 combined in a single translation unit and the names clash. This prop‐
6327 erty can be used to avoid that with code like the following:
6328
6329 // Needed for when unity builds are disabled
6330 #ifndef MY_UNITY_ID
6331 #define MY_UNITY_ID
6332 #endif
6333
6334 namespace { namespace MY_UNITY_ID {
6335 // The name 'i' clashes (or could clash) with other
6336 // variables in other anonymous namespaces
6337 int i = 42;
6338 }}
6339
6340 int use_var()
6341 {
6342 return MY_UNITY_ID::i;
6343 }
6344
6345 The pseudonymous namespace is used within a truly anonymous namespace.
6346 On many platforms, this maintains the invariant that the symbols within
6347 do not get external linkage when performing a unity build.
6348
6349 VERSION
6350 What version number is this target.
6351
6352 For shared libraries VERSION and SOVERSION can be used to specify the
6353 build version and API version respectively. When building or in‐
6354 stalling appropriate symlinks are created if the platform supports sym‐
6355 links and the linker supports so-names. If only one of both is speci‐
6356 fied the missing is assumed to have the same version number. For exe‐
6357 cutables VERSION can be used to specify the build version. When build‐
6358 ing or installing appropriate symlinks are created if the platform sup‐
6359 ports symlinks.
6360
6361 Windows Versions
6362 For shared libraries and executables on Windows the VERSION attribute
6363 is parsed to extract a <major>.<minor> version number. These numbers
6364 are used as the image version of the binary.
6365
6366 Mach-O Versions
6367 For shared libraries and executables on Mach-O systems (e.g. macOS,
6368 iOS), the SOVERSION property corresponds to the compatibility version
6369 and VERSION corresponds to the current version (unless Mach-O specific
6370 overrides are provided, as discussed below). See the FRAMEWORK target
6371 property for an example.
6372
6373 For shared libraries, the MACHO_COMPATIBILITY_VERSION and MACHO_CUR‐
6374 RENT_VERSION properties can be used to override the compatibility ver‐
6375 sion and current version respectively. Note that SOVERSION will still
6376 be used to form the install_name and both SOVERSION and VERSION may
6377 also affect the file and symlink names.
6378
6379 Versions of Mach-O binaries may be checked with the otool -L <binary>
6380 command.
6381
6382 VISIBILITY_INLINES_HIDDEN
6383 Whether to add a compile flag to hide symbols of inline functions
6384
6385 The VISIBILITY_INLINES_HIDDEN property determines whether a flag for
6386 hiding symbols for inline functions, such as -fvisibility-inlines-hid‐
6387 den, should be used when invoking the compiler. This property affects
6388 compilation in sources of all types of targets (subject to policy
6389 CMP0063).
6390
6391 This property is initialized by the value of the CMAKE_VISIBILITY_IN‐
6392 LINES_HIDDEN variable if it is set when a target is created.
6393
6394 VS_CONFIGURATION_TYPE
6395 New in version 3.6.
6396
6397
6398 Visual Studio project configuration type.
6399
6400 Sets the ConfigurationType attribute for a generated Visual Studio
6401 project. The property value may use generator expressions. If this
6402 property is set, it overrides the default setting that is based on the
6403 target type (e.g. StaticLibrary, Application, ...).
6404
6405 Supported on Visual Studio Generators for VS 2010 and higher.
6406
6407 VS_DEBUGGER_COMMAND
6408 New in version 3.12.
6409
6410
6411 Sets the local debugger command for Visual Studio C++ targets. The
6412 property value may use generator expressions. This is defined in <Lo‐
6413 calDebuggerCommand> in the Visual Studio project file.
6414
6415 This property only works for Visual Studio 2010 and above; it is ig‐
6416 nored on other generators.
6417
6418 VS_DEBUGGER_COMMAND_ARGUMENTS
6419 New in version 3.13.
6420
6421
6422 Sets the local debugger command line arguments for Visual Studio C++
6423 targets. The property value may use generator expressions. This is
6424 defined in <LocalDebuggerCommandArguments> in the Visual Studio project
6425 file.
6426
6427 This property only works for Visual Studio 2010 and above; it is ig‐
6428 nored on other generators.
6429
6430 VS_DEBUGGER_ENVIRONMENT
6431 New in version 3.13.
6432
6433
6434 Sets the local debugger environment for Visual Studio C++ targets. The
6435 property value may use generator expressions. This is defined in <Lo‐
6436 calDebuggerEnvironment> in the Visual Studio project file.
6437
6438 This property only works for Visual Studio 2010 and above; it is ig‐
6439 nored on other generators.
6440
6441 VS_DEBUGGER_WORKING_DIRECTORY
6442 New in version 3.8.
6443
6444
6445 Sets the local debugger working directory for Visual Studio C++ tar‐
6446 gets. The property value may use generator expressions. This is de‐
6447 fined in <LocalDebuggerWorkingDirectory> in the Visual Studio project
6448 file.
6449
6450 This property only works for Visual Studio 2010 and above; it is ig‐
6451 nored on other generators.
6452
6453 VS_DESKTOP_EXTENSIONS_VERSION
6454 New in version 3.4.
6455
6456
6457 Visual Studio Windows 10 Desktop Extensions Version
6458
6459 Specifies the version of the Desktop Extensions that should be included
6460 in the target. For example 10.0.10240.0. If the value is not specified,
6461 the Desktop Extensions will not be included. To use the same version of
6462 the extensions as the Windows 10 SDK that is being used, you can use
6463 the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
6464
6465 VS_DOTNET_DOCUMENTATION_FILE
6466 New in version 3.17.
6467
6468
6469 Visual Studio managed project .NET documentation output
6470
6471 Sets the target XML documentation file output.
6472
6473 VS_DOTNET_REFERENCE_<refname>
6474 New in version 3.8.
6475
6476
6477 Visual Studio managed project .NET reference with name <refname> and
6478 hint path.
6479
6480 Adds one .NET reference to generated Visual Studio project. The refer‐
6481 ence will have the name <refname> and will point to the assembly given
6482 as value of the property.
6483
6484 See also VS_DOTNET_REFERENCES and VS_DOTNET_REFERENCES_COPY_LOCAL
6485
6486 VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>
6487 New in version 3.10.
6488
6489
6490 Defines an XML property <tagname> for a .NET reference <refname>.
6491
6492 Reference properties can be set for .NET references which are defined
6493 by the target properties VS_DOTNET_REFERENCES, VS_DOTNET_REFER‐
6494 ENCE_<refname> and also for project references to other C# targets
6495 which are established by target_link_libraries().
6496
6497 This property is only applicable to C# targets and Visual Studio gener‐
6498 ators 2010 and later.
6499
6500 VS_DOTNET_REFERENCES
6501 Visual Studio managed project .NET references
6502
6503 Adds one or more semicolon-delimited .NET references to a generated
6504 Visual Studio project. For example, "System;System.Windows.Forms".
6505
6506 VS_DOTNET_REFERENCES_COPY_LOCAL
6507 New in version 3.8.
6508
6509
6510 Sets the Copy Local property for all .NET hint references in the target
6511
6512 Boolean property to enable/disable copying of .NET hint references to
6513 output directory. The default is ON.
6514
6515 VS_DOTNET_TARGET_FRAMEWORK_VERSION
6516 Specify the .NET target framework version.
6517
6518 Used to specify the .NET target framework version for C++/CLI. For ex‐
6519 ample, "v4.5".
6520
6521 This property is deprecated and should not be used anymore. Use DOT‐
6522 NET_TARGET_FRAMEWORK or DOTNET_TARGET_FRAMEWORK_VERSION instead.
6523
6524 VS_DPI_AWARE
6525 New in version 3.16.
6526
6527
6528 Set the Manifest Tool -> Input and Output -> DPI Awareness in the Vis‐
6529 ual Studio target project properties.
6530
6531 Valid values are PerMonitor, ON, or OFF.
6532
6533 For example:
6534
6535 add_executable(myproject myproject.cpp)
6536 set_property(TARGET myproject PROPERTY VS_DPI_AWARE "PerMonitor")
6537
6538 VS_GLOBAL_KEYWORD
6539 Visual Studio project keyword for VS 10 (2010) and newer.
6540
6541 Sets the "keyword" attribute for a generated Visual Studio project.
6542 Defaults to "Win32Proj". You may wish to override this value with
6543 "ManagedCProj", for example, in a Visual Studio managed C++ unit test
6544 project.
6545
6546 Use the VS_KEYWORD target property to set the keyword for Visual Studio
6547 9 (2008) and older.
6548
6549 VS_GLOBAL_PROJECT_TYPES
6550 Visual Studio project type(s).
6551
6552 Can be set to one or more UUIDs recognized by Visual Studio to indicate
6553 the type of project. This value is copied verbatim into the generated
6554 project file. Example for a managed C++ unit testing project:
6555
6556 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}
6557
6558 UUIDs are semicolon-delimited.
6559
6560 VS_GLOBAL_ROOTNAMESPACE
6561 Visual Studio project root namespace.
6562
6563 Sets the "RootNamespace" attribute for a generated Visual Studio
6564 project. The attribute will be generated only if this is set.
6565
6566 VS_GLOBAL_<variable>
6567 Visual Studio project-specific global variable.
6568
6569 Tell the Visual Studio generator to set the global variable '<vari‐
6570 able>' to a given value in the generated Visual Studio project. Ig‐
6571 nored on other generators. Qt integration works better if
6572 VS_GLOBAL_QtVersion is set to the version FindQt4.cmake found. For ex‐
6573 ample, "4.7.3"
6574
6575 VS_IOT_EXTENSIONS_VERSION
6576 New in version 3.4.
6577
6578
6579 Visual Studio Windows 10 IoT Extensions Version
6580
6581 Specifies the version of the IoT Extensions that should be included in
6582 the target. For example 10.0.10240.0. If the value is not specified,
6583 the IoT Extensions will not be included. To use the same version of the
6584 extensions as the Windows 10 SDK that is being used, you can use the
6585 CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
6586
6587 VS_IOT_STARTUP_TASK
6588 New in version 3.4.
6589
6590
6591 Visual Studio Windows 10 IoT Continuous Background Task
6592
6593 Specifies that the target should be compiled as a Continuous Background
6594 Task library.
6595
6596 VS_JUST_MY_CODE_DEBUGGING
6597 New in version 3.15.
6598
6599
6600 Enable Just My Code with Visual Studio debugger.
6601
6602 Supported on Visual Studio Generators for VS 2010 and higher, Makefile
6603 Generators and the Ninja generators.
6604
6605 This property is initialized by the CMAKE_VS_JUST_MY_CODE_DEBUGGING
6606 variable if it is set when a target is created.
6607
6608 VS_KEYWORD
6609 Visual Studio project keyword for VS 9 (2008) and older.
6610
6611 Can be set to change the visual studio keyword, for example Qt integra‐
6612 tion works better if this is set to Qt4VSv1.0.
6613
6614 Use the VS_GLOBAL_KEYWORD target property to set the keyword for Visual
6615 Studio 10 (2010) and newer.
6616
6617 VS_MOBILE_EXTENSIONS_VERSION
6618 New in version 3.4.
6619
6620
6621 Visual Studio Windows 10 Mobile Extensions Version
6622
6623 Specifies the version of the Mobile Extensions that should be included
6624 in the target. For example 10.0.10240.0. If the value is not specified,
6625 the Mobile Extensions will not be included. To use the same version of
6626 the extensions as the Windows 10 SDK that is being used, you can use
6627 the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
6628
6629 VS_NO_SOLUTION_DEPLOY
6630 New in version 3.15.
6631
6632
6633 Specify that the target should not be marked for deployment to a Win‐
6634 dows CE or Windows Phone device in the generated Visual Studio solu‐
6635 tion.
6636
6637 Be default, all EXE and shared library (DLL) targets are marked to de‐
6638 ploy to the target device in the generated Visual Studio solution.
6639
6640 Generator expressions are supported.
6641
6642 There are reasons one might want to exclude a target / generated
6643 project from deployment:
6644
6645 • The library or executable may not be necessary in the primary de‐
6646 ploy/debug scenario, and excluding from deployment saves time in the
6647 develop/download/debug cycle.
6648
6649 • There may be insufficient space on the target device to accommodate
6650 all of the build products.
6651
6652 • Visual Studio 2013 requires a target device IP address be entered for
6653 each target marked for deployment. For large numbers of targets,
6654 this can be tedious. NOTE: Visual Studio will deploy all project de‐
6655 pendencies of a project tagged for deployment to the IP address con‐
6656 figured for that project even if those dependencies are not tagged
6657 for deployment.
6658
6659 Example 1
6660 This shows setting the variable for the target foo.
6661
6662 add_library(foo SHARED foo.cpp)
6663 set_property(TARGET foo PROPERTY VS_NO_SOLUTION_DEPLOY ON)
6664
6665 Example 2
6666 This shows setting the variable for the Release configuration only.
6667
6668 add_library(foo SHARED foo.cpp)
6669 set_property(TARGET foo PROPERTY VS_NO_SOLUTION_DEPLOY "$<CONFIG:Release>")
6670
6671 VS_PACKAGE_REFERENCES
6672 New in version 3.15.
6673
6674
6675 Visual Studio package references for nuget.
6676
6677 Adds one or more semicolon-delimited package references to a generated
6678 Visual Studio project. The version of the package will be underscore
6679 delimited. For example, boost_1.7.0;nunit_3.12.*.
6680
6681 set_property(TARGET ${TARGET_NAME} PROPERTY
6682 VS_PACKAGE_REFERENCES "boost_1.7.0")
6683
6684 VS_PLATFORM_TOOLSET
6685 New in version 3.18.
6686
6687
6688 Overrides the platform toolset used to build a target.
6689
6690 Only supported when the compiler used by the given toolset is the same
6691 as the compiler used to build the whole source tree.
6692
6693 This is especially useful to create driver projects with the toolsets
6694 "WindowsUserModeDriver10.0" or "WindowsKernelModeDriver10.0".
6695
6696 VS_PROJECT_IMPORT
6697 New in version 3.15.
6698
6699
6700 Visual Studio managed project imports
6701
6702 Adds to a generated Visual Studio project one or more semicolon-delim‐
6703 ited paths to .props files needed when building projects from some
6704 NuGet packages. For example, my_packages_path/MyPack‐
6705 age.1.0.0/build/MyPackage.props.
6706
6707 VS_SCC_AUXPATH
6708 Visual Studio Source Code Control Aux Path.
6709
6710 Can be set to change the visual studio source code control auxpath
6711 property.
6712
6713 VS_SCC_LOCALPATH
6714 Visual Studio Source Code Control Local Path.
6715
6716 Can be set to change the visual studio source code control local path
6717 property.
6718
6719 VS_SCC_PROJECTNAME
6720 Visual Studio Source Code Control Project.
6721
6722 Can be set to change the visual studio source code control project name
6723 property.
6724
6725 VS_SCC_PROVIDER
6726 Visual Studio Source Code Control Provider.
6727
6728 Can be set to change the visual studio source code control provider
6729 property.
6730
6731 VS_SDK_REFERENCES
6732 New in version 3.7.
6733
6734
6735 Visual Studio project SDK references. Specify a semicolon-separated
6736 list of SDK references to be added to a generated Visual Studio
6737 project, e.g. Microsoft.AdMediatorWindows81, Version=1.0.
6738
6739 VS_SOLUTION_DEPLOY
6740 New in version 3.18.
6741
6742
6743 Specify that the target should be marked for deployment when not tar‐
6744 geting Windows CE, Windows Phone or a Windows Store application.
6745
6746 If the target platform doesn't support deployment, this property won't
6747 have any effect.
6748
6749 Generator expressions are supported.
6750
6751 Examples
6752 Always deploy target foo:
6753
6754 add_executable(foo SHARED foo.cpp)
6755 set_property(TARGET foo PROPERTY VS_SOLUTION_DEPLOY ON)
6756
6757 Deploy target foo for all configurations except Release:
6758
6759 add_executable(foo SHARED foo.cpp)
6760 set_property(TARGET foo PROPERTY VS_SOLUTION_DEPLOY "$<NOT:$<CONFIG:Release>>")
6761
6762 VS_SOURCE_SETTINGS_<tool>
6763 New in version 3.18.
6764
6765
6766 Set any item metadata on all non-built files that use <tool>.
6767
6768 Takes a list of Key=Value pairs. Tells the Visual Studio generator to
6769 set Key to Value as item metadata on all non-built files that use
6770 <tool>.
6771
6772 For example:
6773
6774 set_property(TARGET main PROPERTY VS_SOURCE_SETTINGS_FXCompile "Key=Value" "Key2=Value2")
6775
6776 will set Key to Value and Key2 to Value2 for all non-built files that
6777 use FXCompile.
6778
6779 Generator expressions are supported.
6780
6781 VS_USER_PROPS
6782 New in version 3.8.
6783
6784
6785 Sets the user props file to be included in the visual studio C++
6786 project file. The standard path is $(UserRootDir)\\Micro‐
6787 soft.Cpp.$(Platform).user.props, which is in most cases the same as
6788 %LOCALAPPDATA%\\Microsoft\\MSBuild\\v4.0\\Micro‐
6789 soft.Cpp.Win32.user.props or %LOCALAPPDATA%\\Microsoft\\MS‐
6790 Build\\v4.0\\Microsoft.Cpp.x64.user.props.
6791
6792 The *.user.props files can be used for Visual Studio wide configuration
6793 which is independent from cmake.
6794
6795 VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
6796 New in version 3.4.
6797
6798
6799 Visual Studio Windows Target Platform Minimum Version
6800
6801 For Windows 10. Specifies the minimum version of the OS that is being
6802 targeted. For example 10.0.10240.0. If the value is not specified, the
6803 value of CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION will be used on Win‐
6804 dowsStore projects otherwise the target platform minimum version will
6805 not be specified for the project.
6806
6807 VS_WINRT_COMPONENT
6808 New in version 3.1.
6809
6810
6811 Mark a target as a Windows Runtime component for the Visual Studio gen‐
6812 erator. Compile the target with C++/CX language extensions for Windows
6813 Runtime. For SHARED and MODULE libraries, this also defines the
6814 _WINRT_DLL preprocessor macro.
6815
6816 NOTE:
6817 Currently this is implemented only by Visual Studio generators.
6818 Support may be added to other generators in the future.
6819
6820 VS_WINRT_EXTENSIONS
6821 Deprecated. Use VS_WINRT_COMPONENT instead. This property was an ex‐
6822 perimental partial implementation of that one.
6823
6824 VS_WINRT_REFERENCES
6825 Visual Studio project Windows Runtime Metadata references
6826
6827 Adds one or more semicolon-delimited WinRT references to a generated
6828 Visual Studio project. For example, "Windows;Windows.UI.Core".
6829
6830 WIN32_EXECUTABLE
6831 Build an executable with a WinMain entry point on windows.
6832
6833 When this property is set to true the executable when linked on Windows
6834 will be created with a WinMain() entry point instead of just main().
6835 This makes it a GUI executable instead of a console application. See
6836 the CMAKE_MFC_FLAG variable documentation to configure use of the Mi‐
6837 crosoft Foundation Classes (MFC) for WinMain executables. This prop‐
6838 erty is initialized by the value of the CMAKE_WIN32_EXECUTABLE variable
6839 if it is set when a target is created.
6840
6841 This property supports generator expressions, except if the target is
6842 managed (contains C# code.)
6843
6844 WINDOWS_EXPORT_ALL_SYMBOLS
6845 New in version 3.4.
6846
6847
6848 This property is implemented only for MS-compatible tools on Windows.
6849
6850 Enable this boolean property to automatically create a module defini‐
6851 tion (.def) file with all global symbols found in the input .obj files
6852 for a SHARED library (or executable with ENABLE_EXPORTS) on Windows.
6853 The module definition file will be passed to the linker causing all
6854 symbols to be exported from the .dll. For global data symbols, __de‐
6855 clspec(dllimport) must still be used when compiling against the code in
6856 the .dll. All other function symbols will be automatically exported
6857 and imported by callers. This simplifies porting projects to Windows
6858 by reducing the need for explicit dllexport markup, even in C++
6859 classes.
6860
6861 When this property is enabled, zero or more .def files may also be
6862 specified as source files of the target. The exports named by these
6863 files will be merged with those detected from the object files to gen‐
6864 erate a single module definition file to be passed to the linker. This
6865 can be used to export symbols from a .dll that are not in any of its
6866 object files but are added by the linker from dependencies (e.g.
6867 msvcrt.lib).
6868
6869 This property is initialized by the value of the CMAKE_WINDOWS_EX‐
6870 PORT_ALL_SYMBOLS variable if it is set when a target is created.
6871
6872 XCODE_ATTRIBUTE_<an-attribute>
6873 Set Xcode target attributes directly.
6874
6875 Tell the Xcode generator to set <an-attribute> to a given value in the
6876 generated Xcode project. Ignored on other generators.
6877
6878 This offers low-level control over the generated Xcode project file.
6879 It is meant as a last resort for specifying settings that CMake does
6880 not otherwise have a way to control. Although this can override a set‐
6881 ting CMake normally produces on its own, doing so bypasses CMake's
6882 model of the project and can break things.
6883
6884 See the CMAKE_XCODE_ATTRIBUTE_<an-attribute> variable to set attributes
6885 on all targets in a directory tree.
6886
6887 Contents of XCODE_ATTRIBUTE_<an-attribute> may use "generator expres‐
6888 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
6889 manual for available expressions. See the cmake-buildsystem(7) manual
6890 for more on defining buildsystem properties.
6891
6892 XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY
6893 New in version 3.20.
6894
6895
6896 Tell the Xcode generator to perform code signing for all the frameworks
6897 and libraries that are embedded using the XCODE_EMBED_FRAMEWORKS prop‐
6898 erty.
6899
6900 New in version 3.21.
6901
6902
6903 This property was generalized to other types of embedded items. See
6904 XCODE_EMBED_<type>_CODE_SIGN_ON_COPY for the more general form.
6905
6906 XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY
6907 New in version 3.20.
6908
6909
6910 Tell the Xcode generator to remove headers from all the frameworks that
6911 are embedded using the XCODE_EMBED_FRAMEWORKS property.
6912
6913 New in version 3.21.
6914
6915
6916 This property was generalized to other types of embedded items. See
6917 XCODE_EMBED_<type>_REMOVE_HEADERS_ON_COPY for the more general form.
6918
6919 XCODE_EMBED_<type>
6920 New in version 3.20.
6921
6922
6923 Tell the Xcode generator to embed the specified list of items into the
6924 target bundle. <type> specifies the embed build phase to use. See the
6925 Xcode documentation for the base location of each <type>.
6926
6927 The supported values for <type> are:
6928
6929 FRAMEWORKS
6930 The specified items will be added to the Embed Frameworks build
6931 phase. The items can be CMake target names or paths to frame‐
6932 works or libraries.
6933
6934 APP_EXTENSIONS
6935 New in version 3.21.
6936
6937
6938 The specified items will be added to the Embed App Extensions
6939 build phase. They must be CMake target names.
6940
6941 See also XCODE_EMBED_<type>_PATH, XCODE_EMBED_<type>_REMOVE_HEAD‐
6942 ERS_ON_COPY and XCODE_EMBED_<type>_CODE_SIGN_ON_COPY.
6943
6944 XCODE_EMBED_<type>_CODE_SIGN_ON_COPY
6945 New in version 3.20.
6946
6947
6948 Boolean property used only by the Xcode generator. It specifies
6949 whether to perform code signing for the items that are embedded using
6950 the XCODE_EMBED_<type> property.
6951
6952 The supported values for <type> are:
6953
6954 FRAMEWORKS
6955
6956 APP_EXTENSIONS
6957 New in version 3.21.
6958
6959
6960 If a XCODE_EMBED_<type>_CODE_SIGN_ON_COPY property is not defined on
6961 the target, no code signing on copy will be performed for that <type>.
6962
6963 XCODE_EMBED_<type>_PATH
6964 New in version 3.20.
6965
6966
6967 This property is used only by the Xcode generator. When defined, it
6968 specifies the relative path to use when embedding the items specified
6969 by XCODE_EMBED_<type>. The path is relative to the base location of
6970 the Embed XXX build phase associated with <type>. See the Xcode docu‐
6971 mentation for the base location of each <type>.
6972
6973 The supported values for <type> are:
6974
6975 FRAMEWORKS
6976
6977 APP_EXTENSIONS
6978 New in version 3.21.
6979
6980
6981 XCODE_EMBED_<type>_REMOVE_HEADERS_ON_COPY
6982 New in version 3.20.
6983
6984
6985 Boolean property used only by the Xcode generator. It specifies
6986 whether to remove headers from all the frameworks that are embedded us‐
6987 ing the XCODE_EMBED_<type> property.
6988
6989 The supported values for <type> are:
6990
6991 FRAMEWORKS
6992 If the XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY property is
6993 not defined, headers will not be removed on copy by default.
6994
6995 APP_EXTENSIONS
6996 New in version 3.21.
6997
6998
6999 If the XCODE_EMBED_APP_EXTENSIONS_REMOVE_HEADERS_ON_COPY prop‐
7000 erty is not defined, headers WILL be removed on copy by default.
7001
7002 XCODE_EXPLICIT_FILE_TYPE
7003 New in version 3.8.
7004
7005
7006 Set the Xcode explicitFileType attribute on its reference to a target.
7007 CMake computes a default based on target type but can be told explic‐
7008 itly with this property.
7009
7010 See also XCODE_PRODUCT_TYPE.
7011
7012 XCODE_GENERATE_SCHEME
7013 New in version 3.15.
7014
7015
7016 If enabled, the Xcode generator will generate schema files. These are
7017 useful to invoke analyze, archive, build-for-testing and test actions
7018 from the command line.
7019
7020 This property is initialized by the value of the variable
7021 CMAKE_XCODE_GENERATE_SCHEME if it is set when a target is created.
7022
7023 The following target properties overwrite the default of the corre‐
7024 sponding settings on the "Diagnostic" tab for each schema file. Each
7025 of those is initialized by the respective CMAKE_ variable at target
7026 creation time.
7027
7028 • XCODE_SCHEME_ADDRESS_SANITIZER
7029
7030 • XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
7031
7032 • XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
7033
7034 • XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
7035
7036 • XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
7037
7038 • XCODE_SCHEME_GUARD_MALLOC
7039
7040 • XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
7041
7042 • XCODE_SCHEME_MALLOC_GUARD_EDGES
7043
7044 • XCODE_SCHEME_MALLOC_SCRIBBLE
7045
7046 • XCODE_SCHEME_MALLOC_STACK
7047
7048 • XCODE_SCHEME_THREAD_SANITIZER
7049
7050 • XCODE_SCHEME_THREAD_SANITIZER_STOP
7051
7052 • XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
7053
7054 • XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
7055
7056 • XCODE_SCHEME_ZOMBIE_OBJECTS
7057
7058 The following target properties will be applied on the "Info", "Argu‐
7059 ments", and "Options" tab:
7060
7061 • XCODE_SCHEME_ARGUMENTS
7062
7063 • XCODE_SCHEME_DEBUG_AS_ROOT
7064
7065 • XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
7066
7067 • XCODE_SCHEME_ENVIRONMENT
7068
7069 • XCODE_SCHEME_EXECUTABLE
7070
7071 • XCODE_SCHEME_WORKING_DIRECTORY
7072
7073 XCODE_LINK_BUILD_PHASE_MODE
7074 New in version 3.19.
7075
7076
7077 When using the Xcode generator, libraries to be linked will be speci‐
7078 fied in the Xcode project file using either the "Link Binary With Li‐
7079 braries" build phase or directly as linker flags. The former allows
7080 Xcode to manage build paths, which may be necessary when creating Xcode
7081 archives because it may use different build paths to a regular build.
7082
7083 This property controls usage of "Link Binary With Libraries" build
7084 phase for a target that is an app bundle, executable, shared library,
7085 shared framework or a module library.
7086
7087 Possible values are:
7088
7089 • NONE The libraries will be linked by specifying the linker flags di‐
7090 rectly.
7091
7092 • BUILT_ONLY The "Link Binary With Libraries" build phase will be used
7093 to link to another target under the following conditions:
7094
7095 • The target to be linked to is a regular non-imported, non-interface
7096 library target.
7097
7098 • The output directory of the target being built has not been changed
7099 from its default (see RUNTIME_OUTPUT_DIRECTORY and LIBRARY_OUT‐
7100 PUT_DIRECTORY).
7101
7102 • KNOWN_LOCATION The "Link Binary With Libraries" build phase will be
7103 used to link to another target under the same conditions as with
7104 BUILT_ONLY and also:
7105
7106 • Imported library targets except those of type UNKNOWN.
7107
7108 • Any non-target library specified directly with a path.
7109
7110 For all other cases, the libraries will be linked by specifying the
7111 linker flags directly.
7112
7113 WARNING:
7114 Libraries linked using "Link Binary With Libraries" are linked after
7115 the ones linked through regular linker flags. This order should be
7116 taken into account when different static libraries contain symbols
7117 with the same name, as the former ones will take precedence over the
7118 latter.
7119
7120 WARNING:
7121 If two or more directories contain libraries with identical file
7122 names and some libraries are linked from those directories, the li‐
7123 brary search path lookup will end up linking libraries from the
7124 first directory. This is a known limitation of Xcode.
7125
7126 This property is initialized by the value of the
7127 CMAKE_XCODE_LINK_BUILD_PHASE_MODE variable if it is set when a target
7128 is created.
7129
7130 XCODE_PRODUCT_TYPE
7131 New in version 3.8.
7132
7133
7134 Set the Xcode productType attribute on its reference to a target.
7135 CMake computes a default based on target type but can be told explic‐
7136 itly with this property.
7137
7138 See also XCODE_EXPLICIT_FILE_TYPE.
7139
7140 XCODE_SCHEME_ADDRESS_SANITIZER
7141 New in version 3.13.
7142
7143
7144 Whether to enable Address Sanitizer in the Diagnostics section of the
7145 generated Xcode scheme.
7146
7147 This property is initialized by the value of the variable
7148 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER if it is set when a target is cre‐
7149 ated.
7150
7151 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7152 to see all Xcode schema related properties.
7153
7154 XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
7155 New in version 3.13.
7156
7157
7158 Whether to enable Detect use of stack after return in the Diagnostics
7159 section of the generated Xcode scheme.
7160
7161 This property is initialized by the value of the variable
7162 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN if it is set when
7163 a target is created.
7164
7165 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7166 to see all Xcode schema related properties.
7167
7168 XCODE_SCHEME_ARGUMENTS
7169 New in version 3.13.
7170
7171
7172 Specify command line arguments that should be added to the Arguments
7173 section of the generated Xcode scheme.
7174
7175 If set to a list of arguments those will be added to the scheme.
7176
7177 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7178 to see all Xcode schema related properties.
7179
7180 XCODE_SCHEME_DEBUG_AS_ROOT
7181 New in version 3.15.
7182
7183
7184 Whether to debug the target as 'root'.
7185
7186 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7187 to see all Xcode schema related properties.
7188
7189 XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
7190 New in version 3.16.
7191
7192
7193 Whether to enable Allow debugging when using document Versions Browser
7194 in the Options section of the generated Xcode scheme.
7195
7196 This property is initialized by the value of the variable
7197 CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING if it is set when a target
7198 is created.
7199
7200 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7201 to see all Xcode schema related properties.
7202
7203 XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
7204 New in version 3.13.
7205
7206
7207 Whether to disable the Main Thread Checker in the Diagnostics section
7208 of the generated Xcode scheme.
7209
7210 This property is initialized by the value of the variable
7211 CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER if it is set when a tar‐
7212 get is created.
7213
7214 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7215 to see all Xcode schema related properties.
7216
7217 XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
7218 New in version 3.13.
7219
7220
7221 Whether to enable Dynamic Library Loads in the Diagnostics section of
7222 the generated Xcode scheme.
7223
7224 This property is initialized by the value of the variable
7225 CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS if it is set when a target is
7226 created.
7227
7228 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7229 to see all Xcode schema related properties.
7230
7231 XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
7232 New in version 3.13.
7233
7234
7235 Whether to enable Dynamic Linker API usage in the Diagnostics section
7236 of the generated Xcode scheme.
7237
7238 This property is initialized by the value of the variable
7239 CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE if it is set when a target
7240 is created.
7241
7242 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7243 to see all Xcode schema related properties.
7244
7245 XCODE_SCHEME_ENVIRONMENT
7246 New in version 3.13.
7247
7248
7249 Specify environment variables that should be added to the Arguments
7250 section of the generated Xcode scheme.
7251
7252 If set to a list of environment variables and values of the form MY‐
7253 VAR=value those environment variables will be added to the scheme.
7254
7255 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7256 to see all Xcode schema related properties.
7257
7258 XCODE_SCHEME_EXECUTABLE
7259 New in version 3.13.
7260
7261
7262 Specify path to executable in the Info section of the generated Xcode
7263 scheme. If not set the schema generator will select the current target
7264 if it is actually executable.
7265
7266 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7267 to see all Xcode schema related properties.
7268
7269 XCODE_SCHEME_GUARD_MALLOC
7270 New in version 3.13.
7271
7272
7273 Whether to enable Guard Malloc in the Diagnostics section of the gener‐
7274 ated Xcode scheme.
7275
7276 This property is initialized by the value of the variable
7277 CMAKE_XCODE_SCHEME_GUARD_MALLOC if it is set when a target is created.
7278
7279 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7280 to see all Xcode schema related properties.
7281
7282 XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
7283 New in version 3.13.
7284
7285
7286 Whether to enable the Main Thread Checker option Pause on issues in the
7287 Diagnostics section of the generated Xcode scheme.
7288
7289 This property is initialized by the value of the variable
7290 CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP if it is set when a target
7291 is created.
7292
7293 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7294 to see all Xcode schema related properties.
7295
7296 XCODE_SCHEME_MALLOC_GUARD_EDGES
7297 New in version 3.13.
7298
7299
7300 Whether to enable Malloc Guard Edges in the Diagnostics section of the
7301 generated Xcode scheme.
7302
7303 This property is initialized by the value of the variable
7304 CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES if it is set when a target is
7305 created.
7306
7307 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7308 to see all Xcode schema related properties.
7309
7310 XCODE_SCHEME_MALLOC_SCRIBBLE
7311 New in version 3.13.
7312
7313
7314 Whether to enable Malloc Scribble in the Diagnostics section of the
7315 generated Xcode scheme.
7316
7317 This property is initialized by the value of the variable
7318 CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE if it is set when a target is cre‐
7319 ated.
7320
7321 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7322 to see all Xcode schema related properties.
7323
7324 XCODE_SCHEME_MALLOC_STACK
7325 New in version 3.13.
7326
7327
7328 Whether to enable Malloc Stack in the Diagnostics section of the gener‐
7329 ated Xcode scheme.
7330
7331 This property is initialized by the value of the variable
7332 CMAKE_XCODE_SCHEME_MALLOC_STACK if it is set when a target is created.
7333
7334 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7335 to see all Xcode schema related properties.
7336
7337 XCODE_SCHEME_THREAD_SANITIZER
7338 New in version 3.13.
7339
7340
7341 Whether to enable Thread Sanitizer in the Diagnostics section of the
7342 generated Xcode scheme.
7343
7344 This property is initialized by the value of the variable
7345 CMAKE_XCODE_SCHEME_THREAD_SANITIZER if it is set when a target is cre‐
7346 ated.
7347
7348 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7349 to see all Xcode schema related properties.
7350
7351 XCODE_SCHEME_THREAD_SANITIZER_STOP
7352 New in version 3.13.
7353
7354
7355 Whether to enable Thread Sanitizer - Pause on issues in the Diagnostics
7356 section of the generated Xcode scheme.
7357
7358 This property is initialized by the value of the variable
7359 CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP if it is set when a target is
7360 created.
7361
7362 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7363 to see all Xcode schema related properties.
7364
7365 XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
7366 New in version 3.13.
7367
7368
7369 Whether to enable Undefined Behavior Sanitizer in the Diagnostics sec‐
7370 tion of the generated Xcode scheme.
7371
7372 This property is initialized by the value of the variable
7373 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER if it is set when a
7374 target is created.
7375
7376 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7377 to see all Xcode schema related properties.
7378
7379 XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
7380 New in version 3.13.
7381
7382
7383 Whether to enable Undefined Behavior Sanitizer option Pause on issues
7384 in the Diagnostics section of the generated Xcode scheme.
7385
7386 This property is initialized by the value of the variable
7387 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP if it is set when
7388 a target is created.
7389
7390 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7391 to see all Xcode schema related properties.
7392
7393 XCODE_SCHEME_WORKING_DIRECTORY
7394 New in version 3.17.
7395
7396
7397 Specify the Working Directory of the Run and Profile actions in the
7398 generated Xcode scheme. In case the value contains generator expres‐
7399 sions those are evaluated.
7400
7401 This property is initialized by the value of the variable
7402 CMAKE_XCODE_SCHEME_WORKING_DIRECTORY if it is set when a target is cre‐
7403 ated.
7404
7405 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7406 to see all Xcode schema related properties.
7407
7408 XCODE_SCHEME_ZOMBIE_OBJECTS
7409 New in version 3.13.
7410
7411
7412 Whether to enable Zombie Objects in the Diagnostics section of the gen‐
7413 erated Xcode scheme.
7414
7415 This property is initialized by the value of the variable
7416 CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS if it is set when a target is cre‐
7417 ated.
7418
7419 Please refer to the XCODE_GENERATE_SCHEME target property documentation
7420 to see all Xcode schema related properties.
7421
7422 XCTEST
7423 New in version 3.3.
7424
7425
7426 This target is a XCTest CFBundle on the Mac.
7427
7428 This property will usually get set via the xctest_add_bundle() macro in
7429 FindXCTest module.
7430
7431 If a module library target has this property set to true it will be
7432 built as a CFBundle when built on the Mac. It will have the directory
7433 structure required for a CFBundle.
7434
7435 This property depends on BUNDLE to be effective.
7436
7438 ATTACHED_FILES
7439 Attach a list of files to a dashboard submission.
7440
7441 Set this property to a list of files that will be encoded and submitted
7442 to the dashboard as an addition to the test result.
7443
7444 ATTACHED_FILES_ON_FAIL
7445 Attach a list of files to a dashboard submission if the test fails.
7446
7447 Same as ATTACHED_FILES, but these files will only be included if the
7448 test does not pass.
7449
7450 COST
7451 This property describes the cost of a test. When parallel testing is
7452 enabled, tests in the test set will be run in descending order of cost.
7453 Projects can explicitly define the cost of a test by setting this prop‐
7454 erty to a floating point value.
7455
7456 When the cost of a test is not defined by the project, ctest will ini‐
7457 tially use a default cost of 0. It computes a weighted average of the
7458 cost each time a test is run and uses that as an improved estimate of
7459 the cost for the next run. The more a test is re-run in the same build
7460 directory, the more representative the cost should become.
7461
7462 DEPENDS
7463 Specifies that this test should only be run after the specified list of
7464 tests.
7465
7466 Set this to a list of tests that must finish before this test is run.
7467 The results of those tests are not considered, the dependency relation‐
7468 ship is purely for order of execution (i.e. it is really just a run af‐
7469 ter relationship). Consider using test fixtures with setup tests if a
7470 dependency with successful completion is required (see FIXTURES_RE‐
7471 QUIRED).
7472
7473 Examples
7474 add_test(NAME baseTest1 ...)
7475 add_test(NAME baseTest2 ...)
7476 add_test(NAME dependsTest12 ...)
7477
7478 set_tests_properties(dependsTest12 PROPERTIES DEPENDS "baseTest1;baseTest2")
7479 # dependsTest12 runs after baseTest1 and baseTest2, even if they fail
7480
7481 DISABLED
7482 New in version 3.9.
7483
7484
7485 If set to True, the test will be skipped and its status will be 'Not
7486 Run'. A DISABLED test will not be counted in the total number of tests
7487 and its completion status will be reported to CDash as Disabled.
7488
7489 A DISABLED test does not participate in test fixture dependency resolu‐
7490 tion. If a DISABLED test has fixture requirements defined in its FIX‐
7491 TURES_REQUIRED property, it will not cause setup or cleanup tests for
7492 those fixtures to be added to the test set.
7493
7494 If a test with the FIXTURES_SETUP property set is DISABLED, the fixture
7495 behavior will be as though that setup test was passing and any test
7496 case requiring that fixture will still run.
7497
7498 ENVIRONMENT
7499 Specify environment variables that should be defined for running a
7500 test.
7501
7502 If set to a list of environment variables and values of the form MY‐
7503 VAR=value those environment variables will be defined while running the
7504 test. The environment changes from this property do not affect other
7505 tests.
7506
7507 ENVIRONMENT_MODIFICATION
7508 New in version 3.22.
7509
7510
7511 Specify environment variables that should be modified for running a
7512 test. Note that the operations performed by this property are performed
7513 after the ENVIRONMENT property is already applied.
7514
7515 If set to a list of environment variables and values of the form MY‐
7516 VAR=OP:VALUE, where MYVAR is the case-sensitive name of an environment
7517 variable to be modified. Entries are considered in the order specified
7518 in the property's value. The OP may be one of:
7519
7520 • reset: Reset to the unmodified value, ignoring all modifications
7521 to MYVAR prior to this entry. Note that this will reset the vari‐
7522 able to the value set by ENVIRONMENT, if it was set, and otherwise
7523 to its state from the rest of the CTest execution.
7524
7525 • set: Replaces the current value of MYVAR with VALUE.
7526
7527 • unset: Unsets the current value of MYVAR.
7528
7529 • string_append: Appends VALUE to the current value of MYVAR.
7530
7531 • string_prepend: Prepends VALUE to the current value of MYVAR.
7532
7533 • path_list_append: Appends VALUE to the current value of MYVAR us‐
7534 ing the platform-specific list separator.
7535
7536 • path_list_prepend: Prepends VALUE to the current value of MYVAR
7537 using the platform-specific list separator.
7538
7539 • cmake_list_append: Appends VALUE to the current value of MYVAR us‐
7540 ing ; as the separator.
7541
7542 • cmake_list_prepend: Prepends VALUE to the current value of MYVAR
7543 using ; as the separator.
7544
7545 Unrecognized OP values will result in the test failing before it is ex‐
7546 ecuted. This is so that future operations may be added without changing
7547 valid behavior of existing tests.
7548
7549 The environment changes from this property do not affect other tests.
7550
7551 FAIL_REGULAR_EXPRESSION
7552 If the output matches this regular expression the test will fail, re‐
7553 gardless of the process exit code.
7554
7555 If set, if the output matches one of specified regular expressions, the
7556 test will fail. Example:
7557
7558 set_tests_properties(mytest PROPERTIES
7559 FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
7560 )
7561
7562 FAIL_REGULAR_EXPRESSION expects a list of regular expressions.
7563
7564 See also the PASS_REGULAR_EXPRESSION and SKIP_REGULAR_EXPRESSION test
7565 properties.
7566
7567 FIXTURES_CLEANUP
7568 New in version 3.7.
7569
7570
7571 Specifies a list of fixtures for which the test is to be treated as a
7572 cleanup test. These fixture names are distinct from test case names and
7573 are not required to have any similarity to the names of tests associ‐
7574 ated with them.
7575
7576 Fixture cleanup tests are ordinary tests with all of the usual test
7577 functionality. Setting the FIXTURES_CLEANUP property for a test has two
7578 primary effects:
7579
7580 • CTest will ensure the test executes after all other tests which list
7581 any of the fixtures in its FIXTURES_REQUIRED property.
7582
7583 • If CTest is asked to run only a subset of tests (e.g. using regular
7584 expressions or the --rerun-failed option) and the cleanup test is not
7585 in the set of tests to run, it will automatically be added if any
7586 tests in the set require any fixture listed in FIXTURES_CLEANUP.
7587
7588 A cleanup test can have multiple fixtures listed in its FIX‐
7589 TURES_CLEANUP property. It will execute only once for the whole CTest
7590 run, not once for each fixture. A fixture can also have more than one
7591 cleanup test defined. If there are multiple cleanup tests for a fix‐
7592 ture, projects can control their order with the usual DEPENDS test
7593 property if necessary.
7594
7595 A cleanup test is allowed to require other fixtures, but not any fix‐
7596 ture listed in its FIXTURES_CLEANUP property. For example:
7597
7598 # Ok: Dependent fixture is different to cleanup
7599 set_tests_properties(cleanupFoo PROPERTIES
7600 FIXTURES_CLEANUP Foo
7601 FIXTURES_REQUIRED Bar
7602 )
7603
7604 # Error: cannot require same fixture as cleanup
7605 set_tests_properties(cleanupFoo PROPERTIES
7606 FIXTURES_CLEANUP Foo
7607 FIXTURES_REQUIRED Foo
7608 )
7609
7610 Cleanup tests will execute even if setup or regular tests for that fix‐
7611 ture fail or are skipped.
7612
7613 See FIXTURES_REQUIRED for a more complete discussion of how to use test
7614 fixtures.
7615
7616 FIXTURES_REQUIRED
7617 New in version 3.7.
7618
7619
7620 Specifies a list of fixtures the test requires. Fixture names are case
7621 sensitive and they are not required to have any similarity to test
7622 names.
7623
7624 Fixtures are a way to attach setup and cleanup tasks to a set of tests.
7625 If a test requires a given fixture, then all tests marked as setup
7626 tasks for that fixture will be executed first (once for the whole set
7627 of tests, not once per test requiring the fixture). After all tests re‐
7628 quiring a particular fixture have completed, CTest will ensure all
7629 tests marked as cleanup tasks for that fixture are then executed. Tests
7630 are marked as setup tasks with the FIXTURES_SETUP property and as
7631 cleanup tasks with the FIXTURES_CLEANUP property. If any of a fixture's
7632 setup tests fail, all tests listing that fixture in their FIXTURES_RE‐
7633 QUIRED property will not be executed. The cleanup tests for the fixture
7634 will always be executed, even if some setup tests fail.
7635
7636 When CTest is asked to execute only a subset of tests (e.g. by the use
7637 of regular expressions or when run with the --rerun-failed command line
7638 option), it will automatically add any setup or cleanup tests for fix‐
7639 tures required by any of the tests that are in the execution set. This
7640 behavior can be overridden with the -FS, -FC and -FA command line op‐
7641 tions to ctest(1) if desired.
7642
7643 Since setup and cleanup tasks are also tests, they can have an ordering
7644 specified by the DEPENDS test property just like any other tests. This
7645 can be exploited to implement setup or cleanup using multiple tests for
7646 a single fixture to modularise setup or cleanup logic.
7647
7648 The concept of a fixture is different to that of a resource specified
7649 by RESOURCE_LOCK, but they may be used together. A fixture defines a
7650 set of tests which share setup and cleanup requirements, whereas a re‐
7651 source lock has the effect of ensuring a particular set of tests do not
7652 run in parallel. Some situations may need both, such as setting up a
7653 database, serializing test access to that database and deleting the
7654 database again at the end. For such cases, tests would populate both
7655 FIXTURES_REQUIRED and RESOURCE_LOCK to combine the two behaviors. Names
7656 used for RESOURCE_LOCK have no relationship with names of fixtures, so
7657 note that a resource lock does not imply a fixture and vice versa.
7658
7659 Consider the following example which represents a database test sce‐
7660 nario similar to that mentioned above:
7661
7662 add_test(NAME testsDone COMMAND emailResults)
7663 add_test(NAME fooOnly COMMAND testFoo)
7664 add_test(NAME dbOnly COMMAND testDb)
7665 add_test(NAME dbWithFoo COMMAND testDbWithFoo)
7666 add_test(NAME createDB COMMAND initDB)
7667 add_test(NAME setupUsers COMMAND userCreation)
7668 add_test(NAME cleanupDB COMMAND deleteDB)
7669 add_test(NAME cleanupFoo COMMAND removeFoos)
7670
7671 set_tests_properties(setupUsers PROPERTIES DEPENDS createDB)
7672
7673 set_tests_properties(createDB PROPERTIES FIXTURES_SETUP DB)
7674 set_tests_properties(setupUsers PROPERTIES FIXTURES_SETUP DB)
7675 set_tests_properties(cleanupDB PROPERTIES FIXTURES_CLEANUP DB)
7676 set_tests_properties(cleanupFoo PROPERTIES FIXTURES_CLEANUP Foo)
7677 set_tests_properties(testsDone PROPERTIES FIXTURES_CLEANUP "DB;Foo")
7678
7679 set_tests_properties(fooOnly PROPERTIES FIXTURES_REQUIRED Foo)
7680 set_tests_properties(dbOnly PROPERTIES FIXTURES_REQUIRED DB)
7681 set_tests_properties(dbWithFoo PROPERTIES FIXTURES_REQUIRED "DB;Foo")
7682
7683 set_tests_properties(dbOnly dbWithFoo createDB setupUsers cleanupDB
7684 PROPERTIES RESOURCE_LOCK DbAccess)
7685
7686 Key points from this example:
7687
7688 • Two fixtures are defined: DB and Foo. Tests can require a single fix‐
7689 ture as fooOnly and dbOnly do, or they can depend on multiple fix‐
7690 tures like dbWithFoo does.
7691
7692 • A DEPENDS relationship is set up to ensure setupUsers happens after
7693 createDB, both of which are setup tests for the DB fixture and will
7694 therefore be executed before the dbOnly and dbWithFoo tests automati‐
7695 cally.
7696
7697 • No explicit DEPENDS relationships were needed to make the setup tests
7698 run before or the cleanup tests run after the regular tests.
7699
7700 • The Foo fixture has no setup tests defined, only a single cleanup
7701 test.
7702
7703 • testsDone is a cleanup test for both the DB and Foo fixtures. There‐
7704 fore, it will only execute once regular tests for both fixtures have
7705 finished (i.e. after fooOnly, dbOnly and dbWithFoo). No DEPENDS rela‐
7706 tionship was specified for testsDone, so it is free to run before,
7707 after or concurrently with other cleanup tests for either fixture.
7708
7709 • The setup and cleanup tests never list the fixtures they are for in
7710 their own FIXTURES_REQUIRED property, as that would result in a de‐
7711 pendency on themselves and be considered an error.
7712
7713 FIXTURES_SETUP
7714 New in version 3.7.
7715
7716
7717 Specifies a list of fixtures for which the test is to be treated as a
7718 setup test. These fixture names are distinct from test case names and
7719 are not required to have any similarity to the names of tests associ‐
7720 ated with them.
7721
7722 Fixture setup tests are ordinary tests with all of the usual test func‐
7723 tionality. Setting the FIXTURES_SETUP property for a test has two pri‐
7724 mary effects:
7725
7726 • CTest will ensure the test executes before any other test which lists
7727 the fixture name(s) in its FIXTURES_REQUIRED property.
7728
7729 • If CTest is asked to run only a subset of tests (e.g. using regular
7730 expressions or the --rerun-failed option) and the setup test is not
7731 in the set of tests to run, it will automatically be added if any
7732 tests in the set require any fixture listed in FIXTURES_SETUP.
7733
7734 A setup test can have multiple fixtures listed in its FIXTURES_SETUP
7735 property. It will execute only once for the whole CTest run, not once
7736 for each fixture. A fixture can also have more than one setup test de‐
7737 fined. If there are multiple setup tests for a fixture, projects can
7738 control their order with the usual DEPENDS test property if necessary.
7739
7740 A setup test is allowed to require other fixtures, but not any fixture
7741 listed in its FIXTURES_SETUP property. For example:
7742
7743 # Ok: dependent fixture is different to setup
7744 set_tests_properties(setupFoo PROPERTIES
7745 FIXTURES_SETUP Foo
7746 FIXTURES_REQUIRED Bar
7747 )
7748
7749 # Error: cannot require same fixture as setup
7750 set_tests_properties(setupFoo PROPERTIES
7751 FIXTURES_SETUP Foo
7752 FIXTURES_REQUIRED Foo
7753 )
7754
7755 If any of a fixture's setup tests fail, none of the tests listing that
7756 fixture in its FIXTURES_REQUIRED property will be run. Cleanup tests
7757 will, however, still be executed.
7758
7759 See FIXTURES_REQUIRED for a more complete discussion of how to use test
7760 fixtures.
7761
7762 LABELS
7763 Specify a list of text labels associated with a test. The labels are
7764 reported in both the ctest output summary and in dashboard submissions.
7765 They can also be used to filter the set of tests to be executed (see
7766 the ctest -L and ctest -LE CTest Options).
7767
7768 See Additional Labels for adding labels to a test dynamically during
7769 test execution.
7770
7771 MEASUREMENT
7772 Specify a CDASH measurement and value to be reported for a test.
7773
7774 If set to a name then that name will be reported to CDASH as a named
7775 measurement with a value of 1. You may also specify a value by setting
7776 MEASUREMENT to measurement=value.
7777
7778 PASS_REGULAR_EXPRESSION
7779 The output must match this regular expression for the test to pass.
7780 The process exit code is ignored.
7781
7782 If set, the test output will be checked against the specified regular
7783 expressions and at least one of the regular expressions has to match,
7784 otherwise the test will fail. Example:
7785
7786 set_tests_properties(mytest PROPERTIES
7787 PASS_REGULAR_EXPRESSION "TestPassed;All ok"
7788 )
7789
7790 PASS_REGULAR_EXPRESSION expects a list of regular expressions.
7791
7792 See also the FAIL_REGULAR_EXPRESSION and SKIP_REGULAR_EXPRESSION test
7793 properties.
7794
7795 PROCESSOR_AFFINITY
7796 New in version 3.12.
7797
7798
7799 Set to a true value to ask CTest to launch the test process with CPU
7800 affinity for a fixed set of processors. If enabled and supported for
7801 the current platform, CTest will choose a set of processors to place in
7802 the CPU affinity mask when launching the test process. The number of
7803 processors in the set is determined by the PROCESSORS test property or
7804 the number of processors available to CTest, whichever is smaller. The
7805 set of processors chosen will be disjoint from the processors assigned
7806 to other concurrently running tests that also have the PROCESSOR_AFFIN‐
7807 ITY property enabled.
7808
7809 PROCESSORS
7810 Set to specify how many process slots this test requires. If not set,
7811 the default is 1 processor.
7812
7813 Denotes the number of processors that this test will require. This is
7814 typically used for MPI tests, and should be used in conjunction with
7815 the ctest_test() PARALLEL_LEVEL option.
7816
7817 This will also be used to display a weighted test timing result in la‐
7818 bel and subproject summaries in the command line output of ctest(1).
7819 The wall clock time for the test run will be multiplied by this prop‐
7820 erty to give a better idea of how much cpu resource CTest allocated for
7821 the test.
7822
7823 See also the PROCESSOR_AFFINITY test property.
7824
7825 REQUIRED_FILES
7826 List of files required to run the test. The filenames are relative to
7827 the test WORKING_DIRECTORY unless an absolute path is specified.
7828
7829 If set to a list of files, the test will not be run unless all of the
7830 files exist.
7831
7832 Examples
7833 Suppose that test.txt is created by test baseTest and none.txt does not
7834 exist:
7835
7836 add_test(NAME baseTest ...) # Assumed to create test.txt
7837 add_test(NAME fileTest ...)
7838
7839 # The following ensures that if baseTest is successful, test.txt will
7840 # have been created before fileTest is run
7841 set_tests_properties(fileTest PROPERTIES
7842 DEPENDS baseTest
7843 REQUIRED_FILES test.txt
7844 )
7845
7846 add_test(NAME notRunTest ...)
7847
7848 # The following makes notRunTest depend on two files. Nothing creates
7849 # the none.txt file, so notRunTest will fail with status "Not Run".
7850 set_tests_properties(notRunTest PROPERTIES
7851 REQUIRED_FILES "test.txt;none.txt"
7852 )
7853
7854 The above example demonstrates how REQUIRED_FILES works, but it is not
7855 the most robust way to implement test ordering with failure detection.
7856 For that, test fixtures are a better alternative (see FIXTURES_RE‐
7857 QUIRED).
7858
7859 RESOURCE_GROUPS
7860 New in version 3.16.
7861
7862
7863 Specify resources required by a test, grouped in a way that is meaning‐
7864 ful to the test. See resource allocation for more information on how
7865 this property integrates into the CTest resource allocation feature.
7866
7867 The RESOURCE_GROUPS property is a semicolon-separated list of group de‐
7868 scriptions. Each entry consists of an optional number of groups using
7869 the description followed by a series of resource requirements for those
7870 groups. These requirements (and the number of groups) are separated by
7871 commas. The resource requirements consist of the name of a resource
7872 type, followed by a colon, followed by an unsigned integer specifying
7873 the number of slots required on one resource of the given type.
7874
7875 The RESOURCE_GROUPS property tells CTest what resources a test expects
7876 to use grouped in a way meaningful to the test. The test itself must
7877 read the environment variables to determine which resources have been
7878 allocated to each group. For example, each group may correspond to a
7879 process the test will spawn when executed.
7880
7881 Consider the following example:
7882
7883 add_test(NAME MyTest COMMAND MyExe)
7884 set_property(TEST MyTest PROPERTY RESOURCE_GROUPS
7885 "2,gpus:2"
7886 "gpus:4,crypto_chips:2")
7887
7888 In this example, there are two group descriptions (implicitly separated
7889 by a semicolon.) The content of the first description is 2,gpus:2. This
7890 description specifies 2 groups, each of which requires 2 slots from a
7891 single GPU. The content of the second description is
7892 gpus:4,crypto_chips:2. This description does not specify a group count,
7893 so a default of 1 is assumed. This single group requires 4 slots from
7894 a single GPU and 2 slots from a single cryptography chip. In total, 3
7895 resource groups are specified for this test, each with its own unique
7896 requirements.
7897
7898 Note that the number of slots following the resource type specifies
7899 slots from a single instance of the resource. If the resource group can
7900 tolerate receiving slots from different instances of the same resource,
7901 it can indicate this by splitting the specification into multiple re‐
7902 quirements of one slot. For example:
7903
7904 add_test(NAME MyTest COMMAND MyExe)
7905 set_property(TEST MyTest PROPERTY RESOURCE_GROUPS
7906 "gpus:1,gpus:1,gpus:1,gpus:1")
7907
7908 In this case, the single resource group indicates that it needs four
7909 GPU slots, all of which may come from separate GPUs (though they don't
7910 have to; CTest may still assign slots from the same GPU.)
7911
7912 When CTest sets the environment variables for a test, it assigns a
7913 group number based on the group description, starting at 0 on the left
7914 and the number of groups minus 1 on the right. For example, in the ex‐
7915 ample above, the two groups in the first description would have IDs of
7916 0 and 1, and the single group in the second description would have an
7917 ID of 2.
7918
7919 Both the RESOURCE_GROUPS and RESOURCE_LOCK properties serve similar
7920 purposes, but they are distinct and orthogonal. Resources specified by
7921 RESOURCE_GROUPS do not affect RESOURCE_LOCK, and vice versa. Whereas
7922 RESOURCE_LOCK is a simpler property that is used for locking one global
7923 resource, RESOURCE_GROUPS is a more advanced property that allows mul‐
7924 tiple tests to simultaneously use multiple resources of the same type,
7925 specifying their requirements in a fine-grained manner.
7926
7927 RESOURCE_LOCK
7928 Specify a list of resources that are locked by this test.
7929
7930 If multiple tests specify the same resource lock, they are guaranteed
7931 not to run concurrently.
7932
7933 See also FIXTURES_REQUIRED if the resource requires any setup or
7934 cleanup steps.
7935
7936 Both the RESOURCE_GROUPS and RESOURCE_LOCK properties serve similar
7937 purposes, but they are distinct and orthogonal. Resources specified by
7938 RESOURCE_GROUPS do not affect RESOURCE_LOCK, and vice versa. Whereas
7939 RESOURCE_LOCK is a simpler property that is used for locking one global
7940 resource, RESOURCE_GROUPS is a more advanced property that allows mul‐
7941 tiple tests to simultaneously use multiple resources of the same type,
7942 specifying their requirements in a fine-grained manner.
7943
7944 RUN_SERIAL
7945 Do not run this test in parallel with any other test.
7946
7947 Use this option in conjunction with the ctest_test PARALLEL_LEVEL op‐
7948 tion to specify that this test should not be run in parallel with any
7949 other tests.
7950
7951 SKIP_REGULAR_EXPRESSION
7952 New in version 3.16.
7953
7954
7955 If the output matches this regular expression the test will be marked
7956 as skipped.
7957
7958 If set, if the output matches one of specified regular expressions, the
7959 test will be marked as skipped. Example:
7960
7961 set_property(TEST mytest PROPERTY
7962 SKIP_REGULAR_EXPRESSION "[^a-z]Skip" "SKIP" "Skipped"
7963 )
7964
7965 SKIP_REGULAR_EXPRESSION expects a list of regular expressions.
7966
7967 See also the SKIP_RETURN_CODE, PASS_REGULAR_EXPRESSION, and FAIL_REGU‐
7968 LAR_EXPRESSION test properties.
7969
7970 SKIP_RETURN_CODE
7971 Return code to mark a test as skipped.
7972
7973 Sometimes only a test itself can determine if all requirements for the
7974 test are met. If such a situation should not be considered a hard fail‐
7975 ure a return code of the process can be specified that will mark the
7976 test as Not Run if it is encountered. Valid values are in the range of
7977 0 to 255, inclusive.
7978
7979 See also the SKIP_REGULAR_EXPRESSION property.
7980
7981 TIMEOUT
7982 How many seconds to allow for this test.
7983
7984 This property if set will limit a test to not take more than the speci‐
7985 fied number of seconds to run. If it exceeds that the test process
7986 will be killed and ctest will move to the next test. This setting
7987 takes precedence over CTEST_TEST_TIMEOUT.
7988
7989 TIMEOUT_AFTER_MATCH
7990 New in version 3.6.
7991
7992
7993 Change a test's timeout duration after a matching line is encountered
7994 in its output.
7995
7996 Usage
7997 add_test(mytest ...)
7998 set_property(TEST mytest PROPERTY TIMEOUT_AFTER_MATCH "${seconds}" "${regex}")
7999
8000 Description
8001 Allow a test seconds to complete after regex is encountered in its out‐
8002 put.
8003
8004 When the test outputs a line that matches regex its start time is reset
8005 to the current time and its timeout duration is changed to seconds.
8006 Prior to this, the timeout duration is determined by the TIMEOUT prop‐
8007 erty or the CTEST_TEST_TIMEOUT variable if either of these are set.
8008 Because the test's start time is reset, its execution time will not in‐
8009 clude any time that was spent waiting for the matching output.
8010
8011 TIMEOUT_AFTER_MATCH is useful for avoiding spurious timeouts when your
8012 test must wait for some system resource to become available before it
8013 can execute. Set TIMEOUT to a longer duration that accounts for re‐
8014 source acquisition and use TIMEOUT_AFTER_MATCH to control how long the
8015 actual test is allowed to run.
8016
8017 If the required resource can be controlled by CTest you should use RE‐
8018 SOURCE_LOCK instead of TIMEOUT_AFTER_MATCH. This property should be
8019 used when only the test itself can determine when its required re‐
8020 sources are available.
8021
8022 WILL_FAIL
8023 If set to true, this will invert the pass/fail flag of the test.
8024
8025 This property can be used for tests that are expected to fail and re‐
8026 turn a non zero return code.
8027
8028 WORKING_DIRECTORY
8029 The directory from which the test executable will be called.
8030
8031 If this is not set, the test will be run with the working directory set
8032 to the binary directory associated with where the test was created
8033 (i.e. the CMAKE_CURRENT_BINARY_DIR for where add_test() was called).
8034
8036 ABSTRACT
8037 Is this source file an abstract class.
8038
8039 A property on a source file that indicates if the source file repre‐
8040 sents a class that is abstract. This only makes sense for languages
8041 that have a notion of an abstract class and it is only used by some
8042 tools that wrap classes into other languages.
8043
8044 AUTORCC_OPTIONS
8045 Additional options for rcc when using AUTORCC
8046
8047 This property holds additional command line options which will be used
8048 when rcc is executed during the build via AUTORCC, i.e. it is equiva‐
8049 lent to the optional OPTIONS argument of the qt4_add_resources() macro.
8050
8051 By default it is empty.
8052
8053 The options set on the .qrc source file may override AUTORCC_OPTIONS
8054 set on the target.
8055
8056 EXAMPLE
8057 # ...
8058 set_property(SOURCE resources.qrc PROPERTY AUTORCC_OPTIONS "--compress;9")
8059 # ...
8060
8061 AUTOUIC_OPTIONS
8062 Additional options for uic when using AUTOUIC
8063
8064 This property holds additional command line options which will be used
8065 when uic is executed during the build via AUTOUIC, i.e. it is equiva‐
8066 lent to the optional OPTIONS argument of the qt4_wrap_ui() macro.
8067
8068 By default it is empty.
8069
8070 The options set on the .ui source file may override AUTOUIC_OPTIONS set
8071 on the target.
8072
8073 EXAMPLE
8074 # ...
8075 set_property(SOURCE widget.ui PROPERTY AUTOUIC_OPTIONS "--no-protection")
8076 # ...
8077
8078 COMPILE_DEFINITIONS
8079 Preprocessor definitions for compiling a source file.
8080
8081 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
8082 list of preprocessor definitions using the syntax VAR or VAR=value.
8083 Function-style definitions are not supported. CMake will automatically
8084 escape the value correctly for the native build system (note that CMake
8085 language syntax may require escapes to specify some values). This
8086 property may be set on a per-configuration basis using the name COM‐
8087 PILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name (ex.
8088 COMPILE_DEFINITIONS_DEBUG).
8089
8090 CMake will automatically drop some definitions that are not supported
8091 by the native build tool. Xcode does not support per-configuration
8092 definitions on source files.
8093
8094 Disclaimer: Most native build tools have poor support for escaping cer‐
8095 tain values. CMake has work-arounds for many cases but some values may
8096 just not be possible to pass correctly. If a value does not seem to be
8097 escaped correctly, do not attempt to work-around the problem by adding
8098 escape sequences to the value. Your work-around may break in a future
8099 version of CMake that has improved escape support. Instead consider
8100 defining the macro in a (configured) header file. Then report the lim‐
8101 itation. Known limitations include:
8102
8103 # - broken almost everywhere
8104 ; - broken in VS IDE 7.0 and Borland Makefiles
8105 , - broken in VS IDE
8106 % - broken in some cases in NMake
8107 & | - broken in some cases on MinGW
8108 ^ < > \" - broken in most Make tools on Windows
8109
8110 CMake does not reject these values outright because they do work in
8111 some cases. Use with caution.
8112
8113 Contents of COMPILE_DEFINITIONS may use cmake-generator-expressions(7)
8114 with the syntax $<...>. See the cmake-generator-expressions(7) manual
8115 for available expressions. However, Xcode does not support per-config
8116 per-source settings, so expressions that depend on the build configura‐
8117 tion are not allowed with that generator.
8118
8119 Generator expressions should be preferred instead of setting the alter‐
8120 native per-configuration property.
8121
8122 COMPILE_FLAGS
8123 Additional flags to be added when compiling this source file.
8124
8125 The COMPILE_FLAGS property, managed as a string, sets additional com‐
8126 piler flags used that will be added to the list of compile flags when
8127 this source file builds. The flags will be added after target-wide
8128 flags (except in some cases not supported by the Visual Studio 9 2008
8129 generator).
8130
8131 Use COMPILE_DEFINITIONS to pass additional preprocessor definitions.
8132
8133 Contents of COMPILE_FLAGS may use "generator expressions" with the syn‐
8134 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
8135 able expressions. However, Xcode does not support per-config
8136 per-source settings, so expressions that depend on the build configura‐
8137 tion are not allowed with that generator.
8138
8139 NOTE:
8140 This property has been superseded by the COMPILE_OPTIONS property.
8141
8142 COMPILE_OPTIONS
8143 New in version 3.11.
8144
8145
8146 List of additional options to pass to the compiler.
8147
8148 This property holds a semicolon-separated list of options and will be
8149 added to the list of compile flags when this source file builds. The
8150 options will be added after target-wide options (except in some cases
8151 not supported by the Visual Studio 9 2008 generator).
8152
8153 Contents of COMPILE_OPTIONS may use "generator expressions" with the
8154 syntax $<...>. See the cmake-generator-expressions(7) manual for
8155 available expressions. However, Xcode does not support per-config
8156 per-source settings, so expressions that depend on the build configura‐
8157 tion are not allowed with that generator.
8158
8159 Usage example:
8160
8161 set_source_files_properties(foo.cpp PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter;-Wno-missing-field-initializer")
8162
8163 Related properties:
8164
8165 • Prefer this property over COMPILE_FLAGS.
8166
8167 • Use COMPILE_DEFINITIONS to pass additional preprocessor definitions.
8168
8169 • Use INCLUDE_DIRECTORIES to pass additional include directories.
8170
8171 Related commands:
8172
8173 • add_compile_options() for directory-wide settings
8174
8175 • target_compile_options() for target-specific settings
8176
8177 EXTERNAL_OBJECT
8178 If set to true then this is an object file.
8179
8180 If this property is set to True then the source file is really an ob‐
8181 ject file and should not be compiled. It will still be linked into the
8182 target though.
8183
8184 Fortran_FORMAT
8185 Set to FIXED or FREE to indicate the Fortran source layout.
8186
8187 This property tells CMake whether a given Fortran source file uses
8188 fixed-format or free-format. CMake will pass the corresponding format
8189 flag to the compiler. Consider using the target-wide Fortran_FORMAT
8190 property if all source files in a target share the same format.
8191
8192 NOTE:
8193 For some compilers, NAG, PGI and Solaris Studio, setting this to OFF
8194 will have no effect.
8195
8196 Fortran_PREPROCESS
8197 New in version 3.18.
8198
8199
8200 Control whether the Fortran source file should be unconditionally pre‐
8201 processed.
8202
8203 If unset or empty, rely on the compiler to determine whether the file
8204 should be preprocessed. If explicitly set to OFF then the file does not
8205 need to be preprocessed. If explicitly set to ON, then the file does
8206 need to be preprocessed as part of the compilation step.
8207
8208 When using the Ninja generator, all source files are first preprocessed
8209 in order to generate module dependency information. Setting this prop‐
8210 erty to OFF will make Ninja skip this step.
8211
8212 Consider using the target-wide Fortran_PREPROCESS property if all
8213 source files in a target need to be preprocessed.
8214
8215 GENERATED
8216 Is this source file generated as part of the build or CMake process.
8217
8218 Changed in version 3.20: The GENERATED source file property is now vis‐
8219 ible in all directories.
8220
8221
8222 Tells the internal CMake engine that a source file is generated by an
8223 outside process such as another build step, or the execution of CMake
8224 itself. This information is then used to exempt the file from any ex‐
8225 istence or validity checks.
8226
8227 Any file that is
8228
8229 • created by the execution of commands such as add_custom_command() and
8230 file(GENERATE)
8231
8232 • listed as one of the BYPRODUCTS of an add_custom_command() or
8233 add_custom_target() command, or
8234
8235 • created by a CMake AUTOGEN operation such as AUTOMOC, AUTORCC, or
8236 AUTOUIC
8237
8238 will be marked with the GENERATED property.
8239
8240 When a generated file created as the OUTPUT of an add_custom_command()
8241 command is explicitly listed as a source file for any target in the
8242 same directory scope (which usually means the same CMakeLists.txt
8243 file), CMake will automatically create a dependency to make sure the
8244 file is generated before building that target.
8245
8246 The Makefile Generators will remove GENERATED files during make clean.
8247
8248 Generated sources may be hidden in some IDE tools, while in others they
8249 might be shown. For the special case of sources generated by CMake's
8250 AUTOMOC, AUTORCC or AUTOUIC functionality, the AUTOGEN_SOURCE_GROUP,
8251 AUTOMOC_SOURCE_GROUP, AUTORCC_SOURCE_GROUP and AUTOUIC_SOURCE_GROUP
8252 target properties may influence where the generated sources are grouped
8253 in the project's file lists.
8254
8255 NOTE:
8256 Starting with CMake 3.20 the GENERATED source file property can be
8257 set and retrieved from any directory scope. It is an all-or-nothing
8258 property. It also can no longer be removed or unset if it was set
8259 to TRUE. Policy CMP0118 was introduced to allow supporting the OLD
8260 behavior for some time.
8261
8262 HEADER_FILE_ONLY
8263 Is this source file only a header file.
8264
8265 A property on a source file that indicates if the source file is a
8266 header file with no associated implementation. This is set automati‐
8267 cally based on the file extension and is used by CMake to determine if
8268 certain dependency information should be computed.
8269
8270 By setting this property to ON, you can disable compilation of the
8271 given source file, even if it should be compiled because it is part of
8272 the library's/executable's sources.
8273
8274 This is useful if you have some source files which you somehow
8275 pre-process, and then add these pre-processed sources via add_library()
8276 or add_executable(). Normally, in IDE, there would be no reference of
8277 the original sources, only of these pre-processed sources. So by set‐
8278 ting this property for all the original source files to ON, and then
8279 either calling add_library() or add_executable() while passing both the
8280 pre-processed sources and the original sources, or by using tar‐
8281 get_sources() to add original source files will do exactly what would
8282 one expect, i.e. the original source files would be visible in IDE,
8283 and will not be built.
8284
8285 INCLUDE_DIRECTORIES
8286 New in version 3.11.
8287
8288
8289 List of preprocessor include file search directories.
8290
8291 This property holds a semicolon-separated list of paths and will be
8292 added to the list of include directories when this source file builds.
8293 These directories will take precedence over directories defined at tar‐
8294 get level except for Xcode generator due to technical limitations.
8295
8296 Relative paths should not be added to this property directly.
8297
8298 Contents of INCLUDE_DIRECTORIES may use "generator expressions" with
8299 the syntax $<...>. See the cmake-generator-expressions(7) manual for
8300 available expressions. However, Xcode does not support per-config
8301 per-source settings, so expressions that depend on the build configura‐
8302 tion are not allowed with that generator.
8303
8304 KEEP_EXTENSION
8305 Make the output file have the same extension as the source file.
8306
8307 If this property is set then the file extension of the output file will
8308 be the same as that of the source file. Normally the output file ex‐
8309 tension is computed based on the language of the source file, for exam‐
8310 ple .cxx will go to a .o extension.
8311
8312 LABELS
8313 Specify a list of text labels associated with a source file.
8314
8315 This property has meaning only when the source file is listed in a tar‐
8316 get whose LABELS property is also set. No other semantics are cur‐
8317 rently specified.
8318
8319 LANGUAGE
8320 Specify the programming language in which a source file is written.
8321
8322 A property that can be set to indicate what programming language the
8323 source file is. If it is not set the language is determined based on
8324 the file extension. Typical values are CXX (i.e. C++), C, CSharp,
8325 CUDA, Fortran, HIP, ISPC, and ASM. Setting this property for a file
8326 means this file will be compiled. Do not set this for headers or files
8327 that should not be compiled.
8328
8329 Changed in version 3.20: Setting this property causes the source file
8330 to be compiled as the specified language, using explicit flags if pos‐
8331 sible. Previously it only caused the specified language's compiler to
8332 be used. See policy CMP0119.
8333
8334
8335 LOCATION
8336 The full path to a source file.
8337
8338 A read only property on a SOURCE FILE that contains the full path to
8339 the source file.
8340
8341 MACOSX_PACKAGE_LOCATION
8342 Place a source file inside a Application Bundle (MACOSX_BUNDLE), Core
8343 Foundation Bundle (BUNDLE), or Framework Bundle (FRAMEWORK). It is ap‐
8344 plicable for macOS and iOS.
8345
8346 Executable targets with the MACOSX_BUNDLE property set are built as
8347 macOS or iOS application bundles on Apple platforms. Shared library
8348 targets with the FRAMEWORK property set are built as macOS or iOS
8349 frameworks on Apple platforms. Module library targets with the BUNDLE
8350 property set are built as macOS CFBundle bundles on Apple platforms.
8351 Source files listed in the target with this property set will be copied
8352 to a directory inside the bundle or framework content folder specified
8353 by the property value. For macOS Application Bundles the content
8354 folder is <name>.app/Contents. For macOS Frameworks the content folder
8355 is <name>.framework/Versions/<version>. For macOS CFBundles the con‐
8356 tent folder is <name>.bundle/Contents (unless the extension is
8357 changed). See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target
8358 properties for specifying files meant for Headers, PrivateHeaders, or
8359 Resources directories.
8360
8361 If the specified location is equal to Resources, the resulting location
8362 will be the same as if the RESOURCE property had been used. If the
8363 specified location is a sub-folder of Resources, it will be placed into
8364 the respective sub-folder. Note: For iOS Apple uses a flat bundle lay‐
8365 out where no Resources folder exist. Therefore CMake strips the Re‐
8366 sources folder name from the specified location.
8367
8368 OBJECT_DEPENDS
8369 Additional files on which a compiled object file depends.
8370
8371 Specifies a semicolon-separated list of full-paths to files on which
8372 any object files compiled from this source file depend. On Makefile
8373 Generators and the Ninja generator an object file will be recompiled if
8374 any of the named files is newer than it. Visual Studio Generators and
8375 the Xcode generator cannot implement such compilation dependencies.
8376
8377 This property need not be used to specify the dependency of a source
8378 file on a generated header file that it includes. Although the prop‐
8379 erty was originally introduced for this purpose, it is no longer neces‐
8380 sary. If the generated header file is created by a custom command in
8381 the same target as the source file, the automatic dependency scanning
8382 process will recognize the dependency. If the generated header file is
8383 created by another target, an inter-target dependency should be created
8384 with the add_dependencies() command (if one does not already exist due
8385 to linking relationships).
8386
8387 OBJECT_OUTPUTS
8388 Additional outputs for a Ninja or Makefile Generators rule.
8389
8390 Additional outputs created by compilation of this source file. If any
8391 of these outputs is missing the object will be recompiled. This is
8392 supported only on the Ninja and Makefile Generators and will be ignored
8393 on other generators.
8394
8395 This property supports generator expressions.
8396
8397 SKIP_AUTOGEN
8398 New in version 3.8.
8399
8400
8401 Exclude the source file from AUTOMOC, AUTOUIC and AUTORCC processing
8402 (for Qt projects).
8403
8404 For finer exclusion control see SKIP_AUTOMOC, SKIP_AUTOUIC and SKIP_AU‐
8405 TORCC.
8406
8407 EXAMPLE
8408 # ...
8409 set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)
8410 # ...
8411
8412 SKIP_AUTOMOC
8413 New in version 3.8.
8414
8415
8416 Exclude the source file from AUTOMOC processing (for Qt projects).
8417
8418 For broader exclusion control see SKIP_AUTOGEN.
8419
8420 EXAMPLE
8421 # ...
8422 set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON)
8423 # ...
8424
8425 SKIP_AUTORCC
8426 New in version 3.8.
8427
8428
8429 Exclude the source file from AUTORCC processing (for Qt projects).
8430
8431 For broader exclusion control see SKIP_AUTOGEN.
8432
8433 EXAMPLE
8434 # ...
8435 set_property(SOURCE file.qrc PROPERTY SKIP_AUTORCC ON)
8436 # ...
8437
8438 SKIP_AUTOUIC
8439 New in version 3.8.
8440
8441
8442 Exclude the source file from AUTOUIC processing (for Qt projects).
8443
8444 SKIP_AUTOUIC can be set on C++ header and source files and on .ui
8445 files.
8446
8447 For broader exclusion control see SKIP_AUTOGEN.
8448
8449 EXAMPLE
8450 # ...
8451 set_property(SOURCE file.h PROPERTY SKIP_AUTOUIC ON)
8452 set_property(SOURCE file.cpp PROPERTY SKIP_AUTOUIC ON)
8453 set_property(SOURCE widget.ui PROPERTY SKIP_AUTOUIC ON)
8454 # ...
8455
8456 SKIP_PRECOMPILE_HEADERS
8457 New in version 3.16.
8458
8459
8460 Is this source file skipped by PRECOMPILE_HEADERS feature.
8461
8462 This property helps with build problems that one would run into when
8463 using the PRECOMPILE_HEADERS feature.
8464
8465 One example would be the usage of Objective-C (*.m) files, and Objec‐
8466 tive-C++ (*.mm) files, which lead to compilation failure because they
8467 are treated (in case of Ninja / Makefile generator) as C, and CXX re‐
8468 spectively. The precompile headers are not compatible between lan‐
8469 guages.
8470
8471 SKIP_UNITY_BUILD_INCLUSION
8472 New in version 3.16.
8473
8474
8475 Setting this property to true ensures the source file will be skipped
8476 by unity builds when its associated target has its UNITY_BUILD property
8477 set to true. The source file will instead be compiled on its own in
8478 the same way as it would with unity builds disabled.
8479
8480 This property helps with "ODR (One definition rule)" problems where
8481 combining a particular source file with others might lead to build er‐
8482 rors or other unintended side effects.
8483
8484 Swift_DEPENDENCIES_FILE
8485 New in version 3.15.
8486
8487
8488 This property sets the path for the Swift dependency file (swiftdeps)
8489 for the source. If one is not specified, it will default to <OB‐
8490 JECT>.swiftdeps.
8491
8492 Swift_DIAGNOSTICS_FILE
8493 New in version 3.15.
8494
8495
8496 This property controls where the Swift diagnostics are serialized.
8497
8498 SYMBOLIC
8499 Is this just a name for a rule.
8500
8501 If SYMBOLIC (boolean) is set to True the build system will be informed
8502 that the source file is not actually created on disk but instead used
8503 as a symbolic name for a build rule.
8504
8505 UNITY_GROUP
8506 New in version 3.18.
8507
8508
8509 This property controls which bucket the source will be part of when the
8510 UNITY_BUILD_MODE is set to GROUP.
8511
8512 VS_COPY_TO_OUT_DIR
8513 New in version 3.8.
8514
8515
8516 Sets the <CopyToOutputDirectory> tag for a source file in a Visual Stu‐
8517 dio project file. Valid values are Never, Always and PreserveNewest.
8518
8519 VS_CSHARP_<tagname>
8520 New in version 3.8.
8521
8522
8523 Visual Studio and CSharp source-file-specific configuration.
8524
8525 Tell the Visual Studio generators to set the source file tag <tagname>
8526 to a given value in the generated Visual Studio CSharp project. Ignored
8527 on other generators and languages. This property can be used to define
8528 dependencies between source files or set any other Visual Studio spe‐
8529 cific parameters.
8530
8531 Example usage:
8532
8533 set_source_files_property(<filename>
8534 PROPERTIES
8535 VS_CSHARP_DependentUpon <other file>
8536 VS_CSHARP_SubType "Form")
8537
8538 VS_DEPLOYMENT_CONTENT
8539 New in version 3.1.
8540
8541
8542 Mark a source file as content for deployment with a Windows Phone or
8543 Windows Store application when built with a Visual Studio generators.
8544 The value must evaluate to either 1 or 0 and may use generator expres‐
8545 sions to make the choice based on the build configuration. The .vcx‐
8546 proj file entry for the source file will be marked either Deployment‐
8547 Content or ExcludedFromBuild for values 1 and 0, respectively.
8548
8549 VS_DEPLOYMENT_LOCATION
8550 New in version 3.1.
8551
8552
8553 Specifies the deployment location for a content source file with a Win‐
8554 dows Phone or Windows Store application when built with a Visual Studio
8555 generators. This property is only applicable when using VS_DEPLOY‐
8556 MENT_CONTENT. The value represent the path relative to the app package
8557 and applies to all configurations.
8558
8559 VS_INCLUDE_IN_VSIX
8560 New in version 3.8.
8561
8562
8563 Boolean property to specify if the file should be included within a
8564 VSIX (Visual Studio Integration Extension) extension package. This is
8565 needed for development of Visual Studio extensions.
8566
8567 VS_RESOURCE_GENERATOR
8568 New in version 3.8.
8569
8570
8571 This property allows to specify the resource generator to be used on
8572 this file. It defaults to PublicResXFileCodeGenerator if not set.
8573
8574 This property only applies to C# projects.
8575
8576 VS_SETTINGS
8577 New in version 3.18.
8578
8579
8580 Set any item metadata on a file.
8581
8582 New in version 3.22: This property is honored for all source file
8583 types. Previously it worked only for non-built files.
8584
8585
8586 Takes a list of Key=Value pairs. Tells the Visual Studio generator to
8587 set Key to Value as item metadata on the file.
8588
8589 For example:
8590
8591 set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2")
8592
8593 will set Key to Value and Key2 to Value2 on the file.hlsl item as meta‐
8594 data.
8595
8596 Generator expressions are supported.
8597
8598 VS_SHADER_DISABLE_OPTIMIZATIONS
8599 New in version 3.11.
8600
8601
8602 Disable compiler optimizations for an .hlsl source file. This adds the
8603 -Od flag to the command line for the FxCompiler tool. Specify the
8604 value true for this property to disable compiler optimizations.
8605
8606 VS_SHADER_ENABLE_DEBUG
8607 New in version 3.11.
8608
8609
8610 Enable debugging information for an .hlsl source file. This adds the
8611 -Zi flag to the command line for the FxCompiler tool. Specify the
8612 value true to generate debugging information for the compiled shader.
8613
8614 VS_SHADER_ENTRYPOINT
8615 New in version 3.1.
8616
8617
8618 Specifies the name of the entry point for the shader of a .hlsl source
8619 file.
8620
8621 VS_SHADER_FLAGS
8622 New in version 3.2.
8623
8624
8625 Set additional Visual Studio shader flags of a .hlsl source file.
8626
8627 VS_SHADER_MODEL
8628 New in version 3.1.
8629
8630
8631 Specifies the shader model of a .hlsl source file. Some shader types
8632 can only be used with recent shader models
8633
8634 VS_SHADER_OBJECT_FILE_NAME
8635 New in version 3.12.
8636
8637
8638 Specifies a file name for the compiled shader object file for an .hlsl
8639 source file. This adds the -Fo flag to the command line for the FxCom‐
8640 piler tool.
8641
8642 VS_SHADER_OUTPUT_HEADER_FILE
8643 New in version 3.10.
8644
8645
8646 Set filename for output header file containing object code of a .hlsl
8647 source file.
8648
8649 VS_SHADER_TYPE
8650 New in version 3.1.
8651
8652
8653 Set the Visual Studio shader type of a .hlsl source file.
8654
8655 VS_SHADER_VARIABLE_NAME
8656 New in version 3.10.
8657
8658
8659 Set name of variable in header file containing object code of a .hlsl
8660 source file.
8661
8662 VS_TOOL_OVERRIDE
8663 New in version 3.7.
8664
8665
8666 Override the default Visual Studio tool that will be applied to the
8667 source file with a new tool not based on the extension of the file.
8668
8669 VS_XAML_TYPE
8670 New in version 3.3.
8671
8672
8673 Mark a Extensible Application Markup Language (XAML) source file as a
8674 different type than the default Page. The most common usage would be
8675 to set the default App.xaml file as ApplicationDefinition.
8676
8677 WRAP_EXCLUDE
8678 Exclude this source file from any code wrapping techniques.
8679
8680 Some packages can wrap source files into alternate languages to provide
8681 additional functionality.
8682
8683 For example, C++ code can be wrapped into Java or Python, using SWIG.
8684 If WRAP_EXCLUDE is set to True, that indicates that this source file
8685 should not be wrapped.
8686
8687 XCODE_EXPLICIT_FILE_TYPE
8688 New in version 3.1.
8689
8690
8691 Set the Xcode explicitFileType attribute on its reference to a source
8692 file. CMake computes a default based on file extension but can be told
8693 explicitly with this property.
8694
8695 See also XCODE_LAST_KNOWN_FILE_TYPE.
8696
8697 XCODE_FILE_ATTRIBUTES
8698 New in version 3.7.
8699
8700
8701 Add values to the Xcode ATTRIBUTES setting on its reference to a source
8702 file. Among other things, this can be used to set the role on a .mig
8703 file:
8704
8705 set_source_files_properties(defs.mig
8706 PROPERTIES
8707 XCODE_FILE_ATTRIBUTES "Client;Server"
8708 )
8709
8710 XCODE_LAST_KNOWN_FILE_TYPE
8711 New in version 3.1.
8712
8713
8714 Set the Xcode lastKnownFileType attribute on its reference to a source
8715 file. CMake computes a default based on file extension but can be told
8716 explicitly with this property.
8717
8718 See also XCODE_EXPLICIT_FILE_TYPE, which is preferred over this prop‐
8719 erty if set.
8720
8722 ADVANCED
8723 True if entry should be hidden by default in GUIs.
8724
8725 This is a boolean value indicating whether the entry is considered in‐
8726 teresting only for advanced configuration. The mark_as_advanced() com‐
8727 mand modifies this property.
8728
8729 HELPSTRING
8730 Help associated with entry in GUIs.
8731
8732 This string summarizes the purpose of an entry to help users set it
8733 through a CMake GUI.
8734
8735 MODIFIED
8736 Internal management property. Do not set or get.
8737
8738 This is an internal cache entry property managed by CMake to track in‐
8739 teractive user modification of entries. Ignore it.
8740
8741 STRINGS
8742 Enumerate possible STRING entry values for GUI selection.
8743
8744 For cache entries with type STRING, this enumerates a set of values.
8745 CMake GUIs may use this to provide a selection widget instead of a
8746 generic string entry field. This is for convenience only. CMake does
8747 not enforce that the value matches one of those listed.
8748
8749 TYPE
8750 Widget type for entry in GUIs.
8751
8752 Cache entry values are always strings, but CMake GUIs present widgets
8753 to help users set values. The GUIs use this property as a hint to de‐
8754 termine the widget type. Valid TYPE values are:
8755
8756 BOOL = Boolean ON/OFF value.
8757 PATH = Path to a directory.
8758 FILEPATH = Path to a file.
8759 STRING = Generic string value.
8760 INTERNAL = Do not present in GUI at all.
8761 STATIC = Value managed by CMake, do not change.
8762 UNINITIALIZED = Type not yet specified.
8763
8764 Generally the TYPE of a cache entry should be set by the command which
8765 creates it ( set(), option(), find_library(), etc.).
8766
8767 VALUE
8768 Value of a cache entry.
8769
8770 This property maps to the actual value of a cache entry. Setting this
8771 property always sets the value without checking, so use with care.
8772
8774 CPACK_DESKTOP_SHORTCUTS
8775 New in version 3.3.
8776
8777
8778 Species a list of shortcut names that should be created on the Desktop
8779 for this file.
8780
8781 The property is currently only supported by the CPack WIX Generator.
8782
8783 CPACK_NEVER_OVERWRITE
8784 New in version 3.1.
8785
8786
8787 Request that this file not be overwritten on install or reinstall.
8788
8789 The property is currently only supported by the CPack WIX Generator.
8790
8791 CPACK_PERMANENT
8792 New in version 3.1.
8793
8794
8795 Request that this file not be removed on uninstall.
8796
8797 The property is currently only supported by the CPack WIX Generator.
8798
8799 CPACK_START_MENU_SHORTCUTS
8800 New in version 3.3.
8801
8802
8803 Species a list of shortcut names that should be created in the Start
8804 Menu for this file.
8805
8806 The property is currently only supported by the CPack WIX Generator.
8807
8808 CPACK_STARTUP_SHORTCUTS
8809 New in version 3.3.
8810
8811
8812 Species a list of shortcut names that should be created in the Startup
8813 folder for this file.
8814
8815 The property is currently only supported by the CPack WIX Generator.
8816
8817 CPACK_WIX_ACL
8818 New in version 3.1.
8819
8820
8821 Specifies access permissions for files or directories installed by a
8822 WiX installer.
8823
8824 The property can contain multiple list entries, each of which has to
8825 match the following format.
8826
8827 <user>[@<domain>]=<permission>[,<permission>]
8828
8829 <user> and <domain> specify the windows user and domain for which the
8830 <Permission> element should be generated.
8831
8832 <permission> is any of the YesNoType attributes listed here:
8833
8834 http://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html
8835
8836 The property is currently only supported by the CPack WIX Generator.
8837
8839 ADDITIONAL_MAKE_CLEAN_FILES
8840 Deprecated since version 3.15: Use ADDITIONAL_CLEAN_FILES instead.
8841
8842
8843 Additional files to remove during the clean stage.
8844
8845 A ;-list of files that will be removed as a part of the make clean tar‐
8846 get.
8847
8848 Arguments to ADDITIONAL_MAKE_CLEAN_FILES may use generator expressions.
8849
8850 This property only works for the Makefile generators. It is ignored on
8851 other generators.
8852
8853 COMPILE_DEFINITIONS_<CONFIG>
8854 Ignored. See CMake Policy CMP0043.
8855
8856 Per-configuration preprocessor definitions in a directory.
8857
8858 This is the configuration-specific version of COMPILE_DEFINITIONS where
8859 <CONFIG> is an upper-case name (ex. COMPILE_DEFINITIONS_DEBUG).
8860
8861 This property will be initialized in each directory by its value in the
8862 directory's parent.
8863
8864 Contents of COMPILE_DEFINITIONS_<CONFIG> may use "generator expres‐
8865 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
8866 manual for available expressions. See the cmake-buildsystem(7) manual
8867 for more on defining buildsystem properties.
8868
8869 Generator expressions should be preferred instead of setting this prop‐
8870 erty.
8871
8872 TEST_INCLUDE_FILE
8873 Deprecated. Use TEST_INCLUDE_FILES instead.
8874
8875 A cmake file that will be included when ctest is run.
8876
8877 If you specify TEST_INCLUDE_FILE, that file will be included and pro‐
8878 cessed when ctest is run on the directory.
8879
8881 COMPILE_DEFINITIONS_<CONFIG>
8882 Ignored. See CMake Policy CMP0043.
8883
8884 Per-configuration preprocessor definitions on a target.
8885
8886 This is the configuration-specific version of COMPILE_DEFINITIONS where
8887 <CONFIG> is an upper-case name (ex. COMPILE_DEFINITIONS_DEBUG).
8888
8889 Contents of COMPILE_DEFINITIONS_<CONFIG> may use "generator expres‐
8890 sions" with the syntax $<...>. See the cmake-generator-expressions(7)
8891 manual for available expressions. See the cmake-buildsystem(7) manual
8892 for more on defining buildsystem properties.
8893
8894 Generator expressions should be preferred instead of setting this prop‐
8895 erty.
8896
8897 POST_INSTALL_SCRIPT
8898 Deprecated install support.
8899
8900 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old
8901 way to specify CMake scripts to run before and after installing a tar‐
8902 get. They are used only when the old INSTALL_TARGETS command is used
8903 to install the target. Use the install() command instead.
8904
8905 PRE_INSTALL_SCRIPT
8906 Deprecated install support.
8907
8908 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old
8909 way to specify CMake scripts to run before and after installing a tar‐
8910 get. They are used only when the old INSTALL_TARGETS command is used
8911 to install the target. Use the install() command instead.
8912
8914 COMPILE_DEFINITIONS_<CONFIG>
8915 Ignored. See CMake Policy CMP0043.
8916
8917 Per-configuration preprocessor definitions on a source file.
8918
8919 This is the configuration-specific version of COMPILE_DEFINITIONS.
8920 Note that Xcode does not support per-configuration source file flags so
8921 this property will be ignored by the Xcode generator.
8922
8924 2000-2021 Kitware, Inc. and Contributors
8925
8926
8927
8928
89293.22.0 Dec 02, 2021 CMAKE-PROPERTIES(7)