QtPackage: modify QT_ADDITIONAL_PACKAGES_PREFIX_PATH handling (#49297)
* QtPackage: mv QT_ADDITIONAL_PACKAGES_PREFIX_PATH handling * geomodel: support Qt6 * qt-base: rm import re
This commit is contained in:
parent
f015b18230
commit
8677063142
@ -80,7 +80,12 @@ class Geomodel(CMakePackage):
|
|||||||
depends_on("pythia8", when="+pythia")
|
depends_on("pythia8", when="+pythia")
|
||||||
with when("+visualization"):
|
with when("+visualization"):
|
||||||
depends_on("hdf5+cxx")
|
depends_on("hdf5+cxx")
|
||||||
depends_on("qt +gui +opengl +sql")
|
depends_on("qmake")
|
||||||
|
with when("^[virtuals=qmake] qt"):
|
||||||
|
depends_on("qt +gui +opengl +sql")
|
||||||
|
with when("^[virtuals=qmake] qt-base"):
|
||||||
|
depends_on("qt-base +gui +opengl +sql +widgets")
|
||||||
|
depends_on("qt-5compat")
|
||||||
depends_on("coin3d")
|
depends_on("coin3d")
|
||||||
depends_on("soqt")
|
depends_on("soqt")
|
||||||
depends_on("opengl")
|
depends_on("opengl")
|
||||||
@ -94,5 +99,8 @@ def cmake_args(self):
|
|||||||
self.define_from_variant("GEOMODEL_BUILD_EXAMPLES", "examples"),
|
self.define_from_variant("GEOMODEL_BUILD_EXAMPLES", "examples"),
|
||||||
self.define_from_variant("GEOMODEL_BUILD_TOOLS", "tools"),
|
self.define_from_variant("GEOMODEL_BUILD_TOOLS", "tools"),
|
||||||
self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
|
self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
|
||||||
|
self.define(
|
||||||
|
"GEOMODEL_USE_QT6", self.spec.satisfies("+visualization ^[virtuals=qmake] qt-base")
|
||||||
|
),
|
||||||
]
|
]
|
||||||
return args
|
return args
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -59,17 +58,6 @@ def cmake_args(self):
|
|||||||
# Start with upstream cmake_args
|
# Start with upstream cmake_args
|
||||||
args = super().cmake_args()
|
args = super().cmake_args()
|
||||||
|
|
||||||
# Qt components typically install cmake config files in a single prefix,
|
|
||||||
# so we have to point them to the cmake config files of dependencies
|
|
||||||
qt_prefix_path = []
|
|
||||||
re_qt = re.compile("qt-.*")
|
|
||||||
for dep in self.spec.dependencies():
|
|
||||||
if re_qt.match(dep.name):
|
|
||||||
qt_prefix_path.append(self.spec[dep.name].prefix)
|
|
||||||
|
|
||||||
# Now append all qt-* dependency prefixes into a prefix path
|
|
||||||
args.append(self.define("QT_ADDITIONAL_PACKAGES_PREFIX_PATH", ":".join(qt_prefix_path)))
|
|
||||||
|
|
||||||
# Make our CMAKE_INSTALL_RPATH redundant:
|
# Make our CMAKE_INSTALL_RPATH redundant:
|
||||||
# for prefix of current package ($ORIGIN/../lib type of rpaths),
|
# for prefix of current package ($ORIGIN/../lib type of rpaths),
|
||||||
args.append(self.define("QT_DISABLE_RPATH", True))
|
args.append(self.define("QT_DISABLE_RPATH", True))
|
||||||
@ -130,6 +118,11 @@ def setup_run_environment(self, env):
|
|||||||
if os.path.exists(self.prefix.plugins):
|
if os.path.exists(self.prefix.plugins):
|
||||||
env.prepend_path("QT_PLUGIN_PATH", self.prefix.plugins)
|
env.prepend_path("QT_PLUGIN_PATH", self.prefix.plugins)
|
||||||
|
|
||||||
|
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||||
|
# Qt components typically install cmake config files in a single prefix,
|
||||||
|
# so we have to point dependencies to the cmake config files.
|
||||||
|
env.prepend_path("QT_ADDITIONAL_PACKAGES_PREFIX_PATH", self.spec.prefix)
|
||||||
|
|
||||||
|
|
||||||
class QtBase(QtPackage):
|
class QtBase(QtPackage):
|
||||||
"""Qt Base (Core, Gui, Widgets, Network, ...)"""
|
"""Qt Base (Core, Gui, Widgets, Network, ...)"""
|
||||||
|
Loading…
Reference in New Issue
Block a user