diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 965227ac..591a0eb9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -197,6 +197,24 @@ target_link_libraries(${PROJECT_NAME} PUBLIC Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Qml ) +if(APPLE) + find_library(CARBON_LIBRARY Carbon) + target_link_libraries(${PROJECT_NAME} PRIVATE ${CARBON_LIBRARY}) +elseif(WIN32) + target_link_libraries(${PROJECT_NAME} PRIVATE user32) +elseif(UNIX) + if(QT_VERSION_MAJOR STREQUAL "6") + if(QT_VERSION VERSION_LESS "6.2.0") + message(FATAL_ERROR "Qt 6.2.0 or greater is required when using Qt6") + endif() + else() + if(QT_VERSION_MAJOR LESS "6") + find_package(Qt5 REQUIRED COMPONENTS X11Extras) + target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::X11Extras) + endif() + endif() + target_link_libraries(${PROJECT_NAME} PRIVATE X11) +endif() if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release")) find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)