2017-10-24 9:33 GMT+02:00 Eric Noulard <eric.noul...@gmail.com>: > > > Le 16 oct. 2017 23:54, "J. Paul Reed" <pr...@releng-approaches.com> a > écrit : > > > Hey all, > > I have a (potentially?) odd situation: I need to generate multiple packages > using CPack from the same CMake project. > > [...]
> > I see where this message() gets emitted > (https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/ > CPack.cmake#L298-302); > perusing that file, it seems to do things I basically want/need (setting > various defaults, etc.) if I want to use cpack with a different config > file. > > > Hi there, > As you already discovered I was the author of this warning some years ago > when I was actively working on CPack. The reason for this was to make it > clear that even include(CPack) may look (and somehow behave) like a > function call creating a CPack config set of files. It is not. It wasn't > designed for that usage and it may generate weird content on a second (or > more) inclusion. > Some people were occasionally bitten by that. > e.g. since it inspects variable (in the current scope which was initially > global) beginning with CPACK_ prefix for doing its work, when you use it > twice it does not ensure or cleanup variables that may be there due to the > first inclusion. This would be up to the user to clean leftover before > successive inclusion. > > To summarize, this is a pure macro processing, not a function call. > > It would be nice to have a cpack_xxx function which safely implements the > behaviour you seek. That was on my wishlist some time but I never get the > time to implement it. (There may be some old mantis bug report for that > wish, I'll dig into it and come back here if I find something interesting). > After some digging I found that the issue on gitlab is this one, https://gitlab.kitware.com/cmake/cmake/issues/1075. It refers to the original Mantis issue years ago. I guess that the feature (multiple CPack calls) may be useful to some CPack users. I have no time to work on this but I put the ref here in order to make the reference accessible. -- Eric
-- 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