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  1e3d974e792b2afac1b2f3fb89f59e8631d33834 (commit)
       via  d06db7ebe80636876d9701064b16cec9d3e2e3cb (commit)
       via  b680824a5fdcc54c265c64ce8958f9d80acad70d (commit)
      from  f981d599efdbc7a72613213c3290c93bd331758e (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=1e3d974e792b2afac1b2f3fb89f59e8631d33834
commit 1e3d974e792b2afac1b2f3fb89f59e8631d33834
Merge: f981d59 d06db7e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 31 12:55:39 2013 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Fri May 31 12:55:39 2013 -0400

    Merge topic 'refactor-try_compile-argument-processing' into next
    
    d06db7e try_compile: Refactor argument processing
    b680824 try_compile: Add test for bad call error cases


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d06db7ebe80636876d9701064b16cec9d3e2e3cb
commit d06db7ebe80636876d9701064b16cec9d3e2e3cb
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed May 15 15:30:34 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 31 10:01:50 2013 -0400

    try_compile: Refactor argument processing
    
    Process all arguments in a single loop using a simple state machine.
    While at it, fix some error message typos.  Also allow LINK_LIBRARIES
    with no actual libraries to disable use of the -DLINK_LIBRARIES=...
    from the CMAKE_FLAGS.  This was already possible in the old logic if
    LINK_LIBRARIES was immediately followed by another keyword argument
    instead of the end of the argument list, so allow it in general.
    Update the RunCMake.try_compile test cases accordingly.

diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 85e49a9..bf28428 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -23,150 +23,130 @@ int 
cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
   this->BinaryDirectory = argv[1].c_str();
   this->OutputFile = "";
   // which signature were we called with ?
-  this->SrcFileSignature = false;
-  unsigned int i;
+  this->SrcFileSignature = true;
 
   const char* sourceDirectory = argv[2].c_str();
   const char* projectName = 0;
   const char* targetName = 0;
-  char targetNameBuf[64];
-  int extraArgs = 0;
-
-  // look for CMAKE_FLAGS and store them
   std::vector<std::string> cmakeFlags;
-  for (i = 3; i < argv.size(); ++i)
-    {
-    if (argv[i] == "CMAKE_FLAGS")
-      {
-     // CMAKE_FLAGS is the first argument because we need an argv[0] that
-     // is not used, so it matches regular command line parsing which has
-     // the program name as arg 0
-      for (; i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" &&
-             argv[i] != "OUTPUT_VARIABLE" &&
-             argv[i] != "LINK_LIBRARIES";
-           ++i)
-        {
-        extraArgs++;
-        cmakeFlags.push_back(argv[i]);
-        }
-      break;
-      }
-    }
-
-  // look for OUTPUT_VARIABLE and store them
+  std::vector<std::string> compileDefs;
   std::string outputVariable;
-  for (i = 3; i < argv.size(); ++i)
+  std::string copyFile;
+  std::vector<cmTarget*> targets;
+  std::string libsToLink = " ";
+  bool useOldLinkLibs = true;
+  char targetNameBuf[64];
+  bool didOutputVariable = false;
+  bool didCopyFile = false;
+
+  enum Doing { DoingNone, DoingCMakeFlags, DoingCompileDefinitions,
+               DoingLinkLibraries, DoingOutputVariable, DoingCopyFile };
+  Doing doing = DoingNone;
+  for(size_t i=3; i < argv.size(); ++i)
     {
-    if (argv[i] == "OUTPUT_VARIABLE")
+    if(argv[i] == "CMAKE_FLAGS")
       {
-      if ( argv.size() <= (i+1) )
-        {
-        this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-          "OUTPUT_VARIABLE specified but there is no variable");
-        return -1;
-        }
-      extraArgs += 2;
-      outputVariable = argv[i+1];
-      break;
+      doing = DoingCMakeFlags;
+      // CMAKE_FLAGS is the first argument because we need an argv[0] that
+      // is not used, so it matches regular command line parsing which has
+      // the program name as arg 0
+      cmakeFlags.push_back(argv[i]);
       }
-    }
-
-  // look for COMPILE_DEFINITIONS and store them
-  std::vector<std::string> compileFlags;
-  for (i = 3; i < argv.size(); ++i)
-    {
-    if (argv[i] == "COMPILE_DEFINITIONS")
+    else if(argv[i] == "COMPILE_DEFINITIONS")
       {
-      extraArgs++;
-      for (i = i + 1; i < argv.size() && argv[i] != "CMAKE_FLAGS" &&
-             argv[i] != "OUTPUT_VARIABLE" &&
-             argv[i] != "LINK_LIBRARIES";
-           ++i)
-        {
-        extraArgs++;
-        compileFlags.push_back(argv[i]);
-        }
-      break;
+      doing = DoingCompileDefinitions;
       }
-    }
-
-  std::vector<cmTarget*> targets;
-  std::string libsToLink = " ";
-  bool useOldLinkLibs = true;
-  for (i = 3; i < argv.size(); ++i)
-    {
-    if (argv[i] == "LINK_LIBRARIES")
+    else if(argv[i] == "LINK_LIBRARIES")
       {
-      if ( argv.size() <= (i+1) )
-        {
-        this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-          "LINK_LIBRARIES specified but there is no content");
-        return -1;
-        }
-      extraArgs++;
-      ++i;
+      doing = DoingLinkLibraries;
       useOldLinkLibs = false;
-      for ( ; i < argv.size() && argv[i] != "CMAKE_FLAGS"
-          && argv[i] != "COMPILE_DEFINITIONS" && argv[i] != "OUTPUT_VARIABLE";
-          ++i)
+      }
+    else if(argv[i] == "OUTPUT_VARIABLE")
+      {
+      doing = DoingOutputVariable;
+      didOutputVariable = true;
+      }
+    else if(argv[i] == "COPY_FILE")
+      {
+      doing = DoingCopyFile;
+      didCopyFile = true;
+      }
+    else if(doing == DoingCMakeFlags)
+      {
+      cmakeFlags.push_back(argv[i]);
+      }
+    else if(doing == DoingCompileDefinitions)
+      {
+      compileDefs.push_back(argv[i]);
+      }
+    else if(doing == DoingLinkLibraries)
+      {
+      libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
+      if(cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str()))
         {
-        extraArgs++;
-        libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
-        cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str());
-        if (!tgt)
-          {
-          continue;
-          }
         switch(tgt->GetType())
