更新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-gnu
型
g++也安装了。Ubuntu版本14.04.5。
如何解决这个错误?
1条答案
按热度按时间kmbjn2e31#
正如在评论中已经提到的,消息
字符串
是在项目的
CMakeLists.txt
中设置的CMAKE_DISABLE_SOURCE_CHANGES
变量的结果。这个设置激活了检查,CMake项目不会在源目录下创建任何文件。(有关此变量设置的更精确描述,请参见that answer)。通常情况下,设置
CMAKE_DISABLE_SOURCE_CHANGES
变量时会伴随设置CMAKE_DISABLE_IN_SOURCE_BUILD
变量,字面意思为:项目不应在源代码中构建。
解决方案是在不同于 *source目录 * 的 *build目录 * 中构建项目out-of-source。
例如:
型