How to define a custom Clean command?
Asked Answered
P

1

6

I'm calling an existing Makefile for building, so in order to rebuild I'd need to call make clean first. I see that Run | Clean calls

cmake --build <dir> --target clean -- -j 4

Is there a way to make Run | Clean run a custom target instead? For instance, one that is defined as:

add_custom_target(make-clean ALL COMMAND make -C ${mytest_SOURCE_DIR} clean)

Pudding answered 25/6, 2017 at 1:54 Comment(0)
L
0

Run | Clean action is depends on Project Mode. If you opened CMake project it will always running cmake --build <dir> --target clean -- -j 4, but you can create your own External tool and put it in Run menu.

  1. Create a tool in Preferences | Tools | External Tools

enter image description here

  1. Add Tool to Menu Preferences | Appearance & Behavior | Menus and Toolbars enter image description here

  2. Profit

enter image description here

Ligate answered 8/5, 2020 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.