diff --git a/CMakeLists.txt b/CMakeLists.txt index 6269361..82fecd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,26 +3,17 @@ project(network_packet_composer) set(CMAKE_CXX_FLAGS "--std=c++14 -g -Wall") - # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) - - # Find the QtWidgets library -find_package(Qt5Core) find_package(Qt5Widgets) -find_package(Qt5Gui) - add_subdirectory(src) add_executable(npc main.cpp) target_link_libraries(npc src) -target_link_libraries(npc Qt5::Widgets) -target_link_libraries(npc Qt5::Core) -target_link_libraries(npc Qt5::Gui) - +qt5_use_modules(npc Widgets) diff --git a/main.cpp b/main.cpp index a080bdd..3b724ec 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,4 @@ -#include "mainwindow.h" +#include "src/mainwindow.h" #include int main(int argc, char *argv[]) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d43b70d..f460f40 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,20 +1,20 @@ -set(HEADERS abstractguidededitormodel.h - flowlayout.h - guidededitorelement.h - guidededitorelementview.h - guidededitorlayer.h - guidededitorview.h +set(HEADERS abstractguidededitormodel.h + flowlayout.h + guidededitorelement.h + guidededitorelementview.h + guidededitorlayer.h + guidededitorview.h mainwindow.h ) -set(SOURCES abstractguidededitormodel.cpp - flowlayout.cpp - guidededitorelement.cpp - guidededitorelementview.cpp - guidededitorlayer.cpp - guidededitorview.cpp +set(SOURCES abstractguidededitormodel.cpp + flowlayout.cpp + guidededitorelement.cpp + guidededitorelementview.cpp + guidededitorlayer.cpp + guidededitorview.cpp mainwindow.cpp ) add_library(src ${HEADERS} ${SOURCES}) - +qt5_use_modules(src Widgets)