Add support for locating headers and libs in qt_configure
So far we only had support for locating executables. Also support locating header files and libraries. Change-Id: Ib2a83e8338d2da975204089d84c608061a081f29 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
c8b46d3989
commit
27b03be893
@ -275,15 +275,19 @@ defineTest(qtConfTest_linkerSupportsFlag) {
|
|||||||
return($$qtConfToolchainSupportsFlag($$LFLAGS "-Wl,$$flag"))
|
return($$qtConfToolchainSupportsFlag($$LFLAGS "-Wl,$$flag"))
|
||||||
}
|
}
|
||||||
|
|
||||||
defineReplace(qtConfFindInPath) {
|
defineReplace(qtConfFindInPathList) {
|
||||||
ensurePathEnv()
|
for (dir, 2) {
|
||||||
for (dir, QMAKE_PATH_ENV) {
|
|
||||||
exists("$$dir/$${1}"): \
|
exists("$$dir/$${1}"): \
|
||||||
return("$$dir/$${1}")
|
return("$$dir/$${1}")
|
||||||
}
|
}
|
||||||
return()
|
return()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineReplace(qtConfFindInPath) {
|
||||||
|
ensurePathEnv()
|
||||||
|
return($$qtConfFindInPathList($$1, $$QMAKE_PATH_ENV))
|
||||||
|
}
|
||||||
|
|
||||||
defineReplace(qtConfPkgConfigEnv) {
|
defineReplace(qtConfPkgConfigEnv) {
|
||||||
env =
|
env =
|
||||||
!isEmpty(PKG_CONFIG_SYSROOT_DIR): env = "$${SETENV_PFX}PKG_CONFIG_SYSROOT_DIR=$${PKG_CONFIG_SYSROOT_DIR}$${SETENV_SFX} "
|
!isEmpty(PKG_CONFIG_SYSROOT_DIR): env = "$${SETENV_PFX}PKG_CONFIG_SYSROOT_DIR=$${PKG_CONFIG_SYSROOT_DIR}$${SETENV_SFX} "
|
||||||
@ -607,6 +611,27 @@ defineTest(qtConfTest_compile) {
|
|||||||
return(false)
|
return(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineTest(qtConfTest_files) {
|
||||||
|
for(i, $${1}.files._KEYS_) {
|
||||||
|
f = $$eval($${1}.files.$${i})
|
||||||
|
qtLog("Searching for file $${f}.")
|
||||||
|
contains(f, ".*\.h") {
|
||||||
|
file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS)
|
||||||
|
} else: contains(f, ".*\.(lib|so|a)") {
|
||||||
|
file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
|
||||||
|
} else {
|
||||||
|
# assume we're looking for an executable
|
||||||
|
file = $$qtConfFindInPath($$f)
|
||||||
|
}
|
||||||
|
isEmpty(file) {
|
||||||
|
qtLog(" Not found.");
|
||||||
|
return(false)
|
||||||
|
}
|
||||||
|
qtLog(" Found at $${file}.")
|
||||||
|
}
|
||||||
|
return(true)
|
||||||
|
}
|
||||||
|
|
||||||
defineTest(logn) {
|
defineTest(logn) {
|
||||||
log("$${1}$$escape_expand(\\n)")
|
log("$${1}$$escape_expand(\\n)")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user