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