当前位置: 首页 > news >正文

网站关键词排名外包网站云解析域名解析

网站关键词排名外包,网站云解析域名解析,网站建设开,办公用品网站建设市场定位一、CMake简介 CMake是一个跨平台的构建工具#xff0c;它可以生成各种操作系统和编译器的构建文件。CMake使用一种基于文本#xff08;CMakeLists.txt#xff09;的语言来描述项目及其依赖关系#xff0c;并生成相应的构建文件。 CMake的基本概念包括#xff1a; 变量…一、CMake简介 CMake是一个跨平台的构建工具它可以生成各种操作系统和编译器的构建文件。CMake使用一种基于文本CMakeLists.txt的语言来描述项目及其依赖关系并生成相应的构建文件。 CMake的基本概念包括 变量用于存储各种信息例如编译器选项、路径等。函数用于执行各种操作例如检查系统版本、生成Makefile等。命令用于执行各种任务例如添加源文件、设置属性等。包用于组织和管理CMake代码。 CMake的使用非常灵活可以根据不同的需求进行定制。它支持多种构建系统包括Makefile、Ninja、Visual Studio等。同时CMake也提供了丰富的API和脚本语言方便用户进行二次开发和集成。 CMake - Upgrade Your Software Build System Getting Started with CMake CMake Reference Documentation — CMake 3.28.0-rc6 Documentation 二、安装CMake Windows 在Windows下安装CMake可以按照以下步骤进行 1. 下载CMake安装包 访问CMake官方网站 https://cmake.org/download/ 下载适用于Windows的CMake安装包。选择适合你的系统版本(32位或64位)的安装包进行下载。 2. 运行安装程序 双击下载好的CMake安装包启动安装程序。 3. 选择安装路径 在安装向导中选择CMake的安装路径。建议将CMake安装在C:\Program Files\CMake目录下以便于在命令行中直接使用。 4. 完成安装 点击“Install”按钮开始安装CMake。安装完成后点击“Finish”按钮退出安装向导。 5. 验证安装 打开命令提示符(按WinR键输入cmd,回车),输入cmake --version按回车键。如果显示出CMake的版本信息说明安装成功。 至此CMake已经成功安装在你的Windows系统中。你可以开始使用CMake进行跨平台项目构建了。 三、CMake-GUI工具 我们一般都是通过“cmake命令行” 来运行CMakeCMake-GUI作为CMake的一个图形化界面工具可以帮助开发者更方便地创建和管理CMake项目。通过使用CMake-GUI开发者可以提高开发效率实现跨平台项目的快速构建。 可以通过windows “cmake-gui”菜单启动 四、CMake 命令行 cmake --help命令用于查看CMake的帮助信息包括各种参数的使用说明和场景。通过使用--help参数用户可以快速了解CMake的基本用法和常用命令。 通过cmake命令行可以做所有CMake-GUI能做的事情并且更方便通过脚本来构建CMake项目。 C:\Users\Laolangcmake --help Usagecmake [options] path-to-sourcecmake [options] path-to-existing-buildcmake [options] -S path-to-source -B path-to-buildSpecify a source directory to (re-)generate a build system for it in the current working directory. Specify an existing build directory to re-generate its build system.Options-S path-to-source Explicitly specify a source directory.-B path-to-build Explicitly specify a build directory.-C initial-cache Pre-load a script to populate the cache.-D var[:type]value Create or update a cmake cache entry.-U globbing_expr Remove matching entries from CMake cache.-G generator-name Specify a build system generator.-T toolset-name Specify toolset name if supported bygenerator.-A platform-name Specify platform name if supported bygenerator.--toolchain file Specify toolchain file[CMAKE_TOOLCHAIN_FILE].--install-prefix directory Specify install directory[CMAKE_INSTALL_PREFIX].-Wdev Enable developer warnings.-Wno-dev Suppress developer warnings.-Werrordev Make developer warnings errors.-Wno-errordev Make developer warnings not errors.-Wdeprecated Enable deprecation warnings.-Wno-deprecated Suppress deprecation warnings.-Werrordeprecated Make deprecated macro and function warningserrors.-Wno-errordeprecated Make deprecated macro and function warningsnot errors.--preset preset,--presetpreset Specify a configure preset.--list-presets[type] List available presets.-E CMake command mode.-L[A][H] List non-advanced cached variables.--fresh Configure a fresh build tree, removing anyexisting cache file.--build dir Build a CMake-generated project binary tree.--install dir Install a CMake-generated project binarytree.--open dir Open generated project in the associatedapplication.-N View mode only.-P file Process script mode.--find-package Legacy pkg-config like mode. Do not use.--graphvizfile Generate graphviz of dependencies, seeCMakeGraphVizOptions.cmake for more.--system-information [file] Dump information about this system.--log-levelERROR|WARNING|NOTICE|STATUS|VERBOSE|DEBUG|TRACE Set the verbosity of messages from CMakefiles. --loglevel is also accepted forbackward compatibility reasons.--log-context Prepend log messages with context, if given--debug-trycompile Do not delete the try_compile build tree.Only useful on one try_compile at a time.--debug-output Put cmake in a debug mode.--debug-find Put cmake find in a debug mode.--debug-find-pkgpkg-name[,...] Limit cmake debug-find to thecomma-separated list of packages--debug-find-varvar-name[,...] Limit cmake debug-find to thecomma-separated list of result variables--trace Put cmake in trace mode.--trace-expand Put cmake in trace mode with variableexpansion.--trace-formathuman|json-v1 Set the output format of the trace.--trace-sourcefile Trace only this CMake file/module. Multipleoptions allowed.--trace-redirectfile Redirect trace output to a file instead ofstderr.--warn-uninitialized Warn about uninitialized values.--no-warn-unused-cli Dont warn about command line options.--check-system-vars Find problems with variable usage in systemfiles.--compile-no-warning-as-error Ignore COMPILE_WARNING_AS_ERROR property andCMAKE_COMPILE_WARNING_AS_ERROR variable.--profiling-formatfmt Output data for profiling CMake scripts.Supported formats: google-trace--profiling-outputfile Select an output path for the profiling dataenabled through --profiling-format.-h,-H,--help,-help,-usage,/? Print usage information and exit.--version,-version,/V [file] Print version number and exit.--help keyword [file] Print help for one keyword and exit.--help-full [file] Print all help manuals and exit.--help-manual man [file] Print one help manual and exit.--help-manual-list [file] List help manuals available and exit.--help-command cmd [file] Print help for one command and exit.--help-command-list [file] List commands with help available and exit.--help-commands [file] Print cmake-commands manual and exit.--help-module mod [file] Print help for one module and exit.--help-module-list [file] List modules with help available and exit.--help-modules [file] Print cmake-modules manual and exit.--help-policy cmp [file] Print help for one policy and exit.--help-policy-list [file] List policies with help available and exit.--help-policies [file] Print cmake-policies manual and exit.--help-property prop [file] Print help for one property and exit.--help-property-list [file] List properties with help available andexit.--help-properties [file] Print cmake-properties manual and exit.--help-variable var [file] Print help for one variable and exit.--help-variable-list [file] List variables with help available and exit.--help-variables [file] Print cmake-variables manual and exit.GeneratorsThe following generators are available on this platform (* marks default): * Visual Studio 17 2022 Generates Visual Studio 2022 project files.Use -A option to specify architecture.Visual Studio 16 2019 Generates Visual Studio 2019 project files.Use -A option to specify architecture.Visual Studio 15 2017 [arch] Generates Visual Studio 2017 project files.Optional [arch] can be Win64 or ARM.Visual Studio 14 2015 [arch] Generates Visual Studio 2015 project files.Optional [arch] can be Win64 or ARM.Visual Studio 12 2013 [arch] Deprecated. Generates Visual Studio 2013project files. Optional [arch] can beWin64 or ARM.Visual Studio 9 2008 [arch] Deprecated. Generates Visual Studio 2008project files. Optional [arch] can beWin64 or IA64.Borland Makefiles Generates Borland makefiles.NMake Makefiles Generates NMake makefiles.NMake Makefiles JOM Generates JOM makefiles.MSYS Makefiles Generates MSYS makefiles.MinGW Makefiles Generates a make file for use withmingw32-make.Green Hills MULTI Generates Green Hills MULTI files(experimental, work-in-progress).Unix Makefiles Generates standard UNIX makefiles.Ninja Generates build.ninja files.Ninja Multi-Config Generates build-Config.ninja files.Watcom WMake Generates Watcom WMake makefiles.CodeBlocks - MinGW Makefiles Generates CodeBlocks project files(deprecated).CodeBlocks - NMake Makefiles Generates CodeBlocks project files(deprecated).CodeBlocks - NMake Makefiles JOM Generates CodeBlocks project files(deprecated).CodeBlocks - Ninja Generates CodeBlocks project files(deprecated).CodeBlocks - Unix Makefiles Generates CodeBlocks project files(deprecated).CodeLite - MinGW Makefiles Generates CodeLite project files(deprecated).CodeLite - NMake Makefiles Generates CodeLite project files(deprecated).CodeLite - Ninja Generates CodeLite project files(deprecated).CodeLite - Unix Makefiles Generates CodeLite project files(deprecated).Eclipse CDT4 - NMake Makefiles Generates Eclipse CDT 4.0 project files(deprecated).Eclipse CDT4 - MinGW Makefiles Generates Eclipse CDT 4.0 project files(deprecated).Eclipse CDT4 - Ninja Generates Eclipse CDT 4.0 project files(deprecated).Eclipse CDT4 - Unix Makefiles Generates Eclipse CDT 4.0 project files(deprecated).Kate - MinGW Makefiles Generates Kate project files (deprecated).Kate - NMake Makefiles Generates Kate project files (deprecated).Kate - Ninja Generates Kate project files (deprecated).Kate - Ninja Multi-Config Generates Kate project files (deprecated).Kate - Unix Makefiles Generates Kate project files (deprecated).Sublime Text 2 - MinGW Makefiles Generates Sublime Text 2 project files(deprecated).Sublime Text 2 - NMake Makefiles Generates Sublime Text 2 project files(deprecated).Sublime Text 2 - Ninja Generates Sublime Text 2 project files(deprecated).Sublime Text 2 - Unix Makefiles Generates Sublime Text 2 project files(deprecated). 常用命令行参数 -G参数 -G是CMake命令行中的一个参数用于指定生成器。 CMake Generator是CMake构建系统中的一个概念它指定了用于生成构建文件的工具。在CMake中Generator是一个字符串它告诉CMake使用哪个工具来生成构建文件(如Makefile或Visual Studio解决方案)。 CMake支持多种生成器每种生成器都有自己的特点和用途。例如Ninja生成器可以提供更快的构建速度而Unix Makefiles生成器则适用于Unix/Linux系统。 使用案例 cmake -G Visual Studio 16 2019 path/to/source这个例子中我们使用-G参数指定了生成器为Visual Studio 16 2019。然后我们将源代码所在的路径传递给CMake命令。这样CMake会使用Visual Studio 16 2019作为生成器来构建项目。 -D参数 -D是CMake命令行中的一个参数用于定义变量。在CMake中变量可以用于存储各种信息例如编译器选项、路径等。使用-D参数可以在命令行中定义这些变量。 使用案例 cmake -D CMAKE_BUILD_TYPEDebug path/to/source这个例子中我们使用-D参数定义了一个名为CMAKE_BUILD_TYPE的变量并将其值设置为Debug。然后我们将源代码所在的路径传递给CMake命令。这样CMake会使用Debug模式来构建项目。 除了CMAKE_BUILD_TYPE,CMake还支持许多其他变量例如CMAKE_INSTALL_PREFIX、CMAKE_CXX_STANDARD等。使用-D参数可以在命令行中定义这些变量从而方便地控制CMake的构建过程。 -B参数 -B是CMake命令行中的一个参数用于指定构建目录。在CMake中构建目录是用来存放生成的构建文件(如Makefile或Visual Studio解决方案)的目录。 使用案例 cmake -B build path/to/source这个例子中我们使用-B参数指定了一个名为build的构建目录。然后我们将源代码所在的路径传递给CMake命令。这样CMake会在build目录下生成构建文件。 默认情况下CMake会在当前目录下生成构建文件。但是有时候我们需要将构建文件放在其他目录下这时就可以使用-B参数来指定构建目录。 -E参数 -E是CMake命令行中的一个参数用于执行CMake脚本中的命令。在CMake中-E参数可以用来执行各种命令例如生成变量、运行脚本等。 使用案例 cmake -E echo Hello, World!这个例子中我们使用-E参数执行了一个简单的echo命令输出了字符串Hello, World!。 cmake -E make_directory build 这个例子中这将在当前目录下创建一个名为build的目录。 cmake -E copy test.txt build/test.txt这个例子中这将将test.txt文件从当前目录复制到build目录中。 除了echo,CMake还支持许多其他命令例如if、foreach、list等。使用-E参数可以在命令行中执行这些命令从而方便地控制CMake的构建过程。 --build参数 --build是CMake命令行中的一个参数用于指定构建目录。在CMake中构建目录是用来存放生成的构建文件(如Makefile或Visual Studio解决方案)的目录。 使用案例 cmake --build path/to/build这个例子中我们使用--build参数指定了一个名为path/to/build的构建目录。然后CMake会在该目录下执行构建过程。 默认情况下CMake会在当前目录下生成构建文件并在当前目录下执行构建过程。但是有时候我们需要将构建文件放在其他目录下或者在其他目录下执行构建过程这时就可以使用--build参数来指定构建目录。 --install参数 --install是CMake命令行中的一个参数用于指定安装目录。在CMake中安装目录是用来存放生成的安装文件(如Windows下的msi文件或Linux下的tar.gz文件)的目录。 使用案例 cmake --install path/to/build --prefixpath/to/install这个例子中我们使用--install参数指定了一个名为path/to/build的构建目录并使用--prefix参数指定了一个名为path/to/install的安装目录。然后CMake会在该安装目录下执行安装过程。 默认情况下CMake会在当前目录下生成安装文件并在当前目录下执行安装过程。但是有时候我们需要将安装文件放在其他目录下或者在其他目录下执行安装过程这时就可以使用--install参数来指定安装目录。 --graphviz参数 --graphviz是CMake命令行中的一个参数用于生成GraphViz图形。在CMake中GraphViz是一种常用的可视化工具可以用来绘制构建文件的依赖关系图等。 使用案例 cmake --graphviz path/to/output.dot这个例子中我们使用--graphviz参数指定了一个名为path/to/output.dot的输出文件。然后CMake会在该文件中生成GraphViz图形。 默认情况下CMake不会生成GraphViz图形。但是有时候我们需要查看构建文件的依赖关系等信息这时就可以使用--graphviz参数来生成GraphViz图形。 --help-variable-list参数 --help-variable-list是CMake命令行中的一个参数用于列出所有可用的变量。在CMake中变量可以用于存储各种信息例如编译器选项、路径等。使用--help-variable-list参数可以查看所有可用的变量及其描述。 使用案例 cmake --help-variable-list这个例子中我们使用--help-variable-list参数来列出所有可用的变量及其描述。CMake会输出一个帮助信息其中包含所有可用的变量及其描述。 默认情况下CMake不会输出帮助信息。但是有时候我们需要查看所有可用的变量及其描述这时就可以使用--help-variable-list参数来列出所有可用的变量及其描述。 --help-variable参数 --help-variable是CMake命令行中的一个参数用于显示指定变量的值。在CMake中变量可以用于存储各种信息例如编译器选项、路径等。使用--help-variable参数可以查看指定变量的值。 使用案例 cmake --help-variable VARIABLE_NAME这个例子中我们使用--help-variable参数来显示名为VARIABLE_NAME的变量的值。CMake会输出该变量的值及其描述。 默认情况下CMake不会输出帮助信息。但是有时候我们需要查看指定变量的值及其描述这时就可以使用--help-variable参数来显示指定变量的值及其描述。 --help-variables参数 --help-variables是CMake命令行中的一个参数用于列出所有可用的变量及其描述。在CMake中变量可以用于存储各种信息例如编译器选项、路径等。使用--help-variables参数可以查看所有可用的变量及其描述。 使用案例 cmake --help-variables这个例子中我们使用--help-variables参数来列出所有可用的变量及其描述。CMake会输出一个帮助信息其中包含所有可用的变量及其描述。 cmake --help-variables cmake_variables.txt 这个例子中我们使用--help-variables参数来输出所有可用的变量及其描述到当前目录的cmake_variables.txt方便查看。 默认情况下CMake不会输出帮助信息。但是有时候我们需要查看所有可用的变量及其描述这时就可以使用--help-variables参数来列出所有可用的变量及其描述。 --help-property、 --help-property-list、--help-properties参数 --help-property是CMake命令行中的一个参数用于显示指定属性的帮助信息。在CMake中属性可以用于存储各种信息例如编译器选项、路径等。使用--help-property参数可以查看指定属性的帮助信息。 使用案例 cmake --help-property VARIABLE_NAME [file]这个例子中我们使用--help-property参数来显示名为VARIABLE_NAME的属性的帮助信息。CMake会输出该属性的描述及其可用选项。如果指定了文件名则将帮助信息输出到该文件中。 除了--help-property,CMake还提供了其他两个与属性相关的参数--help-property-list和--help-properties。 --help-property-list参数用于列出所有具有可用帮助信息的属性并退出。 --help-properties参数用于打印cmake-properties手册并退出。 这些参数可以帮助用户更好地了解CMake的属性及其用法。 -- help-command、--help-command-list、--help-commands参数 --help-command是CMake命令行中的一个参数用于显示指定命令的帮助信息。在CMake中有许多命令可以用于构建和配置项目例如add_executable、configure等。使用--help-command参数可以查看指定命令的帮助信息。 使用案例 cmake --help-command command [file]这个例子中我们使用--help-command参数来显示名为command的命令的帮助信息。CMake会输出该命令的描述及其可用选项。如果指定了文件名则将帮助信息输出到该文件中。 除了--help-command,CMake还提供了其他两个与命令相关的参数--help-list-commands和--help-all-commands。 --help-list-commands参数用于列出所有可用的命令及其简要描述并退出。 --help-all-commands参数用于打印所有可用命令的手册页并退出。 这些参数可以帮助用户更好地了解CMake的命令及其用法。             常用案例 # 指定构建类型为Release cmake -DCMAKE_BUILD_TYPERelease /path/to/source#指定安装目录为/usr/local cmake -DCMAKE_INSTALL_PREFIX/usr/local /path/to/source#指定使用Android NDK作为交叉编译工具链 cmake -DCMAKE_TOOLCHAIN_FILE/path/to/android.toolchain.cmake /path/to/source#指定使用C11标准 cmake -DCMAKE_CXX_FLAGS-stdc11 /path/to/source#定义CMake变量 cmake -DVARvalue /path/to/source#调用CMake内置命令echo cmake -E echo Hello World#指定构建目录 cmake -B /path/to/build /path/to/source#指定使用gcc编译器 cmake -DCMAKE_C_COMPILERgcc -DCMAKE_CXX_COMPILERg /path/to/source#指定构建共享库 cmake -DBUILD_SHARED_LIBSON /path/to/source#指定生成的可执行文件和库文件的输出目录 cmake -DCMAKE_RUNTIME_OUTPUT_DIRECTORY/path/to/bin -DCMAKE_LIBRARY_OUTPUT_DIRECTORY/path/to/lib /path/to/source指定使用Ninja生成器 cmake -G Ninja /path/to/source指定CMake模块路径 cmake -DCMAKE_MODULE_PATH/path/to/modules /path/to/source指定导出编译命令 cmake -DCMAKE_EXPORT_COMPILE_COMMANDSON /path/to/source指定运行时动态链接库搜索路径 cmake -DCMAKE_INSTALL_RPATH/path/to/lib /path/to/source指定使用Clang编译器且开启优化选项 cmake -DCMAKE_C_COMPILERclang -DCMAKE_CXX_COMPILERclang -DCMAKE_C_FLAGS-O2 -DCMAKE_CXX_FLAGS-O2 /path/to/source指定使用Debug构建类型 cmake -DCMAKE_BUILD_TYPEDebug /path/to/source指定使用Release构建类型并生成Makefile文件 cmake -DCMAKE_BUILD_TYPERelease -G Unix Makefiles /path/to/source指定第三方库安装路径 cmake -DCMAKE_PREFIX_PATH/path/to/third_party /path/to/source指定使用GCC编译器且开启调试信息 cmake -DCMAKE_C_COMPILERgcc -DCMAKE_CXX_COMPILERg -DCMAKE_C_FLAGS-g -DCMAKE_CXX_FLAGS-g /path/to/source 五、总结 通过学习和掌握cmake --help命令行参数我们可以更好地利用CMake进行跨平台项目构建提高开发效率。在实际项目中我们可以根据需要选择合适的参数来满足不同的构建需求。
http://www.hkea.cn/news/14261424/

