Alok
Alok

Reputation: 3290

error while working with Makefile project

I am trying to debug my Makefile based project which I have imported in CLion. I created a simple CMake file as below

cmake_minimum_required(VERSION 2.8.4)
project(Project1)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")

add_custom_target(myProject COMMAND make -j4 DEBUG=1
    CLION_EXE_DIR=${PACKAGE_DIR})

CMake tool shows me error: CMake executable not specified. I tried adding add_executable(myProject ${SOURCE_FILES}) with correct source files, but still same error.

Where as on Edit Configurations page, I cannot select any Configuration. The drop down for Configuration is empty. At the bottom I get error Error: Configuration is not specified..

When I try to debug the program, I get a warning message Configuration is still incorrect. Do you want to edit it again? I click on Continue Anyway, which compiles the program as I expect and it generates the correct executable file as well. But it cannot run the executable because of the errors in the Configurations.

Upvotes: 4

Views: 2405

Answers (2)

Nir Duan
Nir Duan

Reputation: 6392

This solved the problem for me (Ubuntu):

sudo apt-get install cmake

Upvotes: 0

usr1234567
usr1234567

Reputation: 23384

I assume "CMake executable" refers to the location of the executable cmake which is called to configure your project. Probably you have to search for a setting in CLion where you can define /usr/bin/cmake or whereever your cmake resides.

Upvotes: 3

Related Questions