7

I want to debug with Clion an executable that was created using outer makefile.
I saw I can choose another executable in Run/Debug Configurations --> Executable but it automatically runs my CMakeLists, which I don't want to (cause it fails).

I know Clion currently doesn't support "import project with existing makefile".

Is there a way to do that?

1 Answer 1

6
  1. using Cmake's add_custom_command() and add_custom_target() I called my makefile
  2. In the Clion Run/Debug Configuration --> Executable I chose the compiled executable from my makefile.

--- Edit ---
1. Example

add_custom_command(OUTPUT app_run.txt
    COMMAND /bin/echo "Not building!"
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(app_run ALL
    DEPENDS app_run.txt)
Sign up to request clarification or add additional context in comments.

2 Comments

can you share your configuration or an example? (like, as a complete piece of two lines of code as they would look like in CMakeLists?)
Is the makefile app_run.txt, in this case?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.