From 56a7d842b5ea4e32e94ca7a2b9165f9a38d535ca Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 25 Aug 2019 18:27:40 -0400 Subject: [PATCH] CMakeLists: Set CMAKE_AUTORCC Allows the build system to automatically handle qrc resource files automatically without having to do all the manual book keeping. --- Editor/CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 148257f..656be6a 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -1,13 +1,12 @@ cmake_minimum_required(VERSION 3.10) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -# Automatically handle invoking moc +# Automatically handle invoking autorcc, moc, and uic. set(CMAKE_AUTOMOC ON) - -# Automatically handle invoking uic +set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + find_package(Qt5 COMPONENTS LinguistTools Network Qml Svg Widgets Xml REQUIRED) configure_file(resources/translation_res.qrc translation_res.qrc @ONLY) @@ -16,9 +15,6 @@ set(TRANSLATIONS ) QT5_CREATE_TRANSLATION(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../lib ${TRANSLATIONS}) -QT5_ADD_RESOURCES(qrc_resources.cpp resources/resources.qrc) -QT5_ADD_RESOURCES(qrc_translation_res.cpp ${CMAKE_CURRENT_BINARY_DIR}/translation_res.qrc OPTIONS -no-compress) - add_executable(amuse-gui WIN32 MACOSX_BUNDLE ADSREditor.cpp ADSREditor.hpp @@ -58,9 +54,8 @@ add_executable(amuse-gui WIN32 MACOSX_BUNDLE main.cpp - qrc_resources.cpp - qrc_translation_res.cpp resources/resources.qrc + ${CMAKE_CURRENT_BINARY_DIR}/translation_res.qrc ${QM_FILES} )