Stephen Kelly 734df96f5a Qt4: Fix moc command dependencies for incremental build.
Since commit v2.8.12~327^2 (Qt4Macros: Allow specifying a TARGET
in invokations of macros., 2013-02-26), a parameters file is
populated with moc arguments at generate-time.

When the compile definitions or include directories change, the
parameters file is updated but moc is not re-run in response.

Fix that by making the moc invocation depend on the parameters file.

Reported-At: https://bugreports.qt-project.org/browse/QTBUG-36970
2014-03-21 11:14:41 +01:00

14 lines
289 B
CMake

cmake_minimum_required(VERSION 2.8.12)
project(IncrementalMoc)
find_package(Qt4 REQUIRED)
qt4_generate_moc(foo.h moc_foo.cpp)
add_library(testlib foo.cpp moc_foo.cpp)
target_link_libraries(testlib Qt4::QtCore)
if (ADD_DEF)
target_compile_definitions(testlib PRIVATE NEW_DEF)
endif()