[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2773-g3c122fa

Stephen Kelly steveire at gmail.com
Tue May 6 08:03:22 EDT 2014


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  3c122fa1bdc4a619a6b9ab44c8217e5cd67ac2e6 (commit)
       via  d78ec426cd7fc5c602ffdce3c1d64e73264c4417 (commit)
      from  6012f71119506f0d759025b2384e7314dbcb5fe5 (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=3c122fa1bdc4a619a6b9ab44c8217e5cd67ac2e6
commit 3c122fa1bdc4a619a6b9ab44c8217e5cd67ac2e6
Merge: 6012f71 d78ec42
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue May 6 08:03:21 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 6 08:03:21 2014 -0400

    Merge topic 'no-assert-missing-objlib' into next
    
    d78ec426 cmTarget: Don't assert on object libraries for configure-time location.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d78ec426cd7fc5c602ffdce3c1d64e73264c4417
commit d78ec426cd7fc5c602ffdce3c1d64e73264c4417
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue May 6 13:16:23 2014 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue May 6 13:25:33 2014 +0200

    cmTarget: Don't assert on object libraries for configure-time location.
    
    Commit b8af2011 (cmTarget: Fix listing of source files at
    configure-time., 2014-04-13) refactored a GetObjectLibrariesCMP0026
    method out of GetLanguages.  In flight, a conditional use of a target
    if available was changed to an assert-available.
    
    This code is only used to read the LOCATION property at configure
    time, when the link information is incomplete, and not all targets
    are defined, so the assert is inappropriate, even though it can lead
    to incorrect information being generated.  CMP0026 warns about the
    potentially incorrect information anyway.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 6a87342..9d96fd9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5406,8 +5406,10 @@ cmTarget::GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const
           continue;
           }
         cmTarget *objLib = this->Makefile->FindTargetToUse(objLibName.c_str());
-        assert(objLib);
-        objlibs.push_back(objLib);
+        if(objLib)
+          {
+          objlibs.push_back(objLib);
+          }
         }
       }
     }
diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt
index 12cd3c7..f452db1 100644
--- a/Tests/RunCMake/CMP0026/CMakeLists.txt
+++ b/Tests/RunCMake/CMP0026/CMakeLists.txt
@@ -1,3 +1,3 @@
 cmake_minimum_required(VERSION 2.8.4)
-project(${RunCMake_TEST} NONE)
+project(${RunCMake_TEST} CXX)
 include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
new file mode 100644
index 0000000..c7bd990
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
@@ -0,0 +1,12 @@
+CMake Warning \(dev\) at ObjlibNotDefined.cmake:7 \(get_target_property\):
+  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
+  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
+  command to set the policy and suppress this warning.
+
+  The LOCATION property should not be read from target "objlibuser".  Use the
+  target name directly with add_custom_command, or use the generator
+  expression \$<TARGET_FILE>, as appropriate.
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake b/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
new file mode 100644
index 0000000..fe7de06
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake
@@ -0,0 +1,11 @@
+
+add_executable(objlibuser
+    empty.cpp
+    $<TARGET_OBJECTS:bar>
+)
+
+get_target_property(_location objlibuser LOCATION)
+
+add_library(bar OBJECT
+    empty.cpp
+)
diff --git a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
index 1824cc6..7c2582f 100644
--- a/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0026/RunCMakeTest.cmake
@@ -9,3 +9,4 @@ run_cmake(CMP0026-CONFIG-LOCATION-WARN)
 run_cmake(CMP0026-LOCATION-CONFIG-NEW)
 run_cmake(CMP0026-LOCATION-CONFIG-OLD)
 run_cmake(CMP0026-LOCATION-CONFIG-WARN)
+run_cmake(ObjlibNotDefined)

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

Summary of changes:
 Source/cmTarget.cxx                                         |    6 ++++--
 Tests/RunCMake/CMP0026/CMakeLists.txt                       |    2 +-
 .../ObjlibNotDefined-result.txt}                            |    0
 ...{CMP0026-WARN-stderr.txt => ObjlibNotDefined-stderr.txt} |    4 ++--
 Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake               |   11 +++++++++++
 Tests/RunCMake/CMP0026/RunCMakeTest.cmake                   |    1 +
 6 files changed, 19 insertions(+), 5 deletions(-)
 copy Tests/RunCMake/{CMP0022/CMP0022-WARN-empty-old-result.txt => CMP0026/ObjlibNotDefined-result.txt} (100%)
 copy Tests/RunCMake/CMP0026/{CMP0026-WARN-stderr.txt => ObjlibNotDefined-stderr.txt} (75%)
 create mode 100644 Tests/RunCMake/CMP0026/ObjlibNotDefined.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list