Search code examples
cmakekdevelop4

cmake loads cpu without any effect


Recently I've started using cmake instead of creating make-files manually. Moreover I use kdevelop as an IDE. So, I created simple cmake project with kdevelop. It builds and executes successfully. But the thing is that when I try to run cmake from terminal (without kdevelop involved in the process) I see that cmake just loads the cpu as high as possible and there is no result for about half an hour. I couldn't wait more so I've just kill the process.

Here is my cmake file:

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

include_directories(include)
add_library(mylib SHARED mylibsrc/mylib.cpp)

Here is how kdevelop starts runs 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

I try to run cmake in same way but all I receive is the highest possible cpu load.

kdevelop version - 4.8.4

cmake version - 2.8.9

Can you advice anything about that?

Sorry for my broken English.


Solution

  • You can try adding the --trace option to the cmake call. The problem will still exist, but at least you should see then what is taking so long and can then further investigate. The --debug-output option might also help.

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