-        {
-        case cmTarget::SHARED_LIBRARY:
-        case cmTarget::STATIC_LIBRARY:
-        case cmTarget::UNKNOWN_LIBRARY:
-          break;
-        case cmTarget::EXECUTABLE:
-          if (tgt->IsExecutableWithExports())
-            {
+          {
+          case cmTarget::SHARED_LIBRARY:
+          case cmTarget::STATIC_LIBRARY:
+          case cmTarget::UNKNOWN_LIBRARY:
             break;
-            }
-        default:
-          this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-            "Only libraries may be used as try_compile IMPORTED "
-            "LINK_LIBRARIES.  Got " + std::string(tgt->GetName()) + " of "
-            "type " + tgt->GetTargetTypeName(tgt->GetType()) + ".");
-          return -1;
-        }
-        if (!tgt->IsImported())
+          case cmTarget::EXECUTABLE:
+            if (tgt->IsExecutableWithExports())
+              {
+              break;
+              }
+          default:
+            this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+              "Only libraries may be used as try_compile IMPORTED "
+              "LINK_LIBRARIES.  Got " + std::string(tgt->GetName()) + " of "
+              "type " + tgt->GetTargetTypeName(tgt->GetType()) + ".");
+            return -1;
+          }
+        if (tgt->IsImported())
           {
-          continue;
+          targets.push_back(tgt);
           }
-        targets.push_back(tgt);
         }
