From 54705d060c71cb0438ceb2c9ee947052590e5eb9 Mon Sep 17 00:00:00 2001 From: crackedmind Date: Tue, 17 Apr 2018 20:14:37 +0300 Subject: [PATCH] Apply patch to fix compile with cmake 3.11 --- cotire/CMake/cotire.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cotire/CMake/cotire.cmake b/cotire/CMake/cotire.cmake index 97275d649..a92405d88 100644 --- a/cotire/CMake/cotire.cmake +++ b/cotire/CMake/cotire.cmake @@ -260,6 +260,18 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar message (STATUS "Cotired ${_target} ${_language} sources: ${_cotiredSourceFiles}") endif() endif() + get_target_property(_targetAutoMoc ${_target} AUTOMOC) + get_target_property(_targetAutoUic ${_target} AUTOUIC) + get_target_property(_targetAutoRcc ${_target} AUTORCC) + if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc) + # if the original target sources are subject to CMake's automatic Qt processing, + # also include implicitly generated _automoc.cpp file + if (CMAKE_VERSION VERSION_LESS "3.8.0") + list (APPEND _sourceFiles "${CMAKE_CURRENT_BINARY_DIR}/${_target}_automoc.cpp") + else() + list (APPEND _sourceFiles "${CMAKE_CURRENT_BINARY_DIR}/${_target}_autogen/mocs_compilation.cpp") + endif() + endif() set (${_sourceFilesVar} ${_sourceFiles} PARENT_SCOPE) set (${_excludedSourceFilesVar} ${_excludedSourceFiles} PARENT_SCOPE) set (${_cotiredSourceFilesVar} ${_cotiredSourceFiles} PARENT_SCOPE)