Adding qrc icon resource to a CMake Qt project
Unsolved
General and Desktop
-
Can you show your CMakeList.txt file ?
-
@SGaist said in Adding qrc icon resource to a CMake Qt project:
Can you show your CMakeList.txt file ?
I've tried it with GLOB for qrc or directly adding a qrc to the executable (custom cmake function in my case)
/ file(GLOB source_files *.c *.cpp *.qrc) file(GLOB header_files *.h *.hpp *.txt) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5WebEngineWidgets REQUIRED) find_package(Qt5WebChannel REQUIRED) qt5_add_resources(COLYOO_QT_RESOURCES app.qrc web.qrc) message(STATUS "SLEIDEBUG:${COLYOO_QT_RESOURCES}") # add the GUI WIN32 executable cyo_add_executable(${PROJECT_NAME} WIN32 ${source_files} ${header_files} chatwidget.ui ${COLYOO_QT_RESOURCES})
-
@Slei said in Adding qrc icon resource to a CMake Qt project:
COLYOO_QT_RESOURCES
ok i think it works now, for whatever reason I'll test it a few times to be 100% sure, thsi is my current cmakelists.txt
# search all source and header files file(GLOB source_files *.c *.cpp *.qrc) file(GLOB header_files *.h *.hpp *.txt) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) find_package(Qt5Widgets REQUIRED) find_package(Qt5WebEngineWidgets REQUIRED) find_package(Qt5WebChannel REQUIRED) #qt5_add_resources(COLYOO_QT_RESOURCES app.qrc web.qrc) message(STATUS "SLEIDEBUG:${COLYOO_QT_RESOURCES}") # add the GUI WIN32 executable cyo_add_executable(${PROJECT_NAME} WIN32 ${source_files} ${header_files} chatwidget.ui ${COLYOO_QT_RESOURCES})
but i think i tried this version once before and it didn't work lol ._.