在“Visual Studio 14 2015 Win64”中指定“Visual Studio 15 2017 Win64”时,我的CMakeList.txt可能无法生成构建文件!
我安装了visual studio 2017社区。另外,这是我的CMakeList.txt的外观:
{
# Specify the minimum version for CMake
cmake_minimum_required(VERSION 2.8)
# Enable C++11 standard
set(CMAKE_CXX_STANDARD 11)
#set variables
#$CMAKE_SOURCE_DIR:=
set( ENV{CMAKE_SOURCE_DIR} D:/fake/path)
# Project's name
project(integrated)
# Set the output folder where your program will be created
set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# The following folder will be included
include_directories("${PROJECT_SOURCE_DIR}/inc")
# get all *.cpp files recursively
file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/*.cpp ${PROJECT_SOURCE_DIR}/*.hpp ${PROJECT_SOURCE_DIR}/*.h)
message("Files to compile: " ${SRC})
#disable if binary isn't required as output
#add_executable(integrated ${SRC_FILES})
#to make cmake generate a static library
add_library (integrated-static-lib STATIC ${SRC_FILES})
}
请帮忙评论一下吗?!