0e346427a2
In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input changes, 2014-09-17) the "cmake -E cmake_autogen" rule was switched from always running to running as a custom command with dependencies if rcc is enabled. This is not correct because automoc always needs to re-run. Switch back to always running the command.
28 lines
639 B
CMake
28 lines
639 B
CMake
cmake_minimum_required(VERSION 3.1)
|
|
project(automoc_rerun CXX)
|
|
|
|
if (QT_TEST_VERSION STREQUAL 4)
|
|
find_package(Qt4 REQUIRED)
|
|
set(QT_CORE_TARGET Qt4::QtCore)
|
|
else()
|
|
if (NOT QT_TEST_VERSION STREQUAL 5)
|
|
message(SEND_ERROR "Invalid Qt version specified.")
|
|
endif()
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
set(QT_CORE_TARGET Qt5::Core)
|
|
endif()
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
configure_file(test1.h.in1 test1.h COPYONLY)
|
|
|
|
add_executable(test1
|
|
${CMAKE_CURRENT_BINARY_DIR}/test1.h
|
|
test1.cpp
|
|
res1.qrc
|
|
)
|
|
target_include_directories(test1 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
target_link_libraries(test1 ${QT_CORE_TARGET})
|