[CMake] Set target property default

Braden McDaniel braden at endoframe.com
Tue Mar 12 20:07:03 EDT 2013


Is there some way to set the default value for a target property?  That is, I have a flag that I'd like to apply to *everything* without setting it for each specific target.

Specifically, I'm trying to use Whole Program Optimization in Visual Studio.  As I understand it, I need to add "/LTCG" to the target-specific property STATIC_LIBRARY_FLAGS.  But setting this for every static library individually is rather fragile.

I found:

  http://www.itk.org/Bug/view.php?id=9831

That bug seems to describe what I want; but it looks like it was closed on the basis of a fix that addresses a different problem, yet happens to satisfy the specific example given in the bug report. 

Is there some way to do what I want already implemented in CMake?  Should that bug be reopened?

-- 
Braden McDaniel
braden at endoframe.com



More information about the CMake mailing list