Question

I used to use Kdevelop on Linux Mint which worked fine. Now I reinstalled Linux and I can't get Kdevelop and cmake to work.

When I compile I get this error:

make: *** No targets specified and no makefile found.  Stop.

And when I try to configure cmake I get:

/home/benedikt/projects/Exercise 3/build> /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug /home/benedikt/projects/Exercise 3/  
-- Configuring incomplete, errors occurred!  
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.  
Missing variable is:  
CMAKE_3_COMPILER_ENV_VAR  
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.  
Missing variable is:  
CMAKE_3_COMPILER  
CMake Error: Could not find cmake module file:/home/benedikt/projects/Exercise 3/build/CMakeFiles/CMake3Compiler.cmake  
CMake Error: Could not find cmake module file:CMake3Information.cmake  
CMake Error: CMAKE_3_COMPILER not set, after EnableLanguage 

What do I have to set the variable to, and where do I do it?

Edit: The CMakeList.txt is:

project(exercise 3)

add_executable(exercise 3 main.cpp)
Was it helpful?

Solution

Take a look at project() command documentation.

Its first argument is the project name and others are used languages. CMake thinks that 3 is a programming language and tries to find its compiler.

Either remove spaces from project's name or use quotes: project("exercise 3").

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top