diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e2a5e2..877fd54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,15 @@ cmake_minimum_required(VERSION 3.10) project(auto_bus_gui) +file(GLOB_RECURSE QRC_SOURCE_FILES ${PROJECT_SOURCE_DIR}/*.qrc) + set(CMAKE_CXX_STANDARD 14) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) +set(QRC_SOURCE_FILES Resources.qrc) -set(CMAKE_PREFIX_PATH "C:/Users/ricardo.DESKTOP-N6OVBK5/Programs/Qt/6.1.3/msvc2019_64") +set(CMAKE_PREFIX_PATH "C:/Users/ricardo.DESKTOP-N6OVBK5/Programs/Qt/6.1.3/msvc2019_64") find_package(Qt6 COMPONENTS Core @@ -14,6 +17,9 @@ find_package(Qt6 COMPONENTS Widgets REQUIRED) +qt6_add_resources(QRC_FILES ${QRC_SOURCE_FILES}) +SOURCE_GROUP("Resource Files" FILES ${QRC_SOURCE_FILES}) + include_directories( ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/src/header @@ -21,7 +27,7 @@ include_directories( aux_source_directory(${PROJECT_SOURCE_DIR}/src SRCS) -add_executable(auto_bus_gui main.cpp ${SRCS}) +add_executable(auto_bus_gui main.cpp ${SRCS} ${QRC_FILES}) target_link_libraries(auto_bus_gui Qt::Core diff --git a/Resources.qrc b/Resources.qrc new file mode 100644 index 0000000..7b310db --- /dev/null +++ b/Resources.qrc @@ -0,0 +1,8 @@ + + + picture/stop.png + + + picture/bus.png + + \ No newline at end of file diff --git a/picture/bus.png b/picture/bus.png new file mode 100644 index 0000000..91ff966 Binary files /dev/null and b/picture/bus.png differ diff --git a/picture/stop.png b/picture/stop.png new file mode 100644 index 0000000..26ce901 Binary files /dev/null and b/picture/stop.png differ