PDA

View Full Version : QMAKE_POST_LINK does not work with qt creator 2.7.1



DavidXanatos
25th May 2013, 15:56
I have a problem with qt creator 2.7.1,
it seams to ignore QMAKE_POST_LINK it does not call the programms specyfyed.
it seams nto to execute it at all, nothing in the compile log that would indicate it even tryed to execute the command, also it seams the commands don't end up in the make files that are made.

Any idea whats the problem?

Cheers
David

ChrisW67
25th May 2013, 22:52
I am certain it has nothing to do with Qt Creator.

The QMAKE_POST_LINK variable is used by qmake to generate rules into a Makefile for later execution by a make utility. If you have not already done so, rerun qmake.

The QMAKE_POST_LINK commands will only execute if the target is relinked, so if that is not the required the command swill not executed.

DavidXanatos
26th May 2013, 07:43
I tryed i think every thing i could think about already:
1. clicking "run qmake"
2. clicking build
3. erasing the output directory and clicking build
4. clicking build new/rebuild all

I'm using MS VS2010 can it be that the pre/post link stuff only works with gcc or so?

ChrisW67
27th May 2013, 08:47
No. How about you share what you actually have in your PRO file.

DavidXanatos
27th May 2013, 18:11
# ----------------------------------------------------
# This file is generated by the Qt Visual Studio Add-in.
# ------------------------------------------------------

TEMPLATE = app
TARGET = MuleKad
QT += core network widgets gui
DEFINES += QT_LARGEFILE_SUPPORT QT_NETWORK_LIB USING_QT QT_WIDGETS_LIB USING_QT
!mac:!win32:QMAKE_CXXFLAGS += -std=c++0x
!win32:QMAKE_CXXFLAGS += -w
unix:QMAKE_LFLAGS += -Wl,-rpath,'\$\$ORIGIN'


CONFIG(debug, debug|release):DESTDIR = ../Debug
CONFIG(release, debug|release):DESTDIR = ../Release
INCLUDEPATH += .
DEPENDPATH += .
#MOC_DIR += ./GeneratedFiles
#OBJECTS_DIR += ./ObjectFiles
#UI_DIR += ./GeneratedFiles
#RCC_DIR += ./GeneratedFiles

win32:{
CONFIG(debug, debug|release):LIBS += \
-L../../NeoLoader/crypto++/Win32/DLL_Output/Debug/ \
-L../../NeoLoader/zlib/Debug/ \
-L../Debug/
CONFIG(release, debug|release):LIBS += \
-L../../NeoLoader/crypto++/Win32/DLL_Output/Release/ \
-L../../NeoLoader/zlib/Release/ \
-L../Release/
LIBS += -lNeoHelper -lcryptopp -lzlib
LIBS += -lWs2_32
}

!win32:{
CONFIG(debug, debug|release):LIBS += \
-L$$OUT_PWD/../Debug/
CONFIG(release, debug|release):LIBS += \
-L$$OUT_PWD/../Release/
LIBS += \
-L$$OUT_PWD/../../NeoLoader/crypto++/
LIBS += -lqjson -lqbencode -lNeoHelper -lcryptopp -lz
}

CONFIG += precompile_header
PRECOMPILED_HEADER = GlobalHeader.h

include(MuleKad.pri)
win32:RC_FILE = MuleKad.rc

Vanir
29th May 2013, 16:04
Platform SUSE 12.3 x86_64
GCC 4.8.0
Qt 5.0.2
Qt Creator 2.7.1

Yes, QMAKE_POST_LINK does not work on my setup when building from Qt Creator 2.7.1. It does work when building from a shell.

pro file section
<
JS_BASE_DIR = ../
JS_LIBS_DIR = $${JS_BASE_DIR}/libs/
JS_BIN_DIR = $${JS_BASE_DIR}/bin/

INCLUDEPATH = $${JS_BASE_DIR} $${JS_BASE_DIR}/libjoystick
LIBS += -L$${JS_LIBS_DIR} -l$$LIBJOYSTICK -lm

QMAKE_RPATHDIR += $$JS_LIBS_DIR

QMAKE_CXXFLAGS += -std=c++11 -pedantic -Wextra -fvisibility=hidden -fvisibility-inlines-hidden

QMAKE_POST_LINK = $(CHK_DIR_EXISTS) $${JS_BIN_DIR} || $(MKDIR) $${JS_BIN_DIR} && \
$(COPY_FILE) $(TARGET) $${JS_BIN_DIR}

PRECOMPILED_HEADER = src/joysticks_pch.h
>

QMAKE_POST_LINK and PRECOMPILED_HEADER are not syntax highlighted as the other qmake keywords are in the Qt Creator text editor, nor it should be noted in the Kate and KWrite editors. Strange, they are in the qmake reference:
http://http://qt-project.org/doc/qt-5.0/qtdoc/qmake-variable-reference.html#qmake-post-link

Added after 8 minutes:

Ok, I've found out what is happening.

I imported a pro file to Qt Creator 2.7.1. However, what Qt Creator does is, as a default, is to create a shadow build, consequently creating a shadow build directory where the QMAKE_POST_LINK does it's job.

Goto Projects in sidebar and choose Build Settings; look under the top General heading uncheck the Shadow Build setting. Now build.
Well, does it work for you DavidXanatos?

ChrisW67
29th May 2013, 20:43
There is no use of QMAKE_POST_LINK in that pro file. Is it hidden in the included pri file?