From cf3faacad2aff9ac3c9f2d407b1823a75939160e Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Fri, 11 Jan 2013 12:42:34 +0400 Subject: Automoc: Fix automoc for OBJECT libraries. Before this patch, add_library(obj OBJECT helper.cpp) add_executable(tgt $) didn't run automoc on helper.cpp. --- Source/cmGlobalGenerator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d030aa7..b431705 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1075,7 +1075,8 @@ void cmGlobalGenerator::CreateAutomocTargets() if(target.GetType() == cmTarget::EXECUTABLE || target.GetType() == cmTarget::STATIC_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY || - target.GetType() == cmTarget::MODULE_LIBRARY) + target.GetType() == cmTarget::MODULE_LIBRARY || + target.GetType() == cmTarget::OBJECT_LIBRARY) { if(target.GetPropertyAsBool("AUTOMOC") && !target.IsImported()) { -- cgit v0.12 From 0e35cac3d06bb89faa89ed4bf425f0978e828321 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Fri, 11 Jan 2013 13:40:13 +0400 Subject: Automoc: add OBJECT library to QtAutomoc test --- Tests/QtAutomoc/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt index 5e3686d..855fcf0 100644 --- a/Tests/QtAutomoc/CMakeLists.txt +++ b/Tests/QtAutomoc/CMakeLists.txt @@ -13,11 +13,14 @@ add_definitions(-DFOO -DSomeDefine="Barx") # enable relaxed mode so automoc can handle all the special cases: set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) -# create an executable and a library target, both requiring automoc: +# create an executable and two library targets, each requiring automoc: add_library(codeeditorLib STATIC codeeditor.cpp) -add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp xyz.cpp yaf.cpp private_slot.cpp) +add_library(privateSlot OBJECT private_slot.cpp) -set_target_properties(foo codeeditorLib PROPERTIES AUTOMOC TRUE) +add_executable(foo main.cpp calwidget.cpp foo.cpp blub.cpp bar.cpp abc.cpp + xyz.cpp yaf.cpp $) + +set_target_properties(foo codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE) target_link_libraries(foo codeeditorLib ${QT_LIBRARIES} ) -- cgit v0.12