Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt5Gui CMake config error #103

Open
glevner opened this issue Jan 15, 2021 · 2 comments
Open

Qt5Gui CMake config error #103

glevner opened this issue Jan 15, 2021 · 2 comments

Comments

@glevner
Copy link
Contributor

glevner commented Jan 15, 2021

Re: VFX Platform 2020, Qt 5.12.6.

The Qt5GuiConfigExtras.cmake file generated by aswf-docker looks for libGL.so in /usr/local/lib64. So if you try to build an executable or library based on Qt5Gui on a host where the library is installed in /usr/lib64, for example, cmake configuration fails.

An easy kludge would be to patch the cmake file, replacing /usr/local/lib64/libGL.so with just libGL.so. But there may be a cleaner solution, and the problem may be corrected in more recent versions of Qt...?

@glevner
Copy link
Contributor Author

glevner commented Jan 15, 2021

The problem persists in Qt 5.12.10.

@glevner
Copy link
Contributor Author

glevner commented Jan 18, 2021

This isn't pretty, but the following patch to build_qt.sh fixes the problem for us:

diff --git a/scripts/base/build_qt.sh b/scripts/base/build_qt.sh
index 5fcb34a..da05241 100755
--- a/scripts/base/build_qt.sh
+++ b/scripts/base/build_qt.sh
@@ -48,6 +48,31 @@ fi
         -no-use-gold-linker
 make -j$(nproc)
 
+# Kludge to fix cmake config file containing the absolute path of libGL.so,
+# which breaks the building of targets against Qt5Gui on hosts where the GL
+# library lives somewhere else.
+#
+# See https://github.com/AcademySoftwareFoundation/aswf-docker/issues/103
+
+if [[ $ASWF_QT_VERSION == 5.12* ]]; then
+cd qtbase/lib/cmake/Qt5Gui
+cat <<EOF | patch
+diff -u Qt5GuiConfigExtras.cmake Qt5GuiConfigExtras-patched.cmake 
+--- Qt5GuiConfigExtras.cmake	2021-01-18 12:31:00.173398319 +0000
++++ Qt5GuiConfigExtras-patched.cmake	2021-01-18 13:07:37.304713921 +0000
+@@ -65,7 +65,7 @@
+ 
+ 
+ 
+-_qt5gui_find_extra_libs(OPENGL "/usr/local/lib64/libGL.so" "" "")
++_qt5gui_find_extra_libs(OPENGL "libGL.so" "" "")
+ 
+ 
+ 
+EOF
+cd ../../../..
+fi
+
 sudo make install
 
 cd ../..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant