[CMake] 2.8.11-rc3 generator expression error

Stephen Kelly steveire at gmail.com
Thu Apr 25 03:34:25 EDT 2013


Brad King wrote:

> $ cmake .. -G"Xcode"
> ...
> CMake Error at CMakeLists.txt:5 (target_link_libraries):
>   Error evaluating generator expression:
> 
>     $<TARGET_PROPERTY:$<$<CONFIG:DEBUG>:A>,INTERFACE_INCLUDE_DIRECTORIES>
> 
>   $<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name.
> ...

I haven't had time to investigate fully, but this patch should 'fix' the 
problem:

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 66c22b1..8174ac2 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2947,8 +2947,8 @@ std::vector<std::string> 
cmTarget::GetIncludeDirectories(const char *config)
       }
       cmGeneratorExpression ge(it->Backtrace);
       cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(
-          "$<TARGET_PROPERTY:" +
-                              it->Value + 
",INTERFACE_INCLUDE_DIRECTORIES>");
+          "$<$<BOOL:" + it->Value + ">:$<TARGET_PROPERTY:" +
+                              it->Value + 
",INTERFACE_INCLUDE_DIRECTORIES>>");
 
       this->Internal-
>CachedLinkInterfaceIncludeDirectoriesEntries.push_back(
                         new cmTargetInternals::IncludeDirectoriesEntry(cge,


I'll investigate later to see if it's the right fix and why.

Thanks,

Steve.




More information about the CMake mailing list