Fix CMake scripts for FreeBSD (#550)

This fixes linking of the XCB library on FreeBSD.
This commit is contained in:
Joel Bodenmann 2023-08-17 17:57:16 +02:00 committed by GitHub
parent 0d10c6e2d9
commit 2d2de53dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,7 +85,12 @@ target_link_libraries(${library_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets)
if (UNIX AND NOT APPLE)
target_link_libraries(${library_name} PUBLIC xcb)
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
find_package(X11 REQUIRED)
target_link_libraries(${library_name} PUBLIC X11::xcb)
else()
target_link_libraries(${library_name} PUBLIC xcb)
endif()
endif()
set_target_properties(${library_name} PROPERTIES
AUTOMOC ON