[CMake] CMAKE_MFC_FLAG not working in functions

Robert Dailey rcdailey at gmail.com
Thu Oct 20 14:44:57 EDT 2011


On Thu, Oct 20, 2011 at 12:56 PM, Michael Hertling <mhertling at online.de>wrote:

> On 10/20/2011 06:59 PM, Robert Dailey wrote:
> > Let me ask this,
> >
> > What would be the parent of a function located in the root CMakeLists
> file
> > but called from a subordinate CMakeLists file?
>
> It's the subordinate CMakeLists.txt file's parent, but what Michael
> probably aims at is that some variables undergo a lazy evaluation,
> i.e. when you say
>
> set( CMAKE_MFC_FLAG 2 )
> add_executable( ... )
>
> in a function, and CMAKE_MFC_FLAG isn't evaluated till generation time,
> the value "2" will be lost since it is limited to the function's scope.
> See the following project for an example:


Does this lazy evaluation also apply to variables set with PARENT_SCOPE? If
so, that would explain why not even that helped.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111020/48f12ca5/attachment.htm>


More information about the CMake mailing list