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