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