[Cmake-commits] CMake branch, next, updated. v3.2.1-1556-g68fc449

Brad King brad.king at kitware.com
Tue Apr 7 11:24:23 EDT 2015


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  68fc449d9bbf90f05a1a2fa711612ba5ce62d594 (commit)
       via  446a1866e17ed79403a5ddb8e75c3acd3badc460 (commit)
       via  318cd37097c724fac13a364fe3beb21055575ae7 (commit)
       via  1535dcd894eab9eea023d93aec6a0274babc7fd3 (commit)
      from  3edfc7c8774e64a54b2222c8d52db3213eaf3248 (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=68fc449d9bbf90f05a1a2fa711612ba5ce62d594
commit 68fc449d9bbf90f05a1a2fa711612ba5ce62d594
Merge: 3edfc7c 446a186
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 7 11:24:20 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Apr 7 11:24:20 2015 -0400

    Merge topic 'link-implicit-libs-full-path' into next
    
    446a1866 Link libraries by full path even in implicit directories
    318cd370 Help: Add link target for Find Modules section of cmake-developer.7
    1535dcd8 Tests: Teach RunCMake to optionally merge command output to stdout


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=446a1866e17ed79403a5ddb8e75c3acd3badc460
commit 446a1866e17ed79403a5ddb8e75c3acd3badc460
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 7 10:43:47 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 7 11:15:33 2015 -0400

    Link libraries by full path even in implicit directories
    
    When CMP0003 was first introduced we wanted to link all libraries by
    full path.  However, some projects had problems on platforms where
    find_library would find /usr/lib/libfoo.so when the project really
    wanted to link to /usr/lib/<arch>/libfoo.so and had been working by
    accident because pre-CMP0003 behavior used -lfoo to link.
    
    We first tried to address that in commit v2.6.0~440 (Teach find_library
    to avoid returning library paths in system directories, 2008-01-23) by
    returning just "foo" for libraries in implicit link directories.  This
    caused problems for projects expecting find_library to always return a
    full path.  We ended up using the solution in commit v2.6.0~366 (...
    switch library paths found in implicit link directories to use -l,
    2008-01-31).  However, the special case for libraries in implicit link
    directories has also proven problematic and confusing.
    
    Introduce policy CMP0060 to switch to linking all libraries by full path
    even if they are in implicit link directories.  Explain in the policy
    documentation the factors that led to the original approach and now to
    this approach.

diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index 393c8b4..d903d05 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -34,14 +34,20 @@ Each ``<item>`` may be:
   automatically be added in the build system to make sure the named
   library target is up-to-date before the ``<target>`` links.
 
+  If an imported library has the :prop_tgt:`IMPORTED_NO_SONAME`
+  target property set, CMake may ask the linker to search for
+  the library instead of using the full path
+  (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``).
+
 * **A full path to a library file**: The generated link line will
-  normally preserve the full path to the file.  However, there are
-  some cases where CMake must ask the linker to search for the library
-  (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such as when it
-  appears in a system library directory that the compiler front-end
-  may replace with an alternative.  Either way, the buildsystem will
+  normally preserve the full path to the file. The buildsystem will
   have a dependency to re-link ``<target>`` if the library file changes.
 
+  There are some cases where CMake may ask the linker to search for
+  the library (e.g. ``/usr/lib/libfoo.so`` becomes ``-lfoo``), such
+  as when a shared library is detected to have no ``SONAME`` field.
+  See policy :policy:`CMP0060` for discussion of another case.
+
   If the library file is in a Mac OSX framework, the ``Headers`` directory
   of the framework will also be processed as a
   :ref:`usage requirement <Target Usage Requirements>`.  This has the same
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index d2960de..aff696d 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -117,3 +117,4 @@ All Policies
    /policy/CMP0057
    /policy/CMP0058
    /policy/CMP0059
+   /policy/CMP0060
diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst
new file mode 100644
index 0000000..489d68f
--- /dev/null
+++ b/Help/policy/CMP0060.rst
@@ -0,0 +1,62 @@
+CMP0060
+-------
+
+Link libraries by full path even in implicit directories.
+
+Policy :policy:`CMP0003` was introduced with the intention of always
+linking library files by full path when known.  However, on some
+platforms (e.g. HP-UX) the compiler front-end adds alternative library
+search paths for the current architecture (e.g. ``/usr/lib/<arch>`` has
+alternatives to libraries in ``/usr/lib`` for the current architecture).
+On such platforms the :command:`find_library` may find a library such as
+``/usr/lib/libfoo.so`` that does not belong to the current architecture.
+
+Prior to policy :policy:`CMP0003` projects would still build in such
+cases because the incorrect library path would be converted to ``-lfoo``
+on the link line and the linker would find the proper library in the
+arch-specific search path provided by the compiler front-end implicitly.
+At the time we chose to remain compatible with such projects by always
+converting library files found in implicit link directories to ``-lfoo``
+flags to ask the linker to search for them.  This approach allowed existing
+projects to continue to build while still linking to libraries outside
+implicit link directories via full path (such as those in the build tree).
+
+CMake does allow projects to override this behavior by using an
+:ref:`IMPORTED library target <Imported Targets>` with its
+:prop_tgt:`IMPORTED_LOCATION` property set to the desired full path to
+a library file.  In fact, many :ref:`Find Modules` are learning to provide
+:ref:`Imported Targets` instead of just the traditional ``Foo_LIBRARIES``
+variable listing library files.  However, this makes the link line
+generated for a library found by a Find Module depend on whether it
+is linked through an imported target or not, which is inconsistent.
+Furthermore, this behavior has been a source of confusion because the
+generated link line for a library file depends on its location.  It is
+also problematic for projects trying to link statically because flags
+like ``-Wl,-Bstatic -lfoo -Wl,-Bdynamic`` may be used to help the linker
+select ``libfoo.a`` instead of ``libfoo.so`` but then leak dynamic linking
+to following libraries.  (See the :prop_tgt:`LINK_SEARCH_END_STATIC`
+target property for a solution typically used for that problem.)
+
+When the special case for libraries in implicit link directories was first
+introduced the list of implicit link directories was simply hard-coded
+(e.g. ``/lib``, ``/usr/lib``, and a few others).  Since that time, CMake
+has learned to detect the implicit link directories used by the compiler
+front-end.  If necessary, the :command:`find_library` command could be
+taught to use this information to help find libraries of the proper
+architecture.
+
+For these reasons, CMake 3.3 and above prefer to drop the special case
+and link libraries by full path even when they are in implicit link
+directories.  Policy ``CMP0060`` provides compatibility for existing
+projects.
+
+The OLD behavior for this policy is to ask the linker to search for
+libraries whose full paths are known to be in implicit link directories.
+The NEW behavior for this policy is to link libraries by full path even
+if they are in implicit link directories.
+
+This policy was introduced in CMake version 3.3.  Unlike most policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses OLD behavior.  See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0060 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
diff --git a/Help/release/dev/link-implicit-libs-full-path.rst b/Help/release/dev/link-implicit-libs-full-path.rst
new file mode 100644
index 0000000..7ed7245
--- /dev/null
+++ b/Help/release/dev/link-implicit-libs-full-path.rst
@@ -0,0 +1,6 @@
+link-implicit-libs-full-path
+----------------------------
+
+* Linking to library files by a full path in an implicit linker search
+  directory (e.g. ``/usr/lib/libfoo.a``) no longer asks the linker to
+  search for the library (e.g. ``-lfoo``).  See policy :policy:`CMP0060`.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index a83c807..092fe3e 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -11,6 +11,8 @@ warn by default:
   policy :policy:`CMP0047`.
 * ``CMAKE_POLICY_WARNING_CMP0056`` controls the warning for
   policy :policy:`CMP0056`.
+* ``CMAKE_POLICY_WARNING_CMP0060`` controls the warning for
+  policy :policy:`CMP0060`.
 
 This variable should not be set by a project in CMake code.  Project
 developers running CMake may set this variable in their cache to
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index b0e0f36..8880667 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -411,6 +411,10 @@ cmComputeLinkInformation
     std::vector<std::string> const& dirs = this->Target->GetLinkDirectories();
     this->OldLinkDirMask.insert(dirs.begin(), dirs.end());
     }
+
+  this->CMP0060Warn =
+    this->Makefile->PolicyOptionalWarningEnabled(
+      "CMAKE_POLICY_WARNING_CMP0060");
 }
 
 //----------------------------------------------------------------------------
