Using alias targets in CMake
<p>When defining CMake targets one can create alias targets so that the alias name can be used to refer to the defined target in subsequent commands. For instance</p>

<pre><code>add_library(foo_lib foo.cpp bar.cpp bat.cpp)
add_library(foo::lib ALIAS foo_lib)
</code></pre>

<p>As far as I understood it, this has the advantage that the name <code>foo_lib</code> doens't appear as a make target. However, given such an alias name I'd like to set all kinds of properties to them such as:</p>

<pre><code>set_target_properties(foo::lib PROPERTIES COMPILE_DEFINITIONS ...)
target_include_directories(foo::lib PUBLIC ... PRIVATE ...)
</code></pre>

<p>but this is not possible unfortunately, since <em>CMake Error: set_target_properties can not be used on an ALIAS target</em>. I don't see why this shouldn't be possible as I'd like to define the name of my lib once and refer to the given alias whenever I want to adjust a property of the target. Any hints on how to use ALIAS targets "correctly"? What is the purpose of ALIAS targets other than they're not appearing as Make targets then?</p>