[cmake-developers] Generator expressions for <archive|library|runtime> output directory

Robert Goulet Robert.Goulet at autodesk.com
Fri Jul 17 14:34:09 EDT 2015


I'm going to be away for a few weeks, is it ok if the master branch stays in that state for a while?

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: Friday, July 17, 2015 11:47 AM
To: Robert Goulet
Cc: Stephen Kelly; cmake-developers at cmake.org
Subject: Re: [cmake-developers] Generator expressions for <archive|library|runtime> output directory

On 07/17/2015 10:55 AM, Robert Goulet wrote:
> Ok I'd like to fix the crash, what is the clean way to deal with this 
> kind of situation? I'm guessing this might be a problem that was 
> solved elsewhere for other cases before?

I don't recall other cases where this specific problem has come up.  There is code to deal with generator expression reference cycles e.g. for $<TARGET_PROPERTY:...> expressions but that is not quite the same thing.

For the OUTPUT_DIRECTORY case the GetOutputInfo method:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTarget.cxx;hb=v3.3.0-rc4#l2612

memoizes the ComputeOutputDir result in a map.  Currently it does not update the map until after computing the value.  You could try teaching it to insert a placeholder (empty?) value in the map first.  Then in the check for an existing map entry, if it is found to contain the placeholder then you know recursion is occurring and you can diagnose it with an error message and return early.

The GetOutputName method could be refactored to use a map and then work the same way.

Thanks,
-Brad



More information about the cmake-developers mailing list