[cmake-developers] Target usage requirements and conventions
Brad King
brad.king at kitware.com
Thu May 17 10:00:48 EDT 2012
On 05/17/2012 09:25 AM, Stephen Kelly wrote:
>> "$<IF($<CONFIGURATION> MATCHES Debug AND $<LANGUAGE> STREQUALS CXX)...>"
>>
>> I'm not sure what should go in the "..." part though. Some syntax to
>> delimit the then/else values would be needed.
>
> I'm not sure else() and endif() are needed as additional expressions could
> be added for those.
We may not need the "else" part but we still need a strict and extensible
syntax to delimit the value in the "..." part above.
> Perhaps we can get object-orientated:
>
> populate_target_usage_requirements(
> NAME fooRequirements
> [PUBLIC|PRIVATE]
> INCLUDE_DIRECTORIES "/foo/bar"
> INCLUDE_DIRECTORIES "/bat/bug" IF $<CMAKE_BUILD_TYPE> MATCHES Debug
> COMPILE_DEFINITIONS "-DQT_CORE_LIB"
> COMPILE_DEFINITIONS "-DQT_GUI_LIB" IF BUILD_TESTING
> )
I think it will be hard to define the reach to the left of IF in
non-trivial cases, especially when the arguments are built up inside
a variable and some parts might end up empty. Also the result of this
command will still need to be stored in the property as some kind of
generator expression, so we still need to define such an expression.
-Brad
More information about the cmake-developers
mailing list