[cmake-developers] Is this warning really needed: "You have called ADD_LIBRARY for library foobar without any source files."?

Brad King brad.king at kitware.com
Wed Jul 22 11:10:07 EDT 2015


On 07/22/2015 08:25 AM, Erik Sjölund wrote:
> I think this warning could be removed: "You have called ADD_LIBRARY
> for library foobar without any source files. This typically indicates
> a problem with your CMakeLists.txt file "

Yes, since we started allowing sources to be modified after the call
this warning no longer makes sense.  Instead we need to make sure there
is a proper diagnostic if at generate time no SOURCES are available.
Even if that is already the case we also need to make sure the test
suite covers the errors in Tests/RunCMake somewhere, perhaps in new
Tests/RunCMake/{add_library,add_executable} cases.

Thanks,
-Brad



More information about the cmake-developers mailing list