Added QT_HOME to support custom QT installations (nw)

This commit is contained in:
Miodrag Milanovic 2015-04-13 18:47:33 +02:00
parent 5f76399216
commit f6fbdaa2e8
3 changed files with 56 additions and 17 deletions

View File

@ -78,6 +78,8 @@
# PYTHON_EXECUTABLE = python3 # PYTHON_EXECUTABLE = python3
# SHADOW_CHECK = 1 # SHADOW_CHECK = 1
# QT_HOME = /usr/lib64/qt48/
-include useroptions.mak -include useroptions.mak
########################################################################### ###########################################################################
@ -525,6 +527,10 @@ ifdef SHADOW_CHECK
PARAMS += --SHADOW_CHECK='$(SHADOW_CHECK)' PARAMS += --SHADOW_CHECK='$(SHADOW_CHECK)'
endif endif
ifdef QT_HOME
PARAMS += --QT_HOME='$(QT_HOME)'
endif
#------------------------------------------------- #-------------------------------------------------
# All scripts # All scripts
#------------------------------------------------- #-------------------------------------------------

View File

@ -104,6 +104,14 @@ function osdmodulesbuild()
local MOC = "" local MOC = ""
if (os.is("windows")) then if (os.is("windows")) then
MOC = "moc" MOC = "moc"
else
if _OPTIONS["QT_HOME"]~=nil then
QMAKETST = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake --version 2>/dev/null")
if (QMAKETST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1)
end
MOC = _OPTIONS["QT_HOME"] .. "/bin/moc"
else else
MOCTST = backtick("which moc-qt4 2>/dev/null") MOCTST = backtick("which moc-qt4 2>/dev/null")
if (MOCTST=='') then if (MOCTST=='') then
@ -115,6 +123,7 @@ function osdmodulesbuild()
end end
MOC = MOCTST MOC = MOCTST
end end
end
custombuildtask { custombuildtask {
@ -140,11 +149,17 @@ function osdmodulesbuild()
buildoptions { buildoptions {
"-F" .. backtick("qmake -query QT_INSTALL_LIBS"), "-F" .. backtick("qmake -query QT_INSTALL_LIBS"),
} }
else
if _OPTIONS["QT_HOME"]~=nil then
buildoptions {
"-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"),
}
else else
buildoptions { buildoptions {
backtick("pkg-config --cflags QtGui"), backtick("pkg-config --cflags QtGui"),
} }
end end
end
else else
defines { defines {
"USE_QTDEBUG=0", "USE_QTDEBUG=0",
@ -204,12 +219,18 @@ function osdmodulestargetconf()
"QtCore.framework", "QtCore.framework",
"QtGui.framework", "QtGui.framework",
} }
else
if _OPTIONS["QT_HOME"]~=nil then
buildoptions {
"-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
}
else else
linkoptions { linkoptions {
backtick("pkg-config --libs QtGui"), backtick("pkg-config --libs QtGui"),
} }
end end
end end
end
if _OPTIONS["targetos"]=="windows" then if _OPTIONS["targetos"]=="windows" then
links { links {
@ -294,6 +315,12 @@ newoption {
}, },
} }
newoption {
trigger = "QT_HOME",
description = "QT lib location",
}
if not _OPTIONS["USE_QTDEBUG"] then if not _OPTIONS["USE_QTDEBUG"] then
if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "emscripten" or _OPTIONS["targetos"] == "os2" then if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "emscripten" or _OPTIONS["targetos"] == "os2" then
_OPTIONS["USE_QTDEBUG"] = "0" _OPTIONS["USE_QTDEBUG"] = "0"

View File

@ -117,9 +117,15 @@ if _OPTIONS["targetos"]=="windows" then
configuration { } configuration { }
elseif _OPTIONS["targetos"]=="linux" then elseif _OPTIONS["targetos"]=="linux" then
if _OPTIONS["QT_HOME"]~=nil then
buildoptions { buildoptions {
'$(shell pkg-config --cflags QtGui)', "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"),
} }
else
buildoptions {
backtick("pkg-config --cflags QtGui"),
}
end
elseif _OPTIONS["targetos"]=="macosx" then elseif _OPTIONS["targetos"]=="macosx" then
defines { defines {
"SDLMAME_MACOSX", "SDLMAME_MACOSX",