cmake-variables.7.rst 10.5 KB
Newer Older
1
2
.. cmake-manual-description: CMake Variables Reference

3
4
5
6
7
8
9
10
11
12
13
cmake-variables(7)
******************

.. only:: html or latex

   .. contents::

Variables that Provide Information
==================================

.. toctree::
14
15
   :maxdepth: 1

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
   /variable/CMAKE_ARGC
   /variable/CMAKE_ARGV0
   /variable/CMAKE_AR
   /variable/CMAKE_BINARY_DIR
   /variable/CMAKE_BUILD_TOOL
   /variable/CMAKE_CACHEFILE_DIR
   /variable/CMAKE_CACHE_MAJOR_VERSION
   /variable/CMAKE_CACHE_MINOR_VERSION
   /variable/CMAKE_CACHE_PATCH_VERSION
   /variable/CMAKE_CFG_INTDIR
   /variable/CMAKE_COMMAND
   /variable/CMAKE_CROSSCOMPILING
   /variable/CMAKE_CTEST_COMMAND
   /variable/CMAKE_CURRENT_BINARY_DIR
   /variable/CMAKE_CURRENT_LIST_DIR
   /variable/CMAKE_CURRENT_LIST_FILE
   /variable/CMAKE_CURRENT_LIST_LINE
   /variable/CMAKE_CURRENT_SOURCE_DIR
   /variable/CMAKE_DL_LIBS
   /variable/CMAKE_EDIT_COMMAND
   /variable/CMAKE_EXECUTABLE_SUFFIX
   /variable/CMAKE_EXTRA_GENERATOR
   /variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
   /variable/CMAKE_GENERATOR
   /variable/CMAKE_GENERATOR_TOOLSET
   /variable/CMAKE_HOME_DIRECTORY
   /variable/CMAKE_IMPORT_LIBRARY_PREFIX
   /variable/CMAKE_IMPORT_LIBRARY_SUFFIX
44
45
   /variable/CMAKE_JOB_POOL_COMPILE
   /variable/CMAKE_JOB_POOL_LINK
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
   /variable/CMAKE_LINK_LIBRARY_SUFFIX
   /variable/CMAKE_MAJOR_VERSION
   /variable/CMAKE_MAKE_PROGRAM
   /variable/CMAKE_MINIMUM_REQUIRED_VERSION
   /variable/CMAKE_MINOR_VERSION
   /variable/CMAKE_PARENT_LIST_FILE
   /variable/CMAKE_PATCH_VERSION
   /variable/CMAKE_PROJECT_NAME
   /variable/CMAKE_RANLIB
   /variable/CMAKE_ROOT
   /variable/CMAKE_SCRIPT_MODE_FILE
   /variable/CMAKE_SHARED_LIBRARY_PREFIX
   /variable/CMAKE_SHARED_LIBRARY_SUFFIX
   /variable/CMAKE_SHARED_MODULE_PREFIX
   /variable/CMAKE_SHARED_MODULE_SUFFIX
   /variable/CMAKE_SIZEOF_VOID_P
62
   /variable/CMAKE_SKIP_INSTALL_RULES
63
64
65
66
67
   /variable/CMAKE_SKIP_RPATH
   /variable/CMAKE_SOURCE_DIR
   /variable/CMAKE_STANDARD_LIBRARIES
   /variable/CMAKE_STATIC_LIBRARY_PREFIX
   /variable/CMAKE_STATIC_LIBRARY_SUFFIX
68
   /variable/CMAKE_TOOLCHAIN_FILE
69
70
71
   /variable/CMAKE_TWEAK_VERSION
   /variable/CMAKE_VERBOSE_MAKEFILE
   /variable/CMAKE_VERSION
72
   /variable/CMAKE_VS_DEVENV_COMMAND
73
   /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
74
75
   /variable/CMAKE_VS_MSBUILD_COMMAND
   /variable/CMAKE_VS_MSDEV_COMMAND
76
77
78
79
80
81
   /variable/CMAKE_VS_PLATFORM_TOOLSET
   /variable/CMAKE_XCODE_PLATFORM_TOOLSET
   /variable/PROJECT_BINARY_DIR
   /variable/PROJECT-NAME_BINARY_DIR
   /variable/PROJECT_NAME
   /variable/PROJECT-NAME_SOURCE_DIR
Brad King's avatar
Brad King committed
82
83
84
85
86
   /variable/PROJECT-NAME_VERSION
   /variable/PROJECT-NAME_VERSION_MAJOR
   /variable/PROJECT-NAME_VERSION_MINOR
   /variable/PROJECT-NAME_VERSION_PATCH
   /variable/PROJECT-NAME_VERSION_TWEAK
87
   /variable/PROJECT_SOURCE_DIR
Brad King's avatar
Brad King committed
88
89
90
91
92
   /variable/PROJECT_VERSION
   /variable/PROJECT_VERSION_MAJOR
   /variable/PROJECT_VERSION_MINOR
   /variable/PROJECT_VERSION_PATCH
   /variable/PROJECT_VERSION_TWEAK
93
94
95
96
97

Variables that Change Behavior
==============================

.. toctree::
98
99
   :maxdepth: 1

100
101
   /variable/BUILD_SHARED_LIBS
   /variable/CMAKE_ABSOLUTE_DESTINATION_FILES
102
   /variable/CMAKE_APPBUNDLE_PATH
103
104
105
106
107
108
109
110
111
   /variable/CMAKE_AUTOMOC_RELAXED_MODE
   /variable/CMAKE_BACKWARDS_COMPATIBILITY
   /variable/CMAKE_BUILD_TYPE
   /variable/CMAKE_COLOR_MAKEFILE
   /variable/CMAKE_CONFIGURATION_TYPES
   /variable/CMAKE_DEBUG_TARGET_PROPERTIES
   /variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName
   /variable/CMAKE_ERROR_DEPRECATED
   /variable/CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
112
   /variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY
113
   /variable/CMAKE_SYSROOT
114
115
   /variable/CMAKE_FIND_LIBRARY_PREFIXES
   /variable/CMAKE_FIND_LIBRARY_SUFFIXES
116
   /variable/CMAKE_FIND_NO_INSTALL_PREFIX
117
118
   /variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
   /variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
119
120
121
122
123
124
   /variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
   /variable/CMAKE_FIND_ROOT_PATH
   /variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
   /variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
   /variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE
   /variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
125
   /variable/CMAKE_FRAMEWORK_PATH
126
127
   /variable/CMAKE_IGNORE_PATH
   /variable/CMAKE_INCLUDE_PATH
128
129
   /variable/CMAKE_INCLUDE_DIRECTORIES_BEFORE
   /variable/CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE
130
131
132
133
134
135
136
   /variable/CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
   /variable/CMAKE_INSTALL_PREFIX
   /variable/CMAKE_LIBRARY_PATH
   /variable/CMAKE_MFC_FLAG
   /variable/CMAKE_MODULE_PATH
   /variable/CMAKE_NOT_USING_CONFIG_FLAGS
   /variable/CMAKE_POLICY_DEFAULT_CMPNNNN
137
   /variable/CMAKE_POLICY_WARNING_CMPNNNN
138
139
   /variable/CMAKE_PREFIX_PATH
   /variable/CMAKE_PROGRAM_PATH
140
   /variable/CMAKE_PROJECT_PROJECT-NAME_INCLUDE
141
   /variable/CMAKE_SKIP_INSTALL_ALL_DEPENDENCY
142
   /variable/CMAKE_STAGING_PREFIX
143
144
145
146
147
148
149
150
151
152
153
154
155
   /variable/CMAKE_SYSTEM_IGNORE_PATH
   /variable/CMAKE_SYSTEM_INCLUDE_PATH
   /variable/CMAKE_SYSTEM_LIBRARY_PATH
   /variable/CMAKE_SYSTEM_PREFIX_PATH
   /variable/CMAKE_SYSTEM_PROGRAM_PATH
   /variable/CMAKE_USER_MAKE_RULES_OVERRIDE
   /variable/CMAKE_WARN_DEPRECATED
   /variable/CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION

Variables that Describe the System
==================================

