forked from wang-bin/QtAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update qmake pro. use the latest version
- Loading branch information
LucasWang
committed
Jan 14, 2013
1 parent
3a10f67
commit 8d1d970
Showing
4 changed files
with
121 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# qmake common template pri file | ||
# Copyright (C) 2011 Wang Bin <[email protected]> | ||
# Copyright (C) 2011-2013 Wang Bin <[email protected]> | ||
# Shanghai, China. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
|
@@ -22,10 +22,10 @@ isEmpty(COMMON_PRI_INCLUDED): { #begin COMMON_PRI_INCLUDED | |
CONFIG += profile | ||
#profiling, -pg is not supported for msvc | ||
debug:!*msvc*:profile { | ||
QMAKE_CXXFLAGS_DEBUG += -pg | ||
QMAKE_LFLAGS_DEBUG += -pg | ||
QMAKE_CXXFLAGS_DEBUG = $$unique(QMAKE_CXXFLAGS_DEBUG) | ||
QMAKE_LFLAGS_DEBUG = $$unique(QMAKE_LFLAGS_DEBUG) | ||
QMAKE_CXXFLAGS_DEBUG += -pg | ||
QMAKE_LFLAGS_DEBUG += -pg | ||
QMAKE_CXXFLAGS_DEBUG = $$unique(QMAKE_CXXFLAGS_DEBUG) | ||
QMAKE_LFLAGS_DEBUG = $$unique(QMAKE_LFLAGS_DEBUG) | ||
} | ||
|
||
#$$[TARGET_PLATFORM] | ||
|
@@ -35,126 +35,151 @@ _ARCH = | |
_EXTRA = | ||
|
||
unix { | ||
_OS = _unix | ||
*linux*: _OS = _linux | ||
else:mac: _OS = _mac | ||
else:*maemo* { | ||
_OS = _maemo | ||
*maemo5*:_OS = _maemo5 | ||
*maemo6*:_OS = _maemo6 | ||
} | ||
else:*meego*: _OS = _meego | ||
!isEmpty(MEEGO_EDITION): _OS = _$$MEEGO_EDITION | ||
_OS = _unix | ||
macx: _OS = _mac | ||
else:*linux*: _OS = _linux | ||
*maemo* { | ||
_OS = _maemo | ||
*maemo5*:_OS = _maemo5 | ||
*maemo6*:_OS = _maemo6 | ||
} else:*meego*: _OS = _meego | ||
!isEmpty(MEEGO_EDITION): _OS = _$$MEEGO_EDITION | ||
} else:wince* { | ||
_OS = _wince | ||
_OS = _wince | ||
} else:win32 { #true for wince | ||
_OS = _win32 | ||
_OS = _win32 | ||
} | ||
#*arm*: _ARCH = $${_ARCH}_arm | ||
contains(QT_ARCH, arm.*) { | ||
_ARCH = $${_ARCH}_$${QT_ARCH} | ||
_ARCH = $${_ARCH}_$${QT_ARCH} | ||
} | ||
*64: _ARCH = $${_ARCH}_x64 | ||
*64: _ARCH = $${_ARCH}_x64 | ||
*llvm*: _EXTRA = _llvm | ||
#*msvc*: | ||
|
||
win32-msvc* { | ||
#Don"t warn about sprintf, fopen etc being "unsafe" | ||
DEFINES += _CRT_SECURE_NO_WARNINGS | ||
#Don"t warn about sprintf, fopen etc being "unsafe" | ||
DEFINES += _CRT_SECURE_NO_WARNINGS | ||
} | ||
|
||
#################################functions######################################### | ||
defineReplace(cleanPath) { | ||
win32:1 ~= s|\\\\|/|g | ||
contains(1, ^/.*):pfx = / | ||
else:pfx = | ||
segs = $$split(1, /) | ||
out = | ||
for(seg, segs) { | ||
equals(seg, ..):out = $$member(out, 0, -2) | ||
else:!equals(seg, .):out += $$seg | ||
} | ||
return($$join(out, /, $$pfx)) | ||
win32:1 ~= s|\\\\|/|g | ||
contains(1, ^/.*):pfx = / | ||
else:pfx = | ||
segs = $$split(1, /) | ||
out = | ||
for(seg, segs) { | ||
equals(seg, ..):out = $$member(out, 0, -2) | ||
else:!equals(seg, .):out += $$seg | ||
} | ||
return($$join(out, /, $$pfx)) | ||
} | ||
|
||
#Acts like qtLibraryTarget. From qtcreator.pri | ||
defineReplace(qtLibName) { | ||
#TEMPLATE += fakelib | ||
#LIB_FULLNAME = $$qtLibraryTarget($$1) | ||
#TEMPLATE -= fakelib | ||
unset(LIBRARY_NAME) | ||
LIBRARY_NAME = $$1 | ||
CONFIG(debug, debug|release) { | ||
!debug_and_release|build_pass { | ||
mac:RET = $$member(LIBRARY_NAME, 0)_debug | ||
else:win32:RET = $$member(LIBRARY_NAME, 0)d | ||
} | ||
} | ||
isEmpty(RET):RET = $$LIBRARY_NAME | ||
!win32: return($$RET) | ||
|
||
isEmpty(2): VERSION_EXT = $$VERSION | ||
else: VERSION_EXT = $$2 | ||
!isEmpty(VERSION_EXT) { | ||
VERSION_EXT = $$section(VERSION_EXT, ., 0, 0) | ||
#isEqual(VERSION_EXT, 0):unset(VERSION_EXT) | ||
} | ||
RET = $${RET}$${VERSION_EXT} | ||
unset(VERSION_EXT) | ||
return($$RET) | ||
#TEMPLATE += fakelib | ||
#LIB_FULLNAME = $$qtLibraryTarget($$1) | ||
#TEMPLATE -= fakelib | ||
unset(LIBRARY_NAME) | ||
LIBRARY_NAME = $$1 | ||
CONFIG(debug, debug|release) { | ||
!debug_and_release|build_pass { | ||
mac:RET = $$member(LIBRARY_NAME, 0)_debug | ||
else:win32:RET = $$member(LIBRARY_NAME, 0)d | ||
} | ||
} | ||
isEmpty(RET):RET = $$LIBRARY_NAME | ||
!win32: return($$RET) | ||
|
||
isEmpty(2): VERSION_EXT = $$VERSION | ||
else: VERSION_EXT = $$2 | ||
!isEmpty(VERSION_EXT) { | ||
VERSION_EXT = $$section(VERSION_EXT, ., 0, 0) | ||
#isEqual(VERSION_EXT, 0):unset(VERSION_EXT) | ||
} | ||
RET = $${RET}$${VERSION_EXT} | ||
unset(VERSION_EXT) | ||
return($$RET) | ||
} | ||
|
||
|
||
#fakelib | ||
defineReplace(qtStaticLib) { | ||
unset(LIB_FULLNAME) | ||
LIB_FULLNAME = $$qtLibName($$1, $$2) | ||
*msvc*|win32-icc: LIB_FULLNAME = $$member(LIB_FULLNAME, 0).lib | ||
else: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).a | ||
return($$LIB_FULLNAME) | ||
unset(LIB_FULLNAME) | ||
LIB_FULLNAME = $$qtLibName($$1, $$2) | ||
*msvc*|win32-icc: LIB_FULLNAME = $$member(LIB_FULLNAME, 0).lib | ||
else: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).a | ||
return($$LIB_FULLNAME) | ||
} | ||
|
||
defineReplace(qtSharedLib) { | ||
unset(LIB_FULLNAME) | ||
LIB_FULLNAME = $$qtLibName($$1, $$2) | ||
win32: LIB_FULLNAME = $$member(LIB_FULLNAME, 0).dll | ||
else { | ||
macx|ios: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).$${QMAKE_EXTENSION_SHLIB} #default_post.prf | ||
else: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).so | ||
} | ||
return($$LIB_FULLNAME) | ||
unset(LIB_FULLNAME) | ||
LIB_FULLNAME = $$qtLibName($$1, $$2) | ||
win32: LIB_FULLNAME = $$member(LIB_FULLNAME, 0).dll | ||
else { | ||
macx|ios: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).$${QMAKE_EXTENSION_SHLIB} #default_post.prf | ||
else: LIB_FULLNAME = lib$$member(LIB_FULLNAME, 0).so | ||
} | ||
return($$LIB_FULLNAME) | ||
} | ||
|
||
defineReplace(qtLongName) { | ||
unset(LONG_NAME) | ||
LONG_NAME = $$1$${_OS}$${_ARCH}$${_EXTRA} | ||
return($$LONG_NAME) | ||
unset(LONG_NAME) | ||
LONG_NAME = $$1$${_OS}$${_ARCH}$${_EXTRA} | ||
return($$LONG_NAME) | ||
} | ||
|
||
##############################paths#################################### | ||
#TRANSLATIONS += i18n/$${TARGET}_zh-cn.ts i18n/$${TARGET}_zh_CN.ts | ||
#argument 1 is default dir if not defined | ||
defineTest(getBuildRoot) { | ||
!isEmpty($$2): unset(BUILD_DIR) | ||
isEmpty(BUILD_DIR) { | ||
BUILD_DIR=$$(BUILD_DIR) | ||
isEmpty(BUILD_DIR) { | ||
BUILD_DIR=$$[BUILD_DIR] | ||
isEmpty(BUILD_DIR) { | ||
!isEmpty(1) { | ||
BUILD_DIR=$$1 | ||
} else { | ||
BUILD_DIR = $$OUT_PWD | ||
warning(BUILD_DIR not specified, using $$BUILD_DIR) | ||
} | ||
} | ||
} | ||
} | ||
export(BUILD_DIR) | ||
message(BUILD_DIR=$$BUILD_DIR) | ||
return(true) | ||
} | ||
|
||
##############################paths#################################### | ||
#for Qt2, Qt3 which does not have QT_VERSION. Qt4: $$[QT_VERSION] | ||
MOC_DIR = $$BUILD_DIR/.moc/$${QT_VERSION} | ||
RCC_DIR = $$BUILD_DIR/.rcc/$${QT_VERSION} | ||
UI_DIR = $$BUILD_DIR/.ui/$${QT_VERSION} | ||
#obj is platform dependent | ||
OBJECTS_DIR = $$qtLongName($$BUILD_DIR/.obj/$$TARGET) | ||
|
||
isEqual(TEMPLATE, app) { | ||
defineTest(preparePaths) { | ||
getBuildRoot($$1, $$2) | ||
MOC_DIR = $$BUILD_DIR/.moc/$${QT_VERSION} | ||
RCC_DIR = $$BUILD_DIR/.rcc/$${QT_VERSION} | ||
UI_DIR = $$BUILD_DIR/.ui/$${QT_VERSION} | ||
#obj is platform dependent | ||
OBJECTS_DIR = $$qtLongName($$BUILD_DIR/.obj/$$TARGET) | ||
#before target name changed | ||
!isEmpty(PROJECTROOT):TRANSLATIONS *= $$PROJECTROOT/i18n/$${TARGET}_zh-cn.ts $$PROJECTROOT/i18n/$${TARGET}_zh_CN.ts | ||
isEqual(TEMPLATE, app) { | ||
DESTDIR = $$BUILD_DIR/bin | ||
# TARGET = $$qtLongName($$TARGET) | ||
EXE_EXT = | ||
win32: EXE_EXT = .exe | ||
CONFIG(release, debug|release): | ||
!isEmpty(QMAKE_STRIP): QMAKE_POST_LINK = -$$QMAKE_STRIP $$DESTDIR/$${TARGET}$${EXE_EXT} #.exe in win | ||
}else: DESTDIR = $$qtLongName($$BUILD_DIR/lib) | ||
|
||
!build_pass:message(target: $$DESTDIR/$$TARGET) | ||
|
||
CONFIG(release, debug|release): !isEmpty(QMAKE_STRIP): QMAKE_POST_LINK = -$$QMAKE_STRIP $$DESTDIR/$${TARGET}$${EXE_EXT} #.exe in win | ||
} else: DESTDIR = $$qtLongName($$BUILD_DIR/lib) | ||
!build_pass:message(target: $$DESTDIR/$$TARGET) | ||
#export vars outside this function | ||
export(MOC_DIR) | ||
export(RCC_DIR) | ||
export(UI_DIR) | ||
export(OBJECTS_DIR) | ||
export(DESTDIR) | ||
export(TARGET) | ||
return(true) | ||
} | ||
COMMON_PRI_INCLUDED = 1 | ||
|
||
} #end COMMON_PRI_INCLUDED | ||
#before target name changed | ||
#TRANSLATIONS += i18n/$${TARGET}_zh-cn.ts #i18n/$${TARGET}_zh_CN.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# qmake library building template pri file | ||
# Copyright (C) 2011 Wang Bin <[email protected]> | ||
# Copyright (C) 2011-2013 Wang Bin <[email protected]> | ||
# Shanghai, China. | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
|
@@ -24,10 +24,10 @@ | |
# TEMPLATE = lib | ||
# QT -= gui | ||
# CONFIG *= xx-buildlib | ||
# STATICLINK = 1 #optional. default is 0, i.e. dynamically link | ||
# PROJECTROOT = $$PWD/.. | ||
# STATICLINK = 1 #or 0 | ||
# include(libXX.pri) | ||
# include($${PROJECTROOT}/common.pri) | ||
# preparePaths($$OUT_PWD/../out) | ||
# HEADERS = ... | ||
# SOURCES = ... | ||
# ... | ||
|
@@ -36,7 +36,7 @@ | |
# PROJECTROOT = $$PWD/.. | ||
# STATICLINK = 1 #or 0 | ||
# include(dir_of_XX/libXX.pri) | ||
# include($${PROJECTROOT}/common.pri) | ||
# preparePaths($$OUT_PWD/../out) | ||
# HEADERS = ... | ||
# SOURCES = ... | ||
# | ||
|
@@ -58,13 +58,10 @@ TEMPLATE -= fakelib | |
|
||
isEmpty(PROJECTROOT): PROJECTROOT = $$PWD/.. | ||
include($${PROJECTROOT}/common.pri) | ||
#load($${PROJECTROOT}/common.pri) | ||
CONFIG *= depend_includepath #? | ||
preparePaths($$OUT_PWD/../out) | ||
CONFIG += depend_includepath #? | ||
|
||
PROJECT_SRCPATH = $$PWD | ||
isEmpty(BUILD_DIR):BUILD_DIR=$$(BUILD_DIR) | ||
isEmpty(BUILD_DIR):BUILD_DIR=$$[BUILD_DIR] | ||
isEmpty(BUILD_DIR):BUILD_DIR=$$OUT_PWD #remove these? | ||
PROJECT_LIBDIR = $$qtLongName($$BUILD_DIR/lib) | ||
|
||
#for system include path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters