Skip to content

Instantly share code, notes, and snippets.

@webmaster128
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save webmaster128/66d495b4b1ff7962e770 to your computer and use it in GitHub Desktop.

Select an option

Save webmaster128/66d495b4b1ff7962e770 to your computer and use it in GitHub Desktop.
QT += core
QT -= gui
TARGET = qmake-test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
defineTest(deployFiles) {
win32 {
to = $$shell_path($$3)
for(entry,1){
from = $$shell_path($$2/$$entry)
QMAKE_POST_LINK += $$quote(cmd /c copy /y $$from $$to $$escape_expand(\n\t))
PRE_TARGETDEPS += $$from
}
export(QMAKE_POST_LINK)
export(PRE_TARGETDEPS)
} else {
to = $$shell_path($$3)
for(entry,1){
from = $$shell_path($$2/$$entry)
QMAKE_POST_LINK += $$quote(cp $$from $$to $$escape_expand(\n\t))
PRE_TARGETDEPS += $$from
}
export(QMAKE_POST_LINK)
export(PRE_TARGETDEPS)
}
}
deployFiles("main.cpp", ".", "/tmp")
deployFiles("main.cpp", "..", "/tmp2")
deployFiles("main.cpp", "/some dir", "/tmp3")
####### Build rules
$(TARGET): ./main.cpp ../main.cpp /some\ dir/main.cpp $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
cp ./main.cpp /tmp
cp ../main.cpp /tmp2
cp /some dir/main.cpp /tmp3
Makefile: ../qmake-test/qmake-test.pro ../Qt/5.4/gcc_64/mkspecs/linux-g++/qmake.conf ../Qt/5.4/gcc_64/mkspecs/features/spec_pre.prf \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment