On 09/27/2015 08:47 PM, Michael Catanzaro wrote: > CMake Warning (dev): > Policy CMP0058 is not set: Ninja requires custom command byproducts to be > explicit. Run "cmake --help-policy CMP0058" for policy details. Use the > cmake_policy command to set the policy and suppress this warning.
Add this code to the project: if(POLICY CMP0058) cmake_policy(SET CMP0058 NEW) endif() just after any cmake_minimum_required(VERSION) call that does not specify at least CMake 3.3. This will set the policy to NEW and get the new behavior with no warning. In the future when the project's call to cmake_minimum_required(VERSION) specifies 3.3 or higher then this explicit policy setting can be removed. > This project specifies custom command DEPENDS on files in the build tree > that are not specified as the OUTPUT or BYPRODUCTS of any > add_custom_command or add_custom_target: [snip] > But DerivedSources/webkit2gtk/WebKit2ResourcesGResourceBundle.xml is > not generated by add_custom_command or add_custom_target The warning says the file is in the DEPENDS of a custom command, which it is. The warning also says that the file is not specified as generated by a custom command, which it isn't. This is a case for which the warning was intended. > it's generated by the file command (in > WebKit/Source/WebKit2/PlatformGTK.cmake [1]): > > file(WRITE > ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/WebKit2ResourcesGResourceBundle.xml [snip] > So there's no way to specify it as a BYPRODUCT. [snip] > For compatibility with versions of CMake that did not have the BYPRODUCTS > option, CMake is generating phony rules for such files to convince 'ninja' > to build. CMake is warning that it now prefers to generate the Ninja build file for this case a different way than it did before but is doing it the old way for compatibility just in case the project needs that to build. In this case we know we are providing the file ourselves so it is safe to allow CMake to generate the build file without the extra phony rule. One can set the policy to NEW to get the new preferred behavior, but this has to be done in the project itself once it is known that the new behavior works for the project. See the full policy documentation here for more details: https://cmake.org/cmake/help/v3.3/policy/CMP0058.html -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