[Cmake-commits] CMake branch, next, updated. v2.8.9-672-g30dcd76

Stephen Kelly steveire at gmail.com
Fri Sep 21 07:40:25 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  30dcd76a972fdd6324a825ea7f3610ce08aec4a0 (commit)
       via  31cb4f4ed2e066de008296ccc7f96cfd996a8b59 (commit)
       via  58d8bd772984a00c6354f647e37c929474b82c10 (commit)
       via  9a4cb72a47d3a1e775873ea55581b21a1f965b68 (commit)
       via  70fc7fba4aeb86e247c242286c0a24e71d110993 (commit)
       via  616963c3c0cc8a91981d8f7c8f9a8f52c16cf488 (commit)
       via  d7166e687a8b56023a3180a481daa0653ba799dd (commit)
       via  e45fbe25d23e438a6b0b965ad154b649ff4e020b (commit)
       via  b8e61d687abfacf1d5ed3b10cfe20315a344620c (commit)
       via  2c2b25b203e653326c0f4064649da06a8cdfd7a5 (commit)
       via  b7e48e0acbd0cd30f803ec8c2d402c636beba778 (commit)
       via  9a160871d0bc4233a71dfbf2ffcc888a940bb921 (commit)
       via  4557c8db4813b4198fb7d64249e104bdcb828ae5 (commit)
       via  c6abc41eb5ece8fe10d08faf7792337a760d4251 (commit)
       via  0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c (commit)
       via  f178d531a6a75b3cbdaa0a3dec5e0aa8daca7d24 (commit)
      from  184d6b0b638a50aff483e1f3244800967030960a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=30dcd76a972fdd6324a825ea7f3610ce08aec4a0
commit 30dcd76a972fdd6324a825ea7f3610ce08aec4a0
Merge: 184d6b0 31cb4f4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Sep 21 07:40:21 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 21 07:40:21 2012 -0400

    Merge topic 'generator-expression-target-properties' into next
    
    31cb4f4 Process generator expressions in the COMPILE_DEFINITIONS target property.
    58d8bd7 Process generator expressions in the INCLUDE_DIRECTORIES property.
    9a4cb72 Early return if there is no target.
    70fc7fb Add a self-reference check for target properties.
    616963c Add API to check that dependent target properties form a DAG.
    d7166e6 Add a generator expression for target properties.
    e45fbe2 Extend the generator expression language with more logic.
    b8e61d6 Refactor GetCompileDefinitions a bit.
    2c2b25b Return a std::string from GetCompileDefinitions.
    b7e48e0 Add an AppendDefines std::string overload.
    9a16087 Convert paths in INCLUDE_DIRECTORIES property to Unix slashes.
    4557c8d Don't prepend a path before generator expressions in include_directories.
    c6abc41 Add include guard for cmGeneratorExpression.
    0ff4e3f Port remaining code to GetCompileDefinitions().
    f178d53 Fix indentation in the code blocks generator.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31cb4f4ed2e066de008296ccc7f96cfd996a8b59
commit 31cb4f4ed2e066de008296ccc7f96cfd996a8b59
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 23:28:09 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Process generator expressions in the COMPILE_DEFINITIONS target property.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 4485304..67cd721 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -341,5 +341,19 @@ std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
 
   const char *prop = this->Target->GetProperty(defPropName.c_str());
 
-  return prop ? prop : "";
+  if (!prop)
+    {
+    return "";
+    }
+
+  cmGeneratorExpression ge((cmListFileBacktrace()));
+
+  cmGeneratorExpressionDAGChecker dagChecker(cmListFileBacktrace(),
+                                             this->GetName(),
+                                             defPropName, 0, 0);
+  return ge.Parse(prop).Evaluate(this->Makefile,
+                                 config,
+                                 false,
+                                 this,
+                                 &dagChecker);
 }
diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp
index 6db6f3f..4a68a07 100644
--- a/Tests/CompileDefinitions/compiletest.cpp
+++ b/Tests/CompileDefinitions/compiletest.cpp
@@ -27,6 +27,15 @@ enum {
 #endif
 };
 
+#ifdef TEST_GENERATOR_EXPRESSIONS
+#ifndef CMAKE_IS_DECLARATIVE
+#error Expect declarative definition
+#endif
+#ifdef GE_NOT_DEFINED
+#error Expect not defined generator expression
+#endif
+#endif
+
 int main(int argc, char **argv)
 {
   return 0;
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index e2b6ba9..fcb22b0 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -7,3 +7,9 @@ set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAK
 
 set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun)
 set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun")
+
+set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
+  TEST_GENERATOR_EXPRESSIONS
+    "$<1:CMAKE_IS_DECLARATIVE>"
+    "$<0:GE_NOT_DEFINED>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt
new file mode 100644
index 0000000..2b22d0f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:COMPILE_DEFINITIONS>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake
new file mode 100644
index 0000000..74fff67
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions
+PROPERTY
+  COMPILE_DEFINITIONS "$<TARGET_PROPERTY:COMPILE_DEFINITIONS>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt
new file mode 100644
index 0000000..fe7caa3
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake
new file mode 100644
index 0000000..d6650d3
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+COMPILE_DEFINITIONS
+  "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
index 211e6e7..f2ff05b 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
@@ -4,3 +4,5 @@ run_cmake(BadSelfReference1)
 run_cmake(BadSelfReference2)
 run_cmake(BadSelfReference3)
 run_cmake(BadSelfReference4)
+run_cmake(BadSelfReference5)
+run_cmake(BadSelfReference6)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=58d8bd772984a00c6354f647e37c929474b82c10
commit 58d8bd772984a00c6354f647e37c929474b82c10
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Sep 18 13:57:07 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Process generator expressions in the INCLUDE_DIRECTORIES property.
    
    This use of generator expressions, like all others to come which operate
    on target properties, must initalize the dag checker.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3f58433..4485304 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -17,6 +17,8 @@
 #include "cmComputeLinkInformation.h"
 #include "cmGlobalGenerator.h"
 #include "cmSourceFile.h"
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorExpressionDAGChecker.h"
 
 #include <assert.h>
 
