当尝试通过Windows 10上的CMake GUI在websocketpp存储库的examples/echo_server
文件夹中的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".
文件夹中配置CMakeLists.txt文件时,得到以下结果:
Unknown CMake command "init_target"
为什么会出现错误float()
,我该怎么办?我已经在Google上进行了搜索,但是我只收到一则确切的信息,它是关于构建websocketpp的,而不是单个示例。
答案 0 :(得分:0)
init_target
不是cmake命令。
这是在cmake/CMakeHelpers.cmake
文件中定义的自定义marco。
您应通过include(CMakeHelpers)
将其包含在CMakeLists.txt
中,以使用init_target
和其他自定义命令。