c++ - 无法配置 websocketpp 示例 CMakeLists.txt 文件
问题描述
当尝试从 Windows 10 上的 CMake GUI 配置websocketppexamples/echo_server
存储库中文件夹中的 CMakeLists.txt 文件时,我得到以下结果:
CMake Error at CMakeLists.txt:5 (init_target):
Unknown CMake command "init_target".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.13)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also "D:/third-party-software/websocketpp/examples/echo_server/build/CMakeFiles/CMakeOutput.log".
为什么我会收到错误消息Unknown CMake command "init_target"
,我该怎么办?我已经用谷歌搜索了它,但我只得到了那个确切的消息,它是关于构建 websocketpp,而不是一个单独的例子。
解决方案
init_target
不是 cmake 命令。这是一个在cmake/CMakeHelpers.cmake
文件中定义的自定义 marco。
您应该将它包含include(CMakeHelpers)
在您CMakeLists.txt
的使用init_target
和其他自定义命令中。
推荐阅读
- javascript - 如何防止 javascript 中 %WINDIR%\\system32\\netsh.exe 中的 \\n 引起的新行
- mysql - 如何在一个查询中使用表中的选定值并将其用于另一个表中的下一个选择?
- java - 为什么我从 OkHttp 请求中收到协议错误?
- python - 为python中的列表定义数值稳定的sigmoid函数的最佳方法
- css - 响应卡 bootstrap4
- powerbi - 用于合并的多列行的切片器
- javascript - 画布动画性能不佳,线条很多
- gcc - 为什么 x86-64 System V 调用约定在寄存器中传递 args 而不仅仅是堆栈?
- android - 如何在 Android 上使用 react native 查看所有待处理的推送通知?
- mysql - Chef MySQL 食谱用户创建错误