set(HEADERS mainwindow.h ) set(SOURCES mainwindow.cpp ) add_subdirectory(model) add_subdirectory(editor) add_subdirectory(protocol) add_library(src ${HEADERS} ${SOURCES}) target_link_libraries(src model editor protocol) qt5_use_modules(src Widgets)