@@ -289,11 +291,26 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
 {
   std::vector<std::string> includes;
   const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES");
-  if(prop)
+  if(!prop)
     {
-    cmSystemTools::ExpandListArgument(prop, includes);
+    return includes;
     }
 
+  const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+  cmGeneratorExpression ge((cmListFileBacktrace()));
+
+  cmGeneratorExpressionDAGChecker dagChecker(cmListFileBacktrace(),
+                                              this->GetName(),
+                                              "INCLUDE_DIRECTORIES", 0, 0);
+
+  cmSystemTools::ExpandListArgument(ge.Parse(prop)
+                                    .Evaluate(this->Makefile,
+                                              config,
+                                              false,
+                                              this,
+                                              &dagChecker),
+                                    includes);
+
   std::set<std::string> uniqueIncludes;
   std::vector<std::string> orderedAndUniqueIncludes;
   for(std::vector<std::string>::const_iterator
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 334b8be..e51147a 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -12,13 +12,20 @@ create_header(bar)
 create_header(bat)
 create_header(foo)
 create_header(baz)
+create_header(bang)
+create_header(bing)
+create_header(bung)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
+include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>")
 
 add_executable(TargetIncludeDirectories main.cpp)
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
 set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY
+    INCLUDE_DIRECTORIES "$<1:${CMAKE_CURRENT_BINARY_DIR}/bing>")
 
 include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
+include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
index 8aa3532..4ecf9f8 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -3,6 +3,9 @@
 #include "bat.h"
 #include "foo.h"
 #include "baz.h"
+#include "bang.h"
+#include "bing.h"
+#include "bung.h"
 
 int main(int, char**)
 {
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 3ea54f1..2fa7141 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -46,6 +46,7 @@ macro(add_RunCMake_test test)
 endmacro()
 
 add_RunCMake_test(GeneratorExpression)
+add_RunCMake_test(TargetPropertyGeneratorExpressions)
 add_RunCMake_test(Languages)
 add_RunCMake_test(ObjectLibrary)
 
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt
new file mode 100644
index 0000000..791c4a9
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake
new file mode 100644
index 0000000..a85731e
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt
new file mode 100644
index 0000000..791c4a9
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake
new file mode 100644
index 0000000..f1459b8
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake
@@ -0,0 +1,9 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+  INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt
new file mode 100644
index 0000000..f60d726
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake
new file mode 100644
index 0000000..433b730
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake
@@ -0,0 +1,8 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories(
+  "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt
new file mode 100644
index 0000000..f60d726
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+  Error evaluating generator expression:
+
+    \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>
+
+  Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake
new file mode 100644
index 0000000..4b64459
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+           "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+           "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+INCLUDE_DIRECTORIES
+  "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
new file mode 100644
index 0000000..22577da
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+
+# MSVC creates extra targets which pollute the stderr unless we set this.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
new file mode 100644
index 0000000..211e6e7
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
@@ -0,0 +1,6 @@
+include(RunCMake)
+
+run_cmake(BadSelfReference1)
+run_cmake(BadSelfReference2)
+run_cmake(BadSelfReference3)
+run_cmake(BadSelfReference4)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a4cb72a47d3a1e775873ea55581b21a1f965b68
commit 9a4cb72a47d3a1e775873ea55581b21a1f965b68
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Aug 19 23:14:15 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Early return if there is no target.
    
    The remainder of this method depends on the target existing (otherwise
    the includes container would be empty), so make the code a little more
    readable.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 62b6ce7..3f6fe03 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1390,6 +1390,11 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
       }
     }
 
+  if(!target)
+    {
+    return;
+    }
+
   // Load implicit include directories for this language.
   std::string impDirVar = "CMAKE_";
   impDirVar += lang;
@@ -1407,10 +1412,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
 
   // Get the target-specific include directories.
   std::vector<std::string> includes;
-  if(target)
-    {
-    includes = target->GetIncludeDirectories();
-    }
+
+  includes = target->GetIncludeDirectories();
 
   // Support putting all the in-project include directories first if
   // it is requested by the project.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70fc7fba4aeb86e247c242286c0a24e71d110993
commit 70fc7fba4aeb86e247c242286c0a24e71d110993
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Sep 18 13:53:39 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Add a self-reference check for target properties.
    
    Prevent constructs like:
    
     ... INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>"
    
    Indirect self-references (cycles) are also prevented here, but
    indirect generator expression references of any kind are not
    possible yet anyway.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index acaf9f9..9fbc70a 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -14,6 +14,7 @@
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorExpressionParser.h"
 #include "cmGeneratorExpressionDAGChecker.h"
+#include "cmGeneratorExpression.h"
 
 //----------------------------------------------------------------------------
 static void reportError(cmGeneratorExpressionContext *context,
@@ -264,7 +265,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
                        const GeneratorExpressionContent *content,
-                       cmGeneratorExpressionDAGChecker *) const
+                       cmGeneratorExpressionDAGChecker *dagCheckerParent
+                      ) const
   {
     if (parameters.size() != 1 && parameters.size() != 2)
       {
@@ -289,6 +291,19 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
         }
       propertyName = parameters.at(1);
       }
+
+    cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
+                                               target->GetName(),
+                                               propertyName,
+                                               content,
+                                               dagCheckerParent);
+
+    if (!dagChecker.check())
+      {
+      dagChecker.reportError(context, content->GetOriginalExpression());
+      return std::string();
+      }
+
     const char *prop = target->GetProperty(propertyName.c_str());
     return prop ? prop : "";
   }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=616963c3c0cc8a91981d8f7c8f9a8f52c16cf488
commit 616963c3c0cc8a91981d8f7c8f9a8f52c16cf488
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Sep 18 13:42:23 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Add API to check that dependent target properties form a DAG.
    
    Initially this will only be used to check for self-references, but
    can be extended to check for cycles when chaining properties of other
    targets.

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 354f123..5a3e7d1 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -183,6 +183,8 @@ set(SRCS
   cmFileTimeComparison.cxx
   cmFileTimeComparison.h
   cmGeneratedFileStream.cxx
+  cmGeneratorExpressionDAGChecker.cxx
+  cmGeneratorExpressionDAGChecker.h
   cmGeneratorExpressionEvaluator.cxx
   cmGeneratorExpressionEvaluator.h
   cmGeneratorExpressionLexer.cxx
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 55a1e3e..3f8e962 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -19,6 +19,7 @@
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorExpressionLexer.h"
 #include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
 
 //----------------------------------------------------------------------------
 cmGeneratorExpression::cmGeneratorExpression(
@@ -66,7 +67,8 @@ cmGeneratorExpression::~cmGeneratorExpression()
 //----------------------------------------------------------------------------
 const char *cmCompiledGeneratorExpression::Evaluate(
   cmMakefile* mf, const char* config, bool quiet,
-  cmGeneratorTarget *target) const
+  cmGeneratorTarget *target,
+  cmGeneratorExpressionDAGChecker *dagChecker) const
 {
   if (!this->NeedsParsing)
     {
@@ -90,7 +92,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
 
   for ( ; it != end; ++it)
     {
-    this->Output += (*it)->Evaluate(&context);
+    this->Output += (*it)->Evaluate(&context, dagChecker);
     if (context.HadError)
       {
       this->Output = "";
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index fdf45a1..d37ce97 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -25,6 +25,7 @@ class cmMakefile;
 class cmListFileBacktrace;
 
 struct cmGeneratorExpressionEvaluator;
+struct cmGeneratorExpressionDAGChecker;
 
 class cmCompiledGeneratorExpression;
 
@@ -60,7 +61,8 @@ class cmCompiledGeneratorExpression
 public:
   const char* Evaluate(cmMakefile* mf, const char* config,
                        bool quiet = false,
-                       cmGeneratorTarget *target = 0) const;
+                       cmGeneratorTarget *target = 0,
+                       cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
 
   /** Get set of targets found during evaluations.  */
   std::set<cmTarget*> const& GetTargets() const
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
new file mode 100644
index 0000000..bfb0ddf
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -0,0 +1,106 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2012 Stephen Kelly <steveire at gmail.com>
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+
+#include "cmGeneratorExpressionDAGChecker.h"
+
+#include "cmMakefile.h"
+
+//----------------------------------------------------------------------------
+cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
+                const cmListFileBacktrace &backtrace,
+                const std::string &target,
+                const std::string &property,
+                const GeneratorExpressionContent *content,
+                cmGeneratorExpressionDAGChecker *parent)
+  : Parent(parent), Target(target), Property(property),
+    Content(content), Backtrace(backtrace)
+{
+  this->IsDAG = this->isDAG();
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::check() const
+{
+  return this->IsDAG;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorExpressionDAGChecker::reportError(
+                  cmGeneratorExpressionContext *context,
+                  const std::string &expr)
+{
+  if (this->IsDAG)
+    {
+    return;
+    }
+
+  context->HadError = true;
+  if (context->Quiet)
+    {
+    return;
+    }
+
+  const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+
+  if (parent && !parent->Parent)
+    {
+    cmOStringStream e;
+    e << "Error evaluating generator expression:\n"
+      << "  " << expr << "\n"
+      << "Self reference on target \""
+      << context->Target->GetName() << "\".\n";
+    context->Makefile->GetCMakeInstance()
+      ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+                      parent->Backtrace);
+    return;
+    }
+
+  {
+  cmOStringStream e;
+  e << "Error evaluating generator expression:\n"
+    << "  " << expr << "\n"
+    << "Dependency loop found.";
+  context->Makefile->GetCMakeInstance()
+    ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+                    context->Backtrace);
+  }
+
+  int loopStep = 1;
+  while (parent)
+    {
+    cmOStringStream e;
+    e << "Loop step " << loopStep << "\n"
+      << "  "
+      << (parent->Content ? parent->Content->GetOriginalExpression() : expr)
+      << "\n";
+    context->Makefile->GetCMakeInstance()
+      ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+                      parent->Backtrace);
+    parent = parent->Parent;
+    ++loopStep;
+    }
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::isDAG() const
+{
+  const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+  while (parent)
+    {
+    if (this->Target == parent->Target && this->Property == parent->Property)
+      {
+      return false;
+      }
+    parent = parent->Parent;
+    }
+  return true;
+}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
new file mode 100644
index 0000000..ffc84f8
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -0,0 +1,44 @@
+/*============================================================================
+  CMake - Cross Platform Makefile Generator
+  Copyright 2012 Stephen Kelly <steveire at gmail.com>
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+============================================================================*/
+#ifndef cmGeneratorExpressionDAGChecker_h
+#define cmGeneratorExpressionDAGChecker_h
+
+#include "cmStandardIncludes.h"
+
+#include "cmGeneratorExpressionEvaluator.h"
+
+//----------------------------------------------------------------------------
+struct cmGeneratorExpressionDAGChecker
+{
+  cmGeneratorExpressionDAGChecker(const cmListFileBacktrace &backtrace,
+                                  const std::string &target,
+                                  const std::string &property,
+                                  const GeneratorExpressionContent *content,
+                                  cmGeneratorExpressionDAGChecker *parent);
+
+  bool check() const;
+
+  void reportError(cmGeneratorExpressionContext *context,
+                   const std::string &expr);
+private:
+  bool isDAG() const;
+
+private:
+  const cmGeneratorExpressionDAGChecker * const Parent;
+  const std::string Target;
+  const std::string Property;
+  const GeneratorExpressionContent * const Content;
+  const cmListFileBacktrace Backtrace;
+  bool IsDAG;
+};
+
+#endif
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index fbe8dc1..acaf9f9 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -13,6 +13,7 @@
 
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
 
 //----------------------------------------------------------------------------
 static void reportError(cmGeneratorExpressionContext *context,
@@ -47,7 +48,8 @@ struct cmGeneratorExpressionNode
 
   virtual std::string Evaluate(const std::vector<std::string> &parameters,
                                cmGeneratorExpressionContext *context,
-                               const GeneratorExpressionContent *content
+                               const GeneratorExpressionContent *content,
+                               cmGeneratorExpressionDAGChecker *dagChecker
                               ) const = 0;
 };
 
@@ -60,7 +62,8 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     // Unreachable
     return std::string();
@@ -76,7 +79,8 @@ static const struct OneNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     // Unreachable
     return std::string();
@@ -93,7 +97,8 @@ static const struct OP ## Node : public cmGeneratorExpressionNode \
  \
   std::string Evaluate(const std::vector<std::string> &parameters, \
                        cmGeneratorExpressionContext *context, \
-                       const GeneratorExpressionContent *content) const \
+                       const GeneratorExpressionContent *content, \
+                       cmGeneratorExpressionDAGChecker *) const \
   { \
     std::vector<std::string>::const_iterator it = parameters.begin(); \
     const std::vector<std::string>::const_iterator end = parameters.end(); \
@@ -123,9 +128,11 @@ BOOLEAN_OP_NODE(orNode, OR, 0, 1)
 static const struct NotNode : public cmGeneratorExpressionNode
 {
   NotNode() {}
+
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
-                       const GeneratorExpressionContent *content) const
+                       const GeneratorExpressionContent *content,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     if (*parameters.begin() != "0" && *parameters.begin() != "1")
       {
@@ -146,7 +153,8 @@ static const struct BoolNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return !cmSystemTools::IsOff(parameters.begin()->c_str()) ? "1" : "0";
   }
@@ -161,7 +169,8 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return *parameters.begin() == parameters.at(1) ? "1" : "0";
   }
@@ -176,7 +185,8 @@ static const struct Angle_RNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return ">";
   }
@@ -191,7 +201,8 @@ static const struct CommaNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return ",";
   }
@@ -201,11 +212,13 @@ static const struct CommaNode : public cmGeneratorExpressionNode
 static const struct ConfigurationNode : public cmGeneratorExpressionNode
 {
   ConfigurationNode() {}
+
   virtual int NumExpectedParameters() const { return 0; }
 
   std::string Evaluate(const std::vector<std::string> &,
                        cmGeneratorExpressionContext *context,
-                       const GeneratorExpressionContent *) const
+                       const GeneratorExpressionContent *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return context->Config ? context->Config : "";
   }
@@ -220,7 +233,8 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
-                       const GeneratorExpressionContent *content) const
+                       const GeneratorExpressionContent *content,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     if (!context->Config)
       {
@@ -240,7 +254,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
 } configurationTestNode;
 
 //----------------------------------------------------------------------------
-static const struct TargetPropertyNode: public cmGeneratorExpressionNode
+static const struct TargetPropertyNode : public cmGeneratorExpressionNode
 {
   TargetPropertyNode() {}
 
@@ -249,7 +263,8 @@ static const struct TargetPropertyNode: public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
-                       const GeneratorExpressionContent *content) const
+                       const GeneratorExpressionContent *content,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     if (parameters.size() != 1 && parameters.size() != 2)
       {
@@ -393,7 +408,8 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
 
   std::string Evaluate(const std::vector<std::string> &parameters,
                        cmGeneratorExpressionContext *context,
-                       const GeneratorExpressionContent *content) const
+                       const GeneratorExpressionContent *content,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     // Lookup the referenced target.
     std::string name = *parameters.begin();
@@ -523,7 +539,8 @@ std::string GeneratorExpressionContent::GetOriginalExpression() const
 
 //----------------------------------------------------------------------------
 std::string GeneratorExpressionContent::Evaluate(
-                                  cmGeneratorExpressionContext *context) const
+                            cmGeneratorExpressionContext *context,
+                            cmGeneratorExpressionDAGChecker *dagChecker) const
 {
   std::string identifier;
   {
@@ -533,7 +550,7 @@ std::string GeneratorExpressionContent::Evaluate(
                                           = this->IdentifierChildren.end();
   for ( ; it != end; ++it)
     {
-    identifier += (*it)->Evaluate(context);
+    identifier += (*it)->Evaluate(context, dagChecker);
     if (context->HadError)
       {
       return std::string();
@@ -576,7 +593,7 @@ std::string GeneratorExpressionContent::Evaluate(
                                                                 = pit->end();
       for ( ; it != end; ++it)
         {
-        result += (*it)->Evaluate(context);
+        result += (*it)->Evaluate(context, dagChecker);
         if (context->HadError)
           {
           return std::string();
@@ -602,7 +619,7 @@ std::string GeneratorExpressionContent::Evaluate(
                                                               pit->end();
     for ( ; it != end; ++it)
       {
-      parameter += (*it)->Evaluate(context);
+      parameter += (*it)->Evaluate(context, dagChecker);
       if (context->HadError)
         {
         return std::string();
@@ -645,7 +662,7 @@ std::string GeneratorExpressionContent::Evaluate(
     return std::string();
     }
 
-  return node->Evaluate(parameters, context, this);
+  return node->Evaluate(parameters, context, this, dagChecker);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 4086e8e..04a2acd 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -32,6 +32,8 @@ struct cmGeneratorExpressionContext
   bool HadError;
 };
 
+struct cmGeneratorExpressionDAGChecker;
+
 //----------------------------------------------------------------------------
 struct cmGeneratorExpressionEvaluator
 {
@@ -46,8 +48,8 @@ struct cmGeneratorExpressionEvaluator
 
   virtual Type GetType() const = 0;
 
-  virtual std::string Evaluate(cmGeneratorExpressionContext *context
-                              ) const = 0;
+  virtual std::string Evaluate(cmGeneratorExpressionContext *context,
+                              cmGeneratorExpressionDAGChecker *) const = 0;
 
 private:
   cmGeneratorExpressionEvaluator(const cmGeneratorExpressionEvaluator &);
@@ -62,7 +64,8 @@ struct TextContent : public cmGeneratorExpressionEvaluator
 
   }
 
-  std::string Evaluate(cmGeneratorExpressionContext *) const
+  std::string Evaluate(cmGeneratorExpressionContext *,
+                       cmGeneratorExpressionDAGChecker *) const
   {
     return std::string(this->Content, this->Length);
   }
@@ -107,7 +110,8 @@ struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator
     return cmGeneratorExpressionEvaluator::Generator;
   }
 
-  std::string Evaluate(cmGeneratorExpressionContext *context) const;
+  std::string Evaluate(cmGeneratorExpressionContext *context,
+                       cmGeneratorExpressionDAGChecker *) const;
 
   std::string GetOriginalExpression() const;
 
diff --git a/bootstrap b/bootstrap
index 23134d0..89c9012 100755
--- a/bootstrap
+++ b/bootstrap
@@ -202,6 +202,7 @@ CMAKE_CXX_SOURCES="\
   cmInstallDirectoryGenerator \
   cmGeneratedFileStream \
   cmGeneratorTarget \
+  cmGeneratorExpressionDAGChecker \
   cmGeneratorExpressionEvaluator \
   cmGeneratorExpressionLexer \
   cmGeneratorExpressionParser \

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7166e687a8b56023a3180a481daa0653ba799dd
commit d7166e687a8b56023a3180a481daa0653ba799dd
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 12 04:23:31 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Add a generator expression for target properties.
    
    There are two overloads, so that it can use the operational
    target when a target property is being evaluated, and a target
    can alternatively be specified by name.
    
    At this point, the generators don't chain. That comes later.

diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index b11bff9..6a0cd9d 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -81,7 +81,7 @@ public:
       "\n"
       "Arguments after COMMAND may use \"generator expressions\" with the "
       "syntax \"$<...>\".  "
-      CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
+      CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS
       "Example usage:\n"
       "  add_test(NAME mytest\n"
       "           COMMAND testDriver --config $<CONFIGURATION>\n"
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 5622da0..6b0cf49 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -12,7 +12,7 @@
 #ifndef cmDocumentGeneratorExpressions_h
 #define cmDocumentGeneratorExpressions_h
 
-#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS                       \
+#define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS                      \
   "Generator expressions are evaluted during build system generation "  \
   "to produce information specific to each build configuration.  "      \
   "Valid expressions are:\n"                                            \
@@ -35,11 +35,20 @@
   "  $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n"                  \
   "  $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n"    \
   "  $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n"    \
+  "  $<TARGET_PROPERTY:tgt,prop>   = The value of the property prop\n"  \
+  "the target tgt. Note that tgt is not added as a dependency of the "  \
+  "target this expression is evaluated on.\n" \
   "Boolean expressions:\n"                                              \
   "  $<AND:?[,?]...>           = '1' if all '?' are '1', else '0'\n"    \
   "  $<OR:?[,?]...>            = '0' if all '?' are '0', else '1'\n"    \
   "  $<NOT:?>                  = '0' if '?' is '1', else '1'\n"         \
   "where '?' is always either '0' or '1'.\n"                            \
+
+#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS                       \
+  CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
+  "Expressions with an implicit 'this' target:"                         \
+  "  $<TARGET_PROPERTY:prop>   = The value of the property prop on\n"   \
+  "the target on which the generator expression is evaluated.\n"        \
   ""
 
 #endif
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 0885616..55a1e3e 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -65,7 +65,8 @@ cmGeneratorExpression::~cmGeneratorExpression()
 
 //----------------------------------------------------------------------------
 const char *cmCompiledGeneratorExpression::Evaluate(
-  cmMakefile* mf, const char* config, bool quiet) const
+  cmMakefile* mf, const char* config, bool quiet,
+  cmGeneratorTarget *target) const
 {
   if (!this->NeedsParsing)
     {
@@ -84,6 +85,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
   context.Config = config;
   context.Quiet = quiet;
   context.HadError = false;
+  context.Target = target;
   context.Backtrace = this->Backtrace;
 
   for ( ; it != end; ++it)
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 780ccfc..fdf45a1 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -20,6 +20,7 @@
 #include <cmsys/RegularExpression.hxx>
 
 class cmTarget;
+class cmGeneratorTarget;
 class cmMakefile;
 class cmListFileBacktrace;
 
@@ -58,7 +59,8 @@ class cmCompiledGeneratorExpression
 {
 public:
   const char* Evaluate(cmMakefile* mf, const char* config,
-                        bool quiet = false) const;
+                       bool quiet = false,
+                       cmGeneratorTarget *target = 0) const;
 
   /** Get set of targets found during evaluations.  */
   std::set<cmTarget*> const& GetTargets() const
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index d9f374d..fbe8dc1 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -240,6 +240,46 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
 } configurationTestNode;
 
 //----------------------------------------------------------------------------
+static const struct TargetPropertyNode: public cmGeneratorExpressionNode
+{
+  TargetPropertyNode() {}
+
+  // This node handles errors on parameter count itself.
+  virtual int NumExpectedParameters() const { return -1; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *context,
+                       const GeneratorExpressionContent *content) const
+  {
+    if (parameters.size() != 1 && parameters.size() != 2)
+      {
+      reportError(context, content->GetOriginalExpression(),
+          "$<TARGET_PROPERTY:...> expression requires one or two parameters");
+      return std::string();
+      }
+    cmGeneratorTarget* target = context->Target;
+    std::string propertyName = *parameters.begin();
+    if (parameters.size() == 2)
+      {
+      target = context->Makefile->FindGeneratorTargetToUse(
+                                                parameters.begin()->c_str());
+
+      if (!target)
+        {
+        cmOStringStream e;
+        e << "Target \""
+          << target
+          << "\" not found.";
+        reportError(context, content->GetOriginalExpression(), e.str());
+        }
+      propertyName = parameters.at(1);
+      }
+    const char *prop = target->GetProperty(propertyName.c_str());
+    return prop ? prop : "";
+  }
+} targetPropertyNode;
+
+//----------------------------------------------------------------------------
 template<bool linker, bool soname>
 struct TargetFilesystemArtifactResultCreator
 {
@@ -460,7 +500,10 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
     return &angle_rNode;
   else if (identifier == "COMMA")
     return &commaNode;
+  else if (identifier == "TARGET_PROPERTY")
+    return &targetPropertyNode;
   return 0;
+
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 5163ca0..4086e8e 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -15,6 +15,11 @@
 #include <vector>
 #include <string>
 
+#include "cmListFileCache.h"
+
+class cmTarget;
+class cmGeneratorTarget;
+
 //----------------------------------------------------------------------------
 struct cmGeneratorExpressionContext
 {
@@ -22,7 +27,7 @@ struct cmGeneratorExpressionContext
   std::set<cmTarget*> Targets;
   cmMakefile *Makefile;
   const char *Config;
-  cmTarget *Target;
+  cmGeneratorTarget *Target;
   bool Quiet;
   bool HadError;
 };

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e45fbe25d23e438a6b0b965ad154b649ff4e020b
commit e45fbe25d23e438a6b0b965ad154b649ff4e020b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Sep 12 04:20:42 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:20 2012 +0200

    Extend the generator expression language with more logic.
    
    Generator expressions for comparing strings, evaluating
    strings as booleans, and for creating literal right-angle-brackets
    and commas are added. Those may be needed in some cases
    where they appear in literals.

diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 74c673a..5622da0 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -20,6 +20,12 @@
   "  $<1:...>                  = content of \"...\"\n"                  \
   "  $<CONFIG:cfg>             = '1' if config is \"cfg\", else '0'\n"  \
   "  $<CONFIGURATION>          = configuration name\n"                  \
+  "  $<BOOL:...>               = '1' if the '...' is true, else '0'\n"  \
+  "  $<STREQUAL:a,b>           = '1' if a is STREQUAL b, else '0'\n"    \
+  "  $<ANGLE-R>                = A literal '>'. Used to compare "       \
+  "strings which contain a '>' for example.\n"                          \
+  "  $<COMMA>                  = A literal ','. Used to compare "       \
+  "strings which contain a ',' for example.\n"                          \
   "  $<TARGET_FILE:tgt>        = main file (.exe, .so.1.2, .a)\n"       \
   "  $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n"   \
   "  $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n"            \
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index acc844a..d9f374d 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -138,6 +138,66 @@ static const struct NotNode : public cmGeneratorExpressionNode
 } notNode;
 
 //----------------------------------------------------------------------------
+static const struct BoolNode : public cmGeneratorExpressionNode
+{
+  BoolNode() {}
+
+  virtual bool AcceptsSingleArbitraryContentParameter() const { return true; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *,
+                       const GeneratorExpressionContent *) const
+  {
+    return !cmSystemTools::IsOff(parameters.begin()->c_str()) ? "1" : "0";
+  }
+} boolNode;
+
+//----------------------------------------------------------------------------
+static const struct StrEqualNode : public cmGeneratorExpressionNode
+{
+  StrEqualNode() {}
+
+  virtual int NumExpectedParameters() const { return 2; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *,
+                       const GeneratorExpressionContent *) const
+  {
+    return *parameters.begin() == parameters.at(1) ? "1" : "0";
+  }
+} strEqualNode;
+
+//----------------------------------------------------------------------------
+static const struct Angle_RNode : public cmGeneratorExpressionNode
+{
+  Angle_RNode() {}
+
+  virtual int NumExpectedParameters() const { return 0; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *,
+                       const GeneratorExpressionContent *) const
+  {
+    return ">";
+  }
+} angle_rNode;
+
+//----------------------------------------------------------------------------
+static const struct CommaNode : public cmGeneratorExpressionNode
+{
+  CommaNode() {}
+
+  virtual int NumExpectedParameters() const { return 0; }
+
+  std::string Evaluate(const std::vector<std::string> &parameters,
+                       cmGeneratorExpressionContext *,
+                       const GeneratorExpressionContent *) const
+  {
+    return ",";
+  }
+} commaNode;
+
+//----------------------------------------------------------------------------
 static const struct ConfigurationNode : public cmGeneratorExpressionNode
 {
   ConfigurationNode() {}
@@ -392,6 +452,14 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
     return &targetLinkerFileDirNode;
   else if (identifier == "TARGET_SONAME_FILE_DIR")
     return &targetSoNameFileDirNode;
+  else if (identifier == "STREQUAL")
+    return &strEqualNode;
+  else if (identifier == "BOOL")
+    return &boolNode;
+  else if (identifier == "RANGLE")
+    return &angle_rNode;
+  else if (identifier == "COMMA")
+    return &commaNode;
   return 0;
 }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8e61d687abfacf1d5ed3b10cfe20315a344620c
commit b8e61d687abfacf1d5ed3b10cfe20315a344620c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Sep 21 11:45:46 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:31:12 2012 +0200

    Refactor GetCompileDefinitions a bit.
    
    It is now easier to add generator expressions.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f8c274a..3f58433 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -316,13 +316,13 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
 //----------------------------------------------------------------------------
 std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
 {
-  if (!config)
+  std::string defPropName = "COMPILE_DEFINITIONS";
+  if (config)
     {
-    return this->Target->GetProperty("COMPILE_DEFINITIONS");
+    defPropName += "_" + cmSystemTools::UpperCase(config);
     }
-  std::string defPropName = "COMPILE_DEFINITIONS_";
-  defPropName +=
-    cmSystemTools::UpperCase(config);
 
-  return this->Target->GetProperty(defPropName.c_str());
+  const char *prop = this->Target->GetProperty(defPropName.c_str());
+
+  return prop ? prop : "";
 }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2c2b25b203e653326c0f4064649da06a8cdfd7a5
commit 2c2b25b203e653326c0f4064649da06a8cdfd7a5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 23:25:27 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:54 2012 +0200

    Return a std::string from GetCompileDefinitions.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index ec83b7a..f8c274a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -314,7 +314,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
 }
 
 //----------------------------------------------------------------------------
-const char *cmGeneratorTarget::GetCompileDefinitions(const char *config)
+std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
 {
   if (!config)
     {
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 4487c11..8ea17d7 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -74,7 +74,7 @@ public:
   /** Get the include directories for this target.  */
   std::vector<std::string> GetIncludeDirectories();
 
-  const char *GetCompileDefinitions(const char *config = 0);
+  std::string GetCompileDefinitions(const char *config = 0);
 
 private:
   void ClassifySources();
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a270cc9..2f4311f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1648,10 +1648,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     this->AppendDefines(ppDefs, exportMacro);
     }
   cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
-  this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions());
+  this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions().c_str());
   if(configName)
     {
-    this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions(configName));
+    this->AppendDefines(ppDefs,
+                        gtgt->GetCompileDefinitions(configName).c_str());
     }
   buildSettings->AddAttribute
     ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList());
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 71c1647..11d9d9c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -742,8 +742,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.ParseFinish();
   cmGeneratorTarget* gt =
     this->GlobalGenerator->GetGeneratorTarget(&target);
-  targetOptions.AddDefines(gt->GetCompileDefinitions());
-  targetOptions.AddDefines(gt->GetCompileDefinitions(configName));
+  targetOptions.AddDefines(gt->GetCompileDefinitions().c_str());
+  targetOptions.AddDefines(gt->GetCompileDefinitions(configName).c_str());
   targetOptions.SetVerboseMakefile(
     this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
 
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 87312ae..90718ab 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1231,9 +1231,10 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   clOptions.AddFlag("PrecompiledHeader", "NotUsing");
   clOptions.Parse(flags.c_str());
   clOptions.Parse(defineFlags.c_str());
-  clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions());
+  clOptions.AddDefines(
+                     this->GeneratorTarget->GetCompileDefinitions().c_str());
   clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions(
-                                                        configName.c_str()));
+                                                configName.c_str()).c_str());
   clOptions.SetVerboseMakefile(
     this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b7e48e0acbd0cd30f803ec8c2d402c636beba778
commit b7e48e0acbd0cd30f803ec8c2d402c636beba778
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 23:24:20 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:54 2012 +0200

    Add an AppendDefines std::string overload.
    
    This makes it easier to use with cmGeneratorTarget::GetCompileDefinitions.

diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 0916d44..9aaacf7 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -157,6 +157,11 @@ public:
    */
   void AppendDefines(std::set<std::string>& defines,
                      const char* defines_list);
+  void AppendDefines(std::set<std::string>& defines,
+                     std::string defines_list)
+  {
+    this->AppendDefines(defines, defines_list.c_str());
+  }
   /**
    * Join a set of defines into a definesString with a space separator.
    */

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a160871d0bc4233a71dfbf2ffcc888a940bb921
commit 9a160871d0bc4233a71dfbf2ffcc888a940bb921
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 23:22:24 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:54 2012 +0200

    Convert paths in INCLUDE_DIRECTORIES property to Unix slashes.
    
    Duplicate some of the logic from the include_directories command.

diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 91f16d1..ec83b7a 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -299,9 +299,14 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories()
   for(std::vector<std::string>::const_iterator
       li = includes.begin(); li != includes.end(); ++li)
     {
-    if(uniqueIncludes.insert(*li).second)
+    std::string inc = *li;
+    if (!cmSystemTools::IsOff(inc.c_str()))
       {
-      orderedAndUniqueIncludes.push_back(*li);
+      cmSystemTools::ConvertToUnixSlashes(inc);
+      }
+    if(uniqueIncludes.insert(inc).second)
+      {
+      orderedAndUniqueIncludes.push_back(inc);
       }
     }
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4557c8db4813b4198fb7d64249e104bdcb828ae5
commit 4557c8db4813b4198fb7d64249e104bdcb828ae5
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 23:22:59 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:54 2012 +0200

    Don't prepend a path before generator expressions in include_directories.

diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 4dd98a1..11c5f4e 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -105,10 +105,13 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i,
     cmSystemTools::ConvertToUnixSlashes(ret);
     if(!cmSystemTools::FileIsFullPath(ret.c_str()))
       {
-      std::string tmp = this->Makefile->GetStartDirectory();
-      tmp += "/";
-      tmp += ret;
-      ret = tmp;
+      if(ret[0] != '$' && ret[1] != '<')
+        {
+        std::string tmp = this->Makefile->GetStartDirectory();
+        tmp += "/";
+        tmp += ret;
+        ret = tmp;
+        }
       }
     }
   this->Makefile->AddIncludeDirectory(ret.c_str(), before);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c6abc41eb5ece8fe10d08faf7792337a760d4251
commit c6abc41eb5ece8fe10d08faf7792337a760d4251
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Sep 20 00:18:23 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:54 2012 +0200

    Add include guard for cmGeneratorExpression.

diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index b8467c2..780ccfc 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -9,6 +9,10 @@
   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the License for more information.
 ============================================================================*/
+
+#ifndef cmGeneratorExpression_h
+#define cmGeneratorExpression_h
+
 #include "cmStandardIncludes.h"
 
 #include <stack>
@@ -80,3 +84,5 @@ private:
   mutable std::set<cmTarget*> Targets;
   mutable std::string Output;
 };
+
+#endif

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c
commit 0ff4e3f0b88885eafab0693fdf03b44c7a5f9d0c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Sep 21 08:51:42 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 13:28:53 2012 +0200

    Port remaining code to GetCompileDefinitions().

diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 7953dd9..8b2daba 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -617,14 +617,17 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
           "         <Option compiler=\"" << compiler << "\" />\n"
           "         <Compiler>\n";
 
+    cmGeneratorTarget *gtgt = this->GlobalGenerator
+                                  ->GetGeneratorTarget(target);
+
     // the compilerdefines for this target
-    const char* cdefs = target->GetMakefile()->GetProperty(
-                                                        "COMPILE_DEFINITIONS");
-    if(cdefs)
+    std::string cdefs = gtgt->GetCompileDefinitions();
+
+    if(cdefs.empty())
       {
       // Expand the list.
       std::vector<std::string> defs;
-      cmSystemTools::ExpandListArgument(cdefs, defs);
+      cmSystemTools::ExpandListArgument(cdefs.c_str(), defs);
       for(std::vector<std::string>::const_iterator di = defs.begin();
           di != defs.end(); ++di)
         {
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f9a1503..a270cc9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1647,16 +1647,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
     // Add the export symbol definition for shared library objects.
     this->AppendDefines(ppDefs, exportMacro);
     }
-  this->AppendDefines
-    (ppDefs, this->CurrentMakefile->GetProperty("COMPILE_DEFINITIONS"));
-  this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS"));
+  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
+  this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions());
   if(configName)
     {
-    std::string defVarName = "COMPILE_DEFINITIONS_";
-    defVarName += cmSystemTools::UpperCase(configName);
-    this->AppendDefines
-      (ppDefs, this->CurrentMakefile->GetProperty(defVarName.c_str()));
-    this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str()));
+    this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions(configName));
     }
   buildSettings->AddAttribute
     ("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList());
@@ -1713,10 +1708,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 
   // Set target-specific architectures.
   std::vector<std::string> archs;
-  {
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   gtgt->GetAppleArchs(configName, archs);
-  }
+
   if(!archs.empty())
     {
     // Enable ARCHS attribute.
@@ -1953,7 +1946,6 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
   BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
   std::vector<std::string> includes;
-  cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
   this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt);
   std::set<cmStdString> emitted;
   emitted.insert("/System/Library/Frameworks");
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 2ededfe..71c1647 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -724,10 +724,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
     flags += targetFlags;
     }
 
-  std::string configUpper = cmSystemTools::UpperCase(configName);
-  std::string defPropName = "COMPILE_DEFINITIONS_";
-  defPropName += configUpper;
-
   // Get preprocessor definitions for this directory.
   std::string defineFlags = this->Makefile->GetDefineFlags();
   Options::Tool t = Options::Compiler;
@@ -744,11 +740,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.Parse(flags.c_str());
   targetOptions.Parse(defineFlags.c_str());
   targetOptions.ParseFinish();
-  targetOptions.AddDefines
-    (this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
-  targetOptions.AddDefines(target.GetProperty("COMPILE_DEFINITIONS"));
-  targetOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str()));
-  targetOptions.AddDefines(target.GetProperty(defPropName.c_str()));
+  cmGeneratorTarget* gt =
+    this->GlobalGenerator->GetGeneratorTarget(&target);
+  targetOptions.AddDefines(gt->GetCompileDefinitions());
+  targetOptions.AddDefines(gt->GetCompileDefinitions(configName));
   targetOptions.SetVerboseMakefile(
     this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
 
@@ -819,8 +814,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
   targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
   fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
   std::vector<std::string> includes;
-  cmGeneratorTarget* gt =
-    this->GlobalGenerator->GetGeneratorTarget(&target);
   this->GetIncludeDirectories(includes, gt);
   std::vector<std::string>::iterator i = includes.begin();
   for(;i != includes.end(); ++i)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index fea117a..87312ae 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1225,21 +1225,15 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
     flags += " ";
     flags += targetFlags;
     }
-  std::string configUpper = cmSystemTools::UpperCase(configName);
-  std::string defPropName = "COMPILE_DEFINITIONS_";
-  defPropName += configUpper;
-
   // Get preprocessor definitions for this directory.
   std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
   clOptions.FixExceptionHandlingDefault();
   clOptions.AddFlag("PrecompiledHeader", "NotUsing");
   clOptions.Parse(flags.c_str());
   clOptions.Parse(defineFlags.c_str());
-  clOptions.AddDefines
-    (this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
-  clOptions.AddDefines(this->Target->GetProperty("COMPILE_DEFINITIONS"));
-  clOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str()));
-  clOptions.AddDefines(this->Target->GetProperty(defPropName.c_str()));
+  clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions());
+  clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions(
+                                                        configName.c_str()));
   clOptions.SetVerboseMakefile(
     this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f178d531a6a75b3cbdaa0a3dec5e0aa8daca7d24
commit f178d531a6a75b3cbdaa0a3dec5e0aa8daca7d24
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Sep 21 08:50:50 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri Sep 21 08:52:24 2012 +0200

    Fix indentation in the code blocks generator.

diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index b1bbd90..7953dd9 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -633,59 +633,57 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
         }
       }
 
-      // the include directories for this target
-      std::set<std::string> uniqIncludeDirs;
-
-      cmGeneratorTarget *gtgt = this->GlobalGenerator
-                                    ->GetGeneratorTarget(target);
-      std::vector<std::string> includes;
-      target->GetMakefile()->GetLocalGenerator()->
-        GetIncludeDirectories(includes, gtgt);
-      for(std::vector<std::string>::const_iterator dirIt=includes.begin();
-          dirIt != includes.end();
+    // the include directories for this target
+    std::set<std::string> uniqIncludeDirs;
+
+    std::vector<std::string> includes;
+    target->GetMakefile()->GetLocalGenerator()->
+      GetIncludeDirectories(includes, gtgt);
+    for(std::vector<std::string>::const_iterator dirIt=includes.begin();
+        dirIt != includes.end();
+        ++dirIt)
+      {
+      uniqIncludeDirs.insert(*dirIt);
+      }
+
+    std::string systemIncludeDirs = makefile->GetSafeDefinition(
+                              "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
+    if (!systemIncludeDirs.empty())
+      {
+      std::vector<std::string> dirs;
+      cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+      for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+          dirIt != dirs.end();
           ++dirIt)
         {
         uniqIncludeDirs.insert(*dirIt);
         }
+      }
 
-      std::string systemIncludeDirs = makefile->GetSafeDefinition(
-                                "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
-      if (!systemIncludeDirs.empty())
-        {
-        std::vector<std::string> dirs;
-        cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
-        for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
-            dirIt != dirs.end();
-            ++dirIt)
-          {
-          uniqIncludeDirs.insert(*dirIt);
-          }
-        }
-
-      systemIncludeDirs = makefile->GetSafeDefinition(
-                              "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
-      if (!systemIncludeDirs.empty())
-        {
-        std::vector<std::string> dirs;
-        cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
-        for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
-            dirIt != dirs.end();
-            ++dirIt)
-          {
-          uniqIncludeDirs.insert(*dirIt);
-          }
-        }
-
-      for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
-          dirIt != uniqIncludeDirs.end();
+    systemIncludeDirs = makefile->GetSafeDefinition(
+                            "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
+    if (!systemIncludeDirs.empty())
+      {
+      std::vector<std::string> dirs;
+      cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+      for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+          dirIt != dirs.end();
           ++dirIt)
         {
-        fout <<"            <Add directory=\"" << dirIt->c_str() << "\" />\n";
+        uniqIncludeDirs.insert(*dirIt);
         }
+      }
 
-      fout<<"         </Compiler>\n";
+    for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
+        dirIt != uniqIncludeDirs.end();
+        ++dirIt)
+      {
+      fout <<"            <Add directory=\"" << dirIt->c_str() << "\" />\n";
       }
-    else // e.g. all and the GLOBAL and UTILITY targets
+
+    fout<<"         </Compiler>\n";
+    }
+  else // e.g. all and the GLOBAL and UTILITY targets
     {
     fout<<"         <Option working_dir=\""
                             << makefile->GetStartOutputDirectory() << "\" />\n"

-----------------------------------------------------------------------

Summary of changes:
 Source/CMakeLists.txt                              |    2 +
 Source/cmAddTestCommand.h                          |    2 +-
 Source/cmDocumentGeneratorExpressions.h            |   17 ++-
 Source/cmExtraCodeBlocksGenerator.cxx              |   93 ++++++------
 Source/cmGeneratorExpression.cxx                   |    8 +-
 Source/cmGeneratorExpression.h                     |   12 ++-
 Source/cmGeneratorExpressionDAGChecker.cxx         |  106 ++++++++++++
 Source/cmGeneratorExpressionDAGChecker.h           |   44 +++++
 Source/cmGeneratorExpressionEvaluator.cxx          |  169 ++++++++++++++++++--
 Source/cmGeneratorExpressionEvaluator.h            |   19 ++-
 Source/cmGeneratorTarget.cxx                       |   58 ++++++--
 Source/cmGeneratorTarget.h                         |    2 +-
 Source/cmGlobalXCodeGenerator.cxx                  |   17 +--
 Source/cmIncludeDirectoryCommand.cxx               |   11 +-
 Source/cmLocalGenerator.cxx                        |   11 +-
 Source/cmLocalGenerator.h                          |    5 +
 Source/cmLocalVisualStudio7Generator.cxx           |   15 +--
 Source/cmVisualStudio10TargetGenerator.cxx         |   13 +-
 Tests/CompileDefinitions/compiletest.cpp           |    9 +
 .../CompileDefinitions/target_prop/CMakeLists.txt  |    6 +
 .../TargetIncludeDirectories/CMakeLists.txt        |    7 +
 .../TargetIncludeDirectories/main.cpp              |    3 +
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../BadSelfReference1-result.txt}                  |    0
 .../BadSelfReference1-stderr.txt                   |    6 +
 .../BadSelfReference1.cmake                        |    7 +
 .../BadSelfReference2-result.txt}                  |    0
 .../BadSelfReference2-stderr.txt                   |    6 +
 .../BadSelfReference2.cmake                        |    9 +
 .../BadSelfReference3-result.txt}                  |    0
 .../BadSelfReference3-stderr.txt                   |    6 +
 .../BadSelfReference3.cmake                        |    8 +
 .../BadSelfReference4-result.txt}                  |    0
 .../BadSelfReference4-stderr.txt                   |    6 +
 .../BadSelfReference4.cmake                        |   10 ++
 .../BadSelfReference5-result.txt}                  |    0
 .../BadSelfReference5-stderr.txt                   |    6 +
 .../BadSelfReference5.cmake                        |   10 ++
 .../BadSelfReference6-result.txt}                  |    0
 .../BadSelfReference6-stderr.txt                   |    6 +
 .../BadSelfReference6.cmake                        |   10 ++
 .../CMakeLists.txt                                 |    8 +
 .../RunCMakeTest.cmake                             |    8 +
 bootstrap                                          |    1 +
 44 files changed, 616 insertions(+), 121 deletions(-)
 create mode 100644 Source/cmGeneratorExpressionDAGChecker.cxx
 create mode 100644 Source/cmGeneratorExpressionDAGChecker.h
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake
 copy Tests/RunCMake/{GeneratorExpression/BadAND-result.txt => TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt} (100%)
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
 create mode 100644 Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list