在将cmake更新到3.12.1版本后,我发现了错误
CMake Error at /usr/local/share/cmake-3.12/Modules/CMakeDetermineSystem.cmake:174 (file):
file attempted to write a file:
/home/wow/TrinityCore/CMakeFiles/CMakeOutput.log into a source directory.
Call Stack (most recent call first):
CMakeLists.txt:19 (project)
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!make安装
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnug++也是。Ubuntu版本14.04.5
有什么帮助或想法吗?
谢谢!
发布于 2020-08-19 20:46:23
正如评论中已经指出的,
file attempted to write a file ... into a source directory是项目的CMAKE_DISABLE_SOURCE_CHANGES变量集在CMakeLists.txt中的结果。此设置激活检查,CMake项目不会在源目录下创建任何文件。(对此变量设置的更精确描述见that answer中)。
通常,设置CMAKE_DISABLE_SOURCE_CHANGES变量伴随着设置CMAKE_DISABLE_IN_SOURCE_BUILD变量,具有字面意义:
项目不应该在源代码中构建.
解决方案是在构建目录中构建与源目录不同的项目out-of-source,。
以这种方式:
cd <project-dir>
mkdir build
cd build
cmake ..https://stackoverflow.com/questions/52191556
复制相似问题