相关文章:

  • 有一个做搞笑英语视频网站三站合一网站营销
  • 北京做网站男生工资网站建设的描述
  • 网站开发模板免费下载域名多少钱一年
  • 电子商务网站推广计划访问网站需要账号密码
  • 深圳网站建设php推广策略有哪些方法
  • dede新手做网站多久网站建设公司公司我我提供一个平台
  • phpmysql网站开发实例装修公司工装公司
  • 怎么用APdiv做网站导航栏网页平台制作
  • 电子商务安全问题 网站权限WordPress 云 memcache
  • 做php门户网站那个系统好图书馆网站建设公司
  • .net开发网站怎么样无锡网站制作
  • 建立自己网站免费八大营销模式有哪几种
  • 网站建设用什么视频播放器wordpress后台经常504
  • 兴县做网站的公司wordpress首页显示一张图片
  • iis发布网站无法访问知名的企业网站建设
  • 濮阳网站制作网站创建方案论文
  • 免费网站浏览器东营网站建设价格
  • 收费的网站如何免费网站标题做参数
  • html做网站的原则做阿里巴巴网站需要多少钱
  • 怎么通过淘宝优惠券做网站赚钱外贸网站开发推荐
  • 电子商务网站开发目的和意义做网站用的什么服务器
  • 当当网网站建设需求分析wordpress可以做微博
  • 深圳微商城网站制作价格wordpress防止文章被采集
  • 网站建设合同英文模板下载wordpress 添加表格
  • 江门网页建站模板58同城招聘网 找工作
  • 广西学校网站建设网站建设如何为企业电商化转型赋能
  • 海南专业网站建设网站设计线框图
  • 百度seo站长网站遇到攻击时应该怎么做
  • 网站的要求大连手机自适应网站建设电话
  • 建设网站赚钱吗热点新闻素材