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
# SHADOW_CHECK = 1
# QT_HOME = /usr/lib64/qt48/
-include useroptions.mak
###########################################################################
@ -525,6 +527,10 @@ ifdef SHADOW_CHECK
PARAMS += --SHADOW_CHECK='$(SHADOW_CHECK)'
endif
ifdef QT_HOME
PARAMS += --QT_HOME='$(QT_HOME)'
endif
#-------------------------------------------------
# All scripts
#-------------------------------------------------

View File

@ -105,15 +105,24 @@ function osdmodulesbuild()
if (os.is("windows")) then
MOC = "moc"
else
MOCTST = backtick("which moc-qt4 2>/dev/null")
if (MOCTST=='') then
MOCTST = backtick("which moc 2>/dev/null")
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
MOCTST = backtick("which moc-qt4 2>/dev/null")
if (MOCTST=='') then
MOCTST = backtick("which moc 2>/dev/null")
end
if (MOCTST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1)
end
MOC = MOCTST
end
if (MOCTST=='') then
print("Qt's Meta Object Compiler (moc) wasn't found!")
os.exit(1)
end
MOC = MOCTST
end
@ -141,9 +150,15 @@ function osdmodulesbuild()
"-F" .. backtick("qmake -query QT_INSTALL_LIBS"),
}
else
buildoptions {
backtick("pkg-config --cflags QtGui"),
}
if _OPTIONS["QT_HOME"]~=nil then
buildoptions {
"-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"),
}
else
buildoptions {
backtick("pkg-config --cflags QtGui"),
}
end
end
else
defines {
@ -205,9 +220,15 @@ function osdmodulestargetconf()
"QtGui.framework",
}
else
linkoptions {
backtick("pkg-config --libs QtGui"),
}
if _OPTIONS["QT_HOME"]~=nil then
buildoptions {
"-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
}
else
linkoptions {
backtick("pkg-config --libs QtGui"),
}
end
end
end
@ -294,6 +315,12 @@ newoption {
},
}
newoption {
trigger = "QT_HOME",
description = "QT lib location",
}
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
_OPTIONS["USE_QTDEBUG"] = "0"

View File

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