Hi everyone,
I’ve been trying to build Avogadro2 from source on my Ubuntu 22.04 machine to experiment with some plugin development, but I keep running into a conflict with CMake and Qt6.
I cloned the repo and followed the build instructions from GitHub. Everything goes smoothly until CMake tries to find the required Qt6 modules. Here’s the relevant part of the output:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:99 (find_package):
Could not find a package configuration file provided by "Qt6Core"...
I do have Qt6 installed via qt6-base-dev, and qmake6 is accessible from the terminal. I also tried setting CMAKE_PREFIX_PATH manually but still no luck.
Has anyone faced this issue or found a workaround? Would really appreciate some guidance on getting the build environment right. Also open to tips on setting up a smooth development workflow for Avogadro2.
Details of how to build are at Building Source Code — Avogadro 1.100.0 documentation and they should be up-to-date (the only real change since I last made edits is that Qt6 is the default on Linux). Make sure in particular that qt6-base-dev definitely installed all the individual Qt6 packages that you need.
You don’t need qmake at all btw, we use CMake.
Also worth noting that to write a plugin in Python you don’t even need to compile Avogadro from source yourself as the plugins are discovered and loaded at runtime, so you could actually just work with any 1.100 or nightly binary.
Note: contrasting to the releases on the GitHub release page, the link to Linux AppImages on the github landing page of avogadrolibs currently is dysfunctional.