Re: [CMake] can I make an AUTOMOC generated file depend on something ?
Kim Rydhof Thor Hansen wrote: > On Wed, Feb 25, 2015 at 10:45 PM, Stephen Kelly > wrote: >> Kim Rydhof Thor Hansen wrote: >> >>> http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html >>> >>> I have a similar problem because automoc doesn't pick up that my >>> metadata.json file is a dependency to the generated moc_plugin.cpp >>> when building a Qt plugin >> >> Thanks for the testcase. I filed >> >> http://public.kitware.com/Bug/view.php?id=15419 >> >> with more information on what should be done to fix this. > > Thanks for your work on this. > > I can't find a good workaround, I tried using autoget_target_depends > without success but I suspect that it is because I have done something > wrong. > > Can anyone suggest a line to put in CMakeLists.txt in order to > manually register the dependency between metadata.json and > moc_plugin.cpp? A workaround would have to be based on changing the timestamp of the .h file. Here's an ugly workround: add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/metadata.json" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/metadata.json.in" "${CMAKE_CURRENT_BINARY_DIR}/metadata.json" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/plugin.h.in" "${CMAKE_CURRENT_BINARY_DIR}/plugin.h" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/metadata.json.in" "${CMAKE_CURRENT_SOURCE_DIR}/plugin.h.in" ) set_property(TARGET plugin PROPERTY AUTOGEN_TARGET_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/metadata.json") Depending on how you order your include directories, you might not have to rename the .h. Thanks, Steve. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] can I make an AUTOMOC generated file depend on something ?
On Wed, Feb 25, 2015 at 10:45 PM, Stephen Kelly wrote: > Kim Rydhof Thor Hansen wrote: > >> http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html >> >> I have a similar problem because automoc doesn't pick up that my >> metadata.json file is a dependency to the generated moc_plugin.cpp >> when building a Qt plugin > > Thanks for the testcase. I filed > > http://public.kitware.com/Bug/view.php?id=15419 > > with more information on what should be done to fix this. Thanks for your work on this. I can't find a good workaround, I tried using autoget_target_depends without success but I suspect that it is because I have done something wrong. Can anyone suggest a line to put in CMakeLists.txt in order to manually register the dependency between metadata.json and moc_plugin.cpp? Regards, -- Kim Rydhof Thor Hansen Vadgårdsvej 3, 2. tv. 2860 Søborg Phone: +45 3091 2437 -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] can I make an AUTOMOC generated file depend on something ?
Kim Rydhof Thor Hansen wrote: > http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html > > I have a similar problem because automoc doesn't pick up that my > metadata.json file is a dependency to the generated moc_plugin.cpp > when building a Qt plugin Thanks for the testcase. I filed http://public.kitware.com/Bug/view.php?id=15419 with more information on what should be done to fix this. Thanks, Steve. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] can I make an AUTOMOC generated file depend on something ?
Martin Koller wrote: > What rules can I add so that the tar extraction is done BEFORE the moc > generation ? You can add depends in the AUTOGEN_TARGET_DEPENDS target property of particular targets. http://www.cmake.org/cmake/help/v3.0/prop_tgt/AUTOGEN_TARGET_DEPENDS.html Please try that out. It will require you to set it on each target. If that's too suboptimal, we can think about adding an additional convenience interface. Thanks, Steve. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake