0

最近我开始使用 cmake 而不是手动创建 make-files。此外,我使用 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

你能对此提出任何建议吗?

对不起我的英语不好。

4

1 回答 1

2

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

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug --trace --debug-output /home/sergey/projects/project-test/
于 2014-08-17T08:17:16.077 回答