summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutomocNoQt
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-03-11 22:26:38 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-12 21:42:02 (GMT)
commita223a3b65f518f59a73967f0087b0d67842d9f0d (patch)
tree19c8549420d979a291f91474aabad4b43f7a9c17 /Tests/QtAutomocNoQt
parent65b5c1e0645a466dbf5d163296754d12e2db53d5 (diff)
downloadCMake-a223a3b65f518f59a73967f0087b0d67842d9f0d.zip
CMake-a223a3b65f518f59a73967f0087b0d67842d9f0d.tar.gz
CMake-a223a3b65f518f59a73967f0087b0d67842d9f0d.tar.bz2
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.
Diffstat (limited to 'Tests/QtAutomocNoQt')
-rw-r--r--Tests/QtAutomocNoQt/CMakeLists.txt7
-rw-r--r--Tests/QtAutomocNoQt/main.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/QtAutomocNoQt/CMakeLists.txt b/Tests/QtAutomocNoQt/CMakeLists.txt
new file mode 100644
index 0000000..b26e471
--- /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 0000000..8488f4e
--- /dev/null
+++ b/Tests/QtAutomocNoQt/main.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}