How to report deprecated functionalities (subdirs, install_files...)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to report deprecated functionalities (subdirs, install_files...)

Mathieu Malaterre
Hi there,

  I would like cmake to report any deprecated functionalities still
being in use on my project (it would ideally return the filename +
line number where it is being used). I was not able to find a way of
doing that. Typically I would like to get rid of call to
install_files() and subdirs() within an in-house project.

Thanks,
--
Mathieu
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

David Cole
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... :-)

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?


On Thu, Jul 16, 2009 at 10:22 AM, Mathieu Malaterre <[hidden email]> wrote:
Hi there,

 I would like cmake to report any deprecated functionalities still
being in use on my project (it would ideally return the filename +
line number where it is being used). I was not able to find a way of
doing that. Typically I would like to get rid of call to
install_files() and subdirs() within an in-house project.

Thanks,
--
Mathieu
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

Mathieu Malaterre
On Thu, Jul 16, 2009 at 4:32 PM, David Cole<[hidden email]> 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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

Michael Jackson


On Jul 16, 2009, at 10:41 AM, Mathieu Malaterre wrote:

> On Thu, Jul 16, 2009 at 4:32 PM, David Cole<[hidden email]>  
> 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
>

This is from 2.6.4 list of "Compatibility Commands". I would say put  
this into a file called "CheckDeprecated.cmake" and include it into  
your top level project?


function(build_name)
   message(FATAL_ERROR "error: using deprecated build_name")
endfunction()
function(exec_program)
   message(FATAL_ERROR "error: using deprecated exec_program")
endfunction()
function(export_library_dependencies)
   message(FATAL_ERROR "error: using deprecated  
export_library_dependencies")
endfunction()
function(install_files)
   message(FATAL_ERROR "error: using deprecated install_files")
endfunction()
function(install_programs)
   message(FATAL_ERROR "error: using deprecated install_programs")
endfunction()
function(install_targets)
   message(FATAL_ERROR "error: using deprecated install_targets")
endfunction()
function(link_libraries)
   message(FATAL_ERROR "error: using deprecated link_libraries")
endfunction()
function(make_directory)
   message(FATAL_ERROR "error: using deprecated make_directory")
endfunction()
function(remove)
   message(FATAL_ERROR "error: using deprecated remove")
endfunction()
function(subdir_depends)
   message(FATAL_ERROR "error: using deprecated subdir_depends")
endfunction()
function(subdirs)
   message(FATAL_ERROR "error: using deprecated subdirs")
endfunction()
function(use_mangled_mesa)
   message(FATAL_ERROR "error: using deprecated use_mangled_mesa")
endfunction()
function(utility_source)
   message(FATAL_ERROR "error: using deprecated utility_source")
endfunction()
function(variable_requires)
   message(FATAL_ERROR "error: using deprecated variable_requires")
endfunction()
function(write_file)
   message(FATAL_ERROR "error: using deprecated write_file")
endfunction()

Mike

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

Mathieu Malaterre
On Thu, Jul 16, 2009 at 4:58 PM, Michael
Jackson<[hidden email]> wrote:

>
>
> On Jul 16, 2009, at 10:41 AM, Mathieu Malaterre wrote:
>
>> On Thu, Jul 16, 2009 at 4:32 PM, David Cole<[hidden email]> 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
>>
>
> This is from 2.6.4 list of "Compatibility Commands". I would say put this
> into a file called "CheckDeprecated.cmake" and include it into your top
> level project?
>
>
> function(build_name)
>  message(FATAL_ERROR "error: using deprecated build_name")
> endfunction()

<...>

Awesome ! Thank you very much :)

--
Mathieu
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

Mathieu Malaterre
On Thu, Jul 16, 2009 at 5:01 PM, Mathieu
Malaterre<[hidden email]> wrote:

> On Thu, Jul 16, 2009 at 4:58 PM, Michael
> Jackson<[hidden email]> wrote:
>>
>>
>> On Jul 16, 2009, at 10:41 AM, Mathieu Malaterre wrote:
>>
>>> On Thu, Jul 16, 2009 at 4:32 PM, David Cole<[hidden email]> 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
>>>
>>
>> This is from 2.6.4 list of "Compatibility Commands". I would say put this
>> into a file called "CheckDeprecated.cmake" and include it into your top
>> level project?
>>
>>
>> function(build_name)
>>  message(FATAL_ERROR "error: using deprecated build_name")
>> endfunction()
>
> <...>
>
> Awesome ! Thank you very much :)

I thought I would be able to use a warning instead of an error, now
that I know how to report it to cdash, but the following fails ...
recursively :)

function(SUBDIRS)
  message(STATUS "Warning: using deprecated SUBDIRS")
  SUBDIRS( ${ARGV} )
endfunction()


--
Mathieu
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to report deprecated functionalities (subdirs, install_files...)

Alexander Neundorf-3
On Thursday 16 July 2009, Mathieu Malaterre wrote:
> On Thu, Jul 16, 2009 at 5:01 PM, Mathieu
>
> Malaterre<[hidden email]> wrote:
> > On Thu, Jul 16, 2009 at 4:58 PM, Michael
> >
> > Jackson<[hidden email]> wrote:
> >> On Jul 16, 2009, at 10:41 AM, Mathieu Malaterre wrote:
> >>> On Thu, Jul 16, 2009 at 4:32 PM, David Cole<[hidden email]>
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
> >>
> >> This is from 2.6.4 list of "Compatibility Commands". I would say put
> >> this into a file called "CheckDeprecated.cmake" and include it into your
> >> top level project?
> >>
> >>
> >> function(build_name)
> >>  message(FATAL_ERROR "error: using deprecated build_name")
> >> endfunction()
> >
> > <...>
> >
> > Awesome ! Thank you very much :)
>
> I thought I would be able to use a warning instead of an error, now
> that I know how to report it to cdash, but the following fails ...
> recursively :)
>
> function(SUBDIRS)
>   message(STATUS "Warning: using deprecated SUBDIRS")
>   SUBDIRS( ${ARGV} )
> endfunction()

The overridden command gets an underscore prepended, so you can call
_subdirs() to get the original one.

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Loading...