@@ -548,6 +552,22 @@ bool cmComputeLinkInformation::Compute()
   // Add implicit language runtime libraries and directories.
   this->AddImplicitLinkInfo();
 
+  if (!this->CMP0060WarnItems.empty())
+    {
+    std::ostringstream w;
+    w << (this->Makefile->GetCMakeInstance()->GetPolicies()
+          ->GetPolicyWarning(cmPolicies::CMP0060)) << "\n"
+      "Some library files are in directories implicitly searched by "
+      "the linker when invoked for " << this->LinkLanguage << ":\n"
+      " " << cmJoin(this->CMP0060WarnItems, "\n ") << "\n"
+      "For compatibility with older versions of CMake, the generated "
+      "link line will ask the linker to search for these by library "
+      "name."
+      ;
+    this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+                                      this->Target->GetBacktrace());
+    }
+
   return true;
 }
 
@@ -1190,6 +1210,28 @@ bool cmComputeLinkInformation::CheckImplicitDirItem(std::string const& item)
     return false;
     }
 
+  // Check the policy for whether we should use the approach below.
+  switch (this->Target->GetPolicyStatusCMP0060())
+    {
+    case cmPolicies::WARN:
+      if (this->CMP0060Warn)
+        {
+        // Print the warning at most once for this item.
+        std::string const& wid = "CMP0060-WARNING-GIVEN-" + item;
+        if (!this->CMakeInstance->GetPropertyAsBool(wid))
+          {
+          this->CMakeInstance->SetProperty(wid, "1");
+          this->CMP0060WarnItems.insert(item);
+          }
+        }
+    case cmPolicies::OLD:
+      break;
+    case cmPolicies::REQUIRED_ALWAYS:
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::NEW:
+      return false;
+    }
+
   // Many system linkers support multiple architectures by
   // automatically selecting the implicit linker search path for the
   // current architecture.  If the library appears in an implicit link
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index e5d674a..8847141 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -175,6 +175,10 @@ private:
   std::vector<std::string> OldUserFlagItems;
   bool OldLinkDirMode;
 
+  // CMP0060 warnings.
+  bool CMP0060Warn;
+  std::set<std::string> CMP0060WarnItems;
+
   // Runtime path computation.
   cmOrderDirectories* OrderRuntimeSearchPath;
   void AddLibraryRuntimeInfo(std::string const& fullPath,
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 0a61bca..e7678cb 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -390,6 +390,11 @@ cmPolicies::cmPolicies()
     CMP0059, "CMP0059",
     "Do no treat DEFINITIONS as a built-in directory property.",
     3,3,0, cmPolicies::WARN);
+
+  this->DefinePolicy(
+    CMP0060, "CMP0060",
+    "Link libraries by full path even in implicit directories.",
+    3,3,0, cmPolicies::WARN);
 }
 
 cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index ced9d8c..1d108c1 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -118,6 +118,7 @@ public:
     CMP0058, ///< Ninja requires custom command byproducts to be explicit
     CMP0059, ///< Do not treat ``DEFINITIONS`` as a built-in directory
     /// property.
+    CMP0060, ///< Link libraries by full path even in implicit directories.
 
     /** \brief Always the last entry.
      *
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a4ef977..55bf234 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -34,7 +34,8 @@
   F(CMP0041) \
   F(CMP0042) \
   F(CMP0046) \
-  F(CMP0052)
+  F(CMP0052) \
+  F(CMP0060)
 
 class cmake;
 class cmMakefile;
diff --git a/Tests/RunCMake/CMP0060/CMP0060-Common.cmake b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake
new file mode 100644
index 0000000..46cfbbf
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-Common.cmake
@@ -0,0 +1,23 @@
+# Use a predictable library file name on all platforms.
+set(CMAKE_STATIC_LIBRARY_PREFIX lib)
+set(CMAKE_STATIC_LIBRARY_SUFFIX .a)
+
+# Convince CMake that it can instruct the linker to search for the
+# library of the proper linkage type, but do not really pass flags.
+set(CMAKE_EXE_LINK_STATIC_C_FLAGS " ")
+set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS " ")
+
+# Convince CMake that our library is in an implicit linker search directory.
+set(dir ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${dir})
+
+# Make a link line asking for the linker to search for the library
+# look like a missing object file so we will get predictable content
+# in the error message.
+set(CMAKE_LINK_LIBRARY_FLAG LINKFLAG_)
+set(CMAKE_LINK_LIBRARY_SUFFIX _LINKSUFFIX${CMAKE_C_OUTPUT_EXTENSION})
+
+add_executable(main1 main.c)
+target_link_libraries(main1 ${dir}/libCMP0060.a)
+add_executable(main2 main.c)
+target_link_libraries(main2 ${dir}/libCMP0060.a)
diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt
new file mode 100644
index 0000000..258d73f
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[\/]RunCMake[\/]CMP0060[\/]lib[\/]libCMP0060.a
diff --git a/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake
new file mode 100644
index 0000000..0414e4b
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0060 NEW)
+include(CMP0060-Common.cmake)
diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt
new file mode 100644
index 0000000..240764c
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt
@@ -0,0 +1 @@
+LINKFLAG_CMP0060_LINKSUFFIX
diff --git a/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake
new file mode 100644
index 0000000..a9cffef
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0060 OLD)
+include(CMP0060-Common.cmake)
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt
new file mode 100644
index 0000000..240764c
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt
@@ -0,0 +1 @@
+LINKFLAG_CMP0060_LINKSUFFIX
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake
new file mode 100644
index 0000000..6b84565
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake
@@ -0,0 +1 @@
+include(CMP0060-Common.cmake)
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt
new file mode 100644
index 0000000..240764c
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt
@@ -0,0 +1 @@
+LINKFLAG_CMP0060_LINKSUFFIX
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt
new file mode 100644
index 0000000..c8d9d9a
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt
@@ -0,0 +1,16 @@
+^CMake Warning \(dev\) at CMP0060-Common.cmake:[0-9]+ \(add_executable\):
+  Policy CMP0060 is not set: Link libraries by full path even in implicit
+  directories.  Run "cmake --help-policy CMP0060" for policy details.  Use
+  the cmake_policy command to set the policy and suppress this warning.
+
+  Some library files are in directories implicitly searched by the linker
+  when invoked for C:
+
+   .*/Tests/RunCMake/CMP0060/lib/libCMP0060.a
+
+  For compatibility with older versions of CMake, the generated link line
+  will ask the linker to search for these by library name.
+Call Stack \(most recent call first\):
+  CMP0060-WARN-ON.cmake:[0-9]+ \(include\)
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake
new file mode 100644
index 0000000..a0a7950
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_POLICY_WARNING_CMP0060 1)
+include(CMP0060-Common.cmake)
diff --git a/Tests/RunCMake/CMP0060/CMakeLists.txt b/Tests/RunCMake/CMP0060/CMakeLists.txt
new file mode 100644
index 0000000..db6b701
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.2)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0060/RunCMakeTest.cmake b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake
new file mode 100644
index 0000000..afb78fc
--- /dev/null
+++ b/Tests/RunCMake/CMP0060/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+function(run_cmake_CMP0060 CASE)
+  set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0060-${CASE}-build)
+  set(RunCMake_TEST_NO_CLEAN 1)
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+  run_cmake(CMP0060-${CASE})
+  set(RunCMake_TEST_OUTPUT_MERGE 1)
+  run_cmake_command(CMP0060-${CASE}-Build
+    ${CMAKE_COMMAND} --build . --config Debug
+    )
+endfunction()
+
+run_cmake_CMP0060(OLD)
+run_cmake_CMP0060(NEW)
+run_cmake_CMP0060(WARN-OFF)
+run_cmake_CMP0060(WARN-ON)
diff --git a/Tests/RunCMake/CMP0060/lib/libCMP0060.a b/Tests/RunCMake/CMP0060/lib/libCMP0060.a
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CMP0060/main.c b/Tests/RunCMake/CMP0060/main.c
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 60a8a82..de8db56 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -65,6 +65,9 @@ add_RunCMake_test(CMP0054)
 add_RunCMake_test(CMP0055)
 add_RunCMake_test(CMP0057)
 add_RunCMake_test(CMP0059)
