This commit is contained in:
朱子楚\zhuzi 2024-05-16 01:26:59 +08:00
parent 354f7f2e3e
commit 39f58278ff

View File

@ -197,6 +197,24 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
Qt${QT_VERSION_MAJOR}::Quick Qt${QT_VERSION_MAJOR}::Quick
Qt${QT_VERSION_MAJOR}::Qml 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")) if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump) find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)