简体   繁体   中英

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?

  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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM