[cmake-developers] linked-usage-cleanup regressed automoc
Stephen Kelly
steveire at gmail.com
Thu Mar 14 15:15:09 EDT 2013
Brad King wrote:
> On 03/14/2013 01:43 PM, Alexander Neundorf wrote:
>> Would you object a check that if a target has at least one C or Fortran
>> source file, but no C++ source file, it should skipped for automoc ?
>
> I was thinking about that approach too. Basically if the target
> has at least one C++ source or *no sources from any language*
> then we should honor AUTOMOC.
That idea has the same problem that it works in current releases:
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index ebfbb03..1ac6f3b 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -44,3 +44,7 @@ set_target_properties(empty PROPERTIES AUTOMOC TRUE)
target_link_libraries(empty no_link_language)
add_library(no_link_language STATIC empty.h)
set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE)
+
+add_library(empty_c STATIC empty.c)
+set_target_properties(empty_c PROPERTIES AUTOMOC TRUE)
+target_link_libraries(empty_c no_link_language)
Thanks,
Steve.
More information about the cmake-developers
mailing list