我已经安装了 VS2015 (win64),我想用 Cmake 编译 LZO 生成一个 VS 项目,但是 Cmake 显示这个:
CMake Error at CMakeLists.txt:51 (project):
Generator
Visual Studio 15 2017 Win64
could not find any instance of Visual Studio.
我认为问题可能来自 Cmakelist.txt 文档,但我不知道如何解决... CmakeList.txt文件的第51行是:
if(",${CMAKE_SOURCE_DIR}," STREQUAL ",${CMAKE_BINARY_DIR},")
message(FATAL_ERROR "ERROR: In-source builds are not allowed.")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
project(lzo VERSION 2.10 LANGUAGES C++)
最佳答案
Generator Visual Studio 15 2017 Win64 是 Visual Studio 2015 的错误生成器。您需要 Visual Studio 14 2015 Win64
如果您有从 Visual Studio 2015 x64 命令提示符执行 cmake-gui 的问题,以便您设置编译器环境变量。
关于c++ - 使用Cmake编译LZO时提示找不到任何VS实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49278766/