Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug outer executable using Clion

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?

like image 985
hudac Avatar asked Mar 29 '15 11:03

hudac


1 Answers

  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)
like image 172
hudac Avatar answered Oct 23 '22 00:10

hudac