-      break;
+      }
+    else if(doing == DoingOutputVariable)
+      {
+      outputVariable = argv[i].c_str();
+      doing = DoingNone;
+      }
+    else if(doing == DoingCopyFile)
+      {
+      copyFile = argv[i].c_str();
+      doing = DoingNone;
+      }
+    else if(i == 3)
+      {
+      this->SrcFileSignature = false;
+      projectName = argv[i].c_str();
+      }
+    else if(i == 4 && !this->SrcFileSignature)
+      {
+      targetName = argv[i].c_str();
+      }
+    else
+      {
+      cmOStringStream m;
+      m << "try_compile given unknown argument \"" << argv[i] << "\".";
+      this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
       }
     }
 
-  // look for COPY_FILE
-  std::string copyFile;
-  for (i = 3; i < argv.size(); ++i)
+  if(didCopyFile && copyFile.empty())
     {
-    if (argv[i] == "COPY_FILE")
-      {
-      if ( argv.size() <= (i+1) )
-        {
-        this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-          "COPY_FILE specified but there is no variable");
-        return -1;
-        }
-      extraArgs += 2;
-      copyFile = argv[i+1];
-      break;
-      }
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+      "COPY_FILE must be followed by a file path");
+    return -1;
     }
 
-  // do we have a srcfile signature
-  if (argv.size() - extraArgs == 3)
+  if(didOutputVariable && outputVariable.empty())
     {
-    this->SrcFileSignature = true;
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+      "OUTPUT_VARIABLE must be followed by a variable name");
+    return -1;
     }
 
   // compute the binary dir when TRY_COMPILE is called with a src file
@@ -179,10 +159,10 @@ int 
cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
   else
     {
     // only valid for srcfile signatures
-    if (compileFlags.size())
+    if (compileDefs.size())
       {
       this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-        "COMPILE_FLAGS specified on a srcdir type TRY_COMPILE");
+        "COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE");
       return -1;
       }
     if (copyFile.size())
@@ -297,12 +277,12 @@ int 
cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
     fprintf(fout, "SET(CMAKE_SUPPRESS_REGENERATION 1)\n");
     fprintf(fout, "LINK_DIRECTORIES(${LINK_DIRECTORIES})\n");
     // handle any compile flags we need to pass on
-    if (compileFlags.size())
+    if (compileDefs.size())
       {
       fprintf(fout, "ADD_DEFINITIONS( ");
-      for (i = 0; i < compileFlags.size(); ++i)
+      for (size_t i = 0; i < compileDefs.size(); ++i)
         {
-        fprintf(fout,"%s ",compileFlags[i].c_str());
+        fprintf(fout,"%s ",compileDefs[i].c_str());
         }
       fprintf(fout, ")\n");
       }
@@ -398,16 +378,6 @@ int 
cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
       }
 
     }
-  // else the srcdir bindir project target signature
-  else
-    {
-    projectName = argv[3].c_str();
-
-    if (argv.size() - extraArgs == 5)
-      {
-      targetName = argv[4].c_str();
-      }
-    }
 
   bool erroroc = cmSystemTools::GetErrorOccuredFlag();
   cmSystemTools::ResetErrorOccuredFlag();
diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt 
b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
index 096fd98..d65d948 100644
--- a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
+++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
@@ -1,4 +1,4 @@
 CMake Error at NoCopyFile.cmake:1 \(try_compile\):
-  COPY_FILE specified but there is no variable
+  COPY_FILE must be followed by a file path
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt 
b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt
similarity index 100%
copy from Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
copy to Tests/RunCMake/try_compile/NoCopyFile2-result.txt
diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt 
b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt
new file mode 100644
index 0000000..e889524
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoCopyFile2.cmake:1 \(try_compile\):
+  COPY_FILE must be followed by a file path
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake 
b/Tests/RunCMake/try_compile/NoCopyFile2.cmake
similarity index 72%
copy from Tests/RunCMake/try_compile/NoLinkLibraries.cmake
copy to Tests/RunCMake/try_compile/NoCopyFile2.cmake
index 04c5758..04b7f68 100644
--- a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake
+++ b/Tests/RunCMake/try_compile/NoCopyFile2.cmake
@@ -1,2 +1,2 @@
 try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
-  LINK_LIBRARIES)
+  COPY_FILE CMAKE_FLAGS -DA=B)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt 
b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
deleted file mode 100644
index 507dce0..0000000
--- a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at NoLinkLibraries.cmake:1 \(try_compile\):
-  LINK_LIBRARIES specified but there is no content
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt 
b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
index 77ede4c..18ad751 100644
--- a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
+++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
@@ -1,4 +1,4 @@
 CMake Error at NoOutputVariable.cmake:1 \(try_compile\):
-  OUTPUT_VARIABLE specified but there is no variable
+  OUTPUT_VARIABLE must be followed by a variable name
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt 
b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt
similarity index 100%
rename from Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
rename to Tests/RunCMake/try_compile/NoOutputVariable2-result.txt
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt 
b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt
new file mode 100644
index 0000000..8b2cc25
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoOutputVariable2.cmake:1 \(try_compile\):
+  OUTPUT_VARIABLE must be followed by a variable name
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake 
b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake
similarity index 68%
rename from Tests/RunCMake/try_compile/NoLinkLibraries.cmake
rename to Tests/RunCMake/try_compile/NoOutputVariable2.cmake
index 04c5758..ad9ac9a 100644
--- a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake
+++ b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake
@@ -1,2 +1,2 @@
 try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
-  LINK_LIBRARIES)
+  OUTPUT_VARIABLE CMAKE_FLAGS -DA=B)
diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt 
b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
index cf02efb..025e658 100644
--- a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
+++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
@@ -1,4 +1,4 @@
 CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\):
-  COMPILE_FLAGS specified on a srcdir type TRY_COMPILE
+  COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake 
b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index a4248ec..31643cf 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -4,8 +4,9 @@ run_cmake(NoArgs)
 run_cmake(OneArg)
 run_cmake(TwoArgs)
 run_cmake(NoCopyFile)
+run_cmake(NoCopyFile2)
 run_cmake(NoOutputVariable)
-run_cmake(NoLinkLibraries)
+run_cmake(NoOutputVariable2)
 run_cmake(BadLinkLibraries)
 run_cmake(NonSourceCopyFile)
 run_cmake(NonSourceCompileDefinitions)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b680824a5fdcc54c265c64ce8958f9d80acad70d
commit b680824a5fdcc54c265c64ce8958f9d80acad70d
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed May 15 15:19:20 2013 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 31 10:00:42 2013 -0400

    try_compile: Add test for bad call error cases
    
    Add a RunCMake.try_compile test to cover cases of bad invocation of the
    try_compile command.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 66f86b6..f1e01b1 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -76,6 +76,7 @@ add_RunCMake_test(if)
 add_RunCMake_test(include)
 add_RunCMake_test(include_directories)
 add_RunCMake_test(list)
+add_RunCMake_test(try_compile)
 add_RunCMake_test(CMP0004)
 
 find_package(Qt4 QUIET)
diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt 
b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt 
b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
new file mode 100644
index 0000000..eceffec
--- /dev/null
+++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BadLinkLibraries.cmake:2 \(try_compile\):
+  Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES.  Got
+  not_a_library of type UTILITY.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries.cmake 
b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake
new file mode 100644
index 0000000..e8b5add
--- /dev/null
+++ b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake
@@ -0,0 +1,3 @@
+add_custom_target(not_a_library)
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
+  LINK_LIBRARIES not_a_library)
diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt 
b/Tests/RunCMake/try_compile/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/try_compile/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/try_compile/NoArgs-result.txt 
b/Tests/RunCMake/try_compile/NoArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoArgs-stderr.txt 
b/Tests/RunCMake/try_compile/NoArgs-stderr.txt
new file mode 100644
index 0000000..8808fd1
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoArgs.cmake:1 \(try_compile\):
+  try_compile unknown error.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoArgs.cmake 
b/Tests/RunCMake/try_compile/NoArgs.cmake
new file mode 100644
index 0000000..8f751d9
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoArgs.cmake
@@ -0,0 +1 @@
+try_compile()
diff --git a/Tests/RunCMake/try_compile/NoCopyFile-result.txt 
b/Tests/RunCMake/try_compile/NoCopyFile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoCopyFile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt 
b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
new file mode 100644
index 0000000..096fd98
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoCopyFile.cmake:1 \(try_compile\):
+  COPY_FILE specified but there is no variable
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoCopyFile.cmake 
b/Tests/RunCMake/try_compile/NoCopyFile.cmake
new file mode 100644
index 0000000..8c648ff
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoCopyFile.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
+  COPY_FILE)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt 
b/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt 
b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
new file mode 100644
index 0000000..507dce0
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoLinkLibraries.cmake:1 \(try_compile\):
+  LINK_LIBRARIES specified but there is no content
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake 
b/Tests/RunCMake/try_compile/NoLinkLibraries.cmake
new file mode 100644
index 0000000..04c5758
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLinkLibraries.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
+  LINK_LIBRARIES)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-result.txt 
b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt 
b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
new file mode 100644
index 0000000..77ede4c
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoOutputVariable.cmake:1 \(try_compile\):
+  OUTPUT_VARIABLE specified but there is no variable
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable.cmake 
b/Tests/RunCMake/try_compile/NoOutputVariable.cmake
new file mode 100644
index 0000000..3b9cb34
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} 
${CMAKE_CURRENT_SOURCE_DIR}/src.c
+  OUTPUT_VARIABLE)
diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt 
b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt 
b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
new file mode 100644
index 0000000..cf02efb
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\):
+  COMPILE_FLAGS specified on a srcdir type TRY_COMPILE
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake 
b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake
new file mode 100644
index 0000000..8eb0d47
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj
+  TestProject COMPILE_DEFINITIONS DEF)
diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt 
b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt 
b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt
new file mode 100644
index 0000000..f5893e1
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NonSourceCopyFile.cmake:1 \(try_compile\):
+  COPY_FILE specified on a srcdir type TRY_COMPILE
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake 
b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake
new file mode 100644
index 0000000..c44192f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj
+  TestProject COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/result)
diff --git a/Tests/RunCMake/try_compile/OneArg-result.txt 
b/Tests/RunCMake/try_compile/OneArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/OneArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/OneArg-stderr.txt 
b/Tests/RunCMake/try_compile/OneArg-stderr.txt
new file mode 100644
index 0000000..12835be
--- /dev/null
+++ b/Tests/RunCMake/try_compile/OneArg-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at OneArg.cmake:1 \(try_compile\):
+  try_compile unknown error.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/OneArg.cmake 
b/Tests/RunCMake/try_compile/OneArg.cmake
new file mode 100644
index 0000000..e60a462
--- /dev/null
+++ b/Tests/RunCMake/try_compile/OneArg.cmake
@@ -0,0 +1 @@
+try_compile(RESULT)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake 
b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
new file mode 100644
index 0000000..a4248ec
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -0,0 +1,11 @@
+include(RunCMake)
+
+run_cmake(NoArgs)
+run_cmake(OneArg)
+run_cmake(TwoArgs)
+run_cmake(NoCopyFile)
+run_cmake(NoOutputVariable)
+run_cmake(NoLinkLibraries)
+run_cmake(BadLinkLibraries)
+run_cmake(NonSourceCopyFile)
+run_cmake(NonSourceCompileDefinitions)
diff --git a/Tests/RunCMake/try_compile/TwoArgs-result.txt 
b/Tests/RunCMake/try_compile/TwoArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TwoArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/TwoArgs-stderr.txt 
b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt
new file mode 100644
index 0000000..b9c08fc
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at TwoArgs.cmake:1 \(try_compile\):
+  try_compile unknown error.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/TwoArgs.cmake 
b/Tests/RunCMake/try_compile/TwoArgs.cmake
new file mode 100644
index 0000000..7f2212d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/TwoArgs.cmake
@@ -0,0 +1 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt 
b/Tests/RunCMake/try_compile/proj/CMakeLists.txt
new file mode 100644
index 0000000..78a87c0
--- /dev/null
+++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 2.8.10)
+project(TestProject NONE)
diff --git a/Tests/RunCMake/try_compile/src.c b/Tests/RunCMake/try_compile/src.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/RunCMake/try_compile/src.c
@@ -0,0 +1 @@
+int main(void) { return 0; }

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

Summary of changes:
 Source/cmCoreTryCompile.cxx                        |  236 +++++++++-----------
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../BadLinkLibraries-result.txt}                   |    0
 .../try_compile/BadLinkLibraries-stderr.txt        |    5 +
 Tests/RunCMake/try_compile/BadLinkLibraries.cmake  |    3 +
 .../{CMP0004 => try_compile}/CMakeLists.txt        |    0
 .../NoArgs-result.txt}                             |    0
 Tests/RunCMake/try_compile/NoArgs-stderr.txt       |    4 +
 Tests/RunCMake/try_compile/NoArgs.cmake            |    1 +
 .../NoCopyFile-result.txt}                         |    0
 Tests/RunCMake/try_compile/NoCopyFile-stderr.txt   |    4 +
 Tests/RunCMake/try_compile/NoCopyFile.cmake        |    2 +
 .../NoCopyFile2-result.txt}                        |    0
 Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt  |    4 +
 Tests/RunCMake/try_compile/NoCopyFile2.cmake       |    2 +
 .../NoOutputVariable-result.txt}                   |    0
 .../try_compile/NoOutputVariable-stderr.txt        |    4 +
 Tests/RunCMake/try_compile/NoOutputVariable.cmake  |    2 +
 .../NoOutputVariable2-result.txt}                  |    0
 .../try_compile/NoOutputVariable2-stderr.txt       |    4 +
 Tests/RunCMake/try_compile/NoOutputVariable2.cmake |    2 +
 .../NonSourceCompileDefinitions-result.txt}        |    0
 .../NonSourceCompileDefinitions-stderr.txt         |    4 +
 .../try_compile/NonSourceCompileDefinitions.cmake  |    2 +
 .../NonSourceCopyFile-result.txt}                  |    0
 .../try_compile/NonSourceCopyFile-stderr.txt       |    4 +
 Tests/RunCMake/try_compile/NonSourceCopyFile.cmake |    2 +
 .../OneArg-result.txt}                             |    0
 Tests/RunCMake/try_compile/OneArg-stderr.txt       |    4 +
 Tests/RunCMake/try_compile/OneArg.cmake            |    1 +
 Tests/RunCMake/try_compile/RunCMakeTest.cmake      |   12 +
 .../TwoArgs-result.txt}                            |    0
 Tests/RunCMake/try_compile/TwoArgs-stderr.txt      |    4 +
 Tests/RunCMake/try_compile/TwoArgs.cmake           |    1 +
 Tests/RunCMake/try_compile/proj/CMakeLists.txt     |    2 +
 .../main.c => RunCMake/try_compile/src.c}          |    0
 36 files changed, 177 insertions(+), 133 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/BadLinkLibraries-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/BadLinkLibraries.cmake
 copy Tests/RunCMake/{CMP0004 => try_compile}/CMakeLists.txt (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NoArgs-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NoArgs-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NoArgs.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NoCopyFile-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NoCopyFile.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NoCopyFile2-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NoCopyFile2.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NoOutputVariable-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NoOutputVariable2-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NoOutputVariable2.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NonSourceCompileDefinitions-result.txt} (100%)
 create mode 100644 
Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/NonSourceCopyFile-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/NonSourceCopyFile.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/OneArg-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/OneArg-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/OneArg.cmake
 create mode 100644 Tests/RunCMake/try_compile/RunCMakeTest.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_compile/TwoArgs-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_compile/TwoArgs-stderr.txt
 create mode 100644 Tests/RunCMake/try_compile/TwoArgs.cmake
 create mode 100644 Tests/RunCMake/try_compile/proj/CMakeLists.txt
 copy Tests/{CMakeOnly/LinkInterfaceLoop/main.c => RunCMake/try_compile/src.c} 
(100%)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to