+if (NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
+  add_RunCMake_test(CMP0060)
+endif()
 if(CMAKE_GENERATOR STREQUAL "Ninja")
   add_RunCMake_test(Ninja)
 endif()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=318cd37097c724fac13a364fe3beb21055575ae7
commit 318cd37097c724fac13a364fe3beb21055575ae7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 7 10:06:34 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 7 10:30:57 2015 -0400

    Help: Add link target for Find Modules section of cmake-developer.7

diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 7bffa42..ab74140 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -605,6 +605,7 @@ have a .cmake file in this directory NOT show up in the modules
 documentation, simply leave out the ``Help/module/<module-name>.rst``
 file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
 
+.. _`Find Modules`:
 
 Find Modules
 ------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1535dcd894eab9eea023d93aec6a0274babc7fd3
commit 1535dcd894eab9eea023d93aec6a0274babc7fd3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 7 09:06:51 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 7 09:08:39 2015 -0400

    Tests: Teach RunCMake to optionally merge command output to stdout
    
    Some tests may need to read "cmake --build" output passed through from
    native build tools and do not know if it will be on stdout or stderr.
    Optionally use the same variable for the execute_process output so
    that it merges them and we can always match using expected stdout.

diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index abac66e..6333703 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -54,12 +54,18 @@ function(run_cmake test)
   if(RunCMake_MAKE_PROGRAM)
     list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}")
   endif()
+  if(RunCMake_TEST_OUTPUT_MERGE)
+    set(actual_stderr_var actual_stdout)
+    set(actual_stderr "")
+  else()
+    set(actual_stderr_var actual_stderr)
+  endif()
   if(RunCMake_TEST_COMMAND)
     execute_process(
       COMMAND ${RunCMake_TEST_COMMAND}
       WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
       OUTPUT_VARIABLE actual_stdout
-      ERROR_VARIABLE actual_stderr
+      ERROR_VARIABLE ${actual_stderr_var}
       RESULT_VARIABLE actual_result
       )
   else()
@@ -73,7 +79,7 @@ function(run_cmake test)
                 ${RunCMake_TEST_OPTIONS}
       WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
       OUTPUT_VARIABLE actual_stdout
-      ERROR_VARIABLE actual_stderr
+      ERROR_VARIABLE ${actual_stderr_var}
       RESULT_VARIABLE actual_result
       )
   endif()

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

Summary of changes:
 Help/command/target_link_libraries.rst             |   16 +++--
 Help/manual/cmake-developer.7.rst                  |    1 +
 Help/manual/cmake-policies.7.rst                   |    1 +
 Help/policy/CMP0060.rst                            |   62 ++++++++++++++++++++
 Help/release/dev/link-implicit-libs-full-path.rst  |    6 ++
 Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst     |    2 +
 Source/cmComputeLinkInformation.cxx                |   42 +++++++++++++
 Source/cmComputeLinkInformation.h                  |    4 ++
 Source/cmPolicies.cxx                              |    5 ++
 Source/cmPolicies.h                                |    1 +
 Source/cmTarget.h                                  |    3 +-
 Tests/RunCMake/CMP0060/CMP0060-Common.cmake        |   23 ++++++++
 .../RunCMake/CMP0060/CMP0060-NEW-Build-result.txt  |    1 +
 .../RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt  |    1 +
 Tests/RunCMake/CMP0060/CMP0060-NEW.cmake           |    2 +
 .../RunCMake/CMP0060/CMP0060-OLD-Build-result.txt  |    1 +
 .../RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt  |    1 +
 Tests/RunCMake/CMP0060/CMP0060-OLD.cmake           |    2 +
 .../CMP0060/CMP0060-WARN-OFF-Build-result.txt      |    1 +
 .../CMP0060/CMP0060-WARN-OFF-Build-stdout.txt      |    1 +
 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake      |    1 +
 .../CMP0060/CMP0060-WARN-ON-Build-result.txt       |    1 +
 .../CMP0060/CMP0060-WARN-ON-Build-stdout.txt       |    1 +
 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt  |   16 +++++
 Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake       |    2 +
 .../{ObjectLibrary => CMP0060}/CMakeLists.txt      |    2 +-
 Tests/RunCMake/CMP0060/RunCMakeTest.cmake          |   19 ++++++
 .../RunCMake/CMP0060/lib/libCMP0060.a              |    0
 Tests/RunCMake/{XcodeProject => CMP0060}/main.c    |    0
 Tests/RunCMake/CMakeLists.txt                      |    3 +
 Tests/RunCMake/RunCMake.cmake                      |   10 +++-
 31 files changed, 222 insertions(+), 9 deletions(-)
 create mode 100644 Help/policy/CMP0060.rst
 create mode 100644 Help/release/dev/link-implicit-libs-full-path.rst
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-Common.cmake
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-result.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW-Build-stdout.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-NEW.cmake
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-result.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD-Build-stdout.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-OLD.cmake
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-result.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF-Build-stdout.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-OFF.cmake
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-result.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-Build-stdout.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0060/CMP0060-WARN-ON.cmake
 copy Tests/RunCMake/{ObjectLibrary => CMP0060}/CMakeLists.txt (61%)
 create mode 100644 Tests/RunCMake/CMP0060/RunCMakeTest.cmake
 copy Modules/IntelVSImplicitPath/hello.f => Tests/RunCMake/CMP0060/lib/libCMP0060.a (100%)
 copy Tests/RunCMake/{XcodeProject => CMP0060}/main.c (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list