Error working with Makefile project

I am trying to debug my project Makefilethat I imported into CLion. I created a simple CMakefile as shown 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})
Tool

CMakeshows mistake CMake executable not specified. I tried adding add_executable(myProject ${SOURCE_FILES})with the correct source files, but still the same error.

Where, as on the page Edit Configurations, I can not choose any configuration. The fall for the configuration is empty. Below I get an error Error: Configuration is not specified..

When I try to debug a program, I get a warning message Configuration is still incorrect. Do you want to edit it again?. I click Continue Anyway, which compiles the program as I expect, and also generates the correct executable. But it cannot start the executable due to configuration errors.

+4
2

, " CMake" cmake, . , CLion, /usr/bin/cmake , cmake.

+3

(Ubuntu):

sudo apt-get install cmake
0

Source: https://habr.com/ru/post/1613298/


All Articles