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  f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5 (commit)
       via  444a7331ef2da0270a1c2fef7eb16fbdea4c3976 (commit)
       via  78831279eade5a1e6490be244fc19b26d34366f1 (commit)
      from  688d06a039b3c1a3305bd73922e74d3f5eb3c5a2 (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=f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5
commit f682e2a20b69b8bb1113ea25e907b03dd3fe4ba5
Merge: 688d06a 444a733
Author:     Matt McCormick <matt.mccorm...@kitware.com>
AuthorDate: Thu Jan 22 19:54:07 2015 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Jan 22 19:54:07 2015 -0500

    Merge topic 'try-run-link-libraries' into next
    
    444a7331 try_run: Add tests for LINK_LIBRARIES with mock libraries.
    78831279 try_run: Add test for bad link libraries.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=444a7331ef2da0270a1c2fef7eb16fbdea4c3976
commit 444a7331ef2da0270a1c2fef7eb16fbdea4c3976
Author:     Matt McCormick <matt.mccorm...@kitware.com>
AuthorDate: Thu Jan 22 19:53:16 2015 -0500
Commit:     Matt McCormick <matt.mccorm...@kitware.com>
CommitDate: Thu Jan 22 19:53:16 2015 -0500

    try_run: Add tests for LINK_LIBRARIES with mock libraries.

diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt 
b/Tests/ExportImport/Import/A/CMakeLists.txt
index 9450c82..d64e917 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -311,6 +311,21 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND 
CMAKE_C_COMPILER_VERSION VERSION_GREA
       message(SEND_ERROR "EXP_ERROR_VARIABLE try_compile failed, but it was 
expected to succeed ${OUTPUT}.")
     endif()
 
+    if(NOT CMAKE_CROSSCOMPILING)
+      unset(EXP_RUN_VAR CACHE)
+      unset(EXP_COMPILE_VAR CACHE)
+      try_run(EXP_RUN_VAR EXP_COMPILE_VAR
+        "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
+        "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+        COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
+        LINK_LIBRARIES exp_systemlib
+        OUTPUT_VARIABLE OUTPUT
+        )
+      if(NOT EXP_COMPILE_VAR OR NOT EXP_RUN_VAR EQUAL 0)
+        message(SEND_ERROR "try_run failed, but it was expected to succeed 
${OUTPUT}.")
+      endif()
+    endif()
+
     add_executable(test_system_bld test_system.cpp)
     target_link_libraries(test_system_bld bld_systemlib)
     target_compile_options(test_system_bld PRIVATE -Wunused-variable 
-Werror=unused-variable)
@@ -326,5 +341,20 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND 
CMAKE_C_COMPILER_VERSION VERSION_GREA
     if(NOT BLD_ERROR_VARIABLE)
       message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was 
expected to succeed.")
     endif()
+
+    if(NOT CMAKE_CROSSCOMPILING)
+      unset(BLD_RUN_VAR CACHE)
+      unset(BLD_COMPILE_VAR CACHE)
+      try_run(BLD_RUN_VAR BLD_COMPILE_VAR
+        "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
+        "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+        COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
+        LINK_LIBRARIES bld_systemlib
+        OUTPUT_VARIABLE OUTPUT
+        )
+      if(NOT BLD_COMPILE_VAR OR NOT BLD_RUN_VAR EQUAL 0)
+        message(SEND_ERROR "try_run failed, but it was expected to succeed 
${OUTPUT}.")
+      endif()
+    endif()
   endif()
 endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78831279eade5a1e6490be244fc19b26d34366f1
commit 78831279eade5a1e6490be244fc19b26d34366f1
Author:     Matt McCormick <matt.mccorm...@kitware.com>
AuthorDate: Thu Jan 22 19:13:56 2015 -0500
Commit:     Matt McCormick <matt.mccorm...@kitware.com>
CommitDate: Thu Jan 22 19:14:32 2015 -0500

    try_run: Add test for bad link libraries.
    
    Based off the corresponding try_compile test.

diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 0030b84..2f58d96 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -109,7 +109,7 @@ int 
cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
               }
           default:
             this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-              "Only libraries may be used as try_compile IMPORTED "
+              "Only libraries may be used as try_compile or try_run IMPORTED "
               "LINK_LIBRARIES.  Got " + std::string(tgt->GetName()) + " of "
               "type " + tgt->GetTargetTypeName(tgt->GetType()) + ".");
             return -1;
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index b5e41d9..78d375e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -130,6 +130,7 @@ add_RunCMake_test(project)
 add_RunCMake_test(return)
 add_RunCMake_test(string)
 add_RunCMake_test(try_compile)
+add_RunCMake_test(try_run)
 add_RunCMake_test(set)
 add_RunCMake_test(variable_watch)
 add_RunCMake_test(CMP0004)
diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt 
b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
index eceffec..652bcfc 100644
--- a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
+++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt
@@ -1,5 +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.
+  Only libraries may be used as try_compile or try_run 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_run/BadLinkLibraries-result.txt 
b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_run/BadLinkLibraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt 
b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt
new file mode 100644
index 0000000..dcd1bfc
--- /dev/null
+++ b/Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BadLinkLibraries.cmake:2 \(try_run\):
+  Only libraries may be used as try_compile or try_run 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_run/BadLinkLibraries.cmake 
b/Tests/RunCMake/try_run/BadLinkLibraries.cmake
new file mode 100644
index 0000000..a124bf6
--- /dev/null
+++ b/Tests/RunCMake/try_run/BadLinkLibraries.cmake
@@ -0,0 +1,4 @@
+add_custom_target(not_a_library)
+try_run(RUN_RESULT COMPILE_RESULT
+  ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+  LINK_LIBRARIES not_a_library)
diff --git a/Tests/RunCMake/try_run/CMakeLists.txt 
b/Tests/RunCMake/try_run/CMakeLists.txt
new file mode 100644
index 0000000..e034780
--- /dev/null
+++ b/Tests/RunCMake/try_run/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.0)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake 
b/Tests/RunCMake/try_run/RunCMakeTest.cmake
new file mode 100644
index 0000000..1ec9a55
--- /dev/null
+++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(BadLinkLibraries)
diff --git a/Tests/RunCMake/try_run/src.c b/Tests/RunCMake/try_run/src.c
new file mode 100644
index 0000000..78f2de1
--- /dev/null
+++ b/Tests/RunCMake/try_run/src.c
@@ -0,0 +1 @@
+int main(void) { return 0; }

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

Summary of changes:
 Source/cmCoreTryCompile.cxx                        |    2 +-
 Tests/ExportImport/Import/A/CMakeLists.txt         |   30 ++++++++++++++++++++
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../try_compile/BadLinkLibraries-stderr.txt        |    4 +--
 .../BadLinkLibraries-result.txt}                   |    0
 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt |    5 ++++
 Tests/RunCMake/try_run/BadLinkLibraries.cmake      |    4 +++
 .../{ObjectLibrary => try_run}/CMakeLists.txt      |    2 +-
 Tests/RunCMake/try_run/RunCMakeTest.cmake          |    3 ++
 Tests/RunCMake/{try_compile => try_run}/src.c      |    0
 10 files changed, 47 insertions(+), 4 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => 
try_run/BadLinkLibraries-result.txt} (100%)
 create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries-stderr.txt
 create mode 100644 Tests/RunCMake/try_run/BadLinkLibraries.cmake
 copy Tests/RunCMake/{ObjectLibrary => try_run}/CMakeLists.txt (61%)
 create mode 100644 Tests/RunCMake/try_run/RunCMakeTest.cmake
 copy Tests/RunCMake/{try_compile => try_run}/src.c (100%)


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

Reply via email to