最近我开始使用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 version - 2.8.9
你能就此提出建议吗?
抱歉我的英语不好。
答案 0 :(得分:2)
您可以尝试将--trace
选项添加到cmake调用中。这个问题仍然存在,但至少你应该看到这么长时间的问题,然后可以进一步调查。 --debug-output
选项也可能会有所帮助。
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug --trace --debug-output /home/sergey/projects/project-test/