Files
CMake/Tests/RunCMake/Autogen/AutoUicExecutableConfig.cmake
Orkun Tokdemir fddd0f0443 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
2023-09-13 18:23:56 +02:00

25 lines
929 B
CMake

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}::uic)
message(FATAL_ERROR "Qt${with_qt_version}::uic not found")
endif()
add_library(dummy STATIC example_ui.cpp uiA.ui)
target_link_libraries(dummy Qt${with_qt_version}::Core
Qt${with_qt_version}::Widgets
Qt${with_qt_version}::Gui)
get_target_property(uic_location Qt${with_qt_version}::uic IMPORTED_LOCATION)
set_target_properties(dummy PROPERTIES AUTOUIC_OPTIONS "EXE_PATH=${uic_location}")
add_executable(myuic $<$<CONFIG:Debug>:exe_debug.cpp>
$<$<CONFIG:Release>:exe_release.cpp>
$<$<CONFIG:RelWithDebInfo>:exe_relwithdebinfo.cpp>
)
set_target_properties(dummy PROPERTIES AUTOUIC_EXECUTABLE $<TARGET_FILE:myuic>
AUTOUIC ON)