find_package(Qt6 COMPONENTS Core REQUIRED) target_link_libraries(mytarget Qt6::Core)