使用cmake来编译LZO出错的问题
使用cmake来编译LZO报错,提示
CMake Error at CMakeLists.txt:51 (project):
Generator
Visual Studio 15 2017 Win64
could not find any instance of Visual Studio.
Configuring incomplete, errors occurred!
See also "E:/cmake_test/CMakeFiles/CMakeOutput.log".
我认为可能是LZO文件中的cmakelist.txt中出错了,但是我不知道应该怎么改,请大神指教!
cmakelist.txt中的代码如下:
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
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)
# configuration options
option(ENABLE_STATIC "Build static LZO library." OFF)
option(ENABLE_SHARED "Build shared LZO library." ON)
if(NOT ENABLE_STATIC AND NOT ENABLE_SHARED)
set(ENABLE_STATIC ON)
endif()
if(ENABLE_SHARED AND WIN32)
cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR) # needed for WINDOWS_EXPORT_ALL_SYMBOLS
endif()
# install directories
if(NOT CMAKE_INSTALL_PREFIX)
message(FATAL_ERROR "ERROR: CMAKE_INSTALL_PREFIX is not defined.")
endif()
include(FindPkgConfig QUIET)
include(GNUInstallDirs)