qt5base-lts/mkspecs/features/qt_module_headers.prf
Oswald Buddenhagen 95b2e051f9 move creation of module version header to qt_module_headers
Change-Id: I650b495ec1789eb03b31d796f9f475ba01aab2d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:40:05 +02:00

34 lines
1.4 KiB
Plaintext

#load up the headers info
include($$MODULE_BASE_OUTDIR/include/$$TARGET/headers.pri, "", true)
lctarget = $$lower($$TARGET)
uctarget = $$upper($$TARGET)
# Create module version header
MODULE_VERSION_HEADER = $$find(SYNCQT.HEADER_FILES, (^|/)$${lctarget}version\\.h$)
count(MODULE_VERSION_HEADER, 1) {
MODULE_VERSION_HEADER = $$absolute_path($$MODULE_VERSION_HEADER, $$_PRO_FILE_PWD_)
!build_pass {
majorhexstr = $$format_number($$section(VERSION, ., 0, 0), width=2 zeropad obase=16)
minorhexstr = $$format_number($$section(VERSION, ., 1, 1), width=2 zeropad obase=16)
patchhexstr = $$format_number($$section(VERSION, ., 2, 2), width=2 zeropad obase=16)
modulehexstring = 0x$${majorhexstr}$${minorhexstr}$${patchhexstr}
MODULE_VERSION_HEADER_CONT = \
"/* This file was generated by qmake with the info from $${_PRO_FILE_}. */" \
"$${LITERAL_HASH}ifndef QT_$${uctarget}_VERSION_H" \
"$${LITERAL_HASH}define QT_$${uctarget}_VERSION_H" \
"" \
"$${LITERAL_HASH}define $${uctarget}_VERSION_STR \"$$VERSION\"" \
"" \
"$${LITERAL_HASH}define $${uctarget}_VERSION $$modulehexstring" \
"" \
"$${LITERAL_HASH}endif // QT_$${uctarget}_VERSION_H"
write_file($$MODULE_VERSION_HEADER, MODULE_VERSION_HEADER_CONT)|error("Aborting.")
}
HEADERS += $$MODULE_VERSION_HEADER
}
CONFIG += qt_install_headers