On 04/24/2015 05:43 PM, James Bigler wrote: > This new policy breaks a long standing feature of FindCUDA. > > Basically I could add the MAIN_DEPENDENCY to all CUDA files built. > If the same CUDA file was used in multiple custom commands it would > attach the build rule to the first command, and leave the remaining > ones as "phantom" .rule files in the project.
The policy was added to diagnose some previously-broken cases earlier. We technically never supported duplicate MAIN_DEPENDENCY specification but did not diagnose it. Instead it could produce bad builds in some cases IIRC. Nils, do you remember where this came up? It is also somewhat non-sensical to use MAIN_DEPENDENCY for more than one rule for the same source file. The purpose of it is to attach the rule as the custom command for building the source file in VS IDE project files. VS allows only one custom command for building a given source. > should I push/pop the policy in FindCUDA.cmake? No. Never set a policy to OLD in new code, and certainly not in upstream CMake. You could record in a source file property whether a source has been used as the MAIN_DEPENDENCY for something else and then use plain DEPENDS for later rules that depend on the source. -Brad -- 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-developers