cmake-commands(7)¶
脚本命令¶
这些命令始终可用。
- block
- break
- cmake_host_system_information
- cmake_language
- cmake_minimum_required
- cmake_parse_arguments
- cmake_path
- cmake_pkg_config
- cmake_policy
- configure_file
- continue
- else
- elseif
- endblock
- endforeach
- endfunction
- endif
- endmacro
- endwhile
- execute_process
- file
- find_file
- find_library
- find_package
- find_path
- find_program
- foreach
- function
- get_cmake_property
- get_directory_property
- get_filename_component
- get_property
- if
- include
- include_guard
- list
- macro
- mark_as_advanced
- math
- message
- option
- return
- separate_arguments
- set
- set_directory_properties
- set_property
- site_name
- string
- unset
- variable_watch
- while
项目命令¶
这些命令仅在 CMake 项目中可用。
- add_compile_definitions
- add_compile_options
- add_custom_command
- add_custom_target
- add_definitions
- add_dependencies
- add_executable
- add_library
- add_link_options
- add_subdirectory
- add_test
- aux_source_directory
- build_command
- cmake_file_api
- create_test_sourcelist
- define_property
- enable_language
- enable_testing
- export
- fltk_wrap_ui
- get_source_file_property
- get_target_property
- get_test_property
- include_directories
- include_external_msproject
- include_regular_expression
- install
- link_directories
- link_libraries
- load_cache
- project
- remove_definitions
- set_source_files_properties
- set_target_properties
- set_tests_properties
- source_group
- target_compile_definitions
- target_compile_features
- target_compile_options
- target_include_directories
- target_link_directories
- target_link_libraries
- target_link_options
- target_precompile_headers
- target_sources
- try_compile
- try_run
CTest 命令¶
这些命令仅在 CTest 脚本中可用。
已弃用命令¶
这些命令已弃用,仅为了保持向后兼容性而提供。每个命令的文档都说明了它在哪个 CMake 版本中被弃用。在新代码中不要使用这些命令。