summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-06-14 11:10:03 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-09-13 16:23:56 (GMT)
commitfddd0f0443b4ce81d61f15ee1b2f13105967b25a (patch)
tree46e0ed1f11a9ac721672977758c2a628478cba32 /Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
parent10b09647f2699b32c3d243f595437cb1c63049e2 (diff)
downloadCMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.zip
CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.gz
CMake-fddd0f0443b4ce81d61f15ee1b2f13105967b25a.tar.bz2
Autogen: AUTO*_EXECUTABLE: add support for per-config values
* Per-config values were added to `AUTO*_EXECUTABLE`. * Dependency order was refactored for `cmake_autogen` and `cmake_autorcc` to avoid unnecessary rebuilds. * A new parameter was added for `cmake_autogen` and `cmake_autorcc` to specify the config name of the `auto*_executable` to be used. * The timestamp target was split into three targets for per-config to avoid redundant `mocs_compilation` builds. * Per-config `DEP_FILE_RULE_NAME` values were added to `AutogenInfo.json` for `CMAKE_CROSS_CONFIG` usage. * Some functions were refactored to avoid code duplication. Fixes: #20074
Diffstat (limited to 'Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake')
-rw-r--r--Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake b/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
new file mode 100644
index 0000000..a0e9ce9
--- /dev/null
+++ b/Tests/RunCMake/Autogen/AutoRccExecutableConfig.cmake
@@ -0,0 +1,24 @@
+enable_language(CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core Widgets Gui)
+
+if(NOT TARGET Qt${with_qt_version}::rcc)
+ message(FATAL_ERROR "Qt${with_qt_version}::rcc not found")
+endif()
+
+add_library(dummy STATIC example.cpp data.qrc)
+target_link_libraries(dummy Qt${with_qt_version}::Core
+ Qt${with_qt_version}::Widgets
+ Qt${with_qt_version}::Gui)
+
+get_target_property(rcc_location Qt${with_qt_version}::rcc IMPORTED_LOCATION)
+set_target_properties(dummy PROPERTIES AUTORCC_OPTIONS "EXE_PATH=${rcc_location}")
+
+add_executable(myrcc $<$<CONFIG:Debug>:exe_debug.cpp>
+ $<$<CONFIG:Release>:exe_release.cpp>
+ $<$<CONFIG:RelWithDebInfo>:exe_relwithdebinfo.cpp>
+)
+
+set_target_properties(dummy PROPERTIES AUTORCC_EXECUTABLE $<TARGET_FILE:myrcc>
+ AUTORCC ON)