[CMake] How to report deprecated functionalities (subdirs, install_files...)

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Jul 16 10:41:02 EDT 2009


On Thu, Jul 16, 2009 at 4:32 PM, David Cole<david.cole at kitware.com> wrote:
> There is not a built-in method of identifying code like that, although that
> would be a good feature request. Especially if it had a patch attached to
> it... :-)

I can open a feature request :-)

> You could try this at the top of your CMakeLists.txt file:
> function(SUBDIRS)
>   message(FATAL_ERROR "error: using deprecated SUBDIRS")
> endfunction()
> Does CMake give you line number information if you create such a function?

Yup, it does.


CMake Error at CMakeLists.txt:14 (message):
  error: using deprecated SUBDIRS
Call Stack (most recent call first):
  CMakeLists.txt:175 (SUBDIRS)

The second one is the one you are looking for, so this should work. I
just need to know how to pass Warning/Error to cdash now :)

Thanks,
-- 
Mathieu


More information about the CMake mailing list