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 Name of the source_group() for AUTOMOC and AUTORCC generated files.
29
30 Files generated by AUTOMOC and AUTORCC are not always known at config‐
31 ure time and therefore can’t be passed to source_group().
32 AUTOGEN_SOURCE_GROUP an be used instead to generate or select a source
33 group for AUTOMOC and AUTORCC generated files.
34
35 For AUTOMOC and AUTORCC specific overrides see AUTOMOC_SOURCE_GROUP and
36 AUTORCC_SOURCE_GROUP respectively.
37
38 AUTOGEN_TARGETS_FOLDER
39 Name of FOLDER for *_autogen targets that are added automatically by
40 CMake for targets for which AUTOMOC is enabled.
41
42 If not set, CMake uses the FOLDER property of the parent target as a
43 default value for this property. See also the documentation for the
44 FOLDER target property and the AUTOMOC target property.
45
46 AUTOMOC_SOURCE_GROUP
47 Name of the source_group() for AUTOMOC generated files.
48
49 When set this is used instead of AUTOGEN_SOURCE_GROUP for files gener‐
50 ated by AUTOMOC.
51
52 AUTOMOC_TARGETS_FOLDER
53 Name of FOLDER for *_autogen targets that are added automatically by
54 CMake for targets for which AUTOMOC is enabled.
55
56 This property is obsolete. Use AUTOGEN_TARGETS_FOLDER instead.
57
58 If not set, CMake uses the FOLDER property of the parent target as a
59 default value for this property. See also the documentation for the
60 FOLDER target property and the AUTOMOC target property.
61
62 AUTORCC_SOURCE_GROUP
63 Name of the source_group() for AUTORCC generated files.
64
65 When set this is used instead of AUTOGEN_SOURCE_GROUP for files gener‐
66 ated by AUTORCC.
67
68 CMAKE_C_KNOWN_FEATURES
69 List of C features known to this version of CMake.
70
71 The features listed in this global property may be known to be avail‐
72 able to the C compiler. If the feature is available with the C com‐
73 piler, it will be listed in the CMAKE_C_COMPILE_FEATURES variable.
74
75 The features listed here may be used with the target_compile_features()
76 command. See the cmake-compile-features(7) manual for information on
77 compile features and a list of supported compilers.
78
79 The features known to this version of CMake are:
80
81 c_std_90
82 Compiler mode is at least C 90.
83
84 c_std_99
85 Compiler mode is at least C 99.
86
87 c_std_11
88 Compiler mode is at least C 11.
89
90 c_function_prototypes
91 Function prototypes, as defined in ISO/IEC 9899:1990.
92
93 c_restrict
94 restrict keyword, as defined in ISO/IEC 9899:1999.
95
96 c_static_assert
97 Static assert, as defined in ISO/IEC 9899:2011.
98
99 c_variadic_macros
100 Variadic macros, as defined in ISO/IEC 9899:1999.
101
102 CMAKE_CUDA_KNOWN_FEATURES
103 List of CUDA features known to this version of CMake.
104
105 The features listed in this global property may be known to be avail‐
106 able to the CUDA compiler. If the feature is available with the C++
107 compiler, it will be listed in the CMAKE_CUDA_COMPILE_FEATURES vari‐
108 able.
109
110 The features listed here may be used with the target_compile_features()
111 command. See the cmake-compile-features(7) manual for information on
112 compile features and a list of supported compilers.
113
114 The features known to this version of CMake are:
115
116 cuda_std_03
117 Compiler mode is at least CUDA/C++ 03.
118
119 cuda_std_11
120 Compiler mode is at least CUDA/C++ 11.
121
122 cuda_std_14
123 Compiler mode is at least CUDA/C++ 14.
124
125 cuda_std_17
126 Compiler mode is at least CUDA/C++ 17.
127
128 cuda_std_20
129 Compiler mode is at least CUDA/C++ 20.
130
131 CMAKE_CXX_KNOWN_FEATURES
132 List of C++ features known to this version of CMake.
133
134 The features listed in this global property may be known to be avail‐
135 able to the C++ compiler. If the feature is available with the C++
136 compiler, it will be listed in the CMAKE_CXX_COMPILE_FEATURES variable.
137
138 The features listed here may be used with the target_compile_features()
139 command. See the cmake-compile-features(7) manual for information on
140 compile features and a list of supported compilers.
141
142 The features known to this version of CMake are:
143
144 cxx_std_98
145 Compiler mode is at least C++ 98.
146
147 cxx_std_11
148 Compiler mode is at least C++ 11.
149
150 cxx_std_14
151 Compiler mode is at least C++ 14.
152
153 cxx_std_17
154 Compiler mode is at least C++ 17.
155
156 cxx_std_20
157 Compiler mode is at least C++ 20.
158
159 cxx_aggregate_default_initializers
160 Aggregate default initializers, as defined in N3605.
161
162 cxx_alias_templates
163 Template aliases, as defined in N2258.
164
165 cxx_alignas
166 Alignment control alignas, as defined in N2341.
167
168 cxx_alignof
169 Alignment control alignof, as defined in N2341.
170
171 cxx_attributes
172 Generic attributes, as defined in N2761.
173
174 cxx_attribute_deprecated
175 [[deprecated]] attribute, as defined in N3760.
176
177 cxx_auto_type
178 Automatic type deduction, as defined in N1984.
179
180 cxx_binary_literals
181 Binary literals, as defined in N3472.
182
183 cxx_constexpr
184 Constant expressions, as defined in N2235.
185
186 cxx_contextual_conversions
187 Contextual conversions, as defined in N3323.
188
189 cxx_decltype_incomplete_return_types
190 Decltype on incomplete return types, as defined in N3276.
191
192 cxx_decltype
193 Decltype, as defined in N2343.
194
195 cxx_decltype_auto
196 decltype(auto) semantics, as defined in N3638.
197
198 cxx_default_function_template_args
199 Default template arguments for function templates, as defined in
200 DR226
201
202 cxx_defaulted_functions
203 Defaulted functions, as defined in N2346.
204
205 cxx_defaulted_move_initializers
206 Defaulted move initializers, as defined in N3053.
207
208 cxx_delegating_constructors
209 Delegating constructors, as defined in N1986.
210
211 cxx_deleted_functions
212 Deleted functions, as defined in N2346.
213
214 cxx_digit_separators
215 Digit separators, as defined in N3781.
216
217 cxx_enum_forward_declarations
218 Enum forward declarations, as defined in N2764.
219
220 cxx_explicit_conversions
221 Explicit conversion operators, as defined in N2437.
222
223 cxx_extended_friend_declarations
224 Extended friend declarations, as defined in N1791.
225
226 cxx_extern_templates
227 Extern templates, as defined in N1987.
228
229 cxx_final
230 Override control final keyword, as defined in N2928, N3206 and
231 N3272.
232
233 cxx_func_identifier
234 Predefined __func__ identifier, as defined in N2340.
235
236 cxx_generalized_initializers
237 Initializer lists, as defined in N2672.
238
239 cxx_generic_lambdas
240 Generic lambdas, as defined in N3649.
241
242 cxx_inheriting_constructors
243 Inheriting constructors, as defined in N2540.
244
245 cxx_inline_namespaces
246 Inline namespaces, as defined in N2535.
247
248 cxx_lambdas
249 Lambda functions, as defined in N2927.
250
251 cxx_lambda_init_captures
252 Initialized lambda captures, as defined in N3648.
253
254 cxx_local_type_template_args
255 Local and unnamed types as template arguments, as defined in
256 N2657.
257
258 cxx_long_long_type
259 long long type, as defined in N1811.
260
261 cxx_noexcept
262 Exception specifications, as defined in N3050.
263
264 cxx_nonstatic_member_init
265 Non-static data member initialization, as defined in N2756.
266
267 cxx_nullptr
268 Null pointer, as defined in N2431.
269
270 cxx_override
271 Override control override keyword, as defined in N2928, N3206
272 and N3272.
273
274 cxx_range_for
275 Range-based for, as defined in N2930.
276
277 cxx_raw_string_literals
278 Raw string literals, as defined in N2442.
279
280 cxx_reference_qualified_functions
281 Reference qualified functions, as defined in N2439.
282
283 cxx_relaxed_constexpr
284 Relaxed constexpr, as defined in N3652.
285
286 cxx_return_type_deduction
287 Return type deduction on normal functions, as defined in N3386.
288
289 cxx_right_angle_brackets
290 Right angle bracket parsing, as defined in N1757.
291
292 cxx_rvalue_references
293 R-value references, as defined in N2118.
294
295 cxx_sizeof_member
296 Size of non-static data members, as defined in N2253.
297
298 cxx_static_assert
299 Static assert, as defined in N1720.
300
301 cxx_strong_enums
302 Strongly typed enums, as defined in N2347.
303
304 cxx_thread_local
305 Thread-local variables, as defined in N2659.
306
307 cxx_trailing_return_types
308 Automatic function return type, as defined in N2541.
309
310 cxx_unicode_literals
311 Unicode string literals, as defined in N2442.
312
313 cxx_uniform_initialization
314 Uniform initialization, as defined in N2640.
315
316 cxx_unrestricted_unions
317 Unrestricted unions, as defined in N2544.
318
319 cxx_user_literals
320 User-defined literals, as defined in N2765.
321
322 cxx_variable_templates
323 Variable templates, as defined in N3651.
324
325 cxx_variadic_macros
326 Variadic macros, as defined in N1653.
327
328 cxx_variadic_templates
329 Variadic templates, as defined in N2242.
330
331 cxx_template_template_parameters
332 Template template parameters, as defined in ISO/IEC 14882:1998.
333
334 CMAKE_ROLE
335 Tells what mode the current running script is in. Could be one of sev‐
336 eral values:
337
338 PROJECT
339 Running in project mode (processing a CMakeLists.txt file).
340
341 SCRIPT Running in -P script mode.
342
343 FIND_PACKAGE
344 Running in --find-package mode.
345
346 CTEST Running in CTest script mode.
347
348 CPACK Running in CPack.
349
350 DEBUG_CONFIGURATIONS
351 Specify which configurations are for debugging.
352
353 The value must be a semi-colon separated list of configuration names.
354 Currently this property is used only by the target_link_libraries()
355 command. Additional uses may be defined in the future.
356
357 This property must be set at the top level of the project and before
358 the first target_link_libraries() command invocation. If any entry in
359 the list does not match a valid configuration for the project the
360 behavior is undefined.
361
362 DISABLED_FEATURES
363 List of features which are disabled during the CMake run.
364
365 List of features which are disabled during the CMake run. By default
366 it contains the names of all packages which were not found. This is
367 determined using the <NAME>_FOUND variables. Packages which are
368 searched QUIET are not listed. A project can add its own features to
369 this list. This property is used by the macros in FeatureSum‐
370 mary.cmake.
371
372 ECLIPSE_EXTRA_CPROJECT_CONTENTS
373 Additional contents to be inserted into the generated Eclipse cproject
374 file.
375
376 The cproject file defines the CDT specific information. Some third
377 party IDE’s are based on Eclipse with the addition of other information
378 specific to that IDE. Through this property, it is possible to add
379 this additional contents to the generated project. It is expected to
380 contain valid XML.
381
382 Also see the ECLIPSE_EXTRA_NATURES property.
383
384 ECLIPSE_EXTRA_NATURES
385 List of natures to add to the generated Eclipse project file.
386
387 Eclipse projects specify language plugins by using natures. This prop‐
388 erty should be set to the unique identifier for a nature (which looks
389 like a Java package name).
390
391 Also see the ECLIPSE_EXTRA_CPROJECT_CONTENTS property.
392
393 ENABLED_FEATURES
394 List of features which are enabled during the CMake run.
395
396 List of features which are enabled during the CMake run. By default it
397 contains the names of all packages which were found. This is deter‐
398 mined using the <NAME>_FOUND variables. Packages which are searched
399 QUIET are not listed. A project can add its own features to this list.
400 This property is used by the macros in FeatureSummary.cmake.
401
402 ENABLED_LANGUAGES
403 Read-only property that contains the list of currently enabled lan‐
404 guages
405
406 Set to list of currently enabled languages.
407
408 FIND_LIBRARY_USE_LIB32_PATHS
409 Whether the find_library() command should automatically search lib32
410 directories.
411
412 FIND_LIBRARY_USE_LIB32_PATHS is a boolean specifying whether the
413 find_library() command should automatically search the lib32 variant of
414 directories called lib in the search path when building 32-bit bina‐
415 ries.
416
417 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
418
419 FIND_LIBRARY_USE_LIB64_PATHS
420 Whether find_library() should automatically search lib64 directories.
421
422 FIND_LIBRARY_USE_LIB64_PATHS is a boolean specifying whether the
423 find_library() command should automatically search the lib64 variant of
424 directories called lib in the search path when building 64-bit bina‐
425 ries.
426
427 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
428
429 FIND_LIBRARY_USE_LIBX32_PATHS
430 Whether the find_library() command should automatically search libx32
431 directories.
432
433 FIND_LIBRARY_USE_LIBX32_PATHS is a boolean specifying whether the
434 find_library() command should automatically search the libx32 variant
435 of directories called lib in the search path when building x32-abi
436 binaries.
437
438 See also the CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX variable.
439
440 FIND_LIBRARY_USE_OPENBSD_VERSIONING
441 Whether find_library() should find OpenBSD-style shared libraries.
442
443 This property is a boolean specifying whether the find_library() com‐
444 mand should find shared libraries with OpenBSD-style versioned exten‐
445 sion: “.so.<major>.<minor>”. The property is set to true on OpenBSD
446 and false on other platforms.
447
448 GENERATOR_IS_MULTI_CONFIG
449 Read-only property that is true on multi-configuration generators.
450
451 True when using a multi-configuration generator (such as Visual Studio
452 Generators or Xcode). Multi-config generators use CMAKE_CONFIGURA‐
453 TION_TYPES as the set of configurations and ignore CMAKE_BUILD_TYPE.
454
455 GLOBAL_DEPENDS_DEBUG_MODE
456 Enable global target dependency graph debug mode.
457
458 CMake automatically analyzes the global inter-target dependency graph
459 at the beginning of native build system generation. This property
460 causes it to display details of its analysis to stderr.
461
462 GLOBAL_DEPENDS_NO_CYCLES
463 Disallow global target dependency graph cycles.
464
465 CMake automatically analyzes the global inter-target dependency graph
466 at the beginning of native build system generation. It reports an
467 error if the dependency graph contains a cycle that does not consist of
468 all STATIC library targets. This property tells CMake to disallow all
469 cycles completely, even among static libraries.
470
471 IN_TRY_COMPILE
472 Read-only property that is true during a try-compile configuration.
473
474 True when building a project inside a try_compile() or try_run() com‐
475 mand.
476
477 JOB_POOLS
478 Ninja only: List of available pools.
479
480 A pool is a named integer property and defines the maximum number of
481 concurrent jobs which can be started by a rule assigned to the pool.
482 The JOB_POOLS property is a semicolon-separated list of pairs using the
483 syntax NAME=integer (without a space after the equality sign).
484
485 For instance:
486
487 set_property(GLOBAL PROPERTY JOB_POOLS two_jobs=2 ten_jobs=10)
488
489 Defined pools could be used globally by setting CMAKE_JOB_POOL_COMPILE
490 and CMAKE_JOB_POOL_LINK or per target by setting the target properties
491 JOB_POOL_COMPILE and JOB_POOL_LINK. Custom commands and custom targets
492 can specify pools using the option JOB_POOL. Using a pool that is not
493 defined by JOB_POOLS causes an error by ninja at build time.
494
495 If not set, this property uses the value of the CMAKE_JOB_POOLS vari‐
496 able.
497
498 Build targets provided by CMake that are meant for individual interac‐
499 tive use, such as install, are placed in the console pool automati‐
500 cally.
501
502 PACKAGES_FOUND
503 List of packages which were found during the CMake run.
504
505 List of packages which were found during the CMake run. Whether a
506 package has been found is determined using the <NAME>_FOUND variables.
507
508 PACKAGES_NOT_FOUND
509 List of packages which were not found during the CMake run.
510
511 List of packages which were not found during the CMake run. Whether a
512 package has been found is determined using the <NAME>_FOUND variables.
513
514 PREDEFINED_TARGETS_FOLDER
515 Name of FOLDER for targets that are added automatically by CMake.
516
517 If not set, CMake uses “CMakePredefinedTargets” as a default value for
518 this property. Targets such as INSTALL, PACKAGE and RUN_TESTS will be
519 organized into this FOLDER. See also the documentation for the FOLDER
520 target property.
521
522 REPORT_UNDEFINED_PROPERTIES
523 If set, report any undefined properties to this file.
524
525 If this property is set to a filename then when CMake runs it will
526 report any properties or variables that were accessed but not defined
527 into the filename specified in this property.
528
529 RULE_LAUNCH_COMPILE
530 Specify a launcher for compile rules.
531
532 Makefile Generators and the Ninja generator prefix compiler commands
533 with the given launcher command line. This is intended to allow
534 launchers to intercept build problems with high granularity. Other
535 generators ignore this property because their underlying build systems
536 provide no hook to wrap individual commands with a launcher.
537
538 RULE_LAUNCH_CUSTOM
539 Specify a launcher for custom rules.
540
541 Makefile Generators and the Ninja generator prefix custom commands with
542 the given launcher command line. This is intended to allow launchers
543 to intercept build problems with high granularity. Other generators
544 ignore this property because their underlying build systems provide no
545 hook to wrap individual commands with a launcher.
546
547 RULE_LAUNCH_LINK
548 Specify a launcher for link rules.
549
550 Makefile Generators and the Ninja generator prefix link and archive
551 commands with the given launcher command line. This is intended to
552 allow launchers to intercept build problems with high granularity.
553 Other generators ignore this property because their underlying build
554 systems provide no hook to wrap individual commands with a launcher.
555
556 RULE_MESSAGES
557 Specify whether to report a message for each make rule.
558
559 This property specifies whether Makefile generators should add a
560 progress message describing what each build rule does. If the property
561 is not set the default is ON. Set the property to OFF to disable gran‐
562 ular messages and report only as each target completes. This is
563 intended to allow scripted builds to avoid the build time cost of
564 detailed reports. If a CMAKE_RULE_MESSAGES cache entry exists its
565 value initializes the value of this property. Non-Makefile generators
566 currently ignore this property.
567
568 TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
569 Set if shared libraries may be named like archives.
570
571 On AIX shared libraries may be named “lib<name>.a”. This property is
572 set to true on such platforms.
573
574 TARGET_MESSAGES
575 Specify whether to report the completion of each target.
576
577 This property specifies whether Makefile Generators should add a
578 progress message describing that each target has been completed. If
579 the property is not set the default is ON. Set the property to OFF to
580 disable target completion messages.
581
582 This option is intended to reduce build output when little or no work
583 needs to be done to bring the build tree up to date.
584
585 If a CMAKE_TARGET_MESSAGES cache entry exists its value initializes the
586 value of this property.
587
588 Non-Makefile generators currently ignore this property.
589
590 See the counterpart property RULE_MESSAGES to disable everything except
591 for target completion messages.
592
593 TARGET_SUPPORTS_SHARED_LIBS
594 Does the target platform support shared libraries.
595
596 TARGET_SUPPORTS_SHARED_LIBS is a boolean specifying whether the target
597 platform supports shared libraries. Basically all current general gen‐
598 eral purpose OS do so, the exception are usually embedded systems with
599 no or special OSs.
600
601 USE_FOLDERS
602 Use the FOLDER target property to organize targets into folders.
603
604 If not set, CMake treats this property as OFF by default. CMake gener‐
605 ators that are capable of organizing into a hierarchy of folders use
606 the values of the FOLDER target property to name those folders. See
607 also the documentation for the FOLDER target property.
608
609 XCODE_EMIT_EFFECTIVE_PLATFORM_NAME
610 Control emission of EFFECTIVE_PLATFORM_NAME by the Xcode generator.
611
612 It is required for building the same target with multiple SDKs. A com‐
613 mon use case is the parallel use of iphoneos and iphonesimulator SDKs.
614
615 Three different states possible that control when the Xcode generator
616 emits the EFFECTIVE_PLATFORM_NAME variable:
617
618 · If set to ON it will always be emitted
619
620 · If set to OFF it will never be emitted
621
622 · If unset (the default) it will only be emitted when the project was
623 configured for an embedded Xcode SDK like iOS, tvOS, watchOS or any
624 of the simulators.
625
626 NOTE:
627 When this behavior is enable for generated Xcode projects, the
628 EFFECTIVE_PLATFORM_NAME variable will leak into Generator expres‐
629 sions like TARGET_FILE and will render those mostly unusable.
630
632 ADDITIONAL_CLEAN_FILES
633 A ;-list of files or directories that will be removed as a part of the
634 global clean target. It is useful for specifying generated files or
635 directories that are used by multiple targets or by CMake itself, or
636 that are generated in ways which cannot be captured as outputs or
637 byproducts of custom commands.
638
639 If an additional clean file is specific to a single target only, then
640 the ADDITIONAL_CLEAN_FILES target property would usually be a better
641 choice than this directory property.
642
643 Relative paths are allowed and are interpreted relative to the current
644 binary directory.
645
646 Contents of ADDITIONAL_CLEAN_FILES may use generator expressions.
647
648 This property only works for the Ninja and the Makefile generators. It
649 is ignored by other generators.
650
651 BINARY_DIR
652 This read-only directory property reports absolute path to the binary
653 directory corresponding to the source on which it is read.
654
655 BUILDSYSTEM_TARGETS
656 This read-only directory property contains a semicolon-separated list
657 of buildsystem targets added in the directory by calls to the
658 add_library(), add_executable(), and add_custom_target() commands. The
659 list does not include any Imported Targets or Alias Targets, but does
660 include Interface Libraries. Each entry in the list is the logical
661 name of a target, suitable to pass to the get_property() command TARGET
662 option.
663
664 CACHE_VARIABLES
665 List of cache variables available in the current directory.
666
667 This read-only property specifies the list of CMake cache variables
668 currently defined. It is intended for debugging purposes.
669
670 CLEAN_NO_CUSTOM
671 Set to true to tell Makefile Generators not to remove the outputs of
672 custom commands for this directory during the make clean operation.
673 This is ignored on other generators because it is not possible to
674 implement.
675
676 CMAKE_CONFIGURE_DEPENDS
677 Tell CMake about additional input files to the configuration process.
678 If any named file is modified the build system will re-run CMake to
679 re-configure the file and generate the build system again.
680
681 Specify files as a semicolon-separated list of paths. Relative paths
682 are interpreted as relative to the current source directory.
683
684 COMPILE_DEFINITIONS
685 Preprocessor definitions for compiling a directory’s sources.
686
687 This property specifies the list of options given so far to the
688 add_compile_definitions() (or add_definitions()) command.
689
690 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
691 list of preprocessor definitions using the syntax VAR or VAR=value.
692 Function-style definitions are not supported. CMake will automatically
693 escape the value correctly for the native build system (note that CMake
694 language syntax may require escapes to specify some values).
695
696 This property will be initialized in each directory by its value in the
697 directory’s parent.
698
699 CMake will automatically drop some definitions that are not supported
700 by the native build tool.
701
702 Disclaimer: Most native build tools have poor support for escaping cer‐
703 tain values. CMake has work-arounds for many cases but some values may
704 just not be possible to pass correctly. If a value does not seem to be
705 escaped correctly, do not attempt to work-around the problem by adding
706 escape sequences to the value. Your work-around may break in a future
707 version of CMake that has improved escape support. Instead consider
708 defining the macro in a (configured) header file. Then report the lim‐
709 itation. Known limitations include:
710
711 # - broken almost everywhere
712 ; - broken in VS IDE 7.0 and Borland Makefiles
713 , - broken in VS IDE
714 % - broken in some cases in NMake
715 & | - broken in some cases on MinGW
716 ^ < > \" - broken in most Make tools on Windows
717
718 CMake does not reject these values outright because they do work in
719 some cases. Use with caution.
720
721 Contents of COMPILE_DEFINITIONS may use “generator expressions” with
722 the syntax $<...>. See the cmake-generator-expressions(7) manual for
723 available expressions. See the cmake-buildsystem(7) manual for more on
724 defining buildsystem properties.
725
726 The corresponding COMPILE_DEFINITIONS_<CONFIG> property may be set to
727 specify per-configuration definitions. Generator expressions should be
728 preferred instead of setting the alternative property.
729
730 COMPILE_OPTIONS
731 List of options to pass to the compiler.
732
733 This property holds a semicolon-separated list of options given so far
734 to the add_compile_options() command.
735
736 This property is used to initialize the COMPILE_OPTIONS target property
737 when a target is created, which is used by the generators to set the
738 options for the compiler.
739
740 Contents of COMPILE_OPTIONS may use “generator expressions” with the
741 syntax $<...>. See the cmake-generator-expressions(7) manual for
742 available expressions. See the cmake-buildsystem(7) manual for more on
743 defining buildsystem properties.
744
745 DEFINITIONS
746 For CMake 2.4 compatibility only. Use COMPILE_DEFINITIONS instead.
747
748 This read-only property specifies the list of flags given so far to the
749 add_definitions() command. It is intended for debugging purposes. Use
750 the COMPILE_DEFINITIONS directory property instead.
751
752 This built-in read-only property does not exist if policy CMP0059 is
753 set to NEW.
754
755 EXCLUDE_FROM_ALL
756 Set this directory property to a true value on a subdirectory to
757 exclude its targets from the “all” target of its ancestors. If
758 excluded, running e.g. make in the parent directory will not build tar‐
759 gets the subdirectory by default. This does not affect the “all” tar‐
760 get of the subdirectory itself. Running e.g. make inside the subdirec‐
761 tory will still build its targets.
762
763 If the EXCLUDE_FROM_ALL target property is set on a target then its
764 value determines whether the target is included in the “all” target of
765 this directory and its ancestors.
766
767 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
768 Specify #include line transforms for dependencies in a directory.
769
770 This property specifies rules to transform macro-like #include lines
771 during implicit dependency scanning of C and C++ source files. The
772 list of rules must be semicolon-separated with each entry of the form
773 A_MACRO(%)=value-with-% (the % must be literal). During dependency
774 scanning occurrences of A_MACRO(...) on #include lines will be replaced
775 by the value given with the macro argument substituted for %. For
776 example, the entry
777
778 MYDIR(%)=<mydir/%>
779
780 will convert lines of the form
781
782 #include MYDIR(myheader.h)
783
784 to
785
786 #include <mydir/myheader.h>
787
788 allowing the dependency to be followed.
789
790 This property applies to sources in all targets within a directory.
791 The property value is initialized in each directory by its value in the
792 directory’s parent.
793
794 INCLUDE_DIRECTORIES
795 List of preprocessor include file search directories.
796
797 This property specifies the list of directories given so far to the
798 include_directories() command.
799
800 This property is used to populate the INCLUDE_DIRECTORIES target prop‐
801 erty, which is used by the generators to set the include directories
802 for the compiler.
803
804 In addition to accepting values from that command, values may be set
805 directly on any directory using the set_property() command, and can be
806 set on the current directory using the set_directory_properties() com‐
807 mand. A directory gets its initial value from its parent directory if
808 it has one. The initial value of the INCLUDE_DIRECTORIES target prop‐
809 erty comes from the value of this property. Both directory and target
810 property values are adjusted by calls to the include_directories() com‐
811 mand. Calls to set_property() or set_directory_properties(), however,
812 will update the directory property value without updating target prop‐
813 erty values. Therefore direct property updates must be made before
814 calls to add_executable() or add_library() for targets they are meant
815 to affect.
816
817 The target property values are used by the generators to set the
818 include paths for the compiler.
819
820 Contents of INCLUDE_DIRECTORIES may use “generator expressions” with
821 the syntax $<...>. See the cmake-generator-expressions(7) manual for
822 available expressions. See the cmake-buildsystem(7) manual for more on
823 defining buildsystem properties.
824
825 INCLUDE_REGULAR_EXPRESSION
826 Include file scanning regular expression.
827
828 This property specifies the regular expression used during dependency
829 scanning to match include files that should be followed. See the
830 include_regular_expression() command for a high-level interface to set
831 this property.
832
833 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
834 Per-configuration interprocedural optimization for a directory.
835
836 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.
837 If set, this property overrides the generic property for the named con‐
838 figuration.
839
840 INTERPROCEDURAL_OPTIMIZATION
841 Enable interprocedural optimization for targets in a directory.
842
843 If set to true, enables interprocedural optimizations if they are known
844 to be supported by the compiler.
845
846 LABELS
847 Specify a list of text labels associated with a directory and all of
848 its subdirectories. This is equivalent to setting the LABELS target
849 property and the LABELS test property on all targets and tests in the
850 current directory and subdirectories. Note: Launchers must enabled to
851 propagate labels to targets.
852
853 The CMAKE_DIRECTORY_LABELS variable can be used to initialize this
854 property.
855
856 The list is reported in dashboard submissions.
857
858 LINK_DIRECTORIES
859 List of linker search directories.
860
861 This property holds a semicolon-separated list of directories and is
862 typically populated using the link_directories() command. It gets its
863 initial value from its parent directory, if it has one.
864
865 The directory property is used to initialize the LINK_DIRECTORIES tar‐
866 get property when a target is created. That target property is used by
867 the generators to set the library search directories for the linker.
868
869 Contents of LINK_DIRECTORIES may use “generator expressions” with the
870 syntax $<...>. See the cmake-generator-expressions(7) manual for
871 available expressions. See the cmake-buildsystem(7) manual for more on
872 defining buildsystem properties.
873
874 LINK_OPTIONS
875 List of options to use for the link step of shared library, module and
876 executable targets.
877
878 This property holds a semicolon-separated list of options given so far
879 to the add_link_options() command.
880
881 This property is used to initialize the LINK_OPTIONS target property
882 when a target is created, which is used by the generators to set the
883 options for the compiler.
884
885 Contents of LINK_OPTIONS may use “generator expressions” with the syn‐
886 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
887 able expressions. See the cmake-buildsystem(7) manual for more on
888 defining buildsystem properties.
889
890 LISTFILE_STACK
891 The current stack of listfiles being processed.
892
893 This property is mainly useful when trying to debug errors in your
894 CMake scripts. It returns a list of what list files are currently
895 being processed, in order. So if one listfile does an include() com‐
896 mand then that is effectively pushing the included listfile onto the
897 stack.
898
899 MACROS
900 List of macro commands available in the current directory.
901
902 This read-only property specifies the list of CMake macros currently
903 defined. It is intended for debugging purposes. See the macro() com‐
904 mand.
905
906 PARENT_DIRECTORY
907 Source directory that added current subdirectory.
908
909 This read-only property specifies the source directory that added the
910 current source directory as a subdirectory of the build. In the
911 top-level directory the value is the empty-string.
912
913 RULE_LAUNCH_COMPILE
914 Specify a launcher for compile rules.
915
916 See the global property of the same name for details. This overrides
917 the global property for a directory.
918
919 RULE_LAUNCH_CUSTOM
920 Specify a launcher for custom rules.
921
922 See the global property of the same name for details. This overrides
923 the global property for a directory.
924
925 RULE_LAUNCH_LINK
926 Specify a launcher for link rules.
927
928 See the global property of the same name for details. This overrides
929 the global property for a directory.
930
931 SOURCE_DIR
932 This read-only directory property reports absolute path to the source
933 directory on which it is read.
934
935 SUBDIRECTORIES
936 This read-only directory property contains a semicolon-separated list
937 of subdirectories processed so far by the add_subdirectory() or sub‐
938 dirs() commands. Each entry is the absolute path to the source direc‐
939 tory (containing the CMakeLists.txt file). This is suitable to pass to
940 the get_property() command DIRECTORY option.
941
942 NOTE:
943 The subdirs() command does not process its arguments until after the
944 calling directory is fully processed. Therefore looking up this
945 property in the current directory will not see them.
946
947 TESTS
948 List of tests.
949
950 This read-only property holds a semicolon-separated list of tests
951 defined so far, in the current directory, by the add_test() command.
952
953 TEST_INCLUDE_FILES
954 A list of cmake files that will be included when ctest is run.
955
956 If you specify TEST_INCLUDE_FILES, those files will be included and
957 processed when ctest is run on the directory.
958
959 VARIABLES
960 List of variables defined in the current directory.
961
962 This read-only property specifies the list of CMake variables currently
963 defined. It is intended for debugging purposes.
964
965 VS_GLOBAL_SECTION_POST_<section>
966 Specify a postSolution global section in Visual Studio.
967
968 Setting a property like this generates an entry of the following form
969 in the solution file:
970
971 GlobalSection(<section>) = postSolution
972 <contents based on property value>
973 EndGlobalSection
974
975 The property must be set to a semicolon-separated list of key=value
976 pairs. Each such pair will be transformed into an entry in the solu‐
977 tion global section. Whitespace around key and value is ignored. List
978 elements which do not contain an equal sign are skipped.
979
980 This property only works for Visual Studio 9 and above; it is ignored
981 on other generators. The property only applies when set on a directory
982 whose CMakeLists.txt contains a project() command.
983
984 Note that CMake generates postSolution sections ExtensibilityGlobals
985 and ExtensibilityAddIns by default. If you set the corresponding prop‐
986 erty, it will override the default section. For example, setting
987 VS_GLOBAL_SECTION_POST_ExtensibilityGlobals will override the default
988 contents of the ExtensibilityGlobals section, while keeping Extensibil‐
989 ityAddIns on its default. However, CMake will always add a Solu‐
990 tionGuid to the ExtensibilityGlobals section if it is not specified
991 explicitly.
992
993 VS_GLOBAL_SECTION_PRE_<section>
994 Specify a preSolution global section in Visual Studio.
995
996 Setting a property like this generates an entry of the following form
997 in the solution file:
998
999 GlobalSection(<section>) = preSolution
1000 <contents based on property value>
1001 EndGlobalSection
1002
1003 The property must be set to a semicolon-separated list of key=value
1004 pairs. Each such pair will be transformed into an entry in the solu‐
1005 tion global section. Whitespace around key and value is ignored. List
1006 elements which do not contain an equal sign are skipped.
1007
1008 This property only works for Visual Studio 9 and above; it is ignored
1009 on other generators. The property only applies when set on a directory
1010 whose CMakeLists.txt contains a project() command.
1011
1012 VS_STARTUP_PROJECT
1013 Specify the default startup project in a Visual Studio solution.
1014
1015 The Visual Studio Generators create a .sln file for each directory
1016 whose CMakeLists.txt file calls the project() command. Set this prop‐
1017 erty in the same directory as a project() command call (e.g. in the
1018 top-level CMakeLists.txt file) to specify the default startup project
1019 for the corresponding solution file.
1020
1021 The property must be set to the name of an existing target. This will
1022 cause that project to be listed first in the generated solution file
1023 causing Visual Studio to make it the startup project if the solution
1024 has never been opened before.
1025
1026 If this property is not specified, then the ALL_BUILD project will be
1027 the default.
1028
1030 ADDITIONAL_CLEAN_FILES
1031 A ;-list of files or directories that will be removed as a part of the
1032 global clean target. It can be used to specify files and directories
1033 that are generated as part of building the target or that are directly
1034 associated with the target in some way (e.g. created as a result of
1035 running the target).
1036
1037 For custom targets, if such files can be captured as outputs or byprod‐
1038 ucts instead, then that should be preferred over adding them to this
1039 property. If an additional clean file is used by multiple targets or
1040 isn’t target-specific, then the ADDITIONAL_CLEAN_FILES directory prop‐
1041 erty may be the more appropriate property to use.
1042
1043 Relative paths are allowed and are interpreted relative to the current
1044 binary directory.
1045
1046 Contents of ADDITIONAL_CLEAN_FILES may use generator expressions.
1047
1048 This property only works for the Ninja and the Makefile generators. It
1049 is ignored by other generators.
1050
1051 AIX_EXPORT_ALL_SYMBOLS
1052 On AIX, CMake automatically exports all symbols from shared libraries,
1053 and from executables with the ENABLE_EXPORTS target property set.
1054 Explicitly disable this boolean property to suppress the behavior and
1055 export no symbols by default. In this case it is expected that the
1056 project will use other means to export some symbols.
1057
1058 This property is initialized by the value of the
1059 CMAKE_AIX_EXPORT_ALL_SYMBOLS variable if it is set when a target is
1060 created.
1061
1062 ALIASED_TARGET
1063 Name of target aliased by this target.
1064
1065 If this is an Alias Target, this property contains the name of the tar‐
1066 get aliased.
1067
1068 ANDROID_ANT_ADDITIONAL_OPTIONS
1069 Set the additional options for Android Ant build system. This is a
1070 string value containing all command line options for the Ant build.
1071 This property is initialized by the value of the
1072 CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS variable if it is set when a tar‐
1073 get is created.
1074
1075 ANDROID_API
1076 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1077 Edition, this property sets the Android target API version (e.g. 15).
1078 The version number must be a positive decimal integer. This property
1079 is initialized by the value of the CMAKE_ANDROID_API variable if it is
1080 set when a target is created.
1081
1082 ANDROID_API_MIN
1083 Set the Android MIN API version (e.g. 9). The version number must be a
1084 positive decimal integer. This property is initialized by the value of
1085 the CMAKE_ANDROID_API_MIN variable if it is set when a target is cre‐
1086 ated. Native code builds using this API version.
1087
1088 ANDROID_ARCH
1089 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1090 Edition, this property sets the Android target architecture.
1091
1092 This is a string property that could be set to the one of the following
1093 values:
1094
1095 · armv7-a: “ARMv7-A (armv7-a)”
1096
1097 · armv7-a-hard: “ARMv7-A, hard-float ABI (armv7-a)”
1098
1099 · arm64-v8a: “ARMv8-A, 64bit (arm64-v8a)”
1100
1101 · x86: “x86 (x86)”
1102
1103 · x86_64: “x86_64 (x86_64)”
1104
1105 This property is initialized by the value of the CMAKE_ANDROID_ARCH
1106 variable if it is set when a target is created.
1107
1108 ANDROID_ASSETS_DIRECTORIES
1109 Set the Android assets directories to copy into the main assets folder
1110 before build. This a string property that contains the directory paths
1111 separated by semicolon. This property is initialized by the value of
1112 the CMAKE_ANDROID_ASSETS_DIRECTORIES variable if it is set when a tar‐
1113 get is created.
1114
1115 ANDROID_GUI
1116 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1117 Edition, this property specifies whether to build an executable as an
1118 application package on Android.
1119
1120 When this property is set to true the executable when built for Android
1121 will be created as an application package. This property is initial‐
1122 ized by the value of the CMAKE_ANDROID_GUI variable if it is set when a
1123 target is created.
1124
1125 Add the AndroidManifest.xml source file explicitly to the target
1126 add_executable() command invocation to specify the root directory of
1127 the application package source.
1128
1129 ANDROID_JAR_DEPENDENCIES
1130 Set the Android property that specifies JAR dependencies. This is a
1131 string value property. This property is initialized by the value of the
1132 CMAKE_ANDROID_JAR_DEPENDENCIES variable if it is set when a target is
1133 created.
1134
1135 ANDROID_JAR_DIRECTORIES
1136 Set the Android property that specifies directories to search for the
1137 JAR libraries.
1138
1139 This a string property that contains the directory paths separated by
1140 semicolons. This property is initialized by the value of the
1141 CMAKE_ANDROID_JAR_DIRECTORIES variable if it is set when a target is
1142 created.
1143
1144 Contents of ANDROID_JAR_DIRECTORIES may use “generator expressions”
1145 with the syntax $<...>. See the cmake-generator-expressions(7) manual
1146 for available expressions.
1147
1148 ANDROID_JAVA_SOURCE_DIR
1149 Set the Android property that defines the Java source code root direc‐
1150 tories. This a string property that contains the directory paths sepa‐
1151 rated by semicolon. This property is initialized by the value of the
1152 CMAKE_ANDROID_JAVA_SOURCE_DIR variable if it is set when a target is
1153 created.
1154
1155 ANDROID_NATIVE_LIB_DEPENDENCIES
1156 Set the Android property that specifies the .so dependencies. This is
1157 a string property.
1158
1159 This property is initialized by the value of the
1160 CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES variable if it is set when a tar‐
1161 get is created.
1162
1163 Contents of ANDROID_NATIVE_LIB_DEPENDENCIES may use “generator expres‐
1164 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
1165 manual for available expressions.
1166
1167 ANDROID_NATIVE_LIB_DIRECTORIES
1168 Set the Android property that specifies directories to search for the
1169 .so libraries.
1170
1171 This a string property that contains the directory paths separated by
1172 semicolons.
1173
1174 This property is initialized by the value of the
1175 CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES variable if it is set when a tar‐
1176 get is created.
1177
1178 Contents of ANDROID_NATIVE_LIB_DIRECTORIES may use “generator expres‐
1179 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
1180 manual for available expressions.
1181
1182 ANDROID_PROCESS_MAX
1183 Set the Android property that defines the maximum number of a parallel
1184 Android NDK compiler processes (e.g. 4). This property is initialized
1185 by the value of the CMAKE_ANDROID_PROCESS_MAX variable if it is set
1186 when a target is created.
1187
1188 ANDROID_PROGUARD
1189 When this property is set to true that enables the ProGuard tool to
1190 shrink, optimize, and obfuscate the code by removing unused code and
1191 renaming classes, fields, and methods with semantically obscure names.
1192 This property is initialized by the value of the CMAKE_ANDROID_PROGUARD
1193 variable if it is set when a target is created.
1194
1195 ANDROID_PROGUARD_CONFIG_PATH
1196 Set the Android property that specifies the location of the ProGuard
1197 config file. Leave empty to use the default one. This a string prop‐
1198 erty that contains the path to ProGuard config file. This property is
1199 initialized by the value of the CMAKE_ANDROID_PROGUARD_CONFIG_PATH
1200 variable if it is set when a target is created.
1201
1202 ANDROID_SECURE_PROPS_PATH
1203 Set the Android property that states the location of the secure proper‐
1204 ties file. This is a string property that contains the file path.
1205 This property is initialized by the value of the
1206 CMAKE_ANDROID_SECURE_PROPS_PATH variable if it is set when a target is
1207 created.
1208
1209 ANDROID_SKIP_ANT_STEP
1210 Set the Android property that defines whether or not to skip the Ant
1211 build step. This is a boolean property initialized by the value of the
1212 CMAKE_ANDROID_SKIP_ANT_STEP variable if it is set when a target is cre‐
1213 ated.
1214
1215 ANDROID_STL_TYPE
1216 When Cross Compiling for Android with NVIDIA Nsight Tegra Visual Studio
1217 Edition, this property specifies the type of STL support for the
1218 project. This is a string property that could set to the one of the
1219 following values:
1220
1221 none No C++ Support
1222
1223 system Minimal C++ without STL
1224
1225 gabi++_static
1226 GAbi++ Static
1227
1228 gabi++_shared
1229 GAbi++ Shared
1230
1231 gnustl_static
1232 GNU libstdc++ Static
1233
1234 gnustl_shared
1235 GNU libstdc++ Shared
1236
1237 stlport_static
1238 STLport Static
1239
1240 stlport_shared
1241 STLport Shared
1242
1243 This property is initialized by the value of the CMAKE_ANDROID_STL_TYPE
1244 variable if it is set when a target is created.
1245
1246 ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
1247 Per-configuration output directory for ARCHIVE target files.
1248
1249 This is a per-configuration version of the ARCHIVE_OUTPUT_DIRECTORY
1250 target property, but multi-configuration generators (VS, Xcode) do NOT
1251 append a per-configuration subdirectory to the specified directory.
1252 This property is initialized by the value of the CMAKE_ARCHIVE_OUT‐
1253 PUT_DIRECTORY_<CONFIG> variable if it is set when a target is created.
1254
1255 Contents of ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
1256 sions.
1257
1258 ARCHIVE_OUTPUT_DIRECTORY
1259 Output directory in which to build ARCHIVE target files.
1260
1261 This property specifies the directory into which archive target files
1262 should be built. The property value may use generator expressions.
1263 Multi-configuration generators (VS, Xcode) append a per-configuration
1264 subdirectory to the specified directory unless a generator expression
1265 is used.
1266
1267 This property is initialized by the value of the variable CMAKE_AR‐
1268 CHIVE_OUTPUT_DIRECTORY if it is set when a target is created.
1269
1270 See also the ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> target property.
1271
1272 ARCHIVE_OUTPUT_NAME_<CONFIG>
1273 Per-configuration output name for ARCHIVE target files.
1274
1275 This is the configuration-specific version of the ARCHIVE_OUTPUT_NAME
1276 target property.
1277
1278 ARCHIVE_OUTPUT_NAME
1279 Output name for ARCHIVE target files.
1280
1281 This property specifies the base name for archive target files. It
1282 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
1283
1284 See also the ARCHIVE_OUTPUT_NAME_<CONFIG> target property.
1285
1286 AUTOGEN_BUILD_DIR
1287 Directory where AUTOMOC, AUTOUIC and AUTORCC generate files for the
1288 target.
1289
1290 The directory is created on demand and automatically added to the ADDI‐
1291 TIONAL_CLEAN_FILES target property.
1292
1293 When unset or empty the directory <dir>/<target-name>_autogen is used
1294 where <dir> is CMAKE_CURRENT_BINARY_DIR and <target-name> is NAME.
1295
1296 By default AUTOGEN_BUILD_DIR is unset.
1297
1298 See the cmake-qt(7) manual for more information on using CMake with Qt.
1299
1300 AUTOGEN_ORIGIN_DEPENDS
1301 Switch for forwarding origin target dependencies to the corresponding
1302 _autogen target.
1303
1304 Targets which have their AUTOMOC or AUTOUIC property ON have a corre‐
1305 sponding _autogen target which generates moc and uic files. As this
1306 _autogen target is created at generate-time, it is not possible to
1307 define dependencies of it using e.g. add_dependencies(). Instead the
1308 AUTOGEN_ORIGIN_DEPENDS target property decides whether the origin tar‐
1309 get dependencies should be forwarded to the _autogen target or not.
1310
1311 By default AUTOGEN_ORIGIN_DEPENDS is initialized from CMAKE_AUTO‐
1312 GEN_ORIGIN_DEPENDS which is ON by default.
1313
1314 In total the dependencies of the _autogen target are composed from
1315
1316 · forwarded origin target dependencies (enabled by default via
1317 AUTOGEN_ORIGIN_DEPENDS)
1318
1319 · additional user defined dependencies from AUTOGEN_TARGET_DEPENDS
1320
1321 See the cmake-qt(7) manual for more information on using CMake with Qt.
1322
1323 Note
1324 Disabling AUTOGEN_ORIGIN_DEPENDS is useful to avoid building of origin
1325 target dependencies when building the _autogen target only. This is
1326 especially interesting when a global autogen target is enabled.
1327
1328 When the _autogen target doesn’t require all the origin target’s depen‐
1329 dencies, and AUTOGEN_ORIGIN_DEPENDS is disabled, it might be necessary
1330 to extend AUTOGEN_TARGET_DEPENDS to add missing dependencies.
1331
1332 AUTOGEN_PARALLEL
1333 Number of parallel moc or uic processes to start when using AUTOMOC and
1334 AUTOUIC.
1335
1336 The custom <origin>_autogen target starts a number of threads of which
1337 each one parses a source file and on demand starts a moc or uic
1338 process. AUTOGEN_PARALLEL controls how many parallel threads (and
1339 therefore moc or uic processes) are started.
1340
1341 · An empty (or unset) value or the string AUTO sets the number of
1342 threads/processes to the number of physical CPUs on the host system.
1343
1344 · A positive non zero integer value sets the exact thread/process
1345 count.
1346
1347 · Otherwise a single thread/process is started.
1348
1349 By default AUTOGEN_PARALLEL is initialized from CMAKE_AUTOGEN_PARALLEL.
1350
1351 See the cmake-qt(7) manual for more information on using CMake with Qt.
1352
1353 AUTOGEN_TARGET_DEPENDS
1354 Additional target dependencies of the corresponding _autogen target.
1355
1356 Targets which have their AUTOMOC or AUTOUIC property ON have a corre‐
1357 sponding _autogen target which generates moc and uic files. As this
1358 _autogen target is created at generate-time, it is not possible to
1359 define dependencies of it using e.g. add_dependencies(). Instead the
1360 AUTOGEN_TARGET_DEPENDS target property can be set to a ;-list of addi‐
1361 tional dependencies for the _autogen target. Dependencies can be tar‐
1362 get names or file names.
1363
1364 In total the dependencies of the _autogen target are composed from
1365
1366 · forwarded origin target dependencies (enabled by default via AUTO‐
1367 GEN_ORIGIN_DEPENDS)
1368
1369 · additional user defined dependencies from AUTOGEN_TARGET_DEPENDS
1370
1371 See the cmake-qt(7) manual for more information on using CMake with Qt.
1372
1373 Use cases
1374 If AUTOMOC or AUTOUIC depends on a file that is either
1375
1376 · a GENERATED non C++ file (e.g. a GENERATED .json or .ui file) or
1377
1378 · a GENERATED C++ file that isn’t recognized by AUTOMOC and AUTOUIC
1379 because it’s skipped by SKIP_AUTOMOC, SKIP_AUTOUIC, SKIP_AUTOGEN or
1380 CMP0071 or
1381
1382 · a file that isn’t in the origin target’s sources
1383
1384 it must be added to AUTOGEN_TARGET_DEPENDS.
1385
1386 AUTOMOC
1387 Should the target be processed with auto-moc (for Qt projects).
1388
1389 AUTOMOC is a boolean specifying whether CMake will handle the Qt moc
1390 preprocessor automatically, i.e. without having to use the
1391 QT4_WRAP_CPP() or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are sup‐
1392 ported.
1393
1394 This property is initialized by the value of the CMAKE_AUTOMOC variable
1395 if it is set when a target is created.
1396
1397 When this property is set ON, CMake will scan the header and source
1398 files at build time and invoke moc accordingly.
1399
1400 Header file processing
1401 At configuration time, a list of header files that should be scanned by
1402 AUTOMOC is computed from the target’s sources.
1403
1404 · All header files in the target’s sources are added to the scan list.
1405
1406 · For all C++ source files <source_base>.<source_extension> in the tar‐
1407 get’s sources, CMake searches for
1408
1409 · a regular header with the same base name
1410 (<source_base>.<header_extention>) and
1411
1412 · a private header with the same base name and a _p suffix
1413 (<source_base>_p.<header_extention>)
1414
1415 and adds these to the scan list.
1416
1417 At build time, CMake scans each unknown or modified header file from
1418 the list and searches for
1419
1420 · a Qt macro from AUTOMOC_MACRO_NAMES,
1421
1422 · additional file dependencies from the FILE argument of a Q_PLUG‐
1423 IN_METADATA macro and
1424
1425 · additional file dependencies detected by filters defined in AUTO‐
1426 MOC_DEPEND_FILTERS.
1427
1428 If a Qt macro is found, then the header will be compiled by the moc to
1429 the output file moc_<base_name>.cpp. The complete output file path is
1430 described in the section Output file location.
1431
1432 The header will be moc compiled again if a file from the additional
1433 file dependencies changes.
1434
1435 Header moc output files moc_<base_name>.cpp can be included in source
1436 files. In the section Including header moc files in sources there is
1437 more information on that topic.
1438
1439 Source file processing
1440 At build time, CMake scans each unknown or modified C++ source file
1441 from the target’s sources for
1442
1443 · a Qt macro from AUTOMOC_MACRO_NAMES,
1444
1445 · includes of header moc files (see Including header moc files in
1446 sources),
1447
1448 · additional file dependencies from the FILE argument of a Q_PLUG‐
1449 IN_METADATA macro and
1450
1451 · additional file dependencies detected by filters defined in AUTO‐
1452 MOC_DEPEND_FILTERS.
1453
1454 If a Qt macro is found, then the C++ source file <base>.<source_exten‐
1455 sion> is expected to as well contain an include statement
1456
1457 #include <<base>.moc> // or
1458 #include "<base>.moc"
1459
1460 The source file then will be compiled by the moc to the output file
1461 <base>.moc. A description of the complete output file path is in sec‐
1462 tion Output file location.
1463
1464 The source will be moc compiled again if a file from the additional
1465 file dependencies changes.
1466
1467 Including header moc files in sources
1468 A source file can include the moc output file of a header
1469 <header_base>.<header_extension> by using an include statement of the
1470 form
1471
1472 #include <moc_<header_base>.cpp> // or
1473 #include "moc_<header_base>.cpp"
1474
1475 If the moc output file of a header is included by a source, it will be
1476 generated in a different location than if it was not included. This is
1477 described in the section Output file location.
1478
1479 Output file location
1480 Included moc output files
1481 moc output files that are included by a source file will be generated
1482 in
1483
1484 · <AUTOGEN_BUILD_DIR>/include for single configuration generators or in
1485
1486 · <AUTOGEN_BUILD_DIR>/include_<CONFIG> for multi configuration genera‐
1487 tors.
1488
1489 Where <AUTOGEN_BUILD_DIR> is the value of the target property AUTO‐
1490 GEN_BUILD_DIR.
1491
1492 The include directory is automatically added to the target’s
1493 INCLUDE_DIRECTORIES.
1494
1495 Not included moc output files
1496 moc output files that are not included in a source file will be gener‐
1497 ated in
1498
1499 · <AUTOGEN_BUILD_DIR>/<SOURCE_DIR_CHECKSUM> for single configuration
1500 generators or in,
1501
1502 · <AUTOGEN_BUILD_DIR>/include_<CONFIG>/<SOURCE_DIR_CHECKSUM> for multi
1503 configuration generators.
1504
1505 Where <SOURCE_DIR_CHECKSUM> is a checksum computed from the relative
1506 parent directory path of the moc input file. This scheme allows to
1507 have moc input files with the same name in different directories.
1508
1509 All not included moc output files will be included automatically by the
1510 CMake generated file
1511
1512 · <AUTOGEN_BUILD_DIR>/mocs_compilation.cpp,
1513
1514 which is added to the target’s sources.
1515
1516 Qt version detection
1517 AUTOMOC enabled targets need to know the Qt major and minor version
1518 they’re working with. The major version usually is provided by the
1519 INTERFACE_QT_MAJOR_VERSION property of the Qt[45]Core library, that the
1520 target links to. To find the minor version, CMake builds a list of
1521 available Qt versions from
1522
1523 · Qt5Core_VERSION_MAJOR and Qt5Core_VERSION_MINOR variables (usually
1524 set by find_package(Qt5...))
1525
1526 · Qt5Core_VERSION_MAJOR and Qt5Core_VERSION_MINOR directory properties
1527
1528 · QT_VERSION_MAJOR and QT_VERSION_MINOR variables (usually set by
1529 find_package(Qt4...))
1530
1531 · QT_VERSION_MAJOR and QT_VERSION_MINOR directory properties
1532
1533 in the context of the add_executable() or add_library() call.
1534
1535 Assumed INTERFACE_QT_MAJOR_VERSION is a valid number, the first entry
1536 in the list with a matching major version is taken. If no matching
1537 major version was found, an error is generated. If INTER‐
1538 FACE_QT_MAJOR_VERSION is not a valid number, the first entry in the
1539 list is taken.
1540
1541 A find_package(Qt[45]...) call sets the QT/Qt5Core_VERSION_MAJOR/MINOR
1542 variables. If the call is in a different context than the add_exe‐
1543 cutable() or add_library() call, e.g. in a function, then the version
1544 variables might not be available to the AUTOMOC enabled target. In
1545 that case the version variables can be forwarded from the find_pack‐
1546 age(Qt[45]...) calling context to the add_executable() or add_library()
1547 calling context as directory properties. The following Qt5 example
1548 demonstrates the procedure.
1549
1550 function (add_qt5_client)
1551 find_package(Qt5 REQUIRED QUIET COMPONENTS Core Widgets)
1552 ...
1553 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
1554 PROPERTY Qt5Core_VERSION_MAJOR "${Qt5Core_VERSION_MAJOR}")
1555 set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
1556 PROPERTY Qt5Core_VERSION_MINOR "${Qt5Core_VERSION_MAJOR}")
1557 ...
1558 endfunction ()
1559 ...
1560 add_qt5_client()
1561 add_executable(myTarget main.cpp)
1562 target_link_libraries(myTarget Qt5::QtWidgets)
1563 set_property(TARGET myTarget PROPERTY AUTOMOC ON)
1564
1565 Modifiers
1566 AUTOMOC_EXECUTABLE: The moc executable will be detected automatically,
1567 but can be forced to a certain binary using this target property.
1568
1569 AUTOMOC_MOC_OPTIONS: Additional command line options for moc can be set
1570 in this target property.
1571
1572 AUTOMOC_MACRO_NAMES: This list of Qt macro names can be extended to
1573 search for additional macros in headers and sources.
1574
1575 AUTOMOC_DEPEND_FILTERS: moc dependency file names can be extracted from
1576 headers or sources by defining file name filters in this target prop‐
1577 erty.
1578
1579 AUTOMOC_COMPILER_PREDEFINES: Compiler pre definitions for moc are writ‐
1580 ten to the moc_predefs.h file. The generation of this file can be
1581 enabled or disabled in this target property.
1582
1583 SKIP_AUTOMOC: Sources and headers can be excluded from AUTOMOC process‐
1584 ing by setting this source file property.
1585
1586 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
1587 AUTORCC processing by setting this source file property.
1588
1589 AUTOGEN_SOURCE_GROUP: This global property can be used to group files
1590 generated by AUTOMOC or AUTORCC together in an IDE, e.g. in MSVS.
1591
1592 AUTOGEN_TARGETS_FOLDER: This global property can be used to group
1593 AUTOMOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
1594
1595 CMAKE_GLOBAL_AUTOGEN_TARGET: A global autogen target, that depends on
1596 all AUTOMOC or AUTOUIC generated <ORIGIN>_autogen targets in the
1597 project, will be generated when this variable is ON.
1598
1599 AUTOGEN_PARALLEL: This target property controls the number of moc or
1600 uic processes to start in parallel during builds.
1601
1602 See the cmake-qt(7) manual for more information on using CMake with Qt.
1603
1604 AUTOMOC_COMPILER_PREDEFINES
1605 Boolean value used by AUTOMOC to determine if the compiler pre defini‐
1606 tions file moc_predefs.h should be generated.
1607
1608 CMake generates a moc_predefs.h file with compiler pre definitions from
1609 the output of the command defined in CMAKE_CXX_COMPILER_PREDEFINES_COM‐
1610 MAND when
1611
1612 · AUTOMOC is enabled,
1613
1614 · AUTOMOC_COMPILER_PREDEFINES is enabled,
1615
1616 · CMAKE_CXX_COMPILER_PREDEFINES_COMMAND isn’t empty and
1617
1618 · the Qt version is greater or equal 5.8.
1619
1620 The moc_predefs.h file, which is generated in AUTOGEN_BUILD_DIR, is
1621 passed to moc as the argument to the --include option.
1622
1623 By default AUTOMOC_COMPILER_PREDEFINES is initialized from CMAKE_AUTO‐
1624 MOC_COMPILER_PREDEFINES, which is ON by default.
1625
1626 See the cmake-qt(7) manual for more information on using CMake with Qt.
1627
1628 AUTOMOC_DEPEND_FILTERS
1629 Filter definitions used by AUTOMOC to extract file names from a source
1630 file that are registered as additional dependencies for the moc file of
1631 the source file.
1632
1633 Filters are defined as KEYWORD;REGULAR_EXPRESSION pairs. First the file
1634 content is searched for KEYWORD. If it is found at least once, then
1635 file names are extracted by successively searching for REGULAR_EXPRES‐
1636 SION and taking the first match group.
1637
1638 The file name found in the first match group is searched for
1639
1640 · first in the vicinity of the source file
1641
1642 · and afterwards in the target’s INCLUDE_DIRECTORIES.
1643
1644 If any of the extracted files changes, then the moc file for the source
1645 file gets rebuilt even when the source file itself doesn’t change.
1646
1647 If any of the extracted files is GENERATED or if it is not in the tar‐
1648 get’s sources, then it might be necessary to add it to the _autogen
1649 target dependencies. See AUTOGEN_TARGET_DEPENDS for reference.
1650
1651 By default AUTOMOC_DEPEND_FILTERS is initialized from CMAKE_AUTO‐
1652 MOC_DEPEND_FILTERS, which is empty by default.
1653
1654 From Qt 5.15.0 on this variable is ignored as moc is able to output the
1655 correct dependencies.
1656
1657 See the cmake-qt(7) manual for more information on using CMake with Qt.
1658
1659 Example 1
1660 A header file my_class.hpp uses a custom macro JSON_FILE_MACRO which is
1661 defined in an other header macros.hpp. We want the moc file of
1662 my_class.hpp to depend on the file name argument of JSON_FILE_MACRO:
1663
1664 // my_class.hpp
1665 class My_Class : public QObject
1666 {
1667 Q_OBJECT
1668 JSON_FILE_MACRO ( "info.json" )
1669 ...
1670 };
1671
1672 In CMakeLists.txt we add a filter to CMAKE_AUTOMOC_DEPEND_FILTERS like
1673 this:
1674
1675 list( APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
1676 "JSON_FILE_MACRO"
1677 "[\n][ \t]*JSON_FILE_MACRO[ \t]*\\([ \t]*\"([^\"]+)\""
1678 )
1679
1680 We assume info.json is a plain (not GENERATED) file that is listed in
1681 the target’s source. Therefore we do not need to add it to AUTO‐
1682 GEN_TARGET_DEPENDS.
1683
1684 Example 2
1685 In the target my_target a header file complex_class.hpp uses a custom
1686 macro JSON_BASED_CLASS which is defined in an other header macros.hpp:
1687
1688 // macros.hpp
1689 ...
1690 #define JSON_BASED_CLASS(name, json) \
1691 class name : public QObject \
1692 { \
1693 Q_OBJECT \
1694 Q_PLUGIN_METADATA(IID "demo" FILE json) \
1695 name() {} \
1696 };
1697 ...
1698
1699 // complex_class.hpp
1700 #pragma once
1701 JSON_BASED_CLASS(Complex_Class, "meta.json")
1702 // end of file
1703
1704 Since complex_class.hpp doesn’t contain a Q_OBJECT macro it would be
1705 ignored by AUTOMOC. We change this by adding JSON_BASED_CLASS to
1706 CMAKE_AUTOMOC_MACRO_NAMES:
1707
1708 list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "JSON_BASED_CLASS")
1709
1710 We want the moc file of complex_class.hpp to depend on meta.json. So
1711 we add a filter to CMAKE_AUTOMOC_DEPEND_FILTERS:
1712
1713 list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
1714 "JSON_BASED_CLASS"
1715 "[\n^][ \t]*JSON_BASED_CLASS[ \t]*\\([^,]*,[ \t]*\"([^\"]+)\""
1716 )
1717
1718 Additionally we assume meta.json is GENERATED which is why we have to
1719 add it to AUTOGEN_TARGET_DEPENDS:
1720
1721 set_property(TARGET my_target APPEND PROPERTY AUTOGEN_TARGET_DEPENDS "meta.json")
1722
1723 AUTOMOC_EXECUTABLE
1724 AUTOMOC_EXECUTABLE is file path pointing to the moc executable to use
1725 for AUTOMOC enabled files. Setting this property will make CMake skip
1726 the automatic detection of the moc binary as well as the sanity-tests
1727 normally run to ensure that the binary is available and working as
1728 expected.
1729
1730 Usually this property does not need to be set. Only consider this prop‐
1731 erty if auto-detection of moc can not work – e.g. because you are
1732 building the moc binary as part of your project.
1733
1734 See the cmake-qt(7) manual for more information on using CMake with Qt.
1735
1736 AUTOMOC_MACRO_NAMES
1737 A semicolon-separated list list of macro names used by AUTOMOC to
1738 determine if a C++ file needs to be processed by moc.
1739
1740 This property is only used if the AUTOMOC property is ON for this tar‐
1741 get.
1742
1743 When running AUTOMOC, CMake searches for the strings listed in
1744 AUTOMOC_MACRO_NAMES in C++ source and header files. If any of the
1745 strings is found
1746
1747 · as the first non space string on a new line or
1748
1749 · as the first non space string after a { on a new line,
1750
1751 then the file will be processed by moc.
1752
1753 By default AUTOMOC_MACRO_NAMES is initialized from CMAKE_AUTO‐
1754 MOC_MACRO_NAMES.
1755
1756 See the cmake-qt(7) manual for more information on using CMake with Qt.
1757
1758 Example
1759 In this case the Q_OBJECT macro is hidden inside another macro called
1760 CUSTOM_MACRO. To let CMake know that source files that contain CUS‐
1761 TOM_MACRO need to be moc processed, we call:
1762
1763 set_property(TARGET tgt APPEND PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
1764
1765 AUTOMOC_MOC_OPTIONS
1766 Additional options for moc when using AUTOMOC
1767
1768 This property is only used if the AUTOMOC property is ON for this tar‐
1769 get. In this case, it holds additional command line options which will
1770 be used when moc is executed during the build, i.e. it is equivalent
1771 to the optional OPTIONS argument of the qt4_wrap_cpp() macro.
1772
1773 This property is initialized by the value of the CMAKE_AUTO‐
1774 MOC_MOC_OPTIONS variable if it is set when a target is created, or an
1775 empty string otherwise.
1776
1777 See the cmake-qt(7) manual for more information on using CMake with Qt.
1778
1779 AUTOMOC_PATH_PREFIX
1780 When this property is ON, CMake will generate the -p path prefix option
1781 for moc on AUTOMOC enabled Qt targets.
1782
1783 To generate the path prefix, CMake tests if the header compiled by moc
1784 is in any of the target include directories. If so, CMake will compute
1785 the relative path accordingly. If the header is not in the include
1786 directories, CMake will omit the -p path prefix option. moc usually
1787 generates a relative include path in that case.
1788
1789 AUTOMOC_PATH_PREFIX is initialized from the variable CMAKE_AUTO‐
1790 MOC_PATH_PREFIX, which is ON by default.
1791
1792 See the cmake-qt(7) manual for more information on using CMake with Qt.
1793
1794 Reproducible builds
1795 For reproducible builds it is recommended to keep headers that are moc
1796 compiled in one of the target include directories and set
1797 AUTOMOC_PATH_PREFIX to ON (which is the default). This ensures that:
1798
1799 · moc output files are identical on different build setups,
1800
1801 · moc output files will compile correctly when the source and/or build
1802 directory is a symbolic link.
1803
1804 AUTORCC
1805 Should the target be processed with auto-rcc (for Qt projects).
1806
1807 AUTORCC is a boolean specifying whether CMake will handle the Qt rcc
1808 code generator automatically, i.e. without having to use the
1809 QT4_ADD_RESOURCES() or QT5_ADD_RESOURCES() macro. Currently Qt4 and
1810 Qt5 are supported.
1811
1812 When this property is ON, CMake will handle .qrc files added as target
1813 sources at build time and invoke rcc accordingly. This property is
1814 initialized by the value of the CMAKE_AUTORCC variable if it is set
1815 when a target is created.
1816
1817 By default AUTORCC is processed by a custom command. If the .qrc file
1818 is GENERATED, a custom target is used instead.
1819
1820 When there are multiple .qrc files with the same name, CMake will gen‐
1821 erate unspecified unique output file names for rcc. Therefore, if
1822 Q_INIT_RESOURCE() or Q_CLEANUP_RESOURCE() need to be used, the .qrc
1823 file name must be unique.
1824
1825 Modifiers
1826 AUTORCC_EXECUTABLE: The rcc executable will be detected automatically,
1827 but can be forced to a certain binary by setting this target property.
1828
1829 AUTORCC_OPTIONS: Additional command line options for rcc can be set via
1830 this target property. The corresponding AUTORCC_OPTIONS source file
1831 property can be used to specify options to be applied only to a spe‐
1832 cific .qrc file.
1833
1834 SKIP_AUTORCC: .qrc files can be excluded from AUTORCC processing by
1835 setting this source file property.
1836
1837 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
1838 AUTORCC processing by setting this source file property.
1839
1840 AUTOGEN_SOURCE_GROUP: This global property can be used to group files
1841 generated by AUTOMOC or AUTORCC together in an IDE, e.g. in MSVS.
1842
1843 AUTOGEN_TARGETS_FOLDER: This global property can be used to group AUTO‐
1844 MOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
1845
1846 CMAKE_GLOBAL_AUTORCC_TARGET: A global autorcc target that depends on
1847 all AUTORCC targets in the project will be generated when this variable
1848 is ON.
1849
1850 See the cmake-qt(7) manual for more information on using CMake with Qt.
1851
1852 AUTORCC_EXECUTABLE
1853 AUTORCC_EXECUTABLE is file path pointing to the rcc executable to use
1854 for AUTORCC enabled files. Setting this property will make CMake skip
1855 the automatic detection of the rcc binary as well as the sanity-tests
1856 normally run to ensure that the binary is available and working as
1857 expected.
1858
1859 Usually this property does not need to be set. Only consider this prop‐
1860 erty if auto-detection of rcc can not work – e.g. because you are
1861 building the rcc binary as part of your project.
1862
1863 See the cmake-qt(7) manual for more information on using CMake with Qt.
1864
1865 AUTORCC_OPTIONS
1866 Additional options for rcc when using AUTORCC
1867
1868 This property holds additional command line options which will be used
1869 when rcc is executed during the build via AUTORCC, i.e. it is equiva‐
1870 lent to the optional OPTIONS argument of the qt4_add_resources() macro.
1871
1872 This property is initialized by the value of the CMAKE_AUTORCC_OPTIONS
1873 variable if it is set when a target is created, or an empty string oth‐
1874 erwise.
1875
1876 The options set on the target may be overridden by AUTORCC_OPTIONS set
1877 on the .qrc source file.
1878
1879 See the cmake-qt(7) manual for more information on using CMake with Qt.
1880
1881 EXAMPLE
1882 # ...
1883 set_property(TARGET tgt PROPERTY AUTORCC_OPTIONS "--compress;9")
1884 # ...
1885
1886 AUTOUIC
1887 Should the target be processed with auto-uic (for Qt projects).
1888
1889 AUTOUIC is a boolean specifying whether CMake will handle the Qt uic
1890 code generator automatically, i.e. without having to use the
1891 QT4_WRAP_UI() or QT5_WRAP_UI() macro. Currently Qt4 and Qt5 are sup‐
1892 ported.
1893
1894 This property is initialized by the value of the CMAKE_AUTOUIC variable
1895 if it is set when a target is created.
1896
1897 When this property is ON, CMake will scan the header and source files
1898 at build time and invoke uic accordingly.
1899
1900 Header and source file processing
1901 At build time, CMake scans each header and source file from the tar‐
1902 get’s sources for include statements of the form
1903
1904 #include "ui_<ui_base>.h"
1905
1906 Once such an include statement is found in a file, CMake searches for
1907 the uic input file <ui_base>.ui
1908
1909 · in the vicinity of the file and
1910
1911 · in the AUTOUIC_SEARCH_PATHS of the target.
1912
1913 If the <ui_base>.ui file was found, uic is called on it to generate
1914 ui_<ui_base>.h in the directory
1915
1916 · <AUTOGEN_BUILD_DIR>/include for single configuration generators or in
1917
1918 · <AUTOGEN_BUILD_DIR>/include_<CONFIG> for multi configuration genera‐
1919 tors.
1920
1921 Where <AUTOGEN_BUILD_DIR> is the value of the target property AUTO‐
1922 GEN_BUILD_DIR.
1923
1924 The include directory is automatically added to the target’s
1925 INCLUDE_DIRECTORIES.
1926
1927 Modifiers
1928 AUTOUIC_EXECUTABLE: The uic executable will be detected automatically,
1929 but can be forced to a certain binary using this target property.
1930
1931 AUTOUIC_OPTIONS: Additional command line options for uic can be set via
1932 this target property. The corresponding AUTOUIC_OPTIONS source file
1933 property can be used to specify options to be applied only to a spe‐
1934 cific <base_name>.ui file.
1935
1936 SKIP_AUTOUIC: Source files can be excluded from AUTOUIC processing by
1937 setting this source file property.
1938
1939 SKIP_AUTOGEN: Source files can be excluded from AUTOMOC, AUTOUIC and
1940 AUTORCC processing by setting this source file property.
1941
1942 AUTOGEN_TARGETS_FOLDER: This global property can be used to group AUTO‐
1943 MOC, AUTOUIC and AUTORCC targets together in an IDE, e.g. in MSVS.
1944
1945 CMAKE_GLOBAL_AUTOGEN_TARGET: A global autogen target, that depends on
1946 all AUTOMOC or AUTOUIC generated <ORIGIN>_autogen targets in the
1947 project, will be generated when this variable is ON.
1948
1949 AUTOGEN_PARALLEL: This target property controls the number of moc or
1950 uic processes to start in parallel during builds.
1951
1952 See the cmake-qt(7) manual for more information on using CMake with Qt.
1953
1954 AUTOUIC_EXECUTABLE
1955 AUTOUIC_EXECUTABLE is file path pointing to the uic executable to use
1956 for AUTOUIC enabled files. Setting this property will make CMake skip
1957 the automatic detection of the uic binary as well as the sanity-tests
1958 normally run to ensure that the binary is available and working as
1959 expected.
1960
1961 Usually this property does not need to be set. Only consider this prop‐
1962 erty if auto-detection of uic can not work – e.g. because you are
1963 building the uic binary as part of your project.
1964
1965 See the cmake-qt(7) manual for more information on using CMake with Qt.
1966
1967 AUTOUIC_OPTIONS
1968 Additional options for uic when using AUTOUIC
1969
1970 This property holds additional command line options which will be used
1971 when uic is executed during the build via AUTOUIC, i.e. it is equiva‐
1972 lent to the optional OPTIONS argument of the qt4_wrap_ui() macro.
1973
1974 This property is initialized by the value of the CMAKE_AUTOUIC_OPTIONS
1975 variable if it is set when a target is created, or an empty string oth‐
1976 erwise.
1977
1978 The options set on the target may be overridden by AUTOUIC_OPTIONS set
1979 on the .ui source file.
1980
1981 This property may use “generator expressions” with the syntax $<...>.
1982 See the cmake-generator-expressions(7) manual for available expres‐
1983 sions.
1984
1985 See the cmake-qt(7) manual for more information on using CMake with Qt.
1986
1987 EXAMPLE
1988 # ...
1989 set_property(TARGET tgt PROPERTY AUTOUIC_OPTIONS "--no-protection")
1990 # ...
1991
1992 AUTOUIC_SEARCH_PATHS
1993 Search path list used by AUTOUIC to find included .ui files.
1994
1995 This property is initialized by the value of the
1996 CMAKE_AUTOUIC_SEARCH_PATHS variable if it is set when a target is cre‐
1997 ated. Otherwise it is empty.
1998
1999 See the cmake-qt(7) manual for more information on using CMake with Qt.
2000
2001 BINARY_DIR
2002 This read-only property reports the value of the CMAKE_CUR‐
2003 RENT_BINARY_DIR variable in the directory in which the target was
2004 defined.
2005
2006 BUILD_RPATH
2007 A semicolon-separated list specifying runtime path (RPATH) entries to
2008 add to binaries linked in the build tree (for platforms that support
2009 it). The entries will not be used for binaries in the install tree.
2010 See also the INSTALL_RPATH target property.
2011
2012 This property is initialized by the value of the variable
2013 CMAKE_BUILD_RPATH if it is set when a target is created.
2014
2015 This property supports generator expressions.
2016
2017 BUILD_RPATH_USE_ORIGIN
2018 Whether to use relative paths for the build RPATH.
2019
2020 This property is initialized by the value of the variable
2021 CMAKE_BUILD_RPATH_USE_ORIGIN.
2022
2023 On platforms that support runtime paths (RPATH) with the $ORIGIN token,
2024 setting this property to TRUE enables relative paths in the build RPATH
2025 for executables and shared libraries that point to shared libraries in
2026 the same build tree.
2027
2028 Normally the build RPATH of a binary contains absolute paths to the
2029 directory of each shared library it links to. The RPATH entries for
2030 directories contained within the build tree can be made relative to
2031 enable relocatable builds and to help achieve reproducible builds by
2032 omitting the build directory from the build environment.
2033
2034 This property has no effect on platforms that do not support the $ORI‐
2035 GIN token in RPATH, or when the CMAKE_SKIP_RPATH variable is set. The
2036 runtime path set through the BUILD_RPATH target property is also unaf‐
2037 fected by this property.
2038
2039 BUILD_WITH_INSTALL_NAME_DIR
2040 BUILD_WITH_INSTALL_NAME_DIR is a boolean specifying whether the macOS
2041 install_name of a target in the build tree uses the directory given by
2042 INSTALL_NAME_DIR. This setting only applies to targets on macOS.
2043
2044 This property is initialized by the value of the variable
2045 CMAKE_BUILD_WITH_INSTALL_NAME_DIR if it is set when a target is cre‐
2046 ated.
2047
2048 If this property is not set and policy CMP0068 is not NEW, the value of
2049 BUILD_WITH_INSTALL_RPATH is used in its place.
2050
2051 BUILD_WITH_INSTALL_RPATH
2052 BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link the
2053 target in the build tree with the INSTALL_RPATH. This takes precedence
2054 over SKIP_BUILD_RPATH and avoids the need for relinking before instal‐
2055 lation.
2056
2057 This property is initialized by the value of the
2058 CMAKE_BUILD_WITH_INSTALL_RPATH variable if it is set when a target is
2059 created.
2060
2061 If policy CMP0068 is not NEW, this property also controls use of
2062 INSTALL_NAME_DIR in the build tree on macOS. Either way, the
2063 BUILD_WITH_INSTALL_NAME_DIR target property takes precedence.
2064
2065 BUNDLE_EXTENSION
2066 The file extension used to name a BUNDLE, a FRAMEWORK, or a MACOSX_BUN‐
2067 DLE target on the macOS and iOS.
2068
2069 The default value is bundle, framework, or app for the respective tar‐
2070 get types.
2071
2072 BUNDLE
2073 This target is a CFBundle on the macOS.
2074
2075 If a module library target has this property set to true it will be
2076 built as a CFBundle when built on the mac. It will have the directory
2077 structure required for a CFBundle and will be suitable to be used for
2078 creating Browser Plugins or other application resources.
2079
2080 C_EXTENSIONS
2081 Boolean specifying whether compiler specific extensions are requested.
2082
2083 This property specifies whether compiler specific extensions should be
2084 used. For some compilers, this results in adding a flag such as
2085 -std=gnu11 instead of -std=c11 to the compile line. This property is
2086 ON by default. The basic C standard level is controlled by the C_STAN‐
2087 DARD target property.
2088
2089 See the cmake-compile-features(7) manual for information on compile
2090 features and a list of supported compilers.
2091
2092 This property is initialized by the value of the CMAKE_C_EXTENSIONS
2093 variable if it is set when a target is created.
2094
2095 C_STANDARD
2096 The C standard whose features are requested to build this target.
2097
2098 This property specifies the C standard whose features are requested to
2099 build this target. For some compilers, this results in adding a flag
2100 such as -std=gnu11 to the compile line. For compilers that have no
2101 notion of a standard level, such as Microsoft Visual C++ before 2015
2102 Update 3, this has no effect.
2103
2104 Supported values are 90, 99 and 11.
2105
2106 If the value requested does not result in a compile flag being added
2107 for the compiler in use, a previous standard flag will be added
2108 instead. This means that using:
2109
2110 set_property(TARGET tgt PROPERTY C_STANDARD 11)
2111
2112 with a compiler which does not support -std=gnu11 or an equivalent flag
2113 will not result in an error or warning, but will instead add the
2114 -std=gnu99 or -std=gnu90 flag if supported. This “decay” behavior may
2115 be controlled with the C_STANDARD_REQUIRED target property. Addition‐
2116 ally, the C_EXTENSIONS target property may be used to control whether
2117 compiler-specific extensions are enabled on a per-target basis.
2118
2119 See the cmake-compile-features(7) manual for information on compile
2120 features and a list of supported compilers.
2121
2122 This property is initialized by the value of the CMAKE_C_STANDARD vari‐
2123 able if it is set when a target is created.
2124
2125 C_STANDARD_REQUIRED
2126 Boolean describing whether the value of C_STANDARD is a requirement.
2127
2128 If this property is set to ON, then the value of the C_STANDARD target
2129 property is treated as a requirement. If this property is OFF or
2130 unset, the C_STANDARD target property is treated as optional and may
2131 “decay” to a previous standard if the requested is not available. For
2132 compilers that have no notion of a standard level, such as MSVC, this
2133 has no effect.
2134
2135 See the cmake-compile-features(7) manual for information on compile
2136 features and a list of supported compilers.
2137
2138 This property is initialized by the value of the CMAKE_C_STAN‐
2139 DARD_REQUIRED variable if it is set when a target is created.
2140
2141 COMMON_LANGUAGE_RUNTIME
2142 By setting this target property, the target is configured to build with
2143 C++/CLI support.
2144
2145 The Visual Studio generator defines the clr parameter depending on the
2146 value of COMMON_LANGUAGE_RUNTIME:
2147
2148 · property not set: native C++ (i.e. default)
2149
2150 · property set but empty: mixed unmanaged/managed C++
2151
2152 · property set to any non empty value: managed C++
2153
2154 Supported values: "", "pure", "safe"
2155
2156 This property is only evaluated Visual Studio Generators for VS 2010
2157 and above.
2158
2159 To be able to build managed C++ targets with VS 2017 and above the com‐
2160 ponent C++/CLI support must be installed, which may not be done by
2161 default.
2162
2163 See also IMPORTED_COMMON_LANGUAGE_RUNTIME
2164
2165 COMPATIBLE_INTERFACE_BOOL
2166 Properties which must be compatible with their link interface
2167
2168 The COMPATIBLE_INTERFACE_BOOL property may contain a list of properties
2169 for this target which must be consistent when evaluated as a boolean
2170 with the INTERFACE variant of the property in all linked dependees.
2171 For example, if a property FOO appears in the list, then for each
2172 dependee, the INTERFACE_FOO property content in all of its dependencies
2173 must be consistent with each other, and with the FOO property in the
2174 depender.
2175
2176 Consistency in this sense has the meaning that if the property is set,
2177 then it must have the same boolean value as all others, and if the
2178 property is not set, then it is ignored.
2179
2180 Note that for each dependee, the set of properties specified in this
2181 property must not intersect with the set specified in any of the other
2182 Compatible Interface Properties.
2183
2184 COMPATIBLE_INTERFACE_NUMBER_MAX
2185 Properties whose maximum value from the link interface will be used.
2186
2187 The COMPATIBLE_INTERFACE_NUMBER_MAX property may contain a list of
2188 properties for this target whose maximum value may be read at generate
2189 time when evaluated in the INTERFACE variant of the property in all
2190 linked dependees. For example, if a property FOO appears in the list,
2191 then for each dependee, the INTERFACE_FOO property content in all of
2192 its dependencies will be compared with each other and with the FOO
2193 property in the depender. When reading the FOO property at generate
2194 time, the maximum value will be returned. If the property is not set,
2195 then it is ignored.
2196
2197 Note that for each dependee, the set of properties specified in this
2198 property must not intersect with the set specified in any of the other
2199 Compatible Interface Properties.
2200
2201 COMPATIBLE_INTERFACE_NUMBER_MIN
2202 Properties whose maximum value from the link interface will be used.
2203
2204 The COMPATIBLE_INTERFACE_NUMBER_MIN property may contain a list of
2205 properties for this target whose minimum value may be read at generate
2206 time when evaluated in the INTERFACE variant of the property of all
2207 linked dependees. For example, if a property FOO appears in the list,
2208 then for each dependee, the INTERFACE_FOO property content in all of
2209 its dependencies will be compared with each other and with the FOO
2210 property in the depender. When reading the FOO property at generate
2211 time, the minimum value will be returned. If the property is not set,
2212 then it is ignored.
2213
2214 Note that for each dependee, the set of properties specified in this
2215 property must not intersect with the set specified in any of the other
2216 Compatible Interface Properties.
2217
2218 COMPATIBLE_INTERFACE_STRING
2219 Properties which must be string-compatible with their link interface
2220
2221 The COMPATIBLE_INTERFACE_STRING property may contain a list of proper‐
2222 ties for this target which must be the same when evaluated as a string
2223 in the INTERFACE variant of the property all linked dependees. For
2224 example, if a property FOO appears in the list, then for each dependee,
2225 the INTERFACE_FOO property content in all of its dependencies must be
2226 equal with each other, and with the FOO property in the depender. If
2227 the property is not set, then it is ignored.
2228
2229 Note that for each dependee, the set of properties specified in this
2230 property must not intersect with the set specified in any of the other
2231 Compatible Interface Properties.
2232
2233 COMPILE_DEFINITIONS
2234 Preprocessor definitions for compiling a target’s sources.
2235
2236 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
2237 list of preprocessor definitions using the syntax VAR or VAR=value.
2238 Function-style definitions are not supported. CMake will automatically
2239 escape the value correctly for the native build system (note that CMake
2240 language syntax may require escapes to specify some values).
2241
2242 CMake will automatically drop some definitions that are not supported
2243 by the native build tool.
2244
2245 Disclaimer: Most native build tools have poor support for escaping cer‐
2246 tain values. CMake has work-arounds for many cases but some values may
2247 just not be possible to pass correctly. If a value does not seem to be
2248 escaped correctly, do not attempt to work-around the problem by adding
2249 escape sequences to the value. Your work-around may break in a future
2250 version of CMake that has improved escape support. Instead consider
2251 defining the macro in a (configured) header file. Then report the lim‐
2252 itation. Known limitations include:
2253
2254 # - broken almost everywhere
2255 ; - broken in VS IDE 7.0 and Borland Makefiles
2256 , - broken in VS IDE
2257 % - broken in some cases in NMake
2258 & | - broken in some cases on MinGW
2259 ^ < > \" - broken in most Make tools on Windows
2260
2261 CMake does not reject these values outright because they do work in
2262 some cases. Use with caution.
2263
2264 Contents of COMPILE_DEFINITIONS may use “generator expressions” with
2265 the syntax $<...>. See the cmake-generator-expressions(7) manual for
2266 available expressions. See the cmake-buildsystem(7) manual for more on
2267 defining buildsystem properties.
2268
2269 The corresponding COMPILE_DEFINITIONS_<CONFIG> property may be set to
2270 specify per-configuration definitions. Generator expressions should be
2271 preferred instead of setting the alternative property.
2272
2273 COMPILE_FEATURES
2274 Compiler features enabled for this target.
2275
2276 The list of features in this property are a subset of the features
2277 listed in the CMAKE_C_COMPILE_FEATURES, CMAKE_CUDA_COMPILE_FEATURES,
2278 and CMAKE_CXX_COMPILE_FEATURES variables.
2279
2280 Contents of COMPILE_FEATURES may use “generator expressions” with the
2281 syntax $<...>. See the cmake-generator-expressions(7) manual for
2282 available expressions. See the cmake-compile-features(7) manual for
2283 information on compile features and a list of supported compilers.
2284
2285 COMPILE_FLAGS
2286 Additional flags to use when compiling this target’s sources.
2287
2288 The COMPILE_FLAGS property sets additional compiler flags used to build
2289 sources within the target. Use COMPILE_DEFINITIONS to pass additional
2290 preprocessor definitions.
2291
2292 This property is deprecated. Use the COMPILE_OPTIONS property or the
2293 target_compile_options() command instead.
2294
2295 COMPILE_OPTIONS
2296 List of options to pass to the compiler.
2297
2298 This property holds a semicolon-separated list of options specified so
2299 far for its target. Use the target_compile_options() command to append
2300 more options.
2301
2302 This property is initialized by the COMPILE_OPTIONS directory property
2303 when a target is created, and is used by the generators to set the
2304 options for the compiler.
2305
2306 Contents of COMPILE_OPTIONS may use “generator expressions” with the
2307 syntax $<...>. See the cmake-generator-expressions(7) manual for
2308 available expressions. See the cmake-buildsystem(7) manual for more on
2309 defining buildsystem properties.
2310
2311 COMPILE_PDB_NAME
2312 Output name for the MS debug symbol .pdb file generated by the compiler
2313 while building source files.
2314
2315 This property specifies the base name for the debug symbols file. If
2316 not set, the default is unspecified.
2317
2318 NOTE:
2319 The compiler-generated program database files are specified by the
2320 /Fd compiler flag and are not the same as linker-generated program
2321 database files specified by the /pdb linker flag. Use the PDB_NAME
2322 property to specify the latter.
2323
2324 COMPILE_PDB_NAME_<CONFIG>
2325 Per-configuration output name for the MS debug symbol .pdb file gener‐
2326 ated by the compiler while building source files.
2327
2328 This is the configuration-specific version of COMPILE_PDB_NAME.
2329
2330 NOTE:
2331 The compiler-generated program database files are specified by the
2332 /Fd compiler flag and are not the same as linker-generated program
2333 database files specified by the /pdb linker flag. Use the
2334 PDB_NAME_<CONFIG> property to specify the latter.
2335
2336 COMPILE_PDB_OUTPUT_DIRECTORY
2337 Output directory for the MS debug symbol .pdb file generated by the
2338 compiler while building source files.
2339
2340 This property specifies the directory into which the MS debug symbols
2341 will be placed by the compiler. This property is initialized by the
2342 value of the CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY variable if it is set
2343 when a target is created.
2344
2345 NOTE:
2346 The compiler-generated program database files are specified by the
2347 /Fd compiler flag and are not the same as linker-generated program
2348 database files specified by the /pdb linker flag. Use the PDB_OUT‐
2349 PUT_DIRECTORY property to specify the latter.
2350
2351 COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
2352 Per-configuration output directory for the MS debug symbol .pdb file
2353 generated by the compiler while building source files.
2354
2355 This is a per-configuration version of COMPILE_PDB_OUTPUT_DIRECTORY,
2356 but multi-configuration generators (Visual Studio, Xcode) do NOT append
2357 a per-configuration subdirectory to the specified directory. This
2358 property is initialized by the value of the CMAKE_COMPILE_PDB_OUT‐
2359 PUT_DIRECTORY_<CONFIG> variable if it is set when a target is created.
2360
2361 NOTE:
2362 The compiler-generated program database files are specified by the
2363 /Fd compiler flag and are not the same as linker-generated program
2364 database files specified by the /pdb linker flag. Use the PDB_OUT‐
2365 PUT_DIRECTORY_<CONFIG> property to specify the latter.
2366
2367 <CONFIG>_OUTPUT_NAME
2368 Old per-configuration target file base name. Use OUTPUT_NAME_<CONFIG>
2369 instead.
2370
2371 This is a configuration-specific version of the OUTPUT_NAME target
2372 property.
2373
2374 <CONFIG>_POSTFIX
2375 Postfix to append to the target file name for configuration <CONFIG>.
2376
2377 When building with configuration <CONFIG> the value of this property is
2378 appended to the target file name built on disk. For non-executable
2379 targets, this property is initialized by the value of the variable
2380 CMAKE_<CONFIG>_POSTFIX if it is set when a target is created. This
2381 property is ignored on the Mac for Frameworks and App Bundles.
2382
2383 CROSSCOMPILING_EMULATOR
2384 Use the given emulator to run executables created when crosscompiling.
2385 This command will be added as a prefix to add_test(), add_custom_com‐
2386 mand(), and add_custom_target() commands for built target system exe‐
2387 cutables.
2388
2389 If this property contains a semicolon-separated list, then the first
2390 value is the command and remaining values are its arguments.
2391
2392 This property is initialized by the value of the CMAKE_CROSSCOMPIL‐
2393 ING_EMULATOR variable if it is set when a target is created.
2394
2395 CUDA_PTX_COMPILATION
2396 Compile CUDA sources to .ptx files instead of .obj files within Object
2397 Libraries.
2398
2399 For example:
2400
2401 add_library(myptx OBJECT a.cu b.cu)
2402 set_property(TARGET myptx PROPERTY CUDA_PTX_COMPILATION ON)
2403
2404 CUDA_SEPARABLE_COMPILATION
2405 CUDA only: Enables separate compilation of device code
2406
2407 If set this will enable separable compilation for all CUDA files for
2408 the given target.
2409
2410 For instance:
2411
2412 set_property(TARGET myexe PROPERTY CUDA_SEPARABLE_COMPILATION ON)
2413
2414 This property is initialized by the value of the CMAKE_CUDA_SEPARA‐
2415 BLE_COMPILATION variable if it is set when a target is created.
2416
2417 CUDA_RESOLVE_DEVICE_SYMBOLS
2418 CUDA only: Enables device linking for the specific library target where
2419 required.
2420
2421 If set, this will tell the required compilers to enable device linking
2422 on the library target. Device linking is an additional link step
2423 required by some CUDA compilers when CUDA_SEPARABLE_COMPILATION is
2424 enabled. Normally device linking is deferred until a shared library or
2425 executable is generated, allowing for multiple static libraries to
2426 resolve device symbols at the same time when they are used by a shared
2427 library or executable.
2428
2429 By default static library targets have this property is disabled, while
2430 shared, module, and executable targets have this property enabled.
2431
2432 Note that device linking is not supported for Object Libraries.
2433
2434 For instance:
2435
2436 set_property(TARGET mystaticlib PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
2437
2438 CUDA_RUNTIME_LIBRARY
2439 Select the CUDA runtime library for use by compilers targeting the CUDA
2440 language.
2441
2442 The allowed case insensitive values are:
2443
2444 None Link with -cudart=none or equivalent flag(s) to use no CUDA run‐
2445 time library.
2446
2447 Shared Link with -cudart=shared or equivalent flag(s) to use a dynami‐
2448 cally-linked CUDA runtime library.
2449
2450 Static Link with -cudart=static or equivalent flag(s) to use a stati‐
2451 cally-linked CUDA runtime library.
2452
2453 Contents of CUDA_RUNTIME_LIBRARY may use generator expressions.
2454
2455 If this property is not set then CMake uses the default value Static to
2456 select the CUDA runtime library.
2457
2458 NOTE:
2459 This property has effect only when the CUDA language is enabled. To
2460 control the CUDA runtime linking when only using the CUDA SDK with
2461 the C or C++ language we recommend using the FindCUDAToolkit module.
2462
2463 CUDA_EXTENSIONS
2464 Boolean specifying whether compiler specific extensions are requested.
2465
2466 This property specifies whether compiler specific extensions should be
2467 used. For some compilers, this results in adding a flag such as
2468 -std=gnu++11 instead of -std=c++11 to the compile line. This property
2469 is ON by default. The basic CUDA/C++ standard level is controlled by
2470 the CUDA_STANDARD target property.
2471
2472 See the cmake-compile-features(7) manual for information on compile
2473 features and a list of supported compilers.
2474
2475 This property is initialized by the value of the CMAKE_CUDA_EXTENSIONS
2476 variable if it is set when a target is created.
2477
2478 CUDA_STANDARD
2479 The CUDA/C++ standard whose features are requested to build this tar‐
2480 get.
2481
2482 This property specifies the CUDA/C++ standard whose features are
2483 requested to build this target. For some compilers, this results in
2484 adding a flag such as -std=gnu++11 to the compile line.
2485
2486 Supported values are 98, 11, 14.
2487
2488 If the value requested does not result in a compile flag being added
2489 for the compiler in use, a previous standard flag will be added
2490 instead. This means that using:
2491
2492 set_property(TARGET tgt PROPERTY CUDA_STANDARD 11)
2493
2494 with a compiler which does not support -std=gnu++11 or an equivalent
2495 flag will not result in an error or warning, but will instead add the
2496 -std=gnu++98 flag if supported. This “decay” behavior may be con‐
2497 trolled with the CUDA_STANDARD_REQUIRED target property. Additionally,
2498 the CUDA_EXTENSIONS target property may be used to control whether com‐
2499 piler-specific extensions are enabled on a per-target basis.
2500
2501 See the cmake-compile-features(7) manual for information on compile
2502 features and a list of supported compilers.
2503
2504 This property is initialized by the value of the CMAKE_CUDA_STANDARD
2505 variable if it is set when a target is created.
2506
2507 CUDA_STANDARD_REQUIRED
2508 Boolean describing whether the value of CUDA_STANDARD is a requirement.
2509
2510 If this property is set to ON, then the value of the CUDA_STANDARD tar‐
2511 get property is treated as a requirement. If this property is OFF or
2512 unset, the CUDA_STANDARD target property is treated as optional and may
2513 “decay” to a previous standard if the requested is not available. For
2514 compilers that have no notion of a standard level, such as MSVC, this
2515 has no effect.
2516
2517 See the cmake-compile-features(7) manual for information on compile
2518 features and a list of supported compilers.
2519
2520 This property is initialized by the value of the CMAKE_CUDA_STAN‐
2521 DARD_REQUIRED variable if it is set when a target is created.
2522
2523 CXX_EXTENSIONS
2524 Boolean specifying whether compiler specific extensions are requested.
2525
2526 This property specifies whether compiler specific extensions should be
2527 used. For some compilers, this results in adding a flag such as
2528 -std=gnu++11 instead of -std=c++11 to the compile line. This property
2529 is ON by default. The basic C++ standard level is controlled by the
2530 CXX_STANDARD target property.
2531
2532 See the cmake-compile-features(7) manual for information on compile
2533 features and a list of supported compilers.
2534
2535 This property is initialized by the value of the CMAKE_CXX_EXTENSIONS
2536 variable if it is set when a target is created.
2537
2538 CXX_STANDARD
2539 The C++ standard whose features are requested to build this target.
2540
2541 This property specifies the C++ standard whose features are requested
2542 to build this target. For some compilers, this results in adding a
2543 flag such as -std=gnu++11 to the compile line. For compilers that have
2544 no notion of a standard level, such as Microsoft Visual C++ before 2015
2545 Update 3, this has no effect.
2546
2547 Supported values are 98, 11, 14, 17, and 20.
2548
2549 If the value requested does not result in a compile flag being added
2550 for the compiler in use, a previous standard flag will be added
2551 instead. This means that using:
2552
2553 set_property(TARGET tgt PROPERTY CXX_STANDARD 11)
2554
2555 with a compiler which does not support -std=gnu++11 or an equivalent
2556 flag will not result in an error or warning, but will instead add the
2557 -std=gnu++98 flag if supported. This “decay” behavior may be con‐
2558 trolled with the CXX_STANDARD_REQUIRED target property. Additionally,
2559 the CXX_EXTENSIONS target property may be used to control whether com‐
2560 piler-specific extensions are enabled on a per-target basis.
2561
2562 See the cmake-compile-features(7) manual for information on compile
2563 features and a list of supported compilers.
2564
2565 This property is initialized by the value of the CMAKE_CXX_STANDARD
2566 variable if it is set when a target is created.
2567
2568 CXX_STANDARD_REQUIRED
2569 Boolean describing whether the value of CXX_STANDARD is a requirement.
2570
2571 If this property is set to ON, then the value of the CXX_STANDARD tar‐
2572 get property is treated as a requirement. If this property is OFF or
2573 unset, the CXX_STANDARD target property is treated as optional and may
2574 “decay” to a previous standard if the requested is not available. For
2575 compilers that have no notion of a standard level, such as MSVC, this
2576 has no effect.
2577
2578 See the cmake-compile-features(7) manual for information on compile
2579 features and a list of supported compilers.
2580
2581 This property is initialized by the value of the CMAKE_CXX_STAN‐
2582 DARD_REQUIRED variable if it is set when a target is created.
2583
2584 DEBUG_POSTFIX
2585 See target property <CONFIG>_POSTFIX.
2586
2587 This property is a special case of the more-general <CONFIG>_POSTFIX
2588 property for the DEBUG configuration.
2589
2590 DEFINE_SYMBOL
2591 Define a symbol when compiling this target’s sources.
2592
2593 DEFINE_SYMBOL sets the name of the preprocessor symbol defined when
2594 compiling sources in a shared library. If not set here then it is set
2595 to target_EXPORTS by default (with some substitutions if the target is
2596 not a valid C identifier). This is useful for headers to know whether
2597 they are being included from inside their library or outside to prop‐
2598 erly setup dllexport/dllimport decorations.
2599
2600 DEPLOYMENT_REMOTE_DIRECTORY
2601 Set the WinCE project RemoteDirectory in DeploymentTool and RemoteExe‐
2602 cutable in DebuggerTool in .vcproj files generated by the Visual Studio
2603 9 2008 generator. This is useful when you want to debug on remote
2604 WinCE device. For example:
2605
2606 set_property(TARGET ${TARGET} PROPERTY
2607 DEPLOYMENT_REMOTE_DIRECTORY "\\FlashStorage")
2608
2609 produces:
2610
2611 <DeploymentTool RemoteDirectory="\FlashStorage" ... />
2612 <DebuggerTool RemoteExecutable="\FlashStorage\target_file" ... />
2613
2614 DEPLOYMENT_ADDITIONAL_FILES
2615 Set the WinCE project AdditionalFiles in DeploymentTool in .vcproj
2616 files generated by the Visual Studio 9 2008 generator. This is useful
2617 when you want to debug on remote WinCE device. Specify additional
2618 files that will be copied to the device. For example:
2619
2620 set_property(TARGET ${TARGET} PROPERTY
2621 DEPLOYMENT_ADDITIONAL_FILES "english.lng|local_folder|remote_folder|0"
2622 "german.lng|local_folder|remote_folder|0")
2623
2624 produces:
2625
2626 <DeploymentTool AdditionalFiles="english.lng|local_folder|remote_folder|0;german.lng|local_folder|remote_folder|0" ... />
2627
2628 DEPRECATION
2629 Deprecation message from imported target’s developer.
2630
2631 DEPRECATION is the message regarding a deprecation status to be dis‐
2632 played to downstream users of a target.
2633
2634 DISABLE_PRECOMPILE_HEADERS
2635 Disables the precompilation of header files specified by PRECOM‐
2636 PILE_HEADERS property.
2637
2638 If the property is not set, CMake will use the value provided by
2639 CMAKE_DISABLE_PRECOMPILE_HEADERS.
2640
2641 DOTNET_TARGET_FRAMEWORK
2642 Specify the .NET target framework.
2643
2644 Used to specify the .NET target framework for C++/CLI and C#. For
2645 example: netcoreapp2.1.
2646
2647 This property is only evaluated for Visual Studio Generators VS 2010
2648 and above.
2649
2650 Can be initialized for all targets using the variable CMAKE_DOTNET_TAR‐
2651 GET_FRAMEWORK.
2652
2653 DOTNET_TARGET_FRAMEWORK_VERSION
2654 Specify the .NET target framework version.
2655
2656 Used to specify the .NET target framework version for C++/CLI and C#.
2657 For example: v4.5.
2658
2659 This property is only evaluated for Visual Studio Generators VS 2010
2660 and above.
2661
2662 To initialize this variable for all targets set CMAKE_DOTNET_TAR‐
2663 GET_FRAMEWORK or CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION. If both are
2664 set, the latter is ignored.
2665
2666 EchoString
2667 A message to be displayed when the target is built.
2668
2669 A message to display on some generators (such as Makefile Generators)
2670 when the target is built.
2671
2672 ENABLE_EXPORTS
2673 Specify whether an executable exports symbols for loadable modules.
2674
2675 Normally an executable does not export any symbols because it is the
2676 final program. It is possible for an executable to export symbols to
2677 be used by loadable modules. When this property is set to true CMake
2678 will allow other targets to “link” to the executable with the tar‐
2679 get_link_libraries() command. On all platforms a target-level depen‐
2680 dency on the executable is created for targets that link to it. Han‐
2681 dling of the executable on the link lines of the loadable modules
2682 varies by platform:
2683
2684 · On Windows-based systems (including Cygwin) an “import library” is
2685 created along with the executable to list the exported symbols.
2686 Loadable modules link to the import library to get the symbols.
2687
2688 · On macOS, loadable modules link to the executable itself using the
2689 -bundle_loader flag.
2690
2691 · On AIX, a linker “import file” is created along with the executable
2692 to list the exported symbols for import when linking other targets.
2693 Loadable modules link to the import file to get the symbols.
2694
2695 · On other platforms, loadable modules are simply linked without refer‐
2696 encing the executable since the dynamic loader will automatically
2697 bind symbols when the module is loaded.
2698
2699 This property is initialized by the value of the variable
2700 CMAKE_ENABLE_EXPORTS if it is set when a target is created.
2701
2702 EXCLUDE_FROM_ALL
2703 Set this target property to a true (or false) value to exclude (or
2704 include) the target from the “all” target of the containing directory
2705 and its ancestors. If excluded, running e.g. make in the containing
2706 directory or its ancestors will not build the target by default.
2707
2708 If this target property is not set then the target will be included in
2709 the “all” target of the containing directory. Furthermore, it will be
2710 included in the “all” target of its ancestor directories unless the
2711 EXCLUDE_FROM_ALL directory property is set.
2712
2713 With EXCLUDE_FROM_ALL set to false or not set at all, the target will
2714 be brought up to date as part of doing a make install or its equivalent
2715 for the CMake generator being used. If a target has EXCLUDE_FROM_ALL
2716 set to true, then any attempt to install that target has undefined
2717 behavior. Note that such a target can still safely be listed in an
2718 install(TARGETS) command as long as the install components the target
2719 belongs to are not part of the set of components that anything tries to
2720 install.
2721
2722 EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>
2723 Per-configuration version of target exclusion from Build Solution.
2724
2725 This is the configuration-specific version of
2726 EXCLUDE_FROM_DEFAULT_BUILD. If the generic EXCLUDE_FROM_DEFAULT_BUILD
2727 is also set on a target, EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG> takes
2728 precedence in configurations for which it has a value.
2729
2730 EXCLUDE_FROM_DEFAULT_BUILD
2731 Exclude target from Build Solution.
2732
2733 This property is only used by Visual Studio generators. When set to
2734 TRUE, the target will not be built when you press Build Solution.
2735
2736 EXPORT_NAME
2737 Exported name for target files.
2738
2739 This sets the name for the IMPORTED target generated by the
2740 install(EXPORT) and export() commands. If not set, the logical target
2741 name is used by default.
2742
2743 EXPORT_PROPERTIES
2744 List additional properties to export for a target.
2745
2746 This property contains a list of property names that should be exported
2747 by the install(EXPORT) and export() commands. By default only a lim‐
2748 ited number of properties are exported. This property can be used to
2749 additionally export other properties as well.
2750
2751 Properties starting with INTERFACE_ or IMPORTED_ are not allowed as
2752 they are reserved for internal CMake use.
2753
2754 Properties containing generator expressions are also not allowed.
2755
2756 FOLDER
2757 Set the folder name. Use to organize targets in an IDE.
2758
2759 Targets with no FOLDER property will appear as top level entities in
2760 IDEs like Visual Studio. Targets with the same FOLDER property value
2761 will appear next to each other in a folder of that name. To nest fold‐
2762 ers, use FOLDER values such as ‘GUI/Dialogs’ with ‘/’ characters sepa‐
2763 rating folder levels.
2764
2765 This property is initialized by the value of the variable CMAKE_FOLDER
2766 if it is set when a target is created.
2767
2768 Fortran_FORMAT
2769 Set to FIXED or FREE to indicate the Fortran source layout.
2770
2771 This property tells CMake whether the Fortran source files in a target
2772 use fixed-format or free-format. CMake will pass the corresponding
2773 format flag to the compiler. Use the source-specific Fortran_FORMAT
2774 property to change the format of a specific source file. If the vari‐
2775 able CMAKE_Fortran_FORMAT is set when a target is created its value is
2776 used to initialize this property.
2777
2778 Fortran_MODULE_DIRECTORY
2779 Specify output directory for Fortran modules provided by the target.
2780
2781 If the target contains Fortran source files that provide modules and
2782 the compiler supports a module output directory this specifies the
2783 directory in which the modules will be placed. When this property is
2784 not set the modules will be placed in the build directory corresponding
2785 to the target’s source directory. If the variable CMAKE_Fortran_MOD‐
2786 ULE_DIRECTORY is set when a target is created its value is used to ini‐
2787 tialize this property.
2788
2789 Note that some compilers will automatically search the module output
2790 directory for modules USEd during compilation but others will not. If
2791 your sources USE modules their location must be specified by
2792 INCLUDE_DIRECTORIES regardless of this property.
2793
2794 FRAMEWORK
2795 Build SHARED or STATIC library as Framework Bundle on the macOS and
2796 iOS.
2797
2798 If such a library target has this property set to TRUE it will be built
2799 as a framework when built on the macOS and iOS. It will have the
2800 directory structure required for a framework and will be suitable to be
2801 used with the -framework option. This property is initialized by the
2802 value of the CMAKE_FRAMEWORK variable if it is set when a target is
2803 created.
2804
2805 To customize Info.plist file in the framework, use MACOSX_FRAME‐
2806 WORK_INFO_PLIST target property.
2807
2808 For macOS see also the FRAMEWORK_VERSION target property.
2809
2810 Example of creation dynamicFramework:
2811
2812 add_library(dynamicFramework SHARED
2813 dynamicFramework.c
2814 dynamicFramework.h
2815 )
2816 set_target_properties(dynamicFramework PROPERTIES
2817 FRAMEWORK TRUE
2818 FRAMEWORK_VERSION C
2819 MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework
2820 MACOSX_FRAMEWORK_INFO_PLIST Info.plist
2821 # "current version" in semantic format in Mach-O binary file
2822 VERSION 16.4.0
2823 # "compatibility version" in semantic format in Mach-O binary file
2824 SOVERSION 1.0.0
2825 PUBLIC_HEADER dynamicFramework.h
2826 XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
2827 )
2828
2829 FRAMEWORK_VERSION
2830 Version of a framework created using the FRAMEWORK target property
2831 (e.g. A).
2832
2833 This property only affects macOS, as iOS doesn’t have versioned direc‐
2834 tory structure.
2835
2836 GENERATOR_FILE_NAME
2837 Generator’s file for this target.
2838
2839 An internal property used by some generators to record the name of the
2840 project or dsp file associated with this target. Note that at config‐
2841 ure time, this property is only set for targets created by
2842 include_external_msproject().
2843
2844 GHS_INTEGRITY_APP
2845 ON / OFF boolean to determine if an executable target should be treated
2846 as an Integrity Application.
2847
2848 If no value is set and if a .int file is added as a source file to the
2849 executable target it will be treated as an Integrity Application.
2850
2851 Supported on Green Hills MULTI.
2852
2853 GHS_NO_SOURCE_GROUP_FILE
2854 ON / OFF boolean to control if the project file for a target should be
2855 one single file or multiple files.
2856
2857 The default behavior or when the property is OFF is to generate a
2858 project file for the target and then a sub-project file for each source
2859 group.
2860
2861 When this property is ON or if CMAKE_GHS_NO_SOURCE_GROUP_FILE is ON
2862 then only a single project file is generated for the target.
2863
2864 Supported on Green Hills MULTI.
2865
2866 GNUtoMS
2867 Convert GNU import library (.dll.a) to MS format (.lib).
2868
2869 When linking a shared library or executable that exports symbols using
2870 GNU tools on Windows (MinGW/MSYS) with Visual Studio installed convert
2871 the import library (.dll.a) from GNU to MS format (.lib). Both import
2872 libraries will be installed by install(TARGETS) and exported by
2873 install(EXPORT) and export() to be linked by applications with either
2874 GNU- or MS-compatible tools.
2875
2876 If the variable CMAKE_GNUtoMS is set when a target is created its value
2877 is used to initialize this property. The variable must be set prior to
2878 the first command that enables a language such as project() or
2879 enable_language(). CMake provides the variable as an option to the
2880 user automatically when configuring on Windows with GNU tools.
2881
2882 HAS_CXX
2883 Link the target using the C++ linker tool (obsolete).
2884
2885 This is equivalent to setting the LINKER_LANGUAGE property to CXX.
2886
2887 IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
2888 Specify #include line transforms for dependencies in a target.
2889
2890 This property specifies rules to transform macro-like #include lines
2891 during implicit dependency scanning of C and C++ source files. The
2892 list of rules must be semicolon-separated with each entry of the form
2893 “A_MACRO(%)=value-with-%” (the % must be literal). During dependency
2894 scanning occurrences of A_MACRO(…) on #include lines will be replaced
2895 by the value given with the macro argument substituted for ‘%’. For
2896 example, the entry
2897
2898 MYDIR(%)=<mydir/%>
2899
2900 will convert lines of the form
2901
2902 #include MYDIR(myheader.h)
2903
2904 to
2905
2906 #include <mydir/myheader.h>
2907
2908 allowing the dependency to be followed.
2909
2910 This property applies to sources in the target on which it is set.
2911
2912 IMPORTED_COMMON_LANGUAGE_RUNTIME
2913 Property to define if the target uses C++/CLI.
2914
2915 Ignored for non-imported targets.
2916
2917 See also the COMMON_LANGUAGE_RUNTIME target property.
2918
2919 IMPORTED_CONFIGURATIONS
2920 Configurations provided for an IMPORTED target.
2921
2922 Set this to the list of configuration names available for an IMPORTED
2923 target. The names correspond to configurations defined in the project
2924 from which the target is imported. If the importing project uses a
2925 different set of configurations the names may be mapped using the
2926 MAP_IMPORTED_CONFIG_<CONFIG> property. Ignored for non-imported tar‐
2927 gets.
2928
2929 IMPORTED_GLOBAL
2930 Indication of whether an IMPORTED target is globally visible.
2931
2932 The boolean value of this property is True for targets created with the
2933 IMPORTED GLOBAL options to add_executable() or add_library(). It is
2934 always False for targets built within the project.
2935
2936 For targets created with the IMPORTED option to add_executable() or
2937 add_library() but without the additional option GLOBAL this is False,
2938 too. However, setting this property for such a locally IMPORTED target
2939 to True promotes that target to global scope. This promotion can only
2940 be done in the same directory where that IMPORTED target was created in
2941 the first place.
2942
2943 Once an imported target has been made global, it cannot be changed back
2944 to non-global. Therefore, if a project sets this property, it may only
2945 provide a value of True. CMake will issue an error if the project tries
2946 to set the property to a non-True value, even if the value was already
2947 False.
2948
2949 IMPORTED_IMPLIB_<CONFIG>
2950 <CONFIG>-specific version of IMPORTED_IMPLIB property.
2951
2952 Configuration names correspond to those provided by the project from
2953 which the target is imported.
2954
2955 IMPORTED_IMPLIB
2956 Full path to the import library for an IMPORTED target.
2957
2958 Set this to the location of the .lib part of a Windows DLL, or on AIX
2959 set it to an import file created for executables that export symbols
2960 (see the ENABLE_EXPORTS target property). Ignored for non-imported
2961 targets.
2962
2963 IMPORTED_LIBNAME_<CONFIG>
2964 <CONFIG>-specific version of IMPORTED_LIBNAME property.
2965
2966 Configuration names correspond to those provided by the project from
2967 which the target is imported.
2968
2969 IMPORTED_LIBNAME
2970 Specify the link library name for an imported Interface Library.
2971
2972 An interface library builds no library file itself but does specify
2973 usage requirements for its consumers. The IMPORTED_LIBNAME property
2974 may be set to specify a single library name to be placed on the link
2975 line in place of the interface library target name as a requirement for
2976 using the interface.
2977
2978 This property is intended for use in naming libraries provided by a
2979 platform SDK for which the full path to a library file may not be
2980 known. The value may be a plain library name such as foo but may not
2981 be a path (e.g. /usr/lib/libfoo.so) or a flag (e.g. -Wl,...). The name
2982 is never treated as a library target name even if it happens to name
2983 one.
2984
2985 The IMPORTED_LIBNAME property is allowed only on imported Interface
2986 Libraries and is rejected on targets of other types (for which the
2987 IMPORTED_LOCATION target property may be used).
2988
2989 IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG>
2990 <CONFIG>-specific version of IMPORTED_LINK_DEPENDENT_LIBRARIES.
2991
2992 Configuration names correspond to those provided by the project from
2993 which the target is imported. If set, this property completely over‐
2994 rides the generic property for the named configuration.
2995
2996 IMPORTED_LINK_DEPENDENT_LIBRARIES
2997 Dependent shared libraries of an imported shared library.
2998
2999 Shared libraries may be linked to other shared libraries as part of
3000 their implementation. On some platforms the linker searches for the
3001 dependent libraries of shared libraries they are including in the link.
3002 Set this property to the list of dependent shared libraries of an
3003 imported library. The list should be disjoint from the list of inter‐
3004 face libraries in the INTERFACE_LINK_LIBRARIES property. On platforms
3005 requiring dependent shared libraries to be found at link time CMake
3006 uses this list to add appropriate files or paths to the link command
3007 line. Ignored for non-imported targets.
3008
3009 IMPORTED_LINK_INTERFACE_LANGUAGES_<CONFIG>
3010 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LANGUAGES.
3011
3012 Configuration names correspond to those provided by the project from
3013 which the target is imported. If set, this property completely over‐
3014 rides the generic property for the named configuration.
3015
3016 IMPORTED_LINK_INTERFACE_LANGUAGES
3017 Languages compiled into an IMPORTED static library.
3018
3019 Set this to the list of languages of source files compiled to produce a
3020 STATIC IMPORTED library (such as C or CXX). CMake accounts for these
3021 languages when computing how to link a target to the imported library.
3022 For example, when a C executable links to an imported C++ static
3023 library CMake chooses the C++ linker to satisfy language runtime depen‐
3024 dencies of the static library.
3025
3026 This property is ignored for targets that are not STATIC libraries.
3027 This property is ignored for non-imported targets.
3028
3029 IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>
3030 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_LIBRARIES.
3031
3032 Configuration names correspond to those provided by the project from
3033 which the target is imported. If set, this property completely over‐
3034 rides the generic property for the named configuration.
3035
3036 This property is ignored if the target also has a non-empty INTER‐
3037 FACE_LINK_LIBRARIES property.
3038
3039 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3040
3041 IMPORTED_LINK_INTERFACE_LIBRARIES
3042 Transitive link interface of an IMPORTED target.
3043
3044 Set this to the list of libraries whose interface is included when an
3045 IMPORTED library target is linked to another target. The libraries
3046 will be included on the link line for the target. Unlike the
3047 LINK_INTERFACE_LIBRARIES property, this property applies to all
3048 imported target types, including STATIC libraries. This property is
3049 ignored for non-imported targets.
3050
3051 This property is ignored if the target also has a non-empty INTER‐
3052 FACE_LINK_LIBRARIES property.
3053
3054 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3055
3056 IMPORTED_LINK_INTERFACE_MULTIPLICITY_<CONFIG>
3057 <CONFIG>-specific version of IMPORTED_LINK_INTERFACE_MULTIPLICITY.
3058
3059 If set, this property completely overrides the generic property for the
3060 named configuration.
3061
3062 IMPORTED_LINK_INTERFACE_MULTIPLICITY
3063 Repetition count for cycles of IMPORTED static libraries.
3064
3065 This is LINK_INTERFACE_MULTIPLICITY for IMPORTED targets.
3066
3067 IMPORTED_LOCATION_<CONFIG>
3068 <CONFIG>-specific version of IMPORTED_LOCATION property.
3069
3070 Configuration names correspond to those provided by the project from
3071 which the target is imported.
3072
3073 IMPORTED_LOCATION
3074 Full path to the main file on disk for an IMPORTED target.
3075
3076 Set this to the location of an IMPORTED target file on disk. For exe‐
3077 cutables this is the location of the executable file. For bundles on
3078 macOS this is the location of the executable file inside Contents/MacOS
3079 under the application bundle folder. For STATIC libraries and modules
3080 this is the location of the library or module. For SHARED libraries on
3081 non-DLL platforms this is the location of the shared library. For
3082 frameworks on macOS this is the location of the library file symlink
3083 just inside the framework folder. For DLLs this is the location of the
3084 .dll part of the library. For UNKNOWN libraries this is the location
3085 of the file to be linked. Ignored for non-imported targets.
3086
3087 The IMPORTED_LOCATION target property may be overridden for a given
3088 configuration <CONFIG> by the configuration-specific IMPORTED_LOCA‐
3089 TION_<CONFIG> target property. Furthermore, the MAP_IMPORTED_CON‐
3090 FIG_<CONFIG> target property may be used to map between a project’s
3091 configurations and those of an imported target. If none of these is
3092 set then the name of any other configuration listed in the
3093 IMPORTED_CONFIGURATIONS target property may be selected and its
3094 IMPORTED_LOCATION_<CONFIG> value used.
3095
3096 To get the location of an imported target read one of the LOCATION or
3097 LOCATION_<CONFIG> properties.
3098
3099 For platforms with import libraries (e.g. Windows) see also
3100 IMPORTED_IMPLIB.
3101
3102 IMPORTED_NO_SONAME_<CONFIG>
3103 <CONFIG>-specific version of IMPORTED_NO_SONAME property.
3104
3105 Configuration names correspond to those provided by the project from
3106 which the target is imported.
3107
3108 IMPORTED_NO_SONAME
3109 Specifies that an IMPORTED shared library target has no soname.
3110
3111 Set this property to true for an imported shared library file that has
3112 no soname field. CMake may adjust generated link commands for some
3113 platforms to prevent the linker from using the path to the library in
3114 place of its missing soname. Ignored for non-imported targets.
3115
3116 IMPORTED_OBJECTS_<CONFIG>
3117 <CONFIG>-specific version of IMPORTED_OBJECTS property.
3118
3119 Configuration names correspond to those provided by the project from
3120 which the target is imported.
3121
3122 IMPORTED_OBJECTS
3123 A semicolon-separated list of absolute paths to the object files on
3124 disk for an imported object library.
3125
3126 Ignored for non-imported targets.
3127
3128 Projects may skip IMPORTED_OBJECTS if the configuration-specific prop‐
3129 erty IMPORTED_OBJECTS_<CONFIG> is set instead.
3130
3131 IMPORTED
3132 Read-only indication of whether a target is IMPORTED.
3133
3134 The boolean value of this property is True for targets created with the
3135 IMPORTED option to add_executable() or add_library(). It is False for
3136 targets built within the project.
3137
3138 IMPORTED_SONAME_<CONFIG>
3139 <CONFIG>-specific version of IMPORTED_SONAME property.
3140
3141 Configuration names correspond to those provided by the project from
3142 which the target is imported.
3143
3144 IMPORTED_SONAME
3145 The soname of an IMPORTED target of shared library type.
3146
3147 Set this to the soname embedded in an imported shared library. This is
3148 meaningful only on platforms supporting the feature. Ignored for
3149 non-imported targets.
3150
3151 IMPORT_PREFIX
3152 What comes before the import library name.
3153
3154 Similar to the target property PREFIX, but used for import libraries
3155 (typically corresponding to a DLL) instead of regular libraries. A
3156 target property that can be set to override the prefix (such as lib) on
3157 an import library name.
3158
3159 IMPORT_SUFFIX
3160 What comes after the import library name.
3161
3162 Similar to the target property SUFFIX, but used for import libraries
3163 (typically corresponding to a DLL) instead of regular libraries. A
3164 target property that can be set to override the suffix (such as .lib)
3165 on an import library name.
3166
3167 INCLUDE_DIRECTORIES
3168 List of preprocessor include file search directories.
3169
3170 This property specifies the list of directories given so far to the
3171 target_include_directories() command. In addition to accepting values
3172 from that command, values may be set directly on any target using the
3173 set_property() command. A target gets its initial value for this prop‐
3174 erty from the value of the INCLUDE_DIRECTORIES directory property.
3175 Both directory and target property values are adjusted by calls to the
3176 include_directories() command.
3177
3178 The value of this property is used by the generators to set the include
3179 paths for the compiler.
3180
3181 Relative paths should not be added to this property directly. Use one
3182 of the commands above instead to handle relative paths.
3183
3184 Contents of INCLUDE_DIRECTORIES may use cmake-generator-expressions(7)
3185 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3186 for available expressions. See the cmake-buildsystem(7) manual for
3187 more on defining buildsystem properties.
3188
3189 INSTALL_NAME_DIR
3190 macOS directory name for installed targets.
3191
3192 INSTALL_NAME_DIR is a string specifying the directory portion of the
3193 “install_name” field of shared libraries on macOS to use in the
3194 installed targets.
3195
3196 This property is initialized by the value of the variable
3197 CMAKE_INSTALL_NAME_DIR if it is set when a target is created.
3198
3199 This property supports generator expressions. In particular, the
3200 $<INSTALL_PREFIX> generator expression can be used to set the directory
3201 relative to the install-time prefix.
3202
3203 INSTALL_REMOVE_ENVIRONMENT_RPATH
3204 Controls whether toolchain-defined rpaths should be removed during
3205 installation.
3206
3207 When a target is being installed, CMake may need to rewrite its rpath
3208 information. This occurs when the install rpath (as specified by the
3209 INSTALL_RPATH target property) has different contents to the rpath that
3210 the target was built with. Some toolchains insert their own rpath con‐
3211 tents into the binary as part of the build. By default, CMake will
3212 preserve those extra inserted contents in the install rpath. For those
3213 scenarios where such toolchain-inserted entries need to be discarded
3214 during install, set the INSTALL_REMOVE_ENVIRONMENT_RPATH target prop‐
3215 erty to true.
3216
3217 This property is initialized by the value of CMAKE_INSTALL_REMOVE_ENVI‐
3218 RONMENT_RPATH when the target is created.
3219
3220 INSTALL_RPATH
3221 The rpath to use for installed targets.
3222
3223 A semicolon-separated list specifying the rpath to use in installed
3224 targets (for platforms that support it). This property is initialized
3225 by the value of the variable CMAKE_INSTALL_RPATH if it is set when a
3226 target is created.
3227
3228 This property supports generator expressions.
3229
3230 INSTALL_RPATH_USE_LINK_PATH
3231 Add paths to linker search and installed rpath.
3232
3233 INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to True will
3234 append to the runtime search path (rpath) of installed binaries any
3235 directories outside the project that are in the linker search path or
3236 contain linked library files. The directories are appended after the
3237 value of the INSTALL_RPATH target property.
3238
3239 This property is initialized by the value of the variable
3240 CMAKE_INSTALL_RPATH_USE_LINK_PATH if it is set when a target is cre‐
3241 ated.
3242
3243 INTERFACE_AUTOUIC_OPTIONS
3244 List of interface options to pass to uic.
3245
3246 Targets may populate this property to publish the options required to
3247 use when invoking uic. Consuming targets can add entries to their own
3248 AUTOUIC_OPTIONS property such as $<TARGET_PROPERTY:foo,INTER‐
3249 FACE_AUTOUIC_OPTIONS> to use the uic options specified in the interface
3250 of foo. This is done automatically by the target_link_libraries() com‐
3251 mand.
3252
3253 This property supports generator expressions. See the cmake-genera‐
3254 tor-expressions(7) manual for available expressions.
3255
3256 INTERFACE_COMPILE_DEFINITIONS
3257 List of public compile definitions requirements for a library.
3258
3259 Targets may populate this property to publish the compile definitions
3260 required to compile against the headers for the target. The tar‐
3261 get_compile_definitions() command populates this property with values
3262 given to the PUBLIC and INTERFACE keywords. Projects may also get and
3263 set the property directly.
3264
3265 When target dependencies are specified using target_link_libraries(),
3266 CMake will read this property from all target dependencies to determine
3267 the build properties of the consumer.
3268
3269 Contents of INTERFACE_COMPILE_DEFINITIONS may use “generator expres‐
3270 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
3271 manual for available expressions. See the cmake-buildsystem(7) -manual
3272 for more on defining buildsystem properties.
3273
3274 INTERFACE_COMPILE_FEATURES
3275 List of public compile features requirements for a library.
3276
3277 Targets may populate this property to publish the compile features
3278 required to compile against the headers for the target. The tar‐
3279 get_compile_features() command populates this property with values
3280 given to the PUBLIC and INTERFACE keywords. Projects may also get and
3281 set the property directly.
3282
3283 When target dependencies are specified using target_link_libraries(),
3284 CMake will read this property from all target dependencies to determine
3285 the build properties of the consumer.
3286
3287 Contents of INTERFACE_COMPILE_FEATURES may use “generator expressions”
3288 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3289 for available expressions. See the cmake-buildsystem(7) -manual for
3290 more on defining buildsystem properties.
3291
3292 See the cmake-compile-features(7) manual for information on compile
3293 features and a list of supported compilers.
3294
3295 INTERFACE_COMPILE_OPTIONS
3296 List of public compile options requirements for a library.
3297
3298 Targets may populate this property to publish the compile options
3299 required to compile against the headers for the target. The tar‐
3300 get_compile_options() command populates this property with values given
3301 to the PUBLIC and INTERFACE keywords. Projects may also get and set
3302 the property directly.
3303
3304 When target dependencies are specified using target_link_libraries(),
3305 CMake will read this property from all target dependencies to determine
3306 the build properties of the consumer.
3307
3308 Contents of INTERFACE_COMPILE_OPTIONS may use “generator expressions”
3309 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3310 for available expressions. See the cmake-buildsystem(7) -manual for
3311 more on defining buildsystem properties.
3312
3313 INTERFACE_INCLUDE_DIRECTORIES
3314 List of public include directories requirements for a library.
3315
3316 Targets may populate this property to publish the include directories
3317 required to compile against the headers for the target. The tar‐
3318 get_include_directories() command populates this property with values
3319 given to the PUBLIC and INTERFACE keywords. Projects may also get and
3320 set the property directly.
3321
3322 When target dependencies are specified using target_link_libraries(),
3323 CMake will read this property from all target dependencies to determine
3324 the build properties of the consumer.
3325
3326 Contents of INTERFACE_INCLUDE_DIRECTORIES may use “generator expres‐
3327 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
3328 manual for available expressions. See the cmake-buildsystem(7) -manual
3329 for more on defining buildsystem properties.
3330
3331 Include directories usage requirements commonly differ between the
3332 build-tree and the install-tree. The BUILD_INTERFACE and
3333 INSTALL_INTERFACE generator expressions can be used to describe sepa‐
3334 rate usage requirements based on the usage location. Relative paths
3335 are allowed within the INSTALL_INTERFACE expression and are interpreted
3336 relative to the installation prefix. For example:
3337
3338 target_include_directories(mylib INTERFACE
3339 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
3340 $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
3341 )
3342
3343 Creating Relocatable Packages
3344 Note that it is not advisable to populate the INSTALL_INTERFACE of the
3345 INTERFACE_INCLUDE_DIRECTORIES of a target with absolute paths to the
3346 include directories of dependencies. That would hard-code into
3347 installed packages the include directory paths for dependencies as
3348 found on the machine the package was made on.
3349
3350 The INSTALL_INTERFACE of the INTERFACE_INCLUDE_DIRECTORIES is only
3351 suitable for specifying the required include directories for headers
3352 provided with the target itself, not those provided by the transitive
3353 dependencies listed in its INTERFACE_LINK_LIBRARIES target property.
3354 Those dependencies should themselves be targets that specify their own
3355 header locations in INTERFACE_INCLUDE_DIRECTORIES.
3356
3357 See the Creating Relocatable Packages section of the cmake-packages(7)
3358 manual for discussion of additional care that must be taken when speci‐
3359 fying usage requirements while creating packages for redistribution.
3360
3361 INTERFACE_LINK_DEPENDS
3362 Additional public interface files on which a target binary depends for
3363 linking.
3364
3365 This property is supported only by Ninja and Makefile Generators. It
3366 is intended to specify dependencies on “linker scripts” for custom
3367 Makefile link rules.
3368
3369 When target dependencies are specified using target_link_libraries(),
3370 CMake will read this property from all target dependencies to determine
3371 the build properties of the consumer.
3372
3373 Contents of INTERFACE_LINK_DEPENDS may use “generator expressions” with
3374 the syntax $<...>. See the cmake-generator-expressions(7) manual for
3375 available expressions. See the cmake-buildsystem(7) -manual for more
3376 on defining buildsystem properties.
3377
3378 Link dependency files usage requirements commonly differ between the
3379 build-tree and the install-tree. The BUILD_INTERFACE and
3380 INSTALL_INTERFACE generator expressions can be used to describe sepa‐
3381 rate usage requirements based on the usage location. Relative paths
3382 are allowed within the INSTALL_INTERFACE expression and are interpreted
3383 relative to the installation prefix. For example:
3384
3385 set_property(TARGET mylib PROPERTY INTERFACE_LINK_DEPENDS
3386 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/mylinkscript>
3387 $<INSTALL_INTERFACE:mylinkscript> # <prefix>/mylinkscript
3388 )
3389
3390 INTERFACE_LINK_DIRECTORIES
3391 List of public link directories requirements for a library.
3392
3393 Targets may populate this property to publish the link directories
3394 required to compile against the headers for the target. The tar‐
3395 get_link_directories() command populates this property with values
3396 given to the PUBLIC and INTERFACE keywords. Projects may also get and
3397 set the property directly.
3398
3399 When target dependencies are specified using target_link_libraries(),
3400 CMake will read this property from all target dependencies to determine
3401 the build properties of the consumer.
3402
3403 Contents of INTERFACE_LINK_DIRECTORIES may use “generator expressions”
3404 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3405 for available expressions. See the cmake-buildsystem(7) -manual for
3406 more on defining buildsystem properties.
3407
3408 INTERFACE_LINK_LIBRARIES
3409 List public interface libraries for a library.
3410
3411 This property contains the list of transitive link dependencies. When
3412 the target is linked into another target using the tar‐
3413 get_link_libraries() command, the libraries listed (and recursively
3414 their link interface libraries) will be provided to the other target
3415 also. This property is overridden by the LINK_INTERFACE_LIBRARIES or
3416 LINK_INTERFACE_LIBRARIES_<CONFIG> property if policy CMP0022 is OLD or
3417 unset.
3418
3419 Contents of INTERFACE_LINK_LIBRARIES may use “generator expressions”
3420 with the syntax $<...>. See the cmake-generator-expressions(7) manual
3421 for available expressions. See the cmake-buildsystem(7) manual for
3422 more on defining buildsystem properties.
3423
3424 NOTE:
3425 A call to target_link_libraries(<target> ...) may update this prop‐
3426 erty on <target>. If <target> was not created in the same directory
3427 as the call then target_link_libraries() will wrap each entry with
3428 the form ::@(directory-id);...;::@, where the ::@ is literal and the
3429 (directory-id) is unspecified. This tells the generators that the
3430 named libraries must be looked up in the scope of the caller rather
3431 than in the scope in which the <target> was created. Valid direc‐
3432 tory ids are stripped on export by the install(EXPORT) and export()
3433 commands.
3434
3435 Creating Relocatable Packages
3436 Note that it is not advisable to populate the INTERFACE_LINK_LIBRARIES
3437 of a target with absolute paths to dependencies. That would hard-code
3438 into installed packages the library file paths for dependencies as
3439 found on the machine the package was made on.
3440
3441 See the Creating Relocatable Packages section of the cmake-packages(7)
3442 manual for discussion of additional care that must be taken when speci‐
3443 fying usage requirements while creating packages for redistribution.
3444
3445 INTERFACE_LINK_OPTIONS
3446 List of public link options requirements for a library.
3447
3448 Targets may populate this property to publish the link options required
3449 to compile against the headers for the target. The tar‐
3450 get_link_options() command populates this property with values given to
3451 the PUBLIC and INTERFACE keywords. Projects may also get and set the
3452 property directly.
3453
3454 When target dependencies are specified using target_link_libraries(),
3455 CMake will read this property from all target dependencies to determine
3456 the build properties of the consumer.
3457
3458 Contents of INTERFACE_LINK_OPTIONS may use “generator expressions” with
3459 the syntax $<...>. See the cmake-generator-expressions(7) manual for
3460 available expressions. See the cmake-buildsystem(7) -manual for more
3461 on defining buildsystem properties.
3462
3463 INTERFACE_PRECOMPILE_HEADERS
3464 List of interface header files to precompile into consuming targets.
3465
3466 Targets may populate this property to publish the header files for con‐
3467 suming targets to precompile. The target_precompile_headers() command
3468 populates this property with values given to the PUBLIC and INTERFACE
3469 keywords. Projects may also get and set the property directly. See
3470 the discussion in target_precompile_headers() for guidance on appropri‐
3471 ate use of this property for installed or exported targets.
3472
3473 Contents of INTERFACE_PRECOMPILE_HEADERS may use “generator expres‐
3474 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
3475 manual for available expressions. See the cmake-buildsystem(7) manual
3476 for more on defining buildsystem properties.
3477
3478 INTERFACE_POSITION_INDEPENDENT_CODE
3479 Whether consumers need to create a position-independent target
3480
3481 The INTERFACE_POSITION_INDEPENDENT_CODE property informs consumers of
3482 this target whether they must set their POSITION_INDEPENDENT_CODE prop‐
3483 erty to ON. If this property is set to ON, then the POSITION_INDEPEN‐
3484 DENT_CODE property on all consumers will be set to ON. Similarly, if
3485 this property is set to OFF, then the POSITION_INDEPENDENT_CODE prop‐
3486 erty on all consumers will be set to OFF. If this property is unde‐
3487 fined, then consumers will determine their POSITION_INDEPENDENT_CODE
3488 property by other means. Consumers must ensure that the targets that
3489 they link to have a consistent requirement for their INTERFACE_POSI‐
3490 TION_INDEPENDENT_CODE property.
3491
3492 Contents of INTERFACE_POSITION_INDEPENDENT_CODE may use “generator
3493 expressions” with the syntax $<...>. See the cmake-generator-expres‐
3494 sions(7) manual for available expressions. See the cmake-buildsys‐
3495 tem(7) manual for more on defining buildsystem properties.
3496
3497 INTERFACE_SOURCES
3498 List of interface sources to compile into consuming targets.
3499
3500 Targets may populate this property to publish the sources for consuming
3501 targets to compile. The target_sources() command populates this prop‐
3502 erty with values given to the PUBLIC and INTERFACE keywords. Projects
3503 may also get and set the property directly.
3504
3505 When target dependencies are specified using target_link_libraries(),
3506 CMake will read this property from all target dependencies to determine
3507 the sources of the consumer.
3508
3509 Contents of INTERFACE_SOURCES may use “generator expressions” with the
3510 syntax $<...>. See the cmake-generator-expressions(7) manual for
3511 available expressions. See the cmake-buildsystem(7) manual for more on
3512 defining buildsystem properties.
3513
3514 INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
3515 List of public system include directories for a library.
3516
3517 Targets may populate this property to publish the include directories
3518 which contain system headers, and therefore should not result in com‐
3519 piler warnings. The target_include_directories(SYSTEM) command signa‐
3520 ture populates this property with values given to the PUBLIC and INTER‐
3521 FACE keywords.
3522
3523 Projects may also get and set the property directly, but must be aware
3524 that adding directories to this property does not make those directo‐
3525 ries used during compilation. Adding directories to this property
3526 marks directories as SYSTEM which otherwise would be used in a non-SYS‐
3527 TEM manner. This can appear similar to ‘duplication’, so prefer the
3528 high-level target_include_directories(SYSTEM) command and avoid setting
3529 the property by low-level means.
3530
3531 When target dependencies are specified using target_link_libraries(),
3532 CMake will read this property from all target dependencies to mark the
3533 same include directories as containing system headers.
3534
3535 Contents of INTERFACE_SYSTEM_INCLUDE_DIRECTORIES may use “generator
3536 expressions” with the syntax $<...>. See the cmake-generator-expres‐
3537 sions(7) manual for available expressions. See the cmake-buildsys‐
3538 tem(7) manual for more on defining buildsystem properties.
3539
3540 INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
3541 Per-configuration interprocedural optimization for a target.
3542
3543 This is a per-configuration version of INTERPROCEDURAL_OPTIMIZATION.
3544 If set, this property overrides the generic property for the named con‐
3545 figuration.
3546
3547 This property is initialized by the CMAKE_INTERPROCEDURAL_OPTIMIZA‐
3548 TION_<CONFIG> variable if it is set when a target is created.
3549
3550 INTERPROCEDURAL_OPTIMIZATION
3551 Enable interprocedural optimization for a target.
3552
3553 If set to true, enables interprocedural optimizations if they are known
3554 to be supported by the compiler. Depending on value of policy CMP0069,
3555 the error will be reported or ignored, if interprocedural optimization
3556 is enabled but not supported.
3557
3558 This property is initialized by the CMAKE_INTERPROCEDURAL_OPTIMIZATION
3559 variable if it is set when a target is created.
3560
3561 IOS_INSTALL_COMBINED
3562 Build a combined (device and simulator) target when installing.
3563
3564 When this property is set to set to false (which is the default) then
3565 it will either be built with the device SDK or the simulator SDK
3566 depending on the SDK set. But if this property is set to true then the
3567 target will at install time also be built for the corresponding SDK and
3568 combined into one library.
3569
3570 This feature requires at least Xcode version 6.
3571
3572 JOB_POOL_COMPILE
3573 Ninja only: Pool used for compiling.
3574
3575 The number of parallel compile processes could be limited by defining
3576 pools with the global JOB_POOLS property and then specifying here the
3577 pool name.
3578
3579 For instance:
3580
3581 set_property(TARGET myexe PROPERTY JOB_POOL_COMPILE ten_jobs)
3582
3583 This property is initialized by the value of CMAKE_JOB_POOL_COMPILE.
3584
3585 JOB_POOL_LINK
3586 Ninja only: Pool used for linking.
3587
3588 The number of parallel link processes could be limited by defining
3589 pools with the global JOB_POOLS property and then specifying here the
3590 pool name.
3591
3592 For instance:
3593
3594 set_property(TARGET myexe PROPERTY JOB_POOL_LINK two_jobs)
3595
3596 This property is initialized by the value of CMAKE_JOB_POOL_LINK.
3597
3598 JOB_POOL_PRECOMPILE_HEADER
3599 Ninja only: Pool used for generating pre-compiled headers.
3600
3601 The number of parallel compile processes could be limited by defining
3602 pools with the global JOB_POOLS property and then specifying here the
3603 pool name.
3604
3605 For instance:
3606
3607 set_property(TARGET myexe PROPERTY JOB_POOL_PRECOMPILE_HEADER two_jobs)
3608
3609 This property is initialized by the value of CMAKE_JOB_POOL_PRECOM‐
3610 PILE_HEADER.
3611
3612 If neither JOB_POOL_PRECOMPILE_HEADER nor CMAKE_JOB_POOL_PRECOM‐
3613 PILE_HEADER are set then JOB_POOL_COMPILE will be used for this task.
3614
3615 LABELS
3616 Specify a list of text labels associated with a target.
3617
3618 Target label semantics are currently unspecified.
3619
3620 <LANG>_CLANG_TIDY
3621 This property is implemented only when <LANG> is C or CXX.
3622
3623 Specify a semicolon-separated list containing a command line for the
3624 clang-tidy tool. The Makefile Generators and the Ninja generator will
3625 run this tool along with the compiler and report a warning if the tool
3626 reports any problems.
3627
3628 This property is initialized by the value of the
3629 CMAKE_<LANG>_CLANG_TIDY variable if it is set when a target is created.
3630
3631 <LANG>_COMPILER_LAUNCHER
3632 This property is implemented only when <LANG> is C, CXX, Fortran, OBJC,
3633 OBJCXX, or CUDA.
3634
3635 Specify a semicolon-separated list containing a command line for a com‐
3636 piler launching tool. The Makefile Generators and the Ninja generator
3637 will run this tool and pass the compiler and its arguments to the tool.
3638 Some example tools are distcc and ccache.
3639
3640 This property is initialized by the value of the CMAKE_<LANG>_COM‐
3641 PILER_LAUNCHER variable if it is set when a target is created.
3642
3643 <LANG>_CPPCHECK
3644 This property is supported only when <LANG> is C or CXX.
3645
3646 Specify a semicolon-separated list containing a command line for the
3647 cppcheck static analysis tool. The Makefile Generators and the Ninja
3648 generator will run cppcheck along with the compiler and report any
3649 problems. If the command-line specifies the exit code options to
3650 cppcheck then the build will fail if the tool returns non-zero.
3651
3652 This property is initialized by the value of the CMAKE_<LANG>_CPPCHECK
3653 variable if it is set when a target is created.
3654
3655 <LANG>_CPPLINT
3656 This property is supported only when <LANG> is C or CXX.
3657
3658 Specify a semicolon-separated list containing a command line for the
3659 cpplint style checker. The Makefile Generators and the Ninja generator
3660 will run cpplint along with the compiler and report any problems.
3661
3662 This property is initialized by the value of the CMAKE_<LANG>_CPPLINT
3663 variable if it is set when a target is created.
3664
3665 <LANG>_INCLUDE_WHAT_YOU_USE
3666 This property is implemented only when <LANG> is C or CXX.
3667
3668 Specify a semicolon-separated list containing a command line for the
3669 include-what-you-use tool. The Makefile Generators and the Ninja gen‐
3670 erator will run this tool along with the compiler and report a warning
3671 if the tool reports any problems.
3672
3673 This property is initialized by the value of the
3674 CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable if it is set when a target
3675 is created.
3676
3677 <LANG>_VISIBILITY_PRESET
3678 Value for symbol visibility compile flags
3679
3680 The <LANG>_VISIBILITY_PRESET property determines the value passed in a
3681 visibility related compile option, such as -fvisibility= for <LANG>.
3682 This property affects compilation in sources of all types of targets
3683 (subject to policy CMP0063).
3684
3685 This property is initialized by the value of the CMAKE_<LANG>_VISIBIL‐
3686 ITY_PRESET variable if it is set when a target is created.
3687
3688 LIBRARY_OUTPUT_DIRECTORY_<CONFIG>
3689 Per-configuration output directory for LIBRARY target files.
3690
3691 This is a per-configuration version of the LIBRARY_OUTPUT_DIRECTORY
3692 target property, but multi-configuration generators (Visual Studio Gen‐
3693 erators, Xcode) do NOT append a per-configuration subdirectory to the
3694 specified directory. This property is initialized by the value of the
3695 CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> variable if it is set when a
3696 target is created.
3697
3698 Contents of LIBRARY_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
3699 sions.
3700
3701 LIBRARY_OUTPUT_DIRECTORY
3702 Output directory in which to build LIBRARY target files.
3703
3704 This property specifies the directory into which library target files
3705 should be built. The property value may use generator expressions.
3706 Multi-configuration generators (VS, Xcode) append a per-configuration
3707 subdirectory to the specified directory unless a generator expression
3708 is used.
3709
3710 This property is initialized by the value of the variable
3711 CMAKE_LIBRARY_OUTPUT_DIRECTORY if it is set when a target is created.
3712
3713 See also the LIBRARY_OUTPUT_DIRECTORY_<CONFIG> target property.
3714
3715 LIBRARY_OUTPUT_NAME_<CONFIG>
3716 Per-configuration output name for LIBRARY target files.
3717
3718 This is the configuration-specific version of the LIBRARY_OUTPUT_NAME
3719 target property.
3720
3721 LIBRARY_OUTPUT_NAME
3722 Output name for LIBRARY target files.
3723
3724 This property specifies the base name for library target files. It
3725 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
3726
3727 See also the LIBRARY_OUTPUT_NAME_<CONFIG> target property.
3728
3729 LINK_DEPENDS_NO_SHARED
3730 Do not depend on linked shared library files.
3731
3732 Set this property to true to tell CMake generators not to add
3733 file-level dependencies on the shared library files linked by this tar‐
3734 get. Modification to the shared libraries will not be sufficient to
3735 re-link this target. Logical target-level dependencies will not be
3736 affected so the linked shared libraries will still be brought up to
3737 date before this target is built.
3738
3739 This property is initialized by the value of the variable
3740 CMAKE_LINK_DEPENDS_NO_SHARED if it is set when a target is created.
3741
3742 LINK_DEPENDS
3743 Additional files on which a target binary depends for linking.
3744
3745 Specifies a semicolon-separated list of full-paths to files on which
3746 the link rule for this target depends. The target binary will be
3747 linked if any of the named files is newer than it.
3748
3749 This property is supported only by Ninja and Makefile Generators. It
3750 is intended to specify dependencies on “linker scripts” for custom
3751 Makefile link rules.
3752
3753 Contents of LINK_DEPENDS may use “generator expressions” with the syn‐
3754 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
3755 able expressions. See the cmake-buildsystem(7) manual for more on
3756 defining buildsystem properties.
3757
3758 LINKER_LANGUAGE
3759 Specifies language whose compiler will invoke the linker.
3760
3761 For executables, shared libraries, and modules, this sets the language
3762 whose compiler is used to link the target (such as “C” or “CXX”). A
3763 typical value for an executable is the language of the source file pro‐
3764 viding the program entry point (main). If not set, the language with
3765 the highest linker preference value is the default. See documentation
3766 of CMAKE_<LANG>_LINKER_PREFERENCE variables.
3767
3768 If this property is not set by the user, it will be calculated at gen‐
3769 erate-time by CMake.
3770
3771 LINK_DIRECTORIES
3772 List of directories to use for the link step of shared library, module
3773 and executable targets.
3774
3775 This property holds a semicolon-separated list of directories specified
3776 so far for its target. Use the target_link_directories() command to
3777 append more search directories.
3778
3779 This property is initialized by the LINK_DIRECTORIES directory property
3780 when a target is created, and is used by the generators to set the
3781 search directories for the linker.
3782
3783 Contents of LINK_DIRECTORIES may use “generator expressions” with the
3784 syntax $<...>. See the cmake-generator-expressions(7) manual for
3785 available expressions. See the cmake-buildsystem(7) manual for more on
3786 defining buildsystem properties.
3787
3788 LINK_FLAGS_<CONFIG>
3789 Per-configuration linker flags for a SHARED library, MODULE or EXE‐
3790 CUTABLE target.
3791
3792 This is the configuration-specific version of LINK_FLAGS.
3793
3794 NOTE:
3795 This property has been superseded by LINK_OPTIONS property.
3796
3797 LINK_FLAGS
3798 Additional flags to use when linking this target if it is a shared
3799 library, module library, or an executable. Static libraries need to use
3800 STATIC_LIBRARY_OPTIONS or STATIC_LIBRARY_FLAGS properties.
3801
3802 The LINK_FLAGS property, managed as a string, can be used to add extra
3803 flags to the link step of a target. LINK_FLAGS_<CONFIG> will add to
3804 the configuration <CONFIG>, for example, DEBUG, RELEASE, MINSIZEREL,
3805 RELWITHDEBINFO, …
3806
3807 NOTE:
3808 This property has been superseded by LINK_OPTIONS property.
3809
3810 LINK_INTERFACE_LIBRARIES_<CONFIG>
3811 Per-configuration list of public interface libraries for a target.
3812
3813 This is the configuration-specific version of LINK_INTERFACE_LIBRARIES.
3814 If set, this property completely overrides the generic property for the
3815 named configuration.
3816
3817 This property is overridden by the INTERFACE_LINK_LIBRARIES property if
3818 policy CMP0022 is NEW.
3819
3820 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3821
3822 Creating Relocatable Packages
3823 Note that it is not advisable to populate the LINK_INTER‐
3824 FACE_LIBRARIES_<CONFIG> of a target with absolute paths to dependen‐
3825 cies. That would hard-code into installed packages the library file
3826 paths for dependencies as found on the machine the package was made on.
3827
3828 See the Creating Relocatable Packages section of the cmake-packages(7)
3829 manual for discussion of additional care that must be taken when speci‐
3830 fying usage requirements while creating packages for redistribution.
3831
3832 LINK_INTERFACE_LIBRARIES
3833 List public interface libraries for a shared library or executable.
3834
3835 By default linking to a shared library target transitively links to
3836 targets with which the library itself was linked. For an executable
3837 with exports (see the ENABLE_EXPORTS target property) no default tran‐
3838 sitive link dependencies are used. This property replaces the default
3839 transitive link dependencies with an explicit list. When the target is
3840 linked into another target using the target_link_libraries() command,
3841 the libraries listed (and recursively their link interface libraries)
3842 will be provided to the other target also. If the list is empty then
3843 no transitive link dependencies will be incorporated when this target
3844 is linked into another target even if the default set is non-empty.
3845 This property is initialized by the value of the CMAKE_LINK_INTER‐
3846 FACE_LIBRARIES variable if it is set when a target is created. This
3847 property is ignored for STATIC libraries.
3848
3849 This property is overridden by the INTERFACE_LINK_LIBRARIES property if
3850 policy CMP0022 is NEW.
3851
3852 This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.
3853
3854 Creating Relocatable Packages
3855 Note that it is not advisable to populate the LINK_INTERFACE_LIBRARIES
3856 of a target with absolute paths to dependencies. That would hard-code
3857 into installed packages the library file paths for dependencies as
3858 found on the machine the package was made on.
3859
3860 See the Creating Relocatable Packages section of the cmake-packages(7)
3861 manual for discussion of additional care that must be taken when speci‐
3862 fying usage requirements while creating packages for redistribution.
3863
3864 LINK_INTERFACE_MULTIPLICITY_<CONFIG>
3865 Per-configuration repetition count for cycles of STATIC libraries.
3866
3867 This is the configuration-specific version of LINK_INTERFACE_MULTIPLIC‐
3868 ITY. If set, this property completely overrides the generic property
3869 for the named configuration.
3870
3871 LINK_INTERFACE_MULTIPLICITY
3872 Repetition count for STATIC libraries with cyclic dependencies.
3873
3874 When linking to a STATIC library target with cyclic dependencies the
3875 linker may need to scan more than once through the archives in the
3876 strongly connected component of the dependency graph. CMake by default
3877 constructs the link line so that the linker will scan through the com‐
3878 ponent at least twice. This property specifies the minimum number of
3879 scans if it is larger than the default. CMake uses the largest value
3880 specified by any target in a component.
3881
3882 LINK_LIBRARIES
3883 List of direct link dependencies.
3884
3885 This property specifies the list of libraries or targets which will be
3886 used for linking. In addition to accepting values from the tar‐
3887 get_link_libraries() command, values may be set directly on any target
3888 using the set_property() command.
3889
3890 The value of this property is used by the generators to set the link
3891 libraries for the compiler.
3892
3893 Contents of LINK_LIBRARIES may use “generator expressions” with the
3894 syntax $<...>. See the cmake-generator-expressions(7) manual for
3895 available expressions. See the cmake-buildsystem(7) manual for more on
3896 defining buildsystem properties.
3897
3898 NOTE:
3899 A call to target_link_libraries(<target> ...) may update this prop‐
3900 erty on <target>. If <target> was not created in the same directory
3901 as the call then target_link_libraries() will wrap each entry with
3902 the form ::@(directory-id);...;::@, where the ::@ is literal and the
3903 (directory-id) is unspecified. This tells the generators that the
3904 named libraries must be looked up in the scope of the caller rather
3905 than in the scope in which the <target> was created. Valid direc‐
3906 tory ids are stripped on export by the install(EXPORT) and export()
3907 commands.
3908
3909 LINK_OPTIONS
3910 List of options to use for the link step of shared library, module and
3911 executable targets. Targets that are static libraries need to use the
3912 STATIC_LIBRARY_OPTIONS target property.
3913
3914 This property holds a semicolon-separated list of options specified so
3915 far for its target. Use the target_link_options() command to append
3916 more options.
3917
3918 This property is initialized by the LINK_OPTIONS directory property
3919 when a target is created, and is used by the generators to set the
3920 options for the compiler.
3921
3922 Contents of LINK_OPTIONS may use “generator expressions” with the syn‐
3923 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
3924 able expressions. See the cmake-buildsystem(7) manual for more on
3925 defining buildsystem properties.
3926
3927 NOTE:
3928 This property must be used in preference to LINK_FLAGS property.
3929
3930 LINK_SEARCH_END_STATIC
3931 End a link line such that static system libraries are used.
3932
3933 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
3934 mine whether to use static or shared libraries for -lXXX options.
3935 CMake uses these options to set the link type for libraries whose full
3936 paths are not known or (in some cases) are in implicit link directories
3937 for the platform. By default CMake adds an option at the end of the
3938 library list (if necessary) to set the linker search type back to its
3939 starting type. This property switches the final linker search type to
3940 -Bstatic regardless of how it started.
3941
3942 This property is initialized by the value of the variable
3943 CMAKE_LINK_SEARCH_END_STATIC if it is set when a target is created.
3944
3945 See also LINK_SEARCH_START_STATIC.
3946
3947 LINK_SEARCH_START_STATIC
3948 Assume the linker looks for static libraries by default.
3949
3950 Some linkers support switches such as -Bstatic and -Bdynamic to deter‐
3951 mine whether to use static or shared libraries for -lXXX options.
3952 CMake uses these options to set the link type for libraries whose full
3953 paths are not known or (in some cases) are in implicit link directories
3954 for the platform. By default the linker search type is assumed to be
3955 -Bdynamic at the beginning of the library list. This property switches
3956 the assumption to -Bstatic. It is intended for use when linking an
3957 executable statically (e.g. with the GNU -static option).
3958
3959 This property is initialized by the value of the variable
3960 CMAKE_LINK_SEARCH_START_STATIC if it is set when a target is
3961 created.
3962
3963 See also LINK_SEARCH_END_STATIC.
3964
3965 LINK_WHAT_YOU_USE
3966 This is a boolean option that when set to TRUE will automatically run
3967 ldd -r -u on the target after it is linked. In addition, the linker
3968 flag -Wl,--no-as-needed will be passed to the target with the link com‐
3969 mand so that all libraries specified on the command line will be linked
3970 into the target. This will result in the link producing a list of
3971 libraries that provide no symbols used by this target but are being
3972 linked to it. This is only applicable to executable and shared library
3973 targets and will only work when ld and ldd accept the flags used.
3974
3975 This property is initialized by the value of the
3976 CMAKE_LINK_WHAT_YOU_USE variable if it is set when a target is created.
3977
3978 LOCATION_<CONFIG>
3979 Read-only property providing a target location on disk.
3980
3981 A read-only property that indicates where a target’s main file is
3982 located on disk for the configuration <CONFIG>. The property is
3983 defined only for library and executable targets. An imported target
3984 may provide a set of configurations different from that of the import‐
3985 ing project. By default CMake looks for an exact-match but otherwise
3986 uses an arbitrary available configuration. Use the MAP_IMPORTED_CON‐
3987 FIG_<CONFIG> property to map imported configurations explicitly.
3988
3989 Do not set properties that affect the location of a target after read‐
3990 ing this property. These include properties whose names match (RUN‐
3991 TIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?,
3992 (IMPLIB_)?(PREFIX|SUFFIX), or LINKER_LANGUAGE. Failure to follow this
3993 rule is not diagnosed and leaves the location of the target undefined.
3994
3995 LOCATION
3996 Read-only location of a target on disk.
3997
3998 For an imported target, this read-only property returns the value of
3999 the LOCATION_<CONFIG> property for an unspecified configuration <CON‐
4000 FIG> provided by the target.
4001
4002 For a non-imported target, this property is provided for compatibility
4003 with CMake 2.4 and below. It was meant to get the location of an exe‐
4004 cutable target’s output file for use in add_custom_command(). The path
4005 may contain a build-system-specific portion that is replaced at build
4006 time with the configuration getting built (such as $(ConfigurationName)
4007 in VS). In CMake 2.6 and above add_custom_command() automatically rec‐
4008 ognizes a target name in its COMMAND and DEPENDS options and computes
4009 the target location. In CMake 2.8.4 and above add_custom_command()
4010 recognizes generator expressions to refer to target locations anywhere
4011 in the command. Therefore this property is not needed for creating
4012 custom commands.
4013
4014 Do not set properties that affect the location of a target after read‐
4015 ing this property. These include properties whose names match (RUN‐
4016 TIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?,
4017 (IMPLIB_)?(PREFIX|SUFFIX), or “LINKER_LANGUAGE”. Failure to follow
4018 this rule is not diagnosed and leaves the location of the target unde‐
4019 fined.
4020
4021 MACHO_COMPATIBILITY_VERSION
4022 What compatibility version number is this target for Mach-O binaries.
4023
4024 For shared libraries on Mach-O systems (e.g. macOS, iOS) the MACHO_COM‐
4025 PATIBILITY_VERSION property corresponds to the compatibility version
4026 and MACHO_CURRENT_VERSION corresponds to the current version. These
4027 are both embedded in the shared library binary and can be checked with
4028 the otool -L <binary> command.
4029
4030 It should be noted that the MACHO_CURRENT_VERSION and MACHO_COMPATIBIL‐
4031 ITY_VERSION properties do not affect the file names or version-related
4032 symlinks that CMake generates for the library. The VERSION and SOVER‐
4033 SION target properties still control the file and symlink names. The
4034 install_name is also still controlled by SOVERSION.
4035
4036 When MACHO_CURRENT_VERSION and MACHO_COMPATIBILITY_VERSION are not
4037 given, VERSION and SOVERSION are used for the version details to be
4038 embedded in the binaries respectively. The MACHO_CURRENT_VERSION and
4039 MACHO_COMPATIBILITY_VERSION properties only need to be given if the
4040 project needs to decouple the file and symlink naming from the version
4041 details embedded in the binaries (e.g. to match libtool conventions).
4042
4043 MACHO_CURRENT_VERSION
4044 What current version number is this target for Mach-O binaries.
4045
4046 For shared libraries on Mach-O systems (e.g. macOS, iOS) the MACHO_COM‐
4047 PATIBILITY_VERSION property corresponds to the compatibility version
4048 and MACHO_CURRENT_VERSION corresponds to the current version. These
4049 are both embedded in the shared library binary and can be checked with
4050 the otool -L <binary> command.
4051
4052 It should be noted that the MACHO_CURRENT_VERSION and MACHO_COMPATIBIL‐
4053 ITY_VERSION properties do not affect the file names or version-related
4054 symlinks that CMake generates for the library. The VERSION and SOVER‐
4055 SION target properties still control the file and symlink names. The
4056 install_name is also still controlled by SOVERSION.
4057
4058 When MACHO_CURRENT_VERSION and MACHO_COMPATIBILITY_VERSION are not
4059 given, VERSION and SOVERSION are used for the version details to be
4060 embedded in the binaries respectively. The MACHO_CURRENT_VERSION and
4061 MACHO_COMPATIBILITY_VERSION properties only need to be given if the
4062 project needs to decouple the file and symlink naming from the version
4063 details embedded in the binaries (e.g. to match libtool conventions).
4064
4065 MACOSX_BUNDLE_INFO_PLIST
4066 Specify a custom Info.plist template for a macOS and iOS Application
4067 Bundle.
4068
4069 An executable target with MACOSX_BUNDLE enabled will be built as an
4070 application bundle on macOS. By default its Info.plist file is created
4071 by configuring a template called MacOSXBundleInfo.plist.in located in
4072 the CMAKE_MODULE_PATH. This property specifies an alternative template
4073 file name which may be a full path.
4074
4075 The following target properties may be set to specify content to be
4076 configured into the file:
4077
4078 MACOSX_BUNDLE_BUNDLE_NAME
4079 Sets CFBundleName.
4080
4081 MACOSX_BUNDLE_BUNDLE_VERSION
4082 Sets CFBundleVersion.
4083
4084 MACOSX_BUNDLE_COPYRIGHT
4085 Sets NSHumanReadableCopyright.
4086
4087 MACOSX_BUNDLE_GUI_IDENTIFIER
4088 Sets CFBundleIdentifier.
4089
4090 MACOSX_BUNDLE_ICON_FILE
4091 Sets CFBundleIconFile.
4092
4093 MACOSX_BUNDLE_INFO_STRING
4094 Sets CFBundleGetInfoString.
4095
4096 MACOSX_BUNDLE_LONG_VERSION_STRING
4097 Sets CFBundleLongVersionString.
4098
4099 MACOSX_BUNDLE_SHORT_VERSION_STRING
4100 Sets CFBundleShortVersionString.
4101
4102 CMake variables of the same name may be set to affect all targets in a
4103 directory that do not have each specific property set. If a custom
4104 Info.plist is specified by this property it may of course hard-code all
4105 the settings instead of using the target properties.
4106
4107 MACOSX_BUNDLE
4108 Build an executable as an Application Bundle on macOS or iOS.
4109
4110 When this property is set to TRUE the executable when built on macOS or
4111 iOS will be created as an application bundle. This makes it a GUI exe‐
4112 cutable that can be launched from the Finder. See the MACOSX_BUN‐
4113 DLE_INFO_PLIST target property for information about creation of the
4114 Info.plist file for the application bundle. This property is initial‐
4115 ized by the value of the variable CMAKE_MACOSX_BUNDLE if it is set when
4116 a target is created.
4117
4118 MACOSX_FRAMEWORK_INFO_PLIST
4119 Specify a custom Info.plist template for a macOS and iOS Framework.
4120
4121 A library target with FRAMEWORK enabled will be built as a framework on
4122 macOS. By default its Info.plist file is created by configuring a tem‐
4123 plate called MacOSXFrameworkInfo.plist.in located in the CMAKE_MOD‐
4124 ULE_PATH. This property specifies an alternative template file name
4125 which may be a full path.
4126
4127 The following target properties may be set to specify content to be
4128 configured into the file:
4129
4130 MACOSX_FRAMEWORK_BUNDLE_VERSION
4131 Sets CFBundleVersion.
4132
4133 MACOSX_FRAMEWORK_ICON_FILE
4134 Sets CFBundleIconFile.
4135
4136 MACOSX_FRAMEWORK_IDENTIFIER
4137 Sets CFBundleIdentifier.
4138
4139 MACOSX_FRAMEWORK_SHORT_VERSION_STRING
4140 Sets CFBundleShortVersionString.
4141
4142 CMake variables of the same name may be set to affect all targets in a
4143 directory that do not have each specific property set. If a custom
4144 Info.plist is specified by this property it may of course hard-code all
4145 the settings instead of using the target properties.
4146
4147 MACOSX_RPATH
4148 Whether this target on macOS or iOS is located at runtime using rpaths.
4149
4150 When this property is set to TRUE, the directory portion of the
4151 install_name field of this shared library will be @rpath unless over‐
4152 ridden by INSTALL_NAME_DIR. This indicates the shared library is to be
4153 found at runtime using runtime paths (rpaths).
4154
4155 This property is initialized by the value of the variable
4156 CMAKE_MACOSX_RPATH if it is set when a target is created.
4157
4158 Runtime paths will also be embedded in binaries using this target and
4159 can be controlled by the INSTALL_RPATH target property on the target
4160 linking to this target.
4161
4162 Policy CMP0042 was introduced to change the default value of
4163 MACOSX_RPATH to TRUE. This is because use of @rpath is a more flexible
4164 and powerful alternative to @executable_path and @loader_path.
4165
4166 MANUALLY_ADDED_DEPENDENCIES
4167 Get manually added dependencies to other top-level targets.
4168
4169 This read-only property can be used to query all dependencies that were
4170 added for this target with the add_dependencies() command.
4171
4172 MAP_IMPORTED_CONFIG_<CONFIG>
4173 Map from project configuration to imported target’s configuration.
4174
4175 Set this to the list of configurations of an imported target that may
4176 be used for the current project’s <CONFIG> configuration. Targets
4177 imported from another project may not provide the same set of configu‐
4178 ration names available in the current project. Setting this property
4179 tells CMake what imported configurations are suitable for use when
4180 building the <CONFIG> configuration. The first configuration in the
4181 list found to be provided by the imported target (i.e. via
4182 IMPORTED_LOCATION_<CONFIG> for the mapped-to <CONFIG>) is selected. As
4183 a special case, an empty list element refers to the configuration-less
4184 imported target location (i.e. IMPORTED_LOCATION).
4185
4186 If this property is set and no matching configurations are available,
4187 then the imported target is considered to be not found. This property
4188 is ignored for non-imported targets.
4189
4190 This property is initialized by the value of the
4191 CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> variable if it is set when a target
4192 is created.
4193
4194 Example
4195 For example creating imported C++ library foo:
4196
4197 add_library(foo STATIC IMPORTED)
4198
4199 Use foo_debug path for Debug build type:
4200
4201 set_property(
4202 TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG
4203 )
4204
4205 set_target_properties(foo PROPERTIES
4206 IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
4207 IMPORTED_LOCATION_DEBUG "${foo_debug}"
4208 )
4209
4210 Use foo_release path for Release build type:
4211
4212 set_property(
4213 TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE
4214 )
4215
4216 set_target_properties(foo PROPERTIES
4217 IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
4218 IMPORTED_LOCATION_RELEASE "${foo_release}"
4219 )
4220
4221 Use Release version of library for MinSizeRel and RelWithDebInfo build
4222 types:
4223
4224 set_target_properties(foo PROPERTIES
4225 MAP_IMPORTED_CONFIG_MINSIZEREL Release
4226 MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release
4227 )
4228
4229 MSVC_RUNTIME_LIBRARY
4230 Select the MSVC runtime library for use by compilers targeting the MSVC
4231 ABI.
4232
4233 The allowed values are:
4234
4235 MultiThreaded
4236 Compile with -MT or equivalent flag(s) to use a multi-threaded
4237 statically-linked runtime library.
4238
4239 MultiThreadedDLL
4240 Compile with -MD or equivalent flag(s) to use a multi-threaded
4241 dynamically-linked runtime library.
4242
4243 MultiThreadedDebug
4244 Compile with -MTd or equivalent flag(s) to use a multi-threaded
4245 statically-linked runtime library.
4246
4247 MultiThreadedDebugDLL
4248 Compile with -MDd or equivalent flag(s) to use a multi-threaded
4249 dynamically-linked runtime library.
4250
4251 The value is ignored on non-MSVC compilers but an unsupported value
4252 will be rejected as an error when using a compiler targeting the MSVC
4253 ABI.
4254
4255 The value may also be the empty string ("") in which case no runtime
4256 library selection flag will be added explicitly by CMake. Note that
4257 with Visual Studio Generators the native build system may choose to add
4258 its own default runtime library selection flag.
4259
4260 Use generator expressions to support per-configuration specification.
4261 For example, the code:
4262
4263 add_executable(foo foo.c)
4264 set_property(TARGET foo PROPERTY
4265 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
4266
4267 selects for the target foo a multi-threaded statically-linked runtime
4268 library with or without debug information depending on the configura‐
4269 tion.
4270
4271 If this property is not set then CMake uses the default value Multi‐
4272 Threaded$<$<CONFIG:Debug>:Debug>DLL to select a MSVC runtime library.
4273
4274 NOTE:
4275 This property has effect only when policy CMP0091 is set to NEW
4276 prior to the first project() or enable_language() command that
4277 enables a language using a compiler targeting the MSVC ABI.
4278
4279 NAME
4280 Logical name for the target.
4281
4282 Read-only logical name for the target as used by CMake.
4283
4284 NO_SONAME
4285 Whether to set soname when linking a shared library.
4286
4287 Enable this boolean property if a generated SHARED library should not
4288 have soname set. Default is to set soname on all shared libraries as
4289 long as the platform supports it. Generally, use this property only
4290 for leaf private libraries or plugins. If you use it on normal shared
4291 libraries which other targets link against, on some platforms a linker
4292 will insert a full path to the library (as specified at link time) into
4293 the dynamic section of the dependent binary. Therefore, once
4294 installed, dynamic loader may eventually fail to locate the library for
4295 the binary.
4296
4297 NO_SYSTEM_FROM_IMPORTED
4298 Do not treat include directories from the interfaces of consumed
4299 imported targets as SYSTEM.
4300
4301 The contents of the INTERFACE_INCLUDE_DIRECTORIES target property of
4302 imported targets are treated as SYSTEM includes by default. If this
4303 property is enabled on a target, compilation of sources in that target
4304 will not treat the contents of the INTERFACE_INCLUDE_DIRECTORIES of
4305 consumed imported targets as system includes.
4306
4307 This property is initialized by the value of the CMAKE_NO_SYS‐
4308 TEM_FROM_IMPORTED variable if it is set when a target is created.
4309
4310 OBJC_EXTENSIONS
4311 Boolean specifying whether compiler specific extensions are requested.
4312
4313 This property specifies whether compiler specific extensions should be
4314 used. For some compilers, this results in adding a flag such as
4315 -std=gnu11 instead of -std=c11 to the compile line. This property is
4316 ON by default. The basic OBJC standard level is controlled by the
4317 OBJC_STANDARD target property.
4318
4319 If the property is not set, and the project has set the C_EXTENSIONS,
4320 the value of C_EXTENSIONS is set for OBJC_EXTENSIONS.
4321
4322 See the cmake-compile-features(7) manual for information on compile
4323 features and a list of supported compilers.
4324
4325 This property is initialized by the value of the CMAKE_OBJC_EXTENSIONS
4326 variable if it is set when a target is created.
4327
4328 OBJC_STANDARD
4329 The OBJC standard whose features are requested to build this target.
4330
4331 This property specifies the OBJC standard whose features are requested
4332 to build this target. For some compilers, this results in adding a
4333 flag such as -std=gnu11 to the compile line.
4334
4335 Supported values are 90, 99 and 11.
4336
4337 If the value requested does not result in a compile flag being added
4338 for the compiler in use, a previous standard flag will be added
4339 instead. This means that using:
4340
4341 set_property(TARGET tgt PROPERTY OBJC_STANDARD 11)
4342
4343 with a compiler which does not support -std=gnu11 or an equivalent flag
4344 will not result in an error or warning, but will instead add the
4345 -std=gnu99 or -std=gnu90 flag if supported. This “decay” behavior may
4346 be controlled with the OBJC_STANDARD_REQUIRED target property. Addi‐
4347 tionally, the OBJC_EXTENSIONS target property may be used to control
4348 whether compiler-specific extensions are enabled on a per-target basis.
4349
4350 If the property is not set, and the project has set the C_STANDARD, the
4351 value of C_STANDARD is set for OBJC_STANDARD.
4352
4353 See the cmake-compile-features(7) manual for information on compile
4354 features and a list of supported compilers.
4355
4356 This property is initialized by the value of the CMAKE_OBJC_STANDARD
4357 variable if it is set when a target is created.
4358
4359 OBJC_STANDARD_REQUIRED
4360 Boolean describing whether the value of OBJC_STANDARD is a requirement.
4361
4362 If this property is set to ON, then the value of the OBJC_STANDARD tar‐
4363 get property is treated as a requirement. If this property is OFF or
4364 unset, the OBJC_STANDARD target property is treated as optional and may
4365 “decay” to a previous standard if the requested is not available.
4366
4367 If the property is not set, and the project has set the C_STAN‐
4368 DARD_REQUIRED, the value of C_STANDARD_REQUIRED is set for
4369 OBJC_STANDARD_REQUIRED.
4370
4371 See the cmake-compile-features(7) manual for information on compile
4372 features and a list of supported compilers.
4373
4374 This property is initialized by the value of the CMAKE_OBJC_STAN‐
4375 DARD_REQUIRED variable if it is set when a target is created.
4376
4377 OBJCXX_EXTENSIONS
4378 Boolean specifying whether compiler specific extensions are requested.
4379
4380 This property specifies whether compiler specific extensions should be
4381 used. For some compilers, this results in adding a flag such as
4382 -std=gnu++11 instead of -std=c++11 to the compile line. This property
4383 is ON by default. The basic ObjC++ standard level is controlled by the
4384 OBJCXX_STANDARD target property.
4385
4386 See the cmake-compile-features(7) manual for information on compile
4387 features and a list of supported compilers.
4388
4389 If the property is not set, and the project has set the CXX_EXTENSIONS,
4390 the value of CXX_EXTENSIONS is set for OBJCXX_EXTENSIONS.
4391
4392 This property is initialized by the value of the CMAKE_OBJCXX_EXTEN‐
4393 SIONS variable if it is set when a target is created.
4394
4395 OBJCXX_STANDARD
4396 The ObjC++ standard whose features are requested to build this target.
4397
4398 This property specifies the ObjC++ standard whose features are
4399 requested to build this target. For some compilers, this results in
4400 adding a flag such as -std=gnu++11 to the compile line.
4401
4402 Supported values are 98, 11, 14, 17, and 20.
4403
4404 If the value requested does not result in a compile flag being added
4405 for the compiler in use, a previous standard flag will be added
4406 instead. This means that using:
4407
4408 set_property(TARGET tgt PROPERTY OBJCXX_STANDARD 11)
4409
4410 with a compiler which does not support -std=gnu++11 or an equivalent
4411 flag will not result in an error or warning, but will instead add the
4412 -std=gnu++98 flag if supported. This “decay” behavior may be con‐
4413 trolled with the OBJCXX_STANDARD_REQUIRED target property. Addition‐
4414 ally, the OBJCXX_EXTENSIONS target property may be used to control
4415 whether compiler-specific extensions are enabled on a per-target basis.
4416
4417 If the property is not set, and the project has set the CXX_STANDARD,
4418 the value of CXX_STANDARD is set for OBJCXX_STANDARD.
4419
4420 See the cmake-compile-features(7) manual for information on compile
4421 features and a list of supported compilers.
4422
4423 This property is initialized by the value of the CMAKE_OBJCXX_STANDARD
4424 variable if it is set when a target is created.
4425
4426 OBJCXX_STANDARD_REQUIRED
4427 Boolean describing whether the value of OBJCXX_STANDARD is a require‐
4428 ment.
4429
4430 If this property is set to ON, then the value of the OBJCXX_STANDARD
4431 target property is treated as a requirement. If this property is OFF
4432 or unset, the OBJCXX_STANDARD target property is treated as optional
4433 and may “decay” to a previous standard if the requested is not avail‐
4434 able.
4435
4436 If the property is not set, and the project has set the CXX_STAN‐
4437 DARD_REQUIRED, the value of CXX_STANDARD_REQUIRED is set for
4438 OBJCXX_STANDARD_REQUIRED.
4439
4440 See the cmake-compile-features(7) manual for information on compile
4441 features and a list of supported compilers.
4442
4443 This property is initialized by the value of the CMAKE_OBJCXX_STAN‐
4444 DARD_REQUIRED variable if it is set when a target is created.
4445
4446 OSX_ARCHITECTURES_<CONFIG>
4447 Per-configuration macOS and iOS binary architectures for a target.
4448
4449 This property is the configuration-specific version of OSX_ARCHITEC‐
4450 TURES.
4451
4452 OSX_ARCHITECTURES
4453 Target specific architectures for macOS.
4454
4455 The OSX_ARCHITECTURES property sets the target binary architecture for
4456 targets on macOS (-arch). This property is initialized by the value of
4457 the variable CMAKE_OSX_ARCHITECTURES if it is set when a target is cre‐
4458 ated. Use OSX_ARCHITECTURES_<CONFIG> to set the binary architectures
4459 on a per-configuration basis, where <CONFIG> is an upper-case name
4460 (e.g. OSX_ARCHITECTURES_DEBUG).
4461
4462 OUTPUT_NAME_<CONFIG>
4463 Per-configuration target file base name.
4464
4465 This is the configuration-specific version of the OUTPUT_NAME target
4466 property.
4467
4468 OUTPUT_NAME
4469 Output name for target files.
4470
4471 This sets the base name for output files created for an executable or
4472 library target. If not set, the logical target name is used by default
4473 during generation. The value is not set by default during configura‐
4474 tion.
4475
4476 Contents of OUTPUT_NAME and the variants listed below may use generator
4477 expressions.
4478
4479 See also the variants:
4480
4481 · OUTPUT_NAME_<CONFIG>
4482
4483 · ARCHIVE_OUTPUT_NAME_<CONFIG>
4484
4485 · ARCHIVE_OUTPUT_NAME
4486
4487 · LIBRARY_OUTPUT_NAME_<CONFIG>
4488
4489 · LIBRARY_OUTPUT_NAME
4490
4491 · RUNTIME_OUTPUT_NAME_<CONFIG>
4492
4493 · RUNTIME_OUTPUT_NAME
4494
4495 PDB_NAME_<CONFIG>
4496 Per-configuration output name for the MS debug symbol .pdb file gener‐
4497 ated by the linker for an executable or shared library target.
4498
4499 This is the configuration-specific version of PDB_NAME.
4500
4501 NOTE:
4502 This property does not apply to STATIC library targets because no
4503 linker is invoked to produce them so they have no linker-generated
4504 .pdb file containing debug symbols.
4505
4506 The linker-generated program database files are specified by the
4507 /pdb linker flag and are not the same as compiler-generated program
4508 database files specified by the /Fd compiler flag. Use the COM‐
4509 PILE_PDB_NAME_<CONFIG> property to specify the latter.
4510
4511 PDB_NAME
4512 Output name for the MS debug symbol .pdb file generated by the linker
4513 for an executable or shared library target.
4514
4515 This property specifies the base name for the debug symbols file. If
4516 not set, the OUTPUT_NAME target property value or logical target name
4517 is used by default.
4518
4519 NOTE:
4520 This property does not apply to STATIC library targets because no
4521 linker is invoked to produce them so they have no linker-generated
4522 .pdb file containing debug symbols.
4523
4524 The linker-generated program database files are specified by the
4525 /pdb linker flag and are not the same as compiler-generated program
4526 database files specified by the /Fd compiler flag. Use the COM‐
4527 PILE_PDB_NAME property to specify the latter.
4528
4529 PDB_OUTPUT_DIRECTORY_<CONFIG>
4530 Per-configuration output directory for the MS debug symbol .pdb file
4531 generated by the linker for an executable or shared library target.
4532
4533 This is a per-configuration version of PDB_OUTPUT_DIRECTORY, but
4534 multi-configuration generators (Visual Studio Generators, Xcode) do NOT
4535 append a per-configuration subdirectory to the specified directory.
4536 This property is initialized by the value of the CMAKE_PDB_OUT‐
4537 PUT_DIRECTORY_<CONFIG> variable if it is set when a target is created.
4538
4539 Contents of PDB_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
4540 sions.
4541
4542 NOTE:
4543 This property does not apply to STATIC library targets because no
4544 linker is invoked to produce them so they have no linker-generated
4545 .pdb file containing debug symbols.
4546
4547 The linker-generated program database files are specified by the
4548 /pdb linker flag and are not the same as compiler-generated program
4549 database files specified by the /Fd compiler flag. Use the COM‐
4550 PILE_PDB_OUTPUT_DIRECTORY_<CONFIG> property to specify the latter.
4551
4552 PDB_OUTPUT_DIRECTORY
4553 Output directory for the MS debug symbols .pdb file generated by the
4554 linker for an executable or shared library target.
4555
4556 This property specifies the directory into which the MS debug symbols
4557 will be placed by the linker. The property value may use generator
4558 expressions. Multi-configuration generators append a per-configuration
4559 subdirectory to the specified directory unless a generator expression
4560 is used.
4561
4562 This property is initialized by the value of the CMAKE_PDB_OUT‐
4563 PUT_DIRECTORY variable if it is set when a target is created.
4564
4565 NOTE:
4566 This property does not apply to STATIC library targets because no
4567 linker is invoked to produce them so they have no linker-generated
4568 .pdb file containing debug symbols.
4569
4570 The linker-generated program database files are specified by the
4571 /pdb linker flag and are not the same as compiler-generated program
4572 database files specified by the /Fd compiler flag. Use the COM‐
4573 PILE_PDB_OUTPUT_DIRECTORY property to specify the latter.
4574
4575 POSITION_INDEPENDENT_CODE
4576 Whether to create a position-independent target
4577
4578 The POSITION_INDEPENDENT_CODE property determines whether position
4579 independent executables or shared libraries will be created. This
4580 property is True by default for SHARED and MODULE library targets and
4581 False otherwise. This property is initialized by the value of the
4582 CMAKE_POSITION_INDEPENDENT_CODE variable if it is set when a target is
4583 created.
4584
4585 NOTE:
4586 For executable targets, the link step is controlled by the CMP0083
4587 policy and the CheckPIESupported module.
4588
4589 PRECOMPILE_HEADERS
4590 List of header files to precompile.
4591
4592 This property holds a semicolon-separated list of header files to pre‐
4593 compile specified so far for its target. Use the target_precom‐
4594 pile_headers() command to append more header files.
4595
4596 This property supports generator expressions.
4597
4598 PRECOMPILE_HEADERS_REUSE_FROM
4599 Target from which to reuse the precompiled headers build artifact.
4600
4601 See the second signature of target_precompile_headers() command for
4602 more detailed information.
4603
4604 PREFIX
4605 What comes before the library name.
4606
4607 A target property that can be set to override the prefix (such as lib)
4608 on a library name.
4609
4610 PRIVATE_HEADER
4611 Specify private header files in a FRAMEWORK shared library target.
4612
4613 Shared library targets marked with the FRAMEWORK property generate
4614 frameworks on macOS, iOS and normal shared libraries on other plat‐
4615 forms. This property may be set to a list of header files to be placed
4616 in the PrivateHeaders directory inside the framework folder. On
4617 non-Apple platforms these headers may be installed using the PRI‐
4618 VATE_HEADER option to the install(TARGETS) command.
4619
4620 PROJECT_LABEL
4621 Change the name of a target in an IDE.
4622
4623 Can be used to change the name of the target in an IDE like Visual Stu‐
4624 dio.
4625
4626 PUBLIC_HEADER
4627 Specify public header files in a FRAMEWORK shared library target.
4628
4629 Shared library targets marked with the FRAMEWORK property generate
4630 frameworks on macOS, iOS and normal shared libraries on other plat‐
4631 forms. This property may be set to a list of header files to be placed
4632 in the Headers directory inside the framework folder. On non-Apple
4633 platforms these headers may be installed using the PUBLIC_HEADER option
4634 to the install(TARGETS) command.
4635
4636 RESOURCE
4637 Specify resource files in a FRAMEWORK or BUNDLE.
4638
4639 Target marked with the FRAMEWORK or BUNDLE property generate framework
4640 or application bundle (both macOS and iOS is supported) or normal
4641 shared libraries on other platforms. This property may be set to a
4642 list of files to be placed in the corresponding directory (eg.
4643 Resources directory for macOS) inside the bundle. On non-Apple plat‐
4644 forms these files may be installed using the RESOURCE option to the
4645 install(TARGETS) command.
4646
4647 Following example of Application Bundle:
4648
4649 add_executable(ExecutableTarget
4650 addDemo.c
4651 resourcefile.txt
4652 appresourcedir/appres.txt)
4653
4654 target_link_libraries(ExecutableTarget heymath mul)
4655
4656 set(RESOURCE_FILES
4657 resourcefile.txt
4658 appresourcedir/appres.txt)
4659
4660 set_target_properties(ExecutableTarget PROPERTIES
4661 MACOSX_BUNDLE TRUE
4662 MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
4663 RESOURCE "${RESOURCE_FILES}")
4664
4665 will produce flat structure for iOS systems:
4666
4667 ExecutableTarget.app
4668 appres.txt
4669 ExecutableTarget
4670 Info.plist
4671 resourcefile.txt
4672
4673 For macOS systems it will produce following directory structure:
4674
4675 ExecutableTarget.app/
4676 Contents
4677 Info.plist
4678 MacOS
4679 ExecutableTarget
4680 Resources
4681 appres.txt
4682 resourcefile.txt
4683
4684 For Linux, such CMake script produce following files:
4685
4686 ExecutableTarget
4687 Resources
4688 appres.txt
4689 resourcefile.txt
4690
4691 RULE_LAUNCH_COMPILE
4692 Specify a launcher for compile rules.
4693
4694 See the global property of the same name for details. This overrides
4695 the global and directory property for a target.
4696
4697 RULE_LAUNCH_CUSTOM
4698 Specify a launcher for custom rules.
4699
4700 See the global property of the same name for details. This overrides
4701 the global and directory property for a target.
4702
4703 RULE_LAUNCH_LINK
4704 Specify a launcher for link rules.
4705
4706 See the global property of the same name for details. This overrides
4707 the global and directory property for a target.
4708
4709 RUNTIME_OUTPUT_DIRECTORY_<CONFIG>
4710 Per-configuration output directory for RUNTIME target files.
4711
4712 This is a per-configuration version of the RUNTIME_OUTPUT_DIRECTORY
4713 target property, but multi-configuration generators (Visual Studio Gen‐
4714 erators, Xcode) do NOT append a per-configuration subdirectory to the
4715 specified directory. This property is initialized by the value of the
4716 CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> variable if it is set when a
4717 target is created.
4718
4719 Contents of RUNTIME_OUTPUT_DIRECTORY_<CONFIG> may use generator expres‐
4720 sions.
4721
4722 RUNTIME_OUTPUT_DIRECTORY
4723 Output directory in which to build RUNTIME target files.
4724
4725 This property specifies the directory into which runtime target files
4726 should be built. The property value may use generator expressions.
4727 Multi-configuration generators (VS, Xcode) append a per-configuration
4728 subdirectory to the specified directory unless a generator expression
4729 is used.
4730
4731 This property is initialized by the value of the variable CMAKE_RUN‐
4732 TIME_OUTPUT_DIRECTORY if it is set when a target is created.
4733
4734 See also the RUNTIME_OUTPUT_DIRECTORY_<CONFIG> target property.
4735
4736 RUNTIME_OUTPUT_NAME_<CONFIG>
4737 Per-configuration output name for RUNTIME target files.
4738
4739 This is the configuration-specific version of the RUNTIME_OUTPUT_NAME
4740 target property.
4741
4742 RUNTIME_OUTPUT_NAME
4743 Output name for RUNTIME target files.
4744
4745 This property specifies the base name for runtime target files. It
4746 overrides OUTPUT_NAME and OUTPUT_NAME_<CONFIG> properties.
4747
4748 See also the RUNTIME_OUTPUT_NAME_<CONFIG> target property.
4749
4750 SKIP_BUILD_RPATH
4751 Should rpaths be used for the build tree.
4752
4753 SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic gen‐
4754 eration of an rpath allowing the target to run from the build tree.
4755 This property is initialized by the value of the variable
4756 CMAKE_SKIP_BUILD_RPATH if it is set when a target is created.
4757
4758 SOURCE_DIR
4759 This read-only property reports the value of the CMAKE_CUR‐
4760 RENT_SOURCE_DIR variable in the directory in which the target was
4761 defined.
4762
4763 SOURCES
4764 Source names specified for a target.
4765
4766 List of sources specified for a target.
4767
4768 SOVERSION
4769 What version number is this target.
4770
4771 For shared libraries VERSION and SOVERSION can be used to specify the
4772 build version and API version respectively. When building or
4773 installing appropriate symlinks are created if the platform supports
4774 symlinks and the linker supports so-names. If only one of both is
4775 specified the missing is assumed to have the same version number.
4776 SOVERSION is ignored if NO_SONAME property is set.
4777
4778 Windows Versions
4779 For shared libraries and executables on Windows the VERSION attribute
4780 is parsed to extract a <major>.<minor> version number. These numbers
4781 are used as the image version of the binary.
4782
4783 Mach-O Versions
4784 For shared libraries and executables on Mach-O systems (e.g. macOS,
4785 iOS), the SOVERSION property corresponds to the compatibility version
4786 and VERSION corresponds to the current version (unless Mach-O specific
4787 overrides are provided, as discussed below). See the FRAMEWORK target
4788 property for an example.
4789
4790 For shared libraries, the MACHO_COMPATIBILITY_VERSION and MACHO_CUR‐
4791 RENT_VERSION properties can be used to override the compatibility ver‐
4792 sion and current version respectively. Note that SOVERSION will still
4793 be used to form the install_name and both SOVERSION and VERSION may
4794 also affect the file and symlink names.
4795
4796 Versions of Mach-O binaries may be checked with the otool -L <binary>
4797 command.
4798
4799 STATIC_LIBRARY_FLAGS_<CONFIG>
4800 Per-configuration archiver (or MSVC librarian) flags for a static
4801 library target.
4802
4803 This is the configuration-specific version of STATIC_LIBRARY_FLAGS.
4804
4805 NOTE:
4806 This property has been superseded by STATIC_LIBRARY_OPTIONS prop‐
4807 erty.
4808
4809 STATIC_LIBRARY_FLAGS
4810 Archiver (or MSVC librarian) flags for a static library target. Tar‐
4811 gets that are shared libraries, modules, or executables need to use the
4812 LINK_OPTIONS or LINK_FLAGS target properties.
4813
4814 The STATIC_LIBRARY_FLAGS property, managed as a string, can be used to
4815 add extra flags to the link step of a static library target.
4816 STATIC_LIBRARY_FLAGS_<CONFIG> will add to the configuration <CONFIG>,
4817 for example, DEBUG, RELEASE, MINSIZEREL, RELWITHDEBINFO, …
4818
4819 NOTE:
4820 This property has been superseded by STATIC_LIBRARY_OPTIONS prop‐
4821 erty.
4822
4823 STATIC_LIBRARY_OPTIONS
4824 Archiver (or MSVC librarian) flags for a static library target. Tar‐
4825 gets that are shared libraries, modules, or executables need to use the
4826 LINK_OPTIONS target property.
4827
4828 This property holds a semicolon-separated list of options specified so
4829 far for its target. Use set_target_properties() or set_property() com‐
4830 mands to set its content.
4831
4832 Contents of STATIC_LIBRARY_OPTIONS may use “generator expressions” with
4833 the syntax $<...>. See the cmake-generator-expressions(7) manual for
4834 available expressions. See the cmake-buildsystem(7) manual for more on
4835 defining buildsystem properties.
4836
4837 NOTE:
4838 This property must be used in preference to STATIC_LIBRARY_FLAGS
4839 property.
4840
4841 SUFFIX
4842 What comes after the target name.
4843
4844 A target property that can be set to override the suffix (such as .so
4845 or .exe) on the name of a library, module or executable.
4846
4847 Swift_DEPENDENCIES_FILE
4848 This property sets the path for the Swift dependency file (swiftdep)
4849 for the target. If one is not specified, it will default to <TAR‐
4850 GET>.swiftdeps.
4851
4852 Swift_LANGUAGE_VERSION
4853 This property sets the language version for the Swift sources in the
4854 target. If one is not specified, it will default to <CMAKE_Swift_LAN‐
4855 GUAGE_VERSION> if specified, otherwise it is the latest version sup‐
4856 ported by the compiler.
4857
4858 Swift_MODULE_DIRECTORY
4859 Specify output directory for Swift modules provided by the target.
4860
4861 If the target contains Swift source files, this specifies the directory
4862 in which the modules will be placed. When this property is not set,
4863 the modules will be placed in the build directory corresponding to the
4864 target’s source directory. If the variable CMAKE_Swift_MODULE_DIREC‐
4865 TORY is set when a target is created its value is used to initialise
4866 this property.
4867
4868 Swift_MODULE_NAME
4869 This property specifies the name of the Swift module. It is defaulted
4870 to the name of the target.
4871
4872 TYPE
4873 The type of the target.
4874
4875 This read-only property can be used to test the type of the given tar‐
4876 get. It will be one of STATIC_LIBRARY, MODULE_LIBRARY, SHARED_LIBRARY,
4877 OBJECT_LIBRARY, INTERFACE_LIBRARY, EXECUTABLE or one of the internal
4878 target types.
4879
4880 UNITY_BUILD
4881 When this property is set to true, the target source files will be com‐
4882 bined into batches for faster compilation. This is done by creating a
4883 (set of) unity sources which #include the original sources, then com‐
4884 piling these unity sources instead of the originals. This is known as
4885 a Unity or Jumbo build. The UNITY_BUILD_BATCH_SIZE property controls
4886 the upper limit on how many sources can be combined per unity source
4887 file.
4888
4889 Unity builds are not currently supported for all languages. CMake ver‐
4890 sion 3.17.2 supports combining C and CXX source files. For targets
4891 that mix source files from more than one language, CMake will separate
4892 the languages such that each generated unity source file only contains
4893 sources for a single language.
4894
4895 This property is initialized by the value of the CMAKE_UNITY_BUILD
4896 variable when a target is created.
4897
4898 NOTE:
4899 Projects should not directly set the UNITY_BUILD property or its
4900 associated CMAKE_UNITY_BUILD variable to true. Depending on the
4901 capabilities of the build machine and compiler used, it might or
4902 might not be appropriate to enable unity builds. Therefore, this
4903 feature should be under developer control, which would normally be
4904 through the developer choosing whether or not to set the
4905 CMAKE_UNITY_BUILD variable on the cmake(1) command line or some
4906 other equivalent method. However, it IS recommended to set the
4907 UNITY_BUILD target property to false if it is known that enabling
4908 unity builds for the target can lead to problems.
4909
4910 ODR (One definition rule) errors
4911 When multiple source files are included into one source file, as is
4912 done for unity builds, it can potentially lead to ODR errors. CMake
4913 provides a number of measures to help address such problems:
4914
4915 · Any source file that has a non-empty COMPILE_OPTIONS, COMPILE_DEFINI‐
4916 TIONS, COMPILE_FLAGS, or INCLUDE_DIRECTORIES source property will not
4917 be combined into a unity source.
4918
4919 · Projects can prevent an individual source file from being combined
4920 into a unity source by setting its SKIP_UNITY_BUILD_INCLUSION source
4921 property to true. This can be a more effective way to prevent prob‐
4922 lems with specific files than disabling unity builds for an entire
4923 target.
4924
4925 · The UNITY_BUILD_CODE_BEFORE_INCLUDE and
4926 UNITY_BUILD_CODE_AFTER_INCLUDE target properties can be used to
4927 inject code into the unity source files before and after every
4928 #include statement.
4929
4930 · The order of source files added to the target via commands like
4931 add_library(), add_executable() or target_sources() will be preserved
4932 in the generated unity source files. This can be used to manually
4933 enforce a specific grouping based on the UNITY_BUILD_BATCH_SIZE tar‐
4934 get property.
4935
4936 UNITY_BUILD_BATCH_SIZE
4937 Specifies the maximum number of source files that can be combined into
4938 any one unity source file when unity builds are enabled by the
4939 UNITY_BUILD target property. The original source files will be dis‐
4940 tributed across as many unity source files as necessary to honor this
4941 limit.
4942
4943 The initial value for this property is taken from the
4944 CMAKE_UNITY_BUILD_BATCH_SIZE variable when the target is created. If
4945 that variable has not been set, the initial value will be 8.
4946
4947 The batch size needs to be selected carefully. If set too high, the
4948 size of the combined source files could result in the compiler using
4949 excessive memory or hitting other similar limits. In extreme cases,
4950 this can even result in build failure. On the other hand, if the batch
4951 size is too low, there will be little gain in build performance.
4952
4953 Although strongly discouraged, the batch size may be set to a value of
4954 0 to combine all the sources for the target into a single unity file,
4955 regardless of how many sources are involved. This runs the risk of
4956 creating an excessively large unity source file and negatively impact‐
4957 ing the build performance, so a value of 0 is not generally recom‐
4958 mended.
4959
4960 UNITY_BUILD_CODE_AFTER_INCLUDE
4961 Code snippet which is included verbatim by the UNITY_BUILD feature just
4962 after every #include statement in the generated unity source files.
4963 For example:
4964
4965 set(after [[
4966 #if defined(NOMINMAX)
4967 #undef NOMINMAX
4968 #endif
4969 ]])
4970 set_target_properties(myTarget PROPERTIES
4971 UNITY_BUILD_CODE_AFTER_INCLUDE "${after}"
4972 )
4973
4974 See also UNITY_BUILD_CODE_BEFORE_INCLUDE.
4975
4976 UNITY_BUILD_CODE_BEFORE_INCLUDE
4977 Code snippet which is included verbatim by the UNITY_BUILD feature just
4978 before every #include statement in the generated unity source files.
4979 For example:
4980
4981 set(before [[
4982 #if !defined(NOMINMAX)
4983 #define NOMINMAX
4984 #endif
4985 ]])
4986 set_target_properties(myTarget PROPERTIES
4987 UNITY_BUILD_CODE_BEFORE_INCLUDE "${before}"
4988 )
4989
4990 See also UNITY_BUILD_CODE_AFTER_INCLUDE.
4991
4992 VERSION
4993 What version number is this target.
4994
4995 For shared libraries VERSION and SOVERSION can be used to specify the
4996 build version and API version respectively. When building or
4997 installing appropriate symlinks are created if the platform supports
4998 symlinks and the linker supports so-names. If only one of both is
4999 specified the missing is assumed to have the same version number. For
5000 executables VERSION can be used to specify the build version. When
5001 building or installing appropriate symlinks are created if the platform
5002 supports symlinks.
5003
5004 Windows Versions
5005 For shared libraries and executables on Windows the VERSION attribute
5006 is parsed to extract a <major>.<minor> version number. These numbers
5007 are used as the image version of the binary.
5008
5009 Mach-O Versions
5010 For shared libraries and executables on Mach-O systems (e.g. macOS,
5011 iOS), the SOVERSION property corresponds to the compatibility version
5012 and VERSION corresponds to the current version (unless Mach-O specific
5013 overrides are provided, as discussed below). See the FRAMEWORK target
5014 property for an example.
5015
5016 For shared libraries, the MACHO_COMPATIBILITY_VERSION and MACHO_CUR‐
5017 RENT_VERSION properties can be used to override the compatibility ver‐
5018 sion and current version respectively. Note that SOVERSION will still
5019 be used to form the install_name and both SOVERSION and VERSION may
5020 also affect the file and symlink names.
5021
5022 Versions of Mach-O binaries may be checked with the otool -L <binary>
5023 command.
5024
5025 VISIBILITY_INLINES_HIDDEN
5026 Whether to add a compile flag to hide symbols of inline functions
5027
5028 The VISIBILITY_INLINES_HIDDEN property determines whether a flag for
5029 hiding symbols for inline functions, such as -fvisibility-inlines-hid‐
5030 den, should be used when invoking the compiler. This property affects
5031 compilation in sources of all types of targets (subject to policy
5032 CMP0063).
5033
5034 This property is initialized by the value of the CMAKE_VISIBIL‐
5035 ITY_INLINES_HIDDEN variable if it is set when a target is created.
5036
5037 VS_CONFIGURATION_TYPE
5038 Visual Studio project configuration type.
5039
5040 Sets the ConfigurationType attribute for a generated Visual Studio
5041 project. The property value may use generator expressions. If this
5042 property is set, it overrides the default setting that is based on the
5043 target type (e.g. StaticLibrary, Application, …).
5044
5045 Supported on Visual Studio Generators for VS 2010 and higher.
5046
5047 VS_DEBUGGER_COMMAND
5048 Sets the local debugger command for Visual Studio C++ targets. The
5049 property value may use generator expressions. This is defined in
5050 <LocalDebuggerCommand> in the Visual Studio project file.
5051
5052 This property only works for Visual Studio 2010 and above; it is
5053 ignored on other generators.
5054
5055 VS_DEBUGGER_COMMAND_ARGUMENTS
5056 Sets the local debugger command line arguments for Visual Studio C++
5057 targets. The property value may use generator expressions. This is
5058 defined in <LocalDebuggerCommandArguments> in the Visual Studio project
5059 file.
5060
5061 This property only works for Visual Studio 2010 and above; it is
5062 ignored on other generators.
5063
5064 VS_DEBUGGER_ENVIRONMENT
5065 Sets the local debugger environment for Visual Studio C++ targets. The
5066 property value may use generator expressions. This is defined in
5067 <LocalDebuggerEnvironment> in the Visual Studio project file.
5068
5069 This property only works for Visual Studio 2010 and above; it is
5070 ignored on other generators.
5071
5072 VS_DEBUGGER_WORKING_DIRECTORY
5073 Sets the local debugger working directory for Visual Studio C++ tar‐
5074 gets. The property value may use generator expressions. This is
5075 defined in <LocalDebuggerWorkingDirectory> in the Visual Studio project
5076 file.
5077
5078 This property only works for Visual Studio 2010 and above; it is
5079 ignored on other generators.
5080
5081 VS_DESKTOP_EXTENSIONS_VERSION
5082 Visual Studio Windows 10 Desktop Extensions Version
5083
5084 Specifies the version of the Desktop Extensions that should be included
5085 in the target. For example 10.0.10240.0. If the value is not specified,
5086 the Desktop Extensions will not be included. To use the same version of
5087 the extensions as the Windows 10 SDK that is being used, you can use
5088 the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
5089
5090 VS_DOTNET_REFERENCE_<refname>
5091 Visual Studio managed project .NET reference with name <refname> and
5092 hint path.
5093
5094 Adds one .NET reference to generated Visual Studio project. The refer‐
5095 ence will have the name <refname> and will point to the assembly given
5096 as value of the property.
5097
5098 See also VS_DOTNET_REFERENCES and VS_DOTNET_REFERENCES_COPY_LOCAL
5099
5100 VS_DOTNET_REFERENCEPROP_<refname>_TAG_<tagname>
5101 Defines an XML property <tagname> for a .NET reference <refname>.
5102
5103 Reference properties can be set for .NET references which are defined
5104 by the target properties VS_DOTNET_REFERENCES, VS_DOTNET_REFER‐
5105 ENCE_<refname> and also for project references to other C# targets
5106 which are established by target_link_libraries().
5107
5108 This property is only applicable to C# targets and Visual Studio gener‐
5109 ators 2010 and later.
5110
5111 VS_DOTNET_REFERENCES
5112 Visual Studio managed project .NET references
5113
5114 Adds one or more semicolon-delimited .NET references to a generated
5115 Visual Studio project. For example, “System;System.Windows.Forms”.
5116
5117 VS_DOTNET_REFERENCES_COPY_LOCAL
5118 Sets the Copy Local property for all .NET hint references in the target
5119
5120 Boolean property to enable/disable copying of .NET hint references to
5121 output directory. The default is ON.
5122
5123 VS_DOTNET_TARGET_FRAMEWORK_VERSION
5124 Specify the .NET target framework version.
5125
5126 Used to specify the .NET target framework version for C++/CLI. For
5127 example, “v4.5”.
5128
5129 This property is deprecated and should not be used anymore. Use DOT‐
5130 NET_TARGET_FRAMEWORK or DOTNET_TARGET_FRAMEWORK_VERSION instead.
5131
5132 VS_DOTNET_DOCUMENTATION_FILE
5133 Visual Studio managed project .NET documentation output
5134
5135 Sets the target XML documentation file output.
5136
5137 VS_DPI_AWARE
5138 Set the Manifest Tool -> Input and Output -> DPI Awareness in the Vis‐
5139 ual Studio target project properties.
5140
5141 Valid values are PerMonitor, ON, or OFF.
5142
5143 For example:
5144
5145 add_executable(myproject myproject.cpp)
5146 set_property(TARGET myproject PROPERTY VS_DPI_AWARE "PerMonitor")
5147
5148 VS_GLOBAL_KEYWORD
5149 Visual Studio project keyword for VS 10 (2010) and newer.
5150
5151 Sets the “keyword” attribute for a generated Visual Studio project.
5152 Defaults to “Win32Proj”. You may wish to override this value with
5153 “ManagedCProj”, for example, in a Visual Studio managed C++ unit test
5154 project.
5155
5156 Use the VS_KEYWORD target property to set the keyword for Visual Studio
5157 9 (2008) and older.
5158
5159 VS_GLOBAL_PROJECT_TYPES
5160 Visual Studio project type(s).
5161
5162 Can be set to one or more UUIDs recognized by Visual Studio to indicate
5163 the type of project. This value is copied verbatim into the generated
5164 project file. Example for a managed C++ unit testing project:
5165
5166 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}
5167
5168 UUIDs are semicolon-delimited.
5169
5170 VS_GLOBAL_ROOTNAMESPACE
5171 Visual Studio project root namespace.
5172
5173 Sets the “RootNamespace” attribute for a generated Visual Studio
5174 project. The attribute will be generated only if this is set.
5175
5176 VS_GLOBAL_<variable>
5177 Visual Studio project-specific global variable.
5178
5179 Tell the Visual Studio generator to set the global variable ‘<vari‐
5180 able>’ to a given value in the generated Visual Studio project.
5181 Ignored on other generators. Qt integration works better if
5182 VS_GLOBAL_QtVersion is set to the version FindQt4.cmake found. For
5183 example, “4.7.3”
5184
5185 VS_IOT_EXTENSIONS_VERSION
5186 Visual Studio Windows 10 IoT Extensions Version
5187
5188 Specifies the version of the IoT Extensions that should be included in
5189 the target. For example 10.0.10240.0. If the value is not specified,
5190 the IoT Extensions will not be included. To use the same version of the
5191 extensions as the Windows 10 SDK that is being used, you can use the
5192 CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
5193
5194 VS_IOT_STARTUP_TASK
5195 Visual Studio Windows 10 IoT Continuous Background Task
5196
5197 Specifies that the target should be compiled as a Continuous Background
5198 Task library.
5199
5200 VS_JUST_MY_CODE_DEBUGGING
5201 Enable Just My Code with Visual Studio debugger.
5202
5203 Supported on Visual Studio Generators for VS 2010 and higher, Makefile
5204 Generators and the Ninja generators.
5205
5206 This property is initialized by the CMAKE_VS_JUST_MY_CODE_DEBUGGING
5207 variable if it is set when a target is created.
5208
5209 VS_KEYWORD
5210 Visual Studio project keyword for VS 9 (2008) and older.
5211
5212 Can be set to change the visual studio keyword, for example Qt integra‐
5213 tion works better if this is set to Qt4VSv1.0.
5214
5215 Use the VS_GLOBAL_KEYWORD target property to set the keyword for Visual
5216 Studio 10 (2010) and newer.
5217
5218 VS_MOBILE_EXTENSIONS_VERSION
5219 Visual Studio Windows 10 Mobile Extensions Version
5220
5221 Specifies the version of the Mobile Extensions that should be included
5222 in the target. For example 10.0.10240.0. If the value is not specified,
5223 the Mobile Extensions will not be included. To use the same version of
5224 the extensions as the Windows 10 SDK that is being used, you can use
5225 the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable.
5226
5227 VS_NO_SOLUTION_DEPLOY
5228 Specify that the target should not be marked for deployment to a Win‐
5229 dows CE or Windows Phone device in the generated Visual Studio solu‐
5230 tion.
5231
5232 Be default, all EXE and shared library (DLL) targets are marked to
5233 deploy to the target device in the generated Visual Studio solution.
5234
5235 Generator expressions are supported.
5236
5237 There are reasons one might want to exclude a target / generated
5238 project from deployment:
5239
5240 · The library or executable may not be necessary in the primary
5241 deploy/debug scenario, and excluding from deployment saves time in
5242 the develop/download/debug cycle.
5243
5244 · There may be insufficient space on the target device to accommodate
5245 all of the build products.
5246
5247 · Visual Studio 2013 requires a target device IP address be entered for
5248 each target marked for deployment. For large numbers of targets,
5249 this can be tedious. NOTE: Visual Studio will deploy all project
5250 dependencies of a project tagged for deployment to the IP address
5251 configured for that project even if those dependencies are not tagged
5252 for deployment.
5253
5254 Example 1
5255 This shows setting the variable for the target foo.
5256
5257 add_library(foo SHARED foo.cpp)
5258 set_property(TARGET foo PROPERTY VS_NO_SOLUTION_DEPLOY ON)
5259
5260 Example 2
5261 This shows setting the variable for the Release configuration only.
5262
5263 add_library(foo SHARED foo.cpp)
5264 set_property(TARGET foo PROPERTY VS_NO_SOLUTION_DEPLOY "$<CONFIG:Release>")
5265
5266 VS_PACKAGE_REFERENCES
5267 Visual Studio package references for nuget.
5268
5269 Adds one or more semicolon-delimited package references to a generated
5270 Visual Studio project. The version of the package will be underscore
5271 delimited. For example, boost_1.7.0;nunit_3.12.*.
5272
5273 set_property(TARGET ${TARGET_NAME} PROPERTY
5274 VS_PACKAGE_REFERENCES "boost_1.7.0")
5275
5276 VS_PROJECT_IMPORT
5277 Visual Studio managed project imports
5278
5279 Adds to a generated Visual Studio project one or more semicolon-delim‐
5280 ited paths to .props files needed when building projects from some
5281 NuGet packages. For example, my_packages_path/MyPack‐
5282 age.1.0.0/build/MyPackage.props.
5283
5284 VS_SCC_AUXPATH
5285 Visual Studio Source Code Control Aux Path.
5286
5287 Can be set to change the visual studio source code control auxpath
5288 property.
5289
5290 VS_SCC_LOCALPATH
5291 Visual Studio Source Code Control Local Path.
5292
5293 Can be set to change the visual studio source code control local path
5294 property.
5295
5296 VS_SCC_PROJECTNAME
5297 Visual Studio Source Code Control Project.
5298
5299 Can be set to change the visual studio source code control project name
5300 property.
5301
5302 VS_SCC_PROVIDER
5303 Visual Studio Source Code Control Provider.
5304
5305 Can be set to change the visual studio source code control provider
5306 property.
5307
5308 VS_SDK_REFERENCES
5309 Visual Studio project SDK references. Specify a semicolon-separated
5310 list of SDK references to be added to a generated Visual Studio
5311 project, e.g. Microsoft.AdMediatorWindows81, Version=1.0.
5312
5313 VS_USER_PROPS
5314 Sets the user props file to be included in the visual studio C++
5315 project file. The standard path is $(UserRootDir)\\Micro‐
5316 soft.Cpp.$(Platform).user.props, which is in most cases the same as
5317 %LOCALAPPDATA%\\Microsoft\\MSBuild\\v4.0\\Micro‐
5318 soft.Cpp.Win32.user.props or %LOCALAPPDATA%\\Micro‐
5319 soft\\MSBuild\\v4.0\\Microsoft.Cpp.x64.user.props.
5320
5321 The *.user.props files can be used for Visual Studio wide configuration
5322 which is independent from cmake.
5323
5324 VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
5325 Visual Studio Windows Target Platform Minimum Version
5326
5327 For Windows 10. Specifies the minimum version of the OS that is being
5328 targeted. For example 10.0.10240.0. If the value is not specified, the
5329 value of CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION will be used on Win‐
5330 dowsStore projects otherwise the target platform minimum version will
5331 not be specified for the project.
5332
5333 VS_WINRT_COMPONENT
5334 Mark a target as a Windows Runtime component for the Visual Studio gen‐
5335 erator. Compile the target with C++/CX language extensions for Windows
5336 Runtime. For SHARED and MODULE libraries, this also defines the
5337 _WINRT_DLL preprocessor macro.
5338
5339 NOTE:
5340 Currently this is implemented only by Visual Studio generators.
5341 Support may be added to other generators in the future.
5342
5343 VS_WINRT_EXTENSIONS
5344 Deprecated. Use VS_WINRT_COMPONENT instead. This property was an
5345 experimental partial implementation of that one.
5346
5347 VS_WINRT_REFERENCES
5348 Visual Studio project Windows Runtime Metadata references
5349
5350 Adds one or more semicolon-delimited WinRT references to a generated
5351 Visual Studio project. For example, “Windows;Windows.UI.Core”.
5352
5353 WIN32_EXECUTABLE
5354 Build an executable with a WinMain entry point on windows.
5355
5356 When this property is set to true the executable when linked on Windows
5357 will be created with a WinMain() entry point instead of just main().
5358 This makes it a GUI executable instead of a console application. See
5359 the CMAKE_MFC_FLAG variable documentation to configure use of the Mi‐
5360 crosoft Foundation Classes (MFC) for WinMain executables. This prop‐
5361 erty is initialized by the value of the CMAKE_WIN32_EXECUTABLE variable
5362 if it is set when a target is created.
5363
5364 WINDOWS_EXPORT_ALL_SYMBOLS
5365 This property is implemented only for MS-compatible tools on Windows.
5366
5367 Enable this boolean property to automatically create a module defini‐
5368 tion (.def) file with all global symbols found in the input .obj files
5369 for a SHARED library (or executable with ENABLE_EXPORTS) on Windows.
5370 The module definition file will be passed to the linker causing all
5371 symbols to be exported from the .dll. For global data symbols,
5372 __declspec(dllimport) must still be used when compiling against the
5373 code in the .dll. All other function symbols will be automatically
5374 exported and imported by callers. This simplifies porting projects to
5375 Windows by reducing the need for explicit dllexport markup, even in C++
5376 classes.
5377
5378 When this property is enabled, zero or more .def files may also be
5379 specified as source files of the target. The exports named by these
5380 files will be merged with those detected from the object files to gen‐
5381 erate a single module definition file to be passed to the linker. This
5382 can be used to export symbols from a .dll that are not in any of its
5383 object files but are added by the linker from dependencies (e.g.
5384 msvcrt.lib).
5385
5386 This property is initialized by the value of the CMAKE_WIN‐
5387 DOWS_EXPORT_ALL_SYMBOLS variable if it is set when a target is created.
5388
5389 XCODE_ATTRIBUTE_<an-attribute>
5390 Set Xcode target attributes directly.
5391
5392 Tell the Xcode generator to set ‘<an-attribute>’ to a given value in
5393 the generated Xcode project. Ignored on other generators.
5394
5395 See the CMAKE_XCODE_ATTRIBUTE_<an-attribute> variable to set attributes
5396 on all targets in a directory tree.
5397
5398 Contents of XCODE_ATTRIBUTE_<an-attribute> may use “generator expres‐
5399 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
5400 manual for available expressions. See the cmake-buildsystem(7) manual
5401 for more on defining buildsystem properties.
5402
5403 XCODE_EXPLICIT_FILE_TYPE
5404 Set the Xcode explicitFileType attribute on its reference to a target.
5405 CMake computes a default based on target type but can be told explic‐
5406 itly with this property.
5407
5408 See also XCODE_PRODUCT_TYPE.
5409
5410 XCODE_GENERATE_SCHEME
5411 If enabled, the Xcode generator will generate schema files. These are
5412 useful to invoke analyze, archive, build-for-testing and test actions
5413 from the command line.
5414
5415 This property is initialized by the value of the variable
5416 CMAKE_XCODE_GENERATE_SCHEME if it is set when a target is created.
5417
5418 The following target properties overwrite the default of the corre‐
5419 sponding settings on the “Diagnostic” tab for each schema file. Each
5420 of those is initialized by the respective CMAKE_ variable at target
5421 creation time.
5422
5423 · XCODE_SCHEME_ADDRESS_SANITIZER
5424
5425 · XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
5426
5427 · XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
5428
5429 · XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
5430
5431 · XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
5432
5433 · XCODE_SCHEME_GUARD_MALLOC
5434
5435 · XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
5436
5437 · XCODE_SCHEME_MALLOC_GUARD_EDGES
5438
5439 · XCODE_SCHEME_MALLOC_SCRIBBLE
5440
5441 · XCODE_SCHEME_MALLOC_STACK
5442
5443 · XCODE_SCHEME_THREAD_SANITIZER
5444
5445 · XCODE_SCHEME_THREAD_SANITIZER_STOP
5446
5447 · XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
5448
5449 · XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
5450
5451 · XCODE_SCHEME_ZOMBIE_OBJECTS
5452
5453 The following target properties will be applied on the “Info”, “Argu‐
5454 ments”, and “Options” tab:
5455
5456 · XCODE_SCHEME_ARGUMENTS
5457
5458 · XCODE_SCHEME_DEBUG_AS_ROOT
5459
5460 · XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
5461
5462 · XCODE_SCHEME_ENVIRONMENT
5463
5464 · XCODE_SCHEME_EXECUTABLE
5465
5466 · XCODE_SCHEME_WORKING_DIRECTORY
5467
5468 XCODE_PRODUCT_TYPE
5469 Set the Xcode productType attribute on its reference to a target.
5470 CMake computes a default based on target type but can be told explic‐
5471 itly with this property.
5472
5473 See also XCODE_EXPLICIT_FILE_TYPE.
5474
5475 XCODE_SCHEME_ADDRESS_SANITIZER
5476 Whether to enable Address Sanitizer in the Diagnostics section of the
5477 generated Xcode scheme.
5478
5479 This property is initialized by the value of the variable
5480 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER if it is set when a target is cre‐
5481 ated.
5482
5483 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5484 to see all Xcode schema related properties.
5485
5486 XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
5487 Whether to enable Detect use of stack after return in the Diagnostics
5488 section of the generated Xcode scheme.
5489
5490 This property is initialized by the value of the variable
5491 CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN if it is set when
5492 a target is created.
5493
5494 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5495 to see all Xcode schema related properties.
5496
5497 XCODE_SCHEME_ARGUMENTS
5498 Specify command line arguments that should be added to the Arguments
5499 section of the generated Xcode scheme.
5500
5501 If set to a list of arguments those will be added to the scheme.
5502
5503 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5504 to see all Xcode schema related properties.
5505
5506 XCODE_SCHEME_DEBUG_AS_ROOT
5507 Whether to debug the target as ‘root’.
5508
5509 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5510 to see all Xcode schema related properties.
5511
5512 XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING
5513 Whether to enable Allow debugging when using document Versions Browser
5514 in the Options section of the generated Xcode scheme.
5515
5516 This property is initialized by the value of the variable
5517 CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING if it is set when a target
5518 is created.
5519
5520 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5521 to see all Xcode schema related properties.
5522
5523 XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
5524 Whether to disable the Main Thread Checker in the Diagnostics section
5525 of the generated Xcode scheme.
5526
5527 This property is initialized by the value of the variable
5528 CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER if it is set when a tar‐
5529 get is created.
5530
5531 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5532 to see all Xcode schema related properties.
5533
5534 XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
5535 Whether to enable Dynamic Library Loads in the Diagnostics section of
5536 the generated Xcode scheme.
5537
5538 This property is initialized by the value of the variable
5539 CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS if it is set when a target is
5540 created.
5541
5542 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5543 to see all Xcode schema related properties.
5544
5545 XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
5546 Whether to enable Dynamic Linker API usage in the Diagnostics section
5547 of the generated Xcode scheme.
5548
5549 This property is initialized by the value of the variable
5550 CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE if it is set when a target
5551 is created.
5552
5553 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5554 to see all Xcode schema related properties.
5555
5556 XCODE_SCHEME_ENVIRONMENT
5557 Specify environment variables that should be added to the Arguments
5558 section of the generated Xcode scheme.
5559
5560 If set to a list of environment variables and values of the form
5561 MYVAR=value those environment variables will be added to the scheme.
5562
5563 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5564 to see all Xcode schema related properties.
5565
5566 XCODE_SCHEME_EXECUTABLE
5567 Specify path to executable in the Info section of the generated Xcode
5568 scheme. If not set the schema generator will select the current target
5569 if it is actually executable.
5570
5571 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5572 to see all Xcode schema related properties.
5573
5574 XCODE_SCHEME_GUARD_MALLOC
5575 Whether to enable Guard Malloc in the Diagnostics section of the gener‐
5576 ated Xcode scheme.
5577
5578 This property is initialized by the value of the variable
5579 CMAKE_XCODE_SCHEME_GUARD_MALLOC if it is set when a target is created.
5580
5581 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5582 to see all Xcode schema related properties.
5583
5584 XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
5585 Whether to enable the Main Thread Checker option Pause on issues in the
5586 Diagnostics section of the generated Xcode scheme.
5587
5588 This property is initialized by the value of the variable
5589 CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP if it is set when a target
5590 is created.
5591
5592 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5593 to see all Xcode schema related properties.
5594
5595 XCODE_SCHEME_MALLOC_GUARD_EDGES
5596 Whether to enable Malloc Guard Edges in the Diagnostics section of the
5597 generated Xcode scheme.
5598
5599 This property is initialized by the value of the variable
5600 CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES if it is set when a target is
5601 created.
5602
5603 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5604 to see all Xcode schema related properties.
5605
5606 XCODE_SCHEME_MALLOC_SCRIBBLE
5607 Whether to enable Malloc Scribble in the Diagnostics section of the
5608 generated Xcode scheme.
5609
5610 This property is initialized by the value of the variable
5611 CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE if it is set when a target is cre‐
5612 ated.
5613
5614 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5615 to see all Xcode schema related properties.
5616
5617 XCODE_SCHEME_MALLOC_STACK
5618 Whether to enable Malloc Stack in the Diagnostics section of the gener‐
5619 ated Xcode scheme.
5620
5621 This property is initialized by the value of the variable
5622 CMAKE_XCODE_SCHEME_MALLOC_STACK if it is set when a target is created.
5623
5624 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5625 to see all Xcode schema related properties.
5626
5627 XCODE_SCHEME_THREAD_SANITIZER
5628 Whether to enable Thread Sanitizer in the Diagnostics section of the
5629 generated Xcode scheme.
5630
5631 This property is initialized by the value of the variable
5632 CMAKE_XCODE_SCHEME_THREAD_SANITIZER if it is set when a target is cre‐
5633 ated.
5634
5635 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5636 to see all Xcode schema related properties.
5637
5638 XCODE_SCHEME_THREAD_SANITIZER_STOP
5639 Whether to enable Thread Sanitizer - Pause on issues in the Diagnostics
5640 section of the generated Xcode scheme.
5641
5642 This property is initialized by the value of the variable
5643 CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP if it is set when a target is
5644 created.
5645
5646 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5647 to see all Xcode schema related properties.
5648
5649 XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
5650 Whether to enable Undefined Behavior Sanitizer in the Diagnostics sec‐
5651 tion of the generated Xcode scheme.
5652
5653 This property is initialized by the value of the variable
5654 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER if it is set when a
5655 target is created.
5656
5657 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5658 to see all Xcode schema related properties.
5659
5660 XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
5661 Whether to enable Undefined Behavior Sanitizer option Pause on issues
5662 in the Diagnostics section of the generated Xcode scheme.
5663
5664 This property is initialized by the value of the variable
5665 CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP if it is set when
5666 a target is created.
5667
5668 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5669 to see all Xcode schema related properties.
5670
5671 XCODE_SCHEME_WORKING_DIRECTORY
5672 Specify the Working Directory of the Run and Profile actions in the
5673 generated Xcode scheme. In case the value contains generator expres‐
5674 sions those are evaluated.
5675
5676 This property is initialized by the value of the variable
5677 CMAKE_XCODE_SCHEME_WORKING_DIRECTORY if it is set when a target is cre‐
5678 ated.
5679
5680 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5681 to see all Xcode schema related properties.
5682
5683 XCODE_SCHEME_ZOMBIE_OBJECTS
5684 Whether to enable Zombie Objects in the Diagnostics section of the gen‐
5685 erated Xcode scheme.
5686
5687 This property is initialized by the value of the variable
5688 CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS if it is set when a target is cre‐
5689 ated.
5690
5691 Please refer to the XCODE_GENERATE_SCHEME target property documentation
5692 to see all Xcode schema related properties.
5693
5694 XCTEST
5695 This target is a XCTest CFBundle on the Mac.
5696
5697 This property will usually get set via the xctest_add_bundle() macro in
5698 FindXCTest module.
5699
5700 If a module library target has this property set to true it will be
5701 built as a CFBundle when built on the Mac. It will have the directory
5702 structure required for a CFBundle.
5703
5704 This property depends on BUNDLE to be effective.
5705
5707 ATTACHED_FILES_ON_FAIL
5708 Attach a list of files to a dashboard submission if the test fails.
5709
5710 Same as ATTACHED_FILES, but these files will only be included if the
5711 test does not pass.
5712
5713 ATTACHED_FILES
5714 Attach a list of files to a dashboard submission.
5715
5716 Set this property to a list of files that will be encoded and submitted
5717 to the dashboard as an addition to the test result.
5718
5719 COST
5720 This property describes the cost of a test. When parallel testing is
5721 enabled, tests in the test set will be run in descending order of cost.
5722 Projects can explicitly define the cost of a test by setting this prop‐
5723 erty to a floating point value.
5724
5725 When the cost of a test is not defined by the project, ctest will ini‐
5726 tially use a default cost of 0. It computes a weighted average of the
5727 cost each time a test is run and uses that as an improved estimate of
5728 the cost for the next run. The more a test is re-run in the same build
5729 directory, the more representative the cost should become.
5730
5731 DEPENDS
5732 Specifies that this test should only be run after the specified list of
5733 tests.
5734
5735 Set this to a list of tests that must finish before this test is run.
5736 The results of those tests are not considered, the dependency relation‐
5737 ship is purely for order of execution (i.e. it is really just a run
5738 after relationship). Consider using test fixtures with setup tests if a
5739 dependency with successful completion is required (see FIX‐
5740 TURES_REQUIRED).
5741
5742 DISABLED
5743 If set to True, the test will be skipped and its status will be ‘Not
5744 Run’. A DISABLED test will not be counted in the total number of tests
5745 and its completion status will be reported to CDash as Disabled.
5746
5747 A DISABLED test does not participate in test fixture dependency resolu‐
5748 tion. If a DISABLED test has fixture requirements defined in its FIX‐
5749 TURES_REQUIRED property, it will not cause setup or cleanup tests for
5750 those fixtures to be added to the test set.
5751
5752 If a test with the FIXTURES_SETUP property set is DISABLED, the fixture
5753 behavior will be as though that setup test was passing and any test
5754 case requiring that fixture will still run.
5755
5756 ENVIRONMENT
5757 Specify environment variables that should be defined for running a
5758 test.
5759
5760 If set to a list of environment variables and values of the form
5761 MYVAR=value those environment variables will be defined while running
5762 the test. The environment is restored to its previous state after the
5763 test is done.
5764
5765 FAIL_REGULAR_EXPRESSION
5766 If the output matches this regular expression the test will fail.
5767
5768 If set, if the output matches one of specified regular expressions, the
5769 test will fail. Example:
5770
5771 set_tests_properties(mytest PROPERTIES
5772 FAIL_REGULAR_EXPRESSION "[^a-z]Error;ERROR;Failed"
5773 )
5774
5775 FAIL_REGULAR_EXPRESSION expects a list of regular expressions.
5776
5777 FIXTURES_CLEANUP
5778 Specifies a list of fixtures for which the test is to be treated as a
5779 cleanup test. These fixture names are distinct from test case names and
5780 are not required to have any similarity to the names of tests associ‐
5781 ated with them.
5782
5783 Fixture cleanup tests are ordinary tests with all of the usual test
5784 functionality. Setting the FIXTURES_CLEANUP property for a test has two
5785 primary effects:
5786
5787 · CTest will ensure the test executes after all other tests which list
5788 any of the fixtures in its FIXTURES_REQUIRED property.
5789
5790 · If CTest is asked to run only a subset of tests (e.g. using regular
5791 expressions or the --rerun-failed option) and the cleanup test is not
5792 in the set of tests to run, it will automatically be added if any
5793 tests in the set require any fixture listed in FIXTURES_CLEANUP.
5794
5795 A cleanup test can have multiple fixtures listed in its FIX‐
5796 TURES_CLEANUP property. It will execute only once for the whole CTest
5797 run, not once for each fixture. A fixture can also have more than one
5798 cleanup test defined. If there are multiple cleanup tests for a fix‐
5799 ture, projects can control their order with the usual DEPENDS test
5800 property if necessary.
5801
5802 A cleanup test is allowed to require other fixtures, but not any fix‐
5803 ture listed in its FIXTURES_CLEANUP property. For example:
5804
5805 # Ok: Dependent fixture is different to cleanup
5806 set_tests_properties(cleanupFoo PROPERTIES
5807 FIXTURES_CLEANUP Foo
5808 FIXTURES_REQUIRED Bar
5809 )
5810
5811 # Error: cannot require same fixture as cleanup
5812 set_tests_properties(cleanupFoo PROPERTIES
5813 FIXTURES_CLEANUP Foo
5814 FIXTURES_REQUIRED Foo
5815 )
5816
5817 Cleanup tests will execute even if setup or regular tests for that fix‐
5818 ture fail or are skipped.
5819
5820 See FIXTURES_REQUIRED for a more complete discussion of how to use test
5821 fixtures.
5822
5823 FIXTURES_REQUIRED
5824 Specifies a list of fixtures the test requires. Fixture names are case
5825 sensitive and they are not required to have any similarity to test
5826 names.
5827
5828 Fixtures are a way to attach setup and cleanup tasks to a set of tests.
5829 If a test requires a given fixture, then all tests marked as setup
5830 tasks for that fixture will be executed first (once for the whole set
5831 of tests, not once per test requiring the fixture). After all tests
5832 requiring a particular fixture have completed, CTest will ensure all
5833 tests marked as cleanup tasks for that fixture are then executed. Tests
5834 are marked as setup tasks with the FIXTURES_SETUP property and as
5835 cleanup tasks with the FIXTURES_CLEANUP property. If any of a fixture’s
5836 setup tests fail, all tests listing that fixture in their FIX‐
5837 TURES_REQUIRED property will not be executed. The cleanup tests for the
5838 fixture will always be executed, even if some setup tests fail.
5839
5840 When CTest is asked to execute only a subset of tests (e.g. by the use
5841 of regular expressions or when run with the --rerun-failed command line
5842 option), it will automatically add any setup or cleanup tests for fix‐
5843 tures required by any of the tests that are in the execution set. This
5844 behavior can be overridden with the -FS, -FC and -FA command line
5845 options to ctest(1) if desired.
5846
5847 Since setup and cleanup tasks are also tests, they can have an ordering
5848 specified by the DEPENDS test property just like any other tests. This
5849 can be exploited to implement setup or cleanup using multiple tests for
5850 a single fixture to modularise setup or cleanup logic.
5851
5852 The concept of a fixture is different to that of a resource specified
5853 by RESOURCE_LOCK, but they may be used together. A fixture defines a
5854 set of tests which share setup and cleanup requirements, whereas a
5855 resource lock has the effect of ensuring a particular set of tests do
5856 not run in parallel. Some situations may need both, such as setting up
5857 a database, serialising test access to that database and deleting the
5858 database again at the end. For such cases, tests would populate both
5859 FIXTURES_REQUIRED and RESOURCE_LOCK to combine the two behaviours.
5860 Names used for RESOURCE_LOCK have no relationship with names of fix‐
5861 tures, so note that a resource lock does not imply a fixture and vice
5862 versa.
5863
5864 Consider the following example which represents a database test sce‐
5865 nario similar to that mentioned above:
5866
5867 add_test(NAME testsDone COMMAND emailResults)
5868 add_test(NAME fooOnly COMMAND testFoo)
5869 add_test(NAME dbOnly COMMAND testDb)
5870 add_test(NAME dbWithFoo COMMAND testDbWithFoo)
5871 add_test(NAME createDB COMMAND initDB)
5872 add_test(NAME setupUsers COMMAND userCreation)
5873 add_test(NAME cleanupDB COMMAND deleteDB)
5874 add_test(NAME cleanupFoo COMMAND removeFoos)
5875
5876 set_tests_properties(setupUsers PROPERTIES DEPENDS createDB)
5877
5878 set_tests_properties(createDB PROPERTIES FIXTURES_SETUP DB)
5879 set_tests_properties(setupUsers PROPERTIES FIXTURES_SETUP DB)
5880 set_tests_properties(cleanupDB PROPERTIES FIXTURES_CLEANUP DB)
5881 set_tests_properties(cleanupFoo PROPERTIES FIXTURES_CLEANUP Foo)
5882 set_tests_properties(testsDone PROPERTIES FIXTURES_CLEANUP "DB;Foo")
5883
5884 set_tests_properties(fooOnly PROPERTIES FIXTURES_REQUIRED Foo)
5885 set_tests_properties(dbOnly PROPERTIES FIXTURES_REQUIRED DB)
5886 set_tests_properties(dbWithFoo PROPERTIES FIXTURES_REQUIRED "DB;Foo")
5887
5888 set_tests_properties(dbOnly dbWithFoo createDB setupUsers cleanupDB
5889 PROPERTIES RESOURCE_LOCK DbAccess)
5890
5891 Key points from this example:
5892
5893 · Two fixtures are defined: DB and Foo. Tests can require a single fix‐
5894 ture as fooOnly and dbOnly do, or they can depend on multiple fix‐
5895 tures like dbWithFoo does.
5896
5897 · A DEPENDS relationship is set up to ensure setupUsers happens after
5898 createDB, both of which are setup tests for the DB fixture and will
5899 therefore be executed before the dbOnly and dbWithFoo tests automati‐
5900 cally.
5901
5902 · No explicit DEPENDS relationships were needed to make the setup tests
5903 run before or the cleanup tests run after the regular tests.
5904
5905 · The Foo fixture has no setup tests defined, only a single cleanup
5906 test.
5907
5908 · testsDone is a cleanup test for both the DB and Foo fixtures. There‐
5909 fore, it will only execute once regular tests for both fixtures have
5910 finished (i.e. after fooOnly, dbOnly and dbWithFoo). No DEPENDS rela‐
5911 tionship was specified for testsDone, so it is free to run before,
5912 after or concurrently with other cleanup tests for either fixture.
5913
5914 · The setup and cleanup tests never list the fixtures they are for in
5915 their own FIXTURES_REQUIRED property, as that would result in a
5916 dependency on themselves and be considered an error.
5917
5918 FIXTURES_SETUP
5919 Specifies a list of fixtures for which the test is to be treated as a
5920 setup test. These fixture names are distinct from test case names and
5921 are not required to have any similarity to the names of tests associ‐
5922 ated with them.
5923
5924 Fixture setup tests are ordinary tests with all of the usual test func‐
5925 tionality. Setting the FIXTURES_SETUP property for a test has two pri‐
5926 mary effects:
5927
5928 · CTest will ensure the test executes before any other test which lists
5929 the fixture name(s) in its FIXTURES_REQUIRED property.
5930
5931 · If CTest is asked to run only a subset of tests (e.g. using regular
5932 expressions or the --rerun-failed option) and the setup test is not
5933 in the set of tests to run, it will automatically be added if any
5934 tests in the set require any fixture listed in FIXTURES_SETUP.
5935
5936 A setup test can have multiple fixtures listed in its FIXTURES_SETUP
5937 property. It will execute only once for the whole CTest run, not once
5938 for each fixture. A fixture can also have more than one setup test
5939 defined. If there are multiple setup tests for a fixture, projects can
5940 control their order with the usual DEPENDS test property if necessary.
5941
5942 A setup test is allowed to require other fixtures, but not any fixture
5943 listed in its FIXTURES_SETUP property. For example:
5944
5945 # Ok: dependent fixture is different to setup
5946 set_tests_properties(setupFoo PROPERTIES
5947 FIXTURES_SETUP Foo
5948 FIXTURES_REQUIRED Bar
5949 )
5950
5951 # Error: cannot require same fixture as setup
5952 set_tests_properties(setupFoo PROPERTIES
5953 FIXTURES_SETUP Foo
5954 FIXTURES_REQUIRED Foo
5955 )
5956
5957 If any of a fixture’s setup tests fail, none of the tests listing that
5958 fixture in its FIXTURES_REQUIRED property will be run. Cleanup tests
5959 will, however, still be executed.
5960
5961 See FIXTURES_REQUIRED for a more complete discussion of how to use test
5962 fixtures.
5963
5964 LABELS
5965 Specify a list of text labels associated with a test.
5966
5967 The list is reported in dashboard submissions.
5968
5969 MEASUREMENT
5970 Specify a CDASH measurement and value to be reported for a test.
5971
5972 If set to a name then that name will be reported to CDASH as a named
5973 measurement with a value of 1. You may also specify a value by setting
5974 MEASUREMENT to measurement=value.
5975
5976 PASS_REGULAR_EXPRESSION
5977 The output must match this regular expression for the test to pass.
5978
5979 If set, the test output will be checked against the specified regular
5980 expressions and at least one of the regular expressions has to match,
5981 otherwise the test will fail. Example:
5982
5983 set_tests_properties(mytest PROPERTIES
5984 PASS_REGULAR_EXPRESSION "TestPassed;All ok"
5985 )
5986
5987 PASS_REGULAR_EXPRESSION expects a list of regular expressions.
5988
5989 PROCESSOR_AFFINITY
5990 Set to a true value to ask CTest to launch the test process with CPU
5991 affinity for a fixed set of processors. If enabled and supported for
5992 the current platform, CTest will choose a set of processors to place in
5993 the CPU affinity mask when launching the test process. The number of
5994 processors in the set is determined by the PROCESSORS test property or
5995 the number of processors available to CTest, whichever is smaller. The
5996 set of processors chosen will be disjoint from the processors assigned
5997 to other concurrently running tests that also have the PROCESSOR_AFFIN‐
5998 ITY property enabled.
5999
6000 PROCESSORS
6001 Set to specify how many process slots this test requires. If not set,
6002 the default is 1 processor.
6003
6004 Denotes the number of processors that this test will require. This is
6005 typically used for MPI tests, and should be used in conjunction with
6006 the ctest_test() PARALLEL_LEVEL option.
6007
6008 This will also be used to display a weighted test timing result in
6009 label and subproject summaries in the command line output of ctest(1).
6010 The wall clock time for the test run will be multiplied by this prop‐
6011 erty to give a better idea of how much cpu resource CTest allocated for
6012 the test.
6013
6014 See also the PROCESSOR_AFFINITY test property.
6015
6016 REQUIRED_FILES
6017 List of files required to run the test.
6018
6019 If set to a list of files, the test will not be run unless all of the
6020 files exist.
6021
6022 RESOURCE_GROUPS
6023 Specify resources required by a test, grouped in a way that is meaning‐
6024 ful to the test. See resource allocation for more information on how
6025 this property integrates into the CTest resource allocation feature.
6026
6027 The RESOURCE_GROUPS property is a semicolon-separated list of group
6028 descriptions. Each entry consists of an optional number of groups using
6029 the description followed by a series of resource requirements for those
6030 groups. These requirements (and the number of groups) are separated by
6031 commas. The resource requirements consist of the name of a resource
6032 type, followed by a colon, followed by an unsigned integer specifying
6033 the number of slots required on one resource of the given type.
6034
6035 The RESOURCE_GROUPS property tells CTest what resources a test expects
6036 to use grouped in a way meaningful to the test. The test itself must
6037 read the environment variables to determine which resources have been
6038 allocated to each group. For example, each group may correspond to a
6039 process the test will spawn when executed.
6040
6041 Consider the following example:
6042
6043 add_test(NAME MyTest COMMAND MyExe)
6044 set_property(TEST MyTest PROPERTY RESOURCE_GROUPS
6045 "2,gpus:2"
6046 "gpus:4,crypto_chips:2")
6047
6048 In this example, there are two group descriptions (implicitly separated
6049 by a semicolon.) The content of the first description is 2,gpus:2. This
6050 description specifies 2 groups, each of which requires 2 slots from a
6051 single GPU. The content of the second description is
6052 gpus:4,crypto_chips:2. This description does not specify a group count,
6053 so a default of 1 is assumed. This single group requires 4 slots from
6054 a single GPU and 2 slots from a single cryptography chip. In total, 3
6055 resource groups are specified for this test, each with its own unique
6056 requirements.
6057
6058 Note that the number of slots following the resource type specifies
6059 slots from a single instance of the resource. If the resource group can
6060 tolerate receiving slots from different instances of the same resource,
6061 it can indicate this by splitting the specification into multiple
6062 requirements of one slot. For example:
6063
6064 add_test(NAME MyTest COMMAND MyExe)
6065 set_property(TEST MyTest PROPERTY RESOURCE_GROUPS
6066 "gpus:1,gpus:1,gpus:1,gpus:1")
6067
6068 In this case, the single resource group indicates that it needs four
6069 GPU slots, all of which may come from separate GPUs (though they don’t
6070 have to; CTest may still assign slots from the same GPU.)
6071
6072 When CTest sets the environment variables for a test, it assigns a
6073 group number based on the group description, starting at 0 on the left
6074 and the number of groups minus 1 on the right. For example, in the
6075 example above, the two groups in the first description would have IDs
6076 of 0 and 1, and the single group in the second description would have
6077 an ID of 2.
6078
6079 Both the RESOURCE_GROUPS and RESOURCE_LOCK properties serve similar
6080 purposes, but they are distinct and orthogonal. Resources specified by
6081 RESOURCE_GROUPS do not affect RESOURCE_LOCK, and vice versa. Whereas
6082 RESOURCE_LOCK is a simpler property that is used for locking one global
6083 resource, RESOURCE_GROUPS is a more advanced property that allows mul‐
6084 tiple tests to simultaneously use multiple resources of the same type,
6085 specifying their requirements in a fine-grained manner.
6086
6087 RESOURCE_LOCK
6088 Specify a list of resources that are locked by this test.
6089
6090 If multiple tests specify the same resource lock, they are guaranteed
6091 not to run concurrently.
6092
6093 See also FIXTURES_REQUIRED if the resource requires any setup or
6094 cleanup steps.
6095
6096 Both the RESOURCE_GROUPS and RESOURCE_LOCK properties serve similar
6097 purposes, but they are distinct and orthogonal. Resources specified by
6098 RESOURCE_GROUPS do not affect RESOURCE_LOCK, and vice versa. Whereas
6099 RESOURCE_LOCK is a simpler property that is used for locking one global
6100 resource, RESOURCE_GROUPS is a more advanced property that allows mul‐
6101 tiple tests to simultaneously use multiple resources of the same type,
6102 specifying their requirements in a fine-grained manner.
6103
6104 RUN_SERIAL
6105 Do not run this test in parallel with any other test.
6106
6107 Use this option in conjunction with the ctest_test PARALLEL_LEVEL
6108 option to specify that this test should not be run in parallel with any
6109 other tests.
6110
6111 SKIP_REGULAR_EXPRESSION
6112 If the output matches this regular expression the test will be marked
6113 as skipped.
6114
6115 If set, if the output matches one of specified regular expressions, the
6116 test will be marked as skipped. Example:
6117
6118 set_property(TEST mytest PROPERTY
6119 SKIP_REGULAR_EXPRESSION "[^a-z]Skip" "SKIP" "Skipped"
6120 )
6121
6122 SKIP_REGULAR_EXPRESSION expects a list of regular expressions.
6123
6124 See also the SKIP_RETURN_CODE property.
6125
6126 SKIP_RETURN_CODE
6127 Return code to mark a test as skipped.
6128
6129 Sometimes only a test itself can determine if all requirements for the
6130 test are met. If such a situation should not be considered a hard fail‐
6131 ure a return code of the process can be specified that will mark the
6132 test as Not Run if it is encountered. Valid values are in the range of
6133 0 to 255, inclusive.
6134
6135 See also the SKIP_REGULAR_EXPRESSION property.
6136
6137 TIMEOUT
6138 How many seconds to allow for this test.
6139
6140 This property if set will limit a test to not take more than the speci‐
6141 fied number of seconds to run. If it exceeds that the test process
6142 will be killed and ctest will move to the next test. This setting
6143 takes precedence over CTEST_TEST_TIMEOUT.
6144
6145 TIMEOUT_AFTER_MATCH
6146 Change a test’s timeout duration after a matching line is encountered
6147 in its output.
6148
6149 Usage
6150 add_test(mytest ...)
6151 set_property(TEST mytest PROPERTY TIMEOUT_AFTER_MATCH "${seconds}" "${regex}")
6152
6153 Description
6154 Allow a test seconds to complete after regex is encountered in its out‐
6155 put.
6156
6157 When the test outputs a line that matches regex its start time is reset
6158 to the current time and its timeout duration is changed to seconds.
6159 Prior to this, the timeout duration is determined by the TIMEOUT prop‐
6160 erty or the CTEST_TEST_TIMEOUT variable if either of these are set.
6161 Because the test’s start time is reset, its execution time will not
6162 include any time that was spent waiting for the matching output.
6163
6164 TIMEOUT_AFTER_MATCH is useful for avoiding spurious timeouts when your
6165 test must wait for some system resource to become available before it
6166 can execute. Set TIMEOUT to a longer duration that accounts for
6167 resource acquisition and use TIMEOUT_AFTER_MATCH to control how long
6168 the actual test is allowed to run.
6169
6170 If the required resource can be controlled by CTest you should use
6171 RESOURCE_LOCK instead of TIMEOUT_AFTER_MATCH. This property should be
6172 used when only the test itself can determine when its required
6173 resources are available.
6174
6175 WILL_FAIL
6176 If set to true, this will invert the pass/fail flag of the test.
6177
6178 This property can be used for tests that are expected to fail and
6179 return a non zero return code.
6180
6181 WORKING_DIRECTORY
6182 The directory from which the test executable will be called.
6183
6184 If this is not set, the test will be run with the working directory set
6185 to the binary directory associated with where the test was created
6186 (i.e. the CMAKE_CURRENT_BINARY_DIR for where add_test() was called).
6187
6189 ABSTRACT
6190 Is this source file an abstract class.
6191
6192 A property on a source file that indicates if the source file repre‐
6193 sents a class that is abstract. This only makes sense for languages
6194 that have a notion of an abstract class and it is only used by some
6195 tools that wrap classes into other languages.
6196
6197 AUTORCC_OPTIONS
6198 Additional options for rcc when using AUTORCC
6199
6200 This property holds additional command line options which will be used
6201 when rcc is executed during the build via AUTORCC, i.e. it is equiva‐
6202 lent to the optional OPTIONS argument of the qt4_add_resources() macro.
6203
6204 By default it is empty.
6205
6206 The options set on the .qrc source file may override AUTORCC_OPTIONS
6207 set on the target.
6208
6209 EXAMPLE
6210 # ...
6211 set_property(SOURCE resources.qrc PROPERTY AUTORCC_OPTIONS "--compress;9")
6212 # ...
6213
6214 AUTOUIC_OPTIONS
6215 Additional options for uic when using AUTOUIC
6216
6217 This property holds additional command line options which will be used
6218 when uic is executed during the build via AUTOUIC, i.e. it is equiva‐
6219 lent to the optional OPTIONS argument of the qt4_wrap_ui() macro.
6220
6221 By default it is empty.
6222
6223 The options set on the .ui source file may override AUTOUIC_OPTIONS set
6224 on the target.
6225
6226 EXAMPLE
6227 # ...
6228 set_property(SOURCE widget.ui PROPERTY AUTOUIC_OPTIONS "--no-protection")
6229 # ...
6230
6231 COMPILE_DEFINITIONS
6232 Preprocessor definitions for compiling a source file.
6233
6234 The COMPILE_DEFINITIONS property may be set to a semicolon-separated
6235 list of preprocessor definitions using the syntax VAR or VAR=value.
6236 Function-style definitions are not supported. CMake will automatically
6237 escape the value correctly for the native build system (note that CMake
6238 language syntax may require escapes to specify some values). This
6239 property may be set on a per-configuration basis using the name COM‐
6240 PILE_DEFINITIONS_<CONFIG> where <CONFIG> is an upper-case name (ex.
6241 COMPILE_DEFINITIONS_DEBUG).
6242
6243 CMake will automatically drop some definitions that are not supported
6244 by the native build tool. Xcode does not support per-configuration
6245 definitions on source files.
6246
6247 Disclaimer: Most native build tools have poor support for escaping cer‐
6248 tain values. CMake has work-arounds for many cases but some values may
6249 just not be possible to pass correctly. If a value does not seem to be
6250 escaped correctly, do not attempt to work-around the problem by adding
6251 escape sequences to the value. Your work-around may break in a future
6252 version of CMake that has improved escape support. Instead consider
6253 defining the macro in a (configured) header file. Then report the lim‐
6254 itation. Known limitations include:
6255
6256 # - broken almost everywhere
6257 ; - broken in VS IDE 7.0 and Borland Makefiles
6258 , - broken in VS IDE
6259 % - broken in some cases in NMake
6260 & | - broken in some cases on MinGW
6261 ^ < > \" - broken in most Make tools on Windows
6262
6263 CMake does not reject these values outright because they do work in
6264 some cases. Use with caution.
6265
6266 Contents of COMPILE_DEFINITIONS may use cmake-generator-expressions(7)
6267 with the syntax $<...>. See the cmake-generator-expressions(7) manual
6268 for available expressions. However, Xcode does not support per-config
6269 per-source settings, so expressions that depend on the build configura‐
6270 tion are not allowed with that generator.
6271
6272 Generator expressions should be preferred instead of setting the alter‐
6273 native per-configuration property.
6274
6275 COMPILE_FLAGS
6276 Additional flags to be added when compiling this source file.
6277
6278 The COMPILE_FLAGS property, managed as a string, sets additional com‐
6279 piler flags used to build source files. Use COMPILE_DEFINITIONS to
6280 pass additional preprocessor definitions.
6281
6282 Contents of COMPILE_FLAGS may use “generator expressions” with the syn‐
6283 tax $<...>. See the cmake-generator-expressions(7) manual for avail‐
6284 able expressions. However, Xcode does not support per-config
6285 per-source settings, so expressions that depend on the build configura‐
6286 tion are not allowed with that generator.
6287
6288 NOTE:
6289 This property has been superseded by the COMPILE_OPTIONS property.
6290
6291 COMPILE_OPTIONS
6292 List of additional options to pass to the compiler.
6293
6294 This property holds a semicolon-separated list of options and will be
6295 added to the list of compile flags when this source file builds. Use
6296 COMPILE_DEFINITIONS to pass additional preprocessor definitions and
6297 INCLUDE_DIRECTORIES to pass additional include directories.
6298
6299 Contents of COMPILE_OPTIONS may use “generator expressions” with the
6300 syntax $<...>. See the cmake-generator-expressions(7) manual for
6301 available expressions. However, Xcode does not support per-config
6302 per-source settings, so expressions that depend on the build configura‐
6303 tion are not allowed with that generator.
6304
6305 NOTE:
6306 This property should be preferred over the COMPILE_FLAGS property.
6307
6308 EXTERNAL_OBJECT
6309 If set to true then this is an object file.
6310
6311 If this property is set to True then the source file is really an
6312 object file and should not be compiled. It will still be linked into
6313 the target though.
6314
6315 Fortran_FORMAT
6316 Set to FIXED or FREE to indicate the Fortran source layout.
6317
6318 This property tells CMake whether a given Fortran source file uses
6319 fixed-format or free-format. CMake will pass the corresponding format
6320 flag to the compiler. Consider using the target-wide Fortran_FORMAT
6321 property if all source files in a target share the same format.
6322
6323 GENERATED
6324 Is this source file generated as part of the build or CMake process.
6325
6326 Tells the internal CMake engine that a source file is generated by an
6327 outside process such as another build step, or the execution of CMake
6328 itself. This information is then used to exempt the file from any
6329 existence or validity checks.
6330
6331 Any file that is
6332
6333 · created by the execution of commands such as add_custom_command() and
6334 file(GENERATE)
6335
6336 · listed as one of the BYPRODUCTS of an add_custom_command() or
6337 add_custom_target() command, or
6338
6339 · created by a CMake AUTOGEN operation such as AUTOMOC, AUTORCC, or
6340 AUTOUIC
6341
6342 will be marked with the GENERATED property.
6343
6344 When a generated file created as the OUTPUT of an add_custom_command()
6345 command is explicitly listed as a source file for any target in the
6346 same directory scope (which usually means the same CMakeLists.txt
6347 file), CMake will automatically create a dependency to make sure the
6348 file is generated before building that target.
6349
6350 The Makefile Generators will remove GENERATED files during make clean.
6351
6352 Generated sources may be hidden in some IDE tools, while in others they
6353 might be shown. For the special case of sources generated by CMake’s
6354 AUTOMOC or AUTORCC functionality, the AUTOGEN_SOURCE_GROUP, AUTO‐
6355 MOC_SOURCE_GROUP and AUTORCC_SOURCE_GROUP target properties may influ‐
6356 ence where the generated sources are grouped in the project’s file
6357 lists.
6358
6359 HEADER_FILE_ONLY
6360 Is this source file only a header file.
6361
6362 A property on a source file that indicates if the source file is a
6363 header file with no associated implementation. This is set automati‐
6364 cally based on the file extension and is used by CMake to determine if
6365 certain dependency information should be computed.
6366
6367 By setting this property to ON, you can disable compilation of the
6368 given source file, even if it should be compiled because it is part of
6369 the library’s/executable’s sources.
6370
6371 This is useful if you have some source files which you somehow
6372 pre-process, and then add these pre-processed sources via add_library()
6373 or add_executable(). Normally, in IDE, there would be no reference of
6374 the original sources, only of these pre-processed sources. So by set‐
6375 ting this property for all the original source files to ON, and then
6376 either calling add_library() or add_executable() while passing both the
6377 pre-processed sources and the original sources, or by using tar‐
6378 get_sources() to add original source files will do exactly what would
6379 one expect, i.e. the original source files would be visible in IDE,
6380 and will not be built.
6381
6382 INCLUDE_DIRECTORIES
6383 List of preprocessor include file search directories.
6384
6385 This property holds a semicolon-separated list of paths and will be
6386 added to the list of include directories when this source file builds.
6387 These directories will take precedence over directories defined at tar‐
6388 get level except for Xcode generator due to technical limitations.
6389
6390 Relative paths should not be added to this property directly.
6391
6392 Contents of INCLUDE_DIRECTORIES may use “generator expressions” with
6393 the syntax $<...>. See the cmake-generator-expressions(7) manual for
6394 available expressions. However, Xcode does not support per-config
6395 per-source settings, so expressions that depend on the build configura‐
6396 tion are not allowed with that generator.
6397
6398 KEEP_EXTENSION
6399 Make the output file have the same extension as the source file.
6400
6401 If this property is set then the file extension of the output file will
6402 be the same as that of the source file. Normally the output file
6403 extension is computed based on the language of the source file, for
6404 example .cxx will go to a .o extension.
6405
6406 LABELS
6407 Specify a list of text labels associated with a source file.
6408
6409 This property has meaning only when the source file is listed in a tar‐
6410 get whose LABELS property is also set. No other semantics are cur‐
6411 rently specified.
6412
6413 LANGUAGE
6414 What programming language is the file.
6415
6416 A property that can be set to indicate what programming language the
6417 source file is. If it is not set the language is determined based on
6418 the file extension. Typical values are CXX (i.e. C++), C, CSharp,
6419 CUDA, Fortran, and ASM. Setting this property for a file means this
6420 file will be compiled. Do not set this for headers or files that
6421 should not be compiled.
6422
6423 LOCATION
6424 The full path to a source file.
6425
6426 A read only property on a SOURCE FILE that contains the full path to
6427 the source file.
6428
6429 MACOSX_PACKAGE_LOCATION
6430 Place a source file inside a Application Bundle (MACOSX_BUNDLE), Core
6431 Foundation Bundle (BUNDLE), or Framework Bundle (FRAMEWORK). It is
6432 applicable for macOS and iOS.
6433
6434 Executable targets with the MACOSX_BUNDLE property set are built as
6435 macOS or iOS application bundles on Apple platforms. Shared library
6436 targets with the FRAMEWORK property set are built as macOS or iOS
6437 frameworks on Apple platforms. Module library targets with the BUNDLE
6438 property set are built as macOS CFBundle bundles on Apple platforms.
6439 Source files listed in the target with this property set will be copied
6440 to a directory inside the bundle or framework content folder specified
6441 by the property value. For macOS Application Bundles the content
6442 folder is <name>.app/Contents. For macOS Frameworks the content folder
6443 is <name>.framework/Versions/<version>. For macOS CFBundles the con‐
6444 tent folder is <name>.bundle/Contents (unless the extension is
6445 changed). See the PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE target
6446 properties for specifying files meant for Headers, PrivateHeaders, or
6447 Resources directories.
6448
6449 If the specified location is equal to Resources, the resulting location
6450 will be the same as if the RESOURCE property had been used. If the
6451 specified location is a sub-folder of Resources, it will be placed into
6452 the respective sub-folder. Note: For iOS Apple uses a flat bundle lay‐
6453 out where no Resources folder exist. Therefore CMake strips the
6454 Resources folder name from the specified location.
6455
6456 OBJECT_DEPENDS
6457 Additional files on which a compiled object file depends.
6458
6459 Specifies a semicolon-separated list of full-paths to files on which
6460 any object files compiled from this source file depend. On Makefile
6461 Generators and the Ninja generator an object file will be recompiled if
6462 any of the named files is newer than it. Visual Studio Generators and
6463 the Xcode generator cannot implement such compilation dependencies.
6464
6465 This property need not be used to specify the dependency of a source
6466 file on a generated header file that it includes. Although the prop‐
6467 erty was originally introduced for this purpose, it is no longer neces‐
6468 sary. If the generated header file is created by a custom command in
6469 the same target as the source file, the automatic dependency scanning
6470 process will recognize the dependency. If the generated header file is
6471 created by another target, an inter-target dependency should be created
6472 with the add_dependencies() command (if one does not already exist due
6473 to linking relationships).
6474
6475 OBJECT_OUTPUTS
6476 Additional outputs for a Ninja or Makefile Generators rule.
6477
6478 Additional outputs created by compilation of this source file. If any
6479 of these outputs is missing the object will be recompiled. This is
6480 supported only on the Ninja and Makefile Generators and will be ignored
6481 on other generators.
6482
6483 SKIP_AUTOGEN
6484 Exclude the source file from AUTOMOC, AUTOUIC and AUTORCC processing
6485 (for Qt projects).
6486
6487 For finer exclusion control see SKIP_AUTOMOC, SKIP_AUTOUIC and
6488 SKIP_AUTORCC.
6489
6490 EXAMPLE
6491 # ...
6492 set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)
6493 # ...
6494
6495 SKIP_AUTOMOC
6496 Exclude the source file from AUTOMOC processing (for Qt projects).
6497
6498 For broader exclusion control see SKIP_AUTOGEN.
6499
6500 EXAMPLE
6501 # ...
6502 set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON)
6503 # ...
6504
6505 SKIP_AUTORCC
6506 Exclude the source file from AUTORCC processing (for Qt projects).
6507
6508 For broader exclusion control see SKIP_AUTOGEN.
6509
6510 EXAMPLE
6511 # ...
6512 set_property(SOURCE file.qrc PROPERTY SKIP_AUTORCC ON)
6513 # ...
6514
6515 SKIP_AUTOUIC
6516 Exclude the source file from AUTOUIC processing (for Qt projects).
6517
6518 SKIP_AUTOUIC can be set on C++ header and source files and on .ui
6519 files.
6520
6521 For broader exclusion control see SKIP_AUTOGEN.
6522
6523 EXAMPLE
6524 # ...
6525 set_property(SOURCE file.h PROPERTY SKIP_AUTOUIC ON)
6526 set_property(SOURCE file.cpp PROPERTY SKIP_AUTOUIC ON)
6527 set_property(SOURCE widget.ui PROPERTY SKIP_AUTOUIC ON)
6528 # ...
6529
6530 SKIP_PRECOMPILE_HEADERS
6531 Is this source file skipped by PRECOMPILE_HEADERS feature.
6532
6533 This property helps with build problems that one would run into when
6534 using the PRECOMPILE_HEADERS feature.
6535
6536 One example would be the usage of Objective-C (*.m) files, and Objec‐
6537 tive-C++ (*.mm) files, which lead to compilation failure because they
6538 are treated (in case of Ninja / Makefile generator) as C, and CXX
6539 respectively. The precompile headers are not compatible between lan‐
6540 guages.
6541
6542 SKIP_UNITY_BUILD_INCLUSION
6543 Setting this property to true ensures the source file will be skipped
6544 by unity builds when its associated target has its UNITY_BUILD property
6545 set to true. The source file will instead be compiled on its own in
6546 the same way as it would with unity builds disabled.
6547
6548 This property helps with “ODR (One definition rule)” problems where
6549 combining a particular source file with others might lead to build
6550 errors or other unintended side effects.
6551
6552 Swift_DEPENDENCIES_FILE
6553 This property sets the path for the Swift dependency file (swiftdeps)
6554 for the source. If one is not specified, it will default to
6555 <OBJECT>.swiftdeps.
6556
6557 Swift_DIAGNOSTICS_FILE
6558 This property controls where the Swift diagnostics are serialized.
6559
6560 SYMBOLIC
6561 Is this just a name for a rule.
6562
6563 If SYMBOLIC (boolean) is set to True the build system will be informed
6564 that the source file is not actually created on disk but instead used
6565 as a symbolic name for a build rule.
6566
6567 VS_COPY_TO_OUT_DIR
6568 Sets the <CopyToOutputDirectory> tag for a source file in a Visual Stu‐
6569 dio project file. Valid values are Never, Always and PreserveNewest.
6570
6571 VS_CSHARP_<tagname>
6572 Visual Studio and CSharp source-file-specific configuration.
6573
6574 Tell the Visual Studio generators to set the source file tag <tagname>
6575 to a given value in the generated Visual Studio CSharp project. Ignored
6576 on other generators and languages. This property can be used to define
6577 dependencies between source files or set any other Visual Studio spe‐
6578 cific parameters.
6579
6580 Example usage:
6581
6582 set_source_files_property(<filename>
6583 PROPERTIES
6584 VS_CSHARP_DependentUpon <other file>
6585 VS_CSHARP_SubType "Form")
6586
6587 VS_DEPLOYMENT_CONTENT
6588 Mark a source file as content for deployment with a Windows Phone or
6589 Windows Store application when built with a Visual Studio generators.
6590 The value must evaluate to either 1 or 0 and may use generator expres‐
6591 sions to make the choice based on the build configuration. The .vcx‐
6592 proj file entry for the source file will be marked either Deployment‐
6593 Content or ExcludedFromBuild for values 1 and 0, respectively.
6594
6595 VS_DEPLOYMENT_LOCATION
6596 Specifies the deployment location for a content source file with a Win‐
6597 dows Phone or Windows Store application when built with a Visual Studio
6598 generators. This property is only applicable when using VS_DEPLOY‐
6599 MENT_CONTENT. The value represent the path relative to the app package
6600 and applies to all configurations.
6601
6602 VS_INCLUDE_IN_VSIX
6603 Boolean property to specify if the file should be included within a
6604 VSIX (Visual Studio Integration Extension) extension package. This is
6605 needed for development of Visual Studio extensions.
6606
6607 VS_RESOURCE_GENERATOR
6608 This property allows to specify the resource generator to be used on
6609 this file. It defaults to PublicResXFileCodeGenerator if not set.
6610
6611 This property only applies to C# projects.
6612
6613 VS_SHADER_DISABLE_OPTIMIZATIONS
6614 Disable compiler optimizations for an .hlsl source file. This adds the
6615 -Od flag to the command line for the FxCompiler tool. Specify the
6616 value true for this property to disable compiler optimizations.
6617
6618 VS_SHADER_ENABLE_DEBUG
6619 Enable debugging information for an .hlsl source file. This adds the
6620 -Zi flag to the command line for the FxCompiler tool. Specify the
6621 value true to generate debugging information for the compiled shader.
6622
6623 VS_SHADER_ENTRYPOINT
6624 Specifies the name of the entry point for the shader of a .hlsl source
6625 file.
6626
6627 VS_SHADER_FLAGS
6628 Set additional Visual Studio shader flags of a .hlsl source file.
6629
6630 VS_SHADER_MODEL
6631 Specifies the shader model of a .hlsl source file. Some shader types
6632 can only be used with recent shader models
6633
6634 VS_SHADER_OBJECT_FILE_NAME
6635 Specifies a file name for the compiled shader object file for an .hlsl
6636 source file. This adds the -Fo flag to the command line for the FxCom‐
6637 piler tool.
6638
6639 VS_SHADER_OUTPUT_HEADER_FILE
6640 Set filename for output header file containing object code of a .hlsl
6641 source file.
6642
6643 VS_SHADER_TYPE
6644 Set the Visual Studio shader type of a .hlsl source file.
6645
6646 VS_SHADER_VARIABLE_NAME
6647 Set name of variable in header file containing object code of a .hlsl
6648 source file.
6649
6650 VS_TOOL_OVERRIDE
6651 Override the default Visual Studio tool that will be applied to the
6652 source file with a new tool not based on the extension of the file.
6653
6654 VS_XAML_TYPE
6655 Mark a Extensible Application Markup Language (XAML) source file as a
6656 different type than the default Page. The most common usage would be
6657 to set the default App.xaml file as ApplicationDefinition.
6658
6659 WRAP_EXCLUDE
6660 Exclude this source file from any code wrapping techniques.
6661
6662 Some packages can wrap source files into alternate languages to provide
6663 additional functionality.
6664
6665 For example, C++ code can be wrapped into Java or Python, using SWIG.
6666 If WRAP_EXCLUDE is set to True, that indicates that this source file
6667 should not be wrapped.
6668
6669 XCODE_EXPLICIT_FILE_TYPE
6670 Set the Xcode explicitFileType attribute on its reference to a source
6671 file. CMake computes a default based on file extension but can be told
6672 explicitly with this property.
6673
6674 See also XCODE_LAST_KNOWN_FILE_TYPE.
6675
6676 XCODE_FILE_ATTRIBUTES
6677 Add values to the Xcode ATTRIBUTES setting on its reference to a source
6678 file. Among other things, this can be used to set the role on a .mig
6679 file:
6680
6681 set_source_files_properties(defs.mig
6682 PROPERTIES
6683 XCODE_FILE_ATTRIBUTES "Client;Server"
6684 )
6685
6686 XCODE_LAST_KNOWN_FILE_TYPE
6687 Set the Xcode lastKnownFileType attribute on its reference to a source
6688 file. CMake computes a default based on file extension but can be told
6689 explicitly with this property.
6690
6691 See also XCODE_EXPLICIT_FILE_TYPE, which is preferred over this prop‐
6692 erty if set.
6693
6695 ADVANCED
6696 True if entry should be hidden by default in GUIs.
6697
6698 This is a boolean value indicating whether the entry is considered
6699 interesting only for advanced configuration. The mark_as_advanced()
6700 command modifies this property.
6701
6702 HELPSTRING
6703 Help associated with entry in GUIs.
6704
6705 This string summarizes the purpose of an entry to help users set it
6706 through a CMake GUI.
6707
6708 MODIFIED
6709 Internal management property. Do not set or get.
6710
6711 This is an internal cache entry property managed by CMake to track
6712 interactive user modification of entries. Ignore it.
6713
6714 STRINGS
6715 Enumerate possible STRING entry values for GUI selection.
6716
6717 For cache entries with type STRING, this enumerates a set of values.
6718 CMake GUIs may use this to provide a selection widget instead of a
6719 generic string entry field. This is for convenience only. CMake does
6720 not enforce that the value matches one of those listed.
6721
6722 TYPE
6723 Widget type for entry in GUIs.
6724
6725 Cache entry values are always strings, but CMake GUIs present widgets
6726 to help users set values. The GUIs use this property as a hint to
6727 determine the widget type. Valid TYPE values are:
6728
6729 BOOL = Boolean ON/OFF value.
6730 PATH = Path to a directory.
6731 FILEPATH = Path to a file.
6732 STRING = Generic string value.
6733 INTERNAL = Do not present in GUI at all.
6734 STATIC = Value managed by CMake, do not change.
6735 UNINITIALIZED = Type not yet specified.
6736
6737 Generally the TYPE of a cache entry should be set by the command which
6738 creates it ( set(), option(), find_library(), etc.).
6739
6740 VALUE
6741 Value of a cache entry.
6742
6743 This property maps to the actual value of a cache entry. Setting this
6744 property always sets the value without checking, so use with care.
6745
6747 CPACK_DESKTOP_SHORTCUTS
6748 Species a list of shortcut names that should be created on the Desktop
6749 for this file.
6750
6751 The property is currently only supported by the CPack WIX Generator.
6752
6753 CPACK_NEVER_OVERWRITE
6754 Request that this file not be overwritten on install or reinstall.
6755
6756 The property is currently only supported by the CPack WIX Generator.
6757
6758 CPACK_PERMANENT
6759 Request that this file not be removed on uninstall.
6760
6761 The property is currently only supported by the CPack WIX Generator.
6762
6763 CPACK_START_MENU_SHORTCUTS
6764 Species a list of shortcut names that should be created in the Start
6765 Menu for this file.
6766
6767 The property is currently only supported by the CPack WIX Generator.
6768
6769 CPACK_STARTUP_SHORTCUTS
6770 Species a list of shortcut names that should be created in the Startup
6771 folder for this file.
6772
6773 The property is currently only supported by the CPack WIX Generator.
6774
6775 CPACK_WIX_ACL
6776 Specifies access permissions for files or directories installed by a
6777 WiX installer.
6778
6779 The property can contain multiple list entries, each of which has to
6780 match the following format.
6781
6782 <user>[@<domain>]=<permission>[,<permission>]
6783
6784 <user> and <domain> specify the windows user and domain for which the
6785 <Permission> element should be generated.
6786
6787 <permission> is any of the YesNoType attributes listed here:
6788
6789 http://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html
6790
6791 The property is currently only supported by the CPack WIX Generator.
6792
6794 ADDITIONAL_MAKE_CLEAN_FILES
6795 Deprecated since version 3.15: Use ADDITIONAL_CLEAN_FILES instead.
6796
6797
6798 Additional files to remove during the clean stage.
6799
6800 A ;-list of files that will be removed as a part of the make clean tar‐
6801 get.
6802
6803 Arguments to ADDITIONAL_MAKE_CLEAN_FILES may use generator expressions.
6804
6805 This property only works for the Makefile generators. It is ignored on
6806 other generators.
6807
6808 COMPILE_DEFINITIONS_<CONFIG>
6809 Ignored. See CMake Policy CMP0043.
6810
6811 Per-configuration preprocessor definitions in a directory.
6812
6813 This is the configuration-specific version of COMPILE_DEFINITIONS where
6814 <CONFIG> is an upper-case name (ex. COMPILE_DEFINITIONS_DEBUG).
6815
6816 This property will be initialized in each directory by its value in the
6817 directory’s parent.
6818
6819 Contents of COMPILE_DEFINITIONS_<CONFIG> may use “generator expres‐
6820 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
6821 manual for available expressions. See the cmake-buildsystem(7) manual
6822 for more on defining buildsystem properties.
6823
6824 Generator expressions should be preferred instead of setting this prop‐
6825 erty.
6826
6827 TEST_INCLUDE_FILE
6828 Deprecated. Use TEST_INCLUDE_FILES instead.
6829
6830 A cmake file that will be included when ctest is run.
6831
6832 If you specify TEST_INCLUDE_FILE, that file will be included and pro‐
6833 cessed when ctest is run on the directory.
6834
6836 COMPILE_DEFINITIONS_<CONFIG>
6837 Ignored. See CMake Policy CMP0043.
6838
6839 Per-configuration preprocessor definitions on a target.
6840
6841 This is the configuration-specific version of COMPILE_DEFINITIONS where
6842 <CONFIG> is an upper-case name (ex. COMPILE_DEFINITIONS_DEBUG).
6843
6844 Contents of COMPILE_DEFINITIONS_<CONFIG> may use “generator expres‐
6845 sions” with the syntax $<...>. See the cmake-generator-expressions(7)
6846 manual for available expressions. See the cmake-buildsystem(7) manual
6847 for more on defining buildsystem properties.
6848
6849 Generator expressions should be preferred instead of setting this prop‐
6850 erty.
6851
6852 POST_INSTALL_SCRIPT
6853 Deprecated install support.
6854
6855 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old
6856 way to specify CMake scripts to run before and after installing a tar‐
6857 get. They are used only when the old INSTALL_TARGETS command is used
6858 to install the target. Use the install() command instead.
6859
6860 PRE_INSTALL_SCRIPT
6861 Deprecated install support.
6862
6863 The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the old
6864 way to specify CMake scripts to run before and after installing a tar‐
6865 get. They are used only when the old INSTALL_TARGETS command is used
6866 to install the target. Use the install() command instead.
6867
6869 COMPILE_DEFINITIONS_<CONFIG>
6870 Ignored. See CMake Policy CMP0043.
6871
6872 Per-configuration preprocessor definitions on a source file.
6873
6874 This is the configuration-specific version of COMPILE_DEFINITIONS.
6875 Note that Xcode does not support per-configuration source file flags so
6876 this property will be ignored by the Xcode generator.
6877
6879 2000-2020 Kitware, Inc. and Contributors
6880
6881
6882
6883
68843.17.2 Apr 28, 2020 CMAKE-PROPERTIES(7)