cmake加载cpu时不产生任何影响

cmake加载cpu时不产生任何影响,cmake,kdevelop4,Cmake,Kdevelop4,最近我开始使用cmake,而不是手动创建make文件。此外,我使用kdevelop作为IDE。所以,我用kdevelop创建了一个简单的cmake项目。它成功地构建和执行。但问题是,当我尝试从终端运行cmake时(过程中没有涉及kdevelop),我看到cmake只会尽可能高地加载cpu,大约半小时内没有结果。我等不及了,所以我已经结束了这个过程 这是我的cmake文件: project(robot) cmake_minimum_required(VERSION 2.8) set(CMAKE_B

最近我开始使用cmake,而不是手动创建make文件。此外,我使用kdevelop作为IDE。所以,我用kdevelop创建了一个简单的cmake项目。它成功地构建和执行。但问题是,当我尝试从终端运行cmake时(过程中没有涉及kdevelop),我看到cmake只会尽可能高地加载cpu,大约半小时内没有结果。我等不及了,所以我已经结束了这个过程

这是我的cmake文件:

project(robot)
cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Debug)

include_directories(include)
add_library(mylib SHARED mylibsrc/mylib.cpp)
以下是kdevelop如何启动和运行cmake:

/home/sergey/projects/project-test/build> /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug /home/sergey/projects/project-test/
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /home/sergey/bin/gcc
-- Check for working C compiler: /home/sergey/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /home/sergey/bin/c++
-- Check for working CXX compiler: /home/sergey/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sergey/projects/project-test/build
我尝试以同样的方式运行cmake,但我得到的只是可能的最高cpu负载

kdevelop版本-4.8.4

cmake版本-2.8.9

你能给我提些建议吗


对不起,我的英语不好。

您可以尝试将
--trace
选项添加到cmake调用中。这个问题仍然存在,但至少你应该看到什么需要这么长时间,然后可以进一步调查。
--debug output
选项也可能有帮助

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug --trace --debug-output /home/sergey/projects/project-test/

看起来它现在挂起了
/usr/share/cmake-2.8/Modules/cmakeedetermineccompiler.cmake(39):从[2]/usr/share/cmake-2.8/Modules/cmakeetermineccompiler.cmake调用的GET_FILENAME_组件(cmake_编译器_INIT$ENV{CC}程序程序_ARGS cmake_C_标志_ENV_INIT)[1]/home/sergey/projects/project test/CMakeLists.txt
Hm,真奇怪。你能尝试从你的构建目录中删除CMakeCache文件,或者在其他地方创建一个新的构建目录,并在那里使用给定的命令行调用cmake吗?我从一个空的
build
目录的新repo运行cmake。此外,我能说的是,我在zsh中运行cmake,它挂起。然而,当我在bash中运行cmake时,它运行得很平稳。最后,我发现:$CC被设置为'gcc'(不是'gcc',请参见引号后的空格)。
我尝试以同样的方式运行cmake,但我收到的只是可能的最高cpu负载。
任何类似于
的消息——C编译器标识是GNU 4.7.2