Skip to content

Conversation

Aram-Vn
Copy link

@Aram-Vn Aram-Vn commented Feb 6, 2025

Fix: Correct GStreamer Paths for Arch Linux in FindGStreamer.cmake

Description

QGroundControl’s FindGStreamer.cmake assumes a Debian-based library path structure (/usr/lib/x86_64-linux-gnu/). This causes build failures on Arch Linux, where libraries are located in /usr/lib/ instead.

This PR:

  • Dynamically detects Arch Linux using /etc/os-release.
  • Sets PKG_CONFIG_PATH and GSTREAMER_LIB_PATH correctly for Arch (/usr/lib/).
  • Preserves Debian-based paths for Ubuntu, Debian, etc.
  • Ensures QGroundControl builds successfully on Arch Linux

Test Steps

To Reproduce the Original Issue (Before Fix):

  1. Clone the QGroundControl repository on Arch Linux.
  2. run
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
./build/Debug/QGroundControl      

Checklist:

Related Issue

N/A (first report)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

QGroundControl’s FindGStreamer.cmake assumed a Debian-based path structure (/usr/lib/x86_64-linux-gnu/), causing build failures on Arch Linux. This fix dynamically detects Arch Linux using /etc/os-release and correctly sets PKG_CONFIG_PATH and GSTREAMER_LIB_PATH for Arch (/usr/lib/). This preserves Debian-based paths for other Linux distributions while enabling successful builds on Arch.
@HTRamsey
Copy link
Collaborator

HTRamsey commented Feb 6, 2025

Probably need to rebase because I cleaned up that file a bit more yesterday

@Aram-Vn Aram-Vn changed the title Fix: Use correct GStreamer paths for Arch Linux Fix: Check if Arch and Use correct GStreamer paths for Arch Linux Feb 12, 2025
@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 12, 2025

Probably need to rebase because I cleaned up that file a bit more yesterday

Thanks, that worked!

@HTRamsey
Copy link
Collaborator

Did my method solve your problem? Trying to avoid manually listing distributions

@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 17, 2025

Did my method solve your problem? Trying to avoid manually listing distributions

image
same problem
i did git pull --rebase

@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 17, 2025

Did my method solve your problem? Trying to avoid manually listing distributions

and other problem

find_program(QMAKE_EXECUTABLE NAMES qmake HINTS ${QT_ROOT_DIR} ${QTDIR} ENV QTDIR PATH_SUFFIXES bin)
execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION)
if(QT_VERSION LESS QT_MINIMUM_VERSION)
    MESSAGE(FATAL_ERROR "Minimum supported Qt version: ${QT_MINIMUM_VERSION}.
    Installed version: ${QT_VERSION}")
endif()

include(Qt6QGCConfiguration)

this didnt work well

image

i have both wersion but it sees 5.15.16

image

@HTRamsey
Copy link
Collaborator

Trying to avoid having distribution specific cmake code. Can you make this use find_path or Exists or something like that instead?

@HTRamsey
Copy link
Collaborator

as far as the other problem, I generally build using the qt-cmake file from the target Qt installation which makes sure all the build parameters are set correctly and the right Qt gets used.

@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 24, 2025

Ok
I will try it tomorrow

@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 24, 2025

as far as the other problem, I generally build using the qt-cmake file from the target Qt installation which makes sure all the build parameters are set correctly and the right Qt gets used.

I build using these guide steps

https://docs.qgroundcontrol.com/master/en/qgc-dev-guide/getting_started/index.html

@HTRamsey
Copy link
Collaborator

HTRamsey commented Feb 24, 2025

I'd personally use "C:\Qt\6.8.2\msvc2022_64\bin\qt-cmake.bat" instead of calling cmake directly

@Aram-Vn
Copy link
Author

Aram-Vn commented Feb 24, 2025

I'd personally use "C:\Qt\6.8.2\msvc2022_64\bin\qt-cmake.bat" instead of calling cmake directly

It's windows specific
But I got what you mean

@HTRamsey
Copy link
Collaborator

Yup sorry, working on a windows pc right now and didn't fix the path for you

@Aram-Vn Aram-Vn closed this Mar 18, 2025
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

Successfully merging this pull request may close these issues.

2 participants