Actually, INSTALLS works fine:
TARGET = bin/tea
target.path = /usr/local/bin
INSTALLS += target
TARGET = bin/tea
target.path = /usr/local/bin
INSTALLS += target
To copy to clipboard, switch view to plain text mode
and qmake generates a makefile with this lines:
install_target: first FORCE
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
-$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
-strip "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
uninstall_target: FORCE
-$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
-$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/
install_target: first FORCE
@$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/
-$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
-strip "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
uninstall_target: FORCE
-$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
-$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/
To copy to clipboard, switch view to plain text mode
The problem is - I don't need the last line. How to disable the attempt to remove the installation directory? Let's assume that my binary is installed to /usr/local/bin. Make uninstall trying to remove this dir as well as the binary file. What I can do to prevent such action?
Bookmarks