.. toctree::
156
157
   :maxdepth: 1

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
   /variable/APPLE
   /variable/BORLAND
   /variable/CMAKE_CL_64
   /variable/CMAKE_COMPILER_2005
   /variable/CMAKE_HOST_APPLE
   /variable/CMAKE_HOST_SYSTEM_NAME
   /variable/CMAKE_HOST_SYSTEM_PROCESSOR
   /variable/CMAKE_HOST_SYSTEM
   /variable/CMAKE_HOST_SYSTEM_VERSION
   /variable/CMAKE_HOST_UNIX
   /variable/CMAKE_HOST_WIN32
   /variable/CMAKE_LIBRARY_ARCHITECTURE_REGEX
   /variable/CMAKE_LIBRARY_ARCHITECTURE
   /variable/CMAKE_OBJECT_PATH_MAX
   /variable/CMAKE_SYSTEM_NAME
   /variable/CMAKE_SYSTEM_PROCESSOR
   /variable/CMAKE_SYSTEM
   /variable/CMAKE_SYSTEM_VERSION
   /variable/CYGWIN
   /variable/ENV
   /variable/MSVC10
   /variable/MSVC11
   /variable/MSVC12
   /variable/MSVC60
   /variable/MSVC70
   /variable/MSVC71
   /variable/MSVC80
   /variable/MSVC90
   /variable/MSVC_IDE
   /variable/MSVC
   /variable/MSVC_VERSION
   /variable/UNIX
   /variable/WIN32
   /variable/XCODE_VERSION

Variables that Control the Build
================================

.. toctree::
197
198
   :maxdepth: 1

199
200
201
   /variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
   /variable/CMAKE_AUTOMOC_MOC_OPTIONS
   /variable/CMAKE_AUTOMOC
202
203
   /variable/CMAKE_AUTORCC
   /variable/CMAKE_AUTORCC_OPTIONS
204
205
   /variable/CMAKE_AUTOUIC
   /variable/CMAKE_AUTOUIC_OPTIONS
206
   /variable/CMAKE_BUILD_WITH_INSTALL_RPATH
207
208
   /variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
   /variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
   /variable/CMAKE_CONFIG_POSTFIX
   /variable/CMAKE_DEBUG_POSTFIX
   /variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
   /variable/CMAKE_EXE_LINKER_FLAGS
   /variable/CMAKE_Fortran_FORMAT
   /variable/CMAKE_Fortran_MODULE_DIRECTORY
   /variable/CMAKE_GNUtoMS
   /variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
   /variable/CMAKE_INCLUDE_CURRENT_DIR
   /variable/CMAKE_INSTALL_NAME_DIR
   /variable/CMAKE_INSTALL_RPATH
   /variable/CMAKE_INSTALL_RPATH_USE_LINK_PATH
   /variable/CMAKE_LANG_VISIBILITY_PRESET
   /variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY
   /variable/CMAKE_LIBRARY_PATH_FLAG
   /variable/CMAKE_LINK_DEF_FILE_FLAG
   /variable/CMAKE_LINK_DEPENDS_NO_SHARED
   /variable/CMAKE_LINK_INTERFACE_LIBRARIES
   /variable/CMAKE_LINK_LIBRARY_FILE_FLAG
   /variable/CMAKE_LINK_LIBRARY_FLAG
   /variable/CMAKE_MACOSX_BUNDLE
230
   /variable/CMAKE_MACOSX_RPATH
231
232
233
234
235
   /variable/CMAKE_MAP_IMPORTED_CONFIG_CONFIG
   /variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG
   /variable/CMAKE_MODULE_LINKER_FLAGS
   /variable/CMAKE_NO_BUILTIN_CHRPATH
   /variable/CMAKE_NO_SYSTEM_FROM_IMPORTED
236
237
238
   /variable/CMAKE_OSX_ARCHITECTURES
   /variable/CMAKE_OSX_DEPLOYMENT_TARGET
   /variable/CMAKE_OSX_SYSROOT
239
   /variable/CMAKE_PDB_OUTPUT_DIRECTORY
240
   /variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
   /variable/CMAKE_POSITION_INDEPENDENT_CODE
   /variable/CMAKE_RUNTIME_OUTPUT_DIRECTORY
   /variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG
   /variable/CMAKE_SHARED_LINKER_FLAGS
   /variable/CMAKE_SKIP_BUILD_RPATH
   /variable/CMAKE_SKIP_INSTALL_RPATH
   /variable/CMAKE_STATIC_LINKER_FLAGS_CONFIG
   /variable/CMAKE_STATIC_LINKER_FLAGS
   /variable/CMAKE_TRY_COMPILE_CONFIGURATION
   /variable/CMAKE_USE_RELATIVE_PATHS
   /variable/CMAKE_VISIBILITY_INLINES_HIDDEN
   /variable/CMAKE_WIN32_EXECUTABLE
   /variable/EXECUTABLE_OUTPUT_PATH
   /variable/LIBRARY_OUTPUT_PATH

Variables for Languages
=======================

.. toctree::
260
261
   :maxdepth: 1

262
   /variable/CMAKE_COMPILER_IS_GNULANG
263
   /variable/CMAKE_CXX_COMPILE_FEATURES
264
   /variable/CMAKE_CXX_EXTENSIONS
265
   /variable/CMAKE_CXX_STANDARD
266
   /variable/CMAKE_CXX_STANDARD_REQUIRED
267
268
269
270
271
272
273
274
275
276
277
278
   /variable/CMAKE_Fortran_MODDIR_DEFAULT
   /variable/CMAKE_Fortran_MODDIR_FLAG
   /variable/CMAKE_Fortran_MODOUT_FLAG
   /variable/CMAKE_INTERNAL_PLATFORM_ABI
   /variable/CMAKE_LANG_ARCHIVE_APPEND
   /variable/CMAKE_LANG_ARCHIVE_CREATE
   /variable/CMAKE_LANG_ARCHIVE_FINISH
   /variable/CMAKE_LANG_COMPILE_OBJECT
   /variable/CMAKE_LANG_COMPILER_ABI
   /variable/CMAKE_LANG_COMPILER_ID
   /variable/CMAKE_LANG_COMPILER_LOADED
   /variable/CMAKE_LANG_COMPILER
279
   /variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
280
   /variable/CMAKE_LANG_COMPILER_TARGET
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
   /variable/CMAKE_LANG_COMPILER_VERSION
   /variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
   /variable/CMAKE_LANG_CREATE_SHARED_MODULE
   /variable/CMAKE_LANG_CREATE_STATIC_LIBRARY
   /variable/CMAKE_LANG_FLAGS_DEBUG
   /variable/CMAKE_LANG_FLAGS_MINSIZEREL
   /variable/CMAKE_LANG_FLAGS_RELEASE
   /variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO
   /variable/CMAKE_LANG_FLAGS
   /variable/CMAKE_LANG_IGNORE_EXTENSIONS
   /variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES
   /variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES
   /variable/CMAKE_LANG_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES
   /variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES
   /variable/CMAKE_LANG_LIBRARY_ARCHITECTURE
   /variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES
   /variable/CMAKE_LANG_LINKER_PREFERENCE
   /variable/CMAKE_LANG_LINK_EXECUTABLE
   /variable/CMAKE_LANG_OUTPUT_EXTENSION
   /variable/CMAKE_LANG_PLATFORM_ID
   /variable/CMAKE_LANG_SIMULATE_ID
   /variable/CMAKE_LANG_SIMULATE_VERSION
   /variable/CMAKE_LANG_SIZEOF_DATA_PTR
   /variable/CMAKE_LANG_SOURCE_FILE_EXTENSIONS
   /variable/CMAKE_USER_MAKE_RULES_OVERRIDE_LANG

Variables for CPack
===================

.. toctree::
311
312
   :maxdepth: 1

313
314
315
316
317
318
319
320
   /variable/CPACK_ABSOLUTE_DESTINATION_FILES
   /variable/CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY
   /variable/CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
   /variable/CPACK_INCLUDE_TOPLEVEL_DIRECTORY
   /variable/CPACK_INSTALL_SCRIPT
   /variable/CPACK_PACKAGING_INSTALL_PREFIX
   /variable/CPACK_SET_DESTDIR
   /variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION