From a223a3b65f518f59a73967f0087b0d67842d9f0d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 11 Mar 2013 23:26:38 +0100 Subject: Automoc: Don't create automoc targets if Qt is not used (#13999) Commit 79568f95 (automoc: Add source file to target early to set the linker language, 2013-02-20) changed automoc initialization to a two step process. In the first step, the generated source file was added to the target, which allows the link language to be determined. However, this bypassed the check for the availability of Qt itself. At build-time the automoc file could not be generated because the moc tool was not available to create it. The solution is to only add the automoc file to the target if Qt is found. --- Tests/QtAutomocNoQt/CMakeLists.txt | 7 +++++++ Tests/QtAutomocNoQt/main.c | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 Tests/QtAutomocNoQt/CMakeLists.txt create mode 100644 Tests/QtAutomocNoQt/main.c (limited to 'Tests/QtAutomocNoQt') diff --git a/Tests/QtAutomocNoQt/CMakeLists.txt b/Tests/QtAutomocNoQt/CMakeLists.txt new file mode 100644 index 0000000000..b26e471174 --- /dev/null +++ b/Tests/QtAutomocNoQt/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8) + +project(QtAutomocNoQt) + +set(CMAKE_AUTOMOC ON) + +add_executable(hello main.c) diff --git a/Tests/QtAutomocNoQt/main.c b/Tests/QtAutomocNoQt/main.c new file mode 100644 index 0000000000..8488f4e58f --- /dev/null +++ b/Tests/QtAutomocNoQt/main.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} -- cgit v1.2.1