[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5854-gd109c9b

Peter Kuemmel syntheticpp at gmx.net
Tue Nov 26 13:40:54 EST 2013


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  d109c9b4997f56ac7b013a43f1e1d6924685b413 (commit)
       via  c82a2f01891b1b28aad36bdf67456c14d6d14e12 (commit)
      from  ff31bfedbf86e48fae4533080de1ff969ea51d20 (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=d109c9b4997f56ac7b013a43f1e1d6924685b413
commit d109c9b4997f56ac7b013a43f1e1d6924685b413
Merge: ff31bfe c82a2f0
Author:     Peter Kuemmel <syntheticpp at gmx.net>
AuthorDate: Tue Nov 26 13:40:41 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 26 13:40:41 2013 -0500

    Merge topic 'experimental-pch-properties' into next
    
    c82a2f0 Revert "add source file properties EXTERNAL_SOURCE and OBJECT_LOCATION"


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c82a2f01891b1b28aad36bdf67456c14d6d14e12
commit c82a2f01891b1b28aad36bdf67456c14d6d14e12
Author:     Peter Kümmel <syntheticpp at gmx.net>
AuthorDate: Tue Nov 26 19:39:46 2013 +0100
Commit:     Peter Kümmel <syntheticpp at gmx.net>
CommitDate: Tue Nov 26 19:39:46 2013 +0100

    Revert "add source file properties EXTERNAL_SOURCE and OBJECT_LOCATION"
    
    This reverts commit d207f1bf8fd697ae6521a1336dd27222168f548e.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 563caa3..d26d6e9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -3074,21 +3074,6 @@ cmLocalGenerator
                                  std::string const& dir_max,
                                  bool* hasSourceExtension)
 {
-  // A specified OBJECT_LOCATION overwrites the generated file name
-  if (const char* location = source.GetProperty("OBJECT_LOCATION"))
-    {
-    std::string fullPath;
-    if (cmSystemTools::FileIsFullPath(location))
-      {
-      fullPath = location;
-      }
-    else
-      {
-      fullPath = this->Convert(location, FULL);
-      }
-    return this->Convert(fullPath.c_str(), HOME_OUTPUT);
-    }
-
   // Construct the object file name using the full path to the source
   // file which is its only unique identification.
   const char* fullPath = source.GetFullPath().c_str();
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 8c4ef91..2063a24 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -181,14 +181,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
         si = this->GeneratorTarget->ExternalObjects.begin();
       si != this->GeneratorTarget->ExternalObjects.end(); ++si)
     {
-    if (const char* path = (*si)->GetProperty("OBJECT_LOCATION"))
-      {
-      this->Objects.push_back(path);
-      }
-    else
-      {
-      this->ExternalObjects.push_back((*si)->GetFullPath());
-      }
+    this->ExternalObjects.push_back((*si)->GetFullPath());
     }
   for(std::vector<cmSourceFile*>::const_iterator
         si = this->GeneratorTarget->ObjectSources.begin();
@@ -429,19 +422,10 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
     }
 
   // Get the full path name of the object file.
-  std::string obj;
-  if (source.GetProperty("OBJECT_LOCATION"))
-    {
-    // path is already absolute or HOME_OUTPUT relative
-    obj = this->GeneratorTarget->Objects[&source];
-    }
-  else
-    {
-    std::string const& objectName = this->GeneratorTarget->Objects[&source];
-    obj = this->LocalGenerator->GetTargetDirectory(*this->Target);
-    obj += "/";
-    obj += objectName;
-    }
+  std::string const& objectName = this->GeneratorTarget->Objects[&source];
+  std::string obj = this->LocalGenerator->GetTargetDirectory(*this->Target);
+  obj += "/";
+  obj += objectName;
 
   // Avoid generating duplicate rules.
   if(this->ObjectFiles.find(obj) == this->ObjectFiles.end())
@@ -467,10 +451,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
     (this->LocalGenerator->ConvertToFullPath(dir).c_str());
 
   // Save this in the target's list of object files.
-  if (!source.GetPropertyAsBool("EXTERNAL_SOURCE"))
-    {
-    this->Objects.push_back(obj);
-    }
+  this->Objects.push_back(obj);
   this->CleanFiles.push_back(obj);
 
   // TODO: Remove
@@ -752,27 +733,6 @@ cmMakefileTargetGenerator
       }
     }
 
-  if(const char* object_location_str =
-     source.GetProperty("OBJECT_LOCATION"))
-    {
-    if (relativeObj != object_location_str)
-      {
-      std::vector<std::string> extra_outputs;
-      cmSystemTools::ExpandListArgument(object_location_str, extra_outputs);
-      for(std::vector<std::string>::const_iterator eoi = extra_outputs.begin();
-          eoi != extra_outputs.end(); ++eoi)
-        {
-        // Register this as an extra output for the object file rule.
-        // This will cause the object file to be rebuilt if the extra
-        // output is missing.
-        this->GenerateExtraOutput(eoi->c_str(), relativeObj.c_str(), false);
-
-        // Register this as an extra file to clean.
-        this->CleanFiles.push_back(eoi->c_str());
-        }
-      }
-    }
-
   bool do_preprocess_rules = lang_is_c_or_cxx &&
     this->LocalGenerator->GetCreatePreprocessedSourceRules();
   bool do_assembly_rules = lang_is_c_or_cxx &&
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 5fc79cb..e3c058f 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -273,12 +273,6 @@ std::string
 cmNinjaTargetGenerator
 ::GetObjectFilePath(cmSourceFile* source) const
 {
-  if (source->GetProperty("OBJECT_LOCATION"))
-    {
-    // path is already absolute or HOME_OUTPUT relative
-    return this->GeneratorTarget->Objects[source];
-    }
-
   std::string path = this->LocalGenerator->GetHomeRelativeOutputPath();
   if(!path.empty())
     path += "/";
@@ -481,14 +475,7 @@ cmNinjaTargetGenerator
         si = this->GeneratorTarget->ExternalObjects.begin();
       si != this->GeneratorTarget->ExternalObjects.end(); ++si)
     {
-    if (const char* path = (*si)->GetProperty("OBJECT_LOCATION"))
-      {
-      this->Objects.push_back(this->ConvertToNinjaPath(path));
-      }
-    else
-      {
-      this->Objects.push_back(this->GetSourceFilePath(*si));
-      }
+    this->Objects.push_back(this->GetSourceFilePath(*si));
     }
   for(std::vector<cmSourceFile*>::const_iterator
         si = this->GeneratorTarget->ObjectSources.begin();
@@ -527,10 +514,8 @@ cmNinjaTargetGenerator
   cmNinjaDeps outputs;
   std::string objectFileName = this->GetObjectFilePath(source);
   outputs.push_back(objectFileName);
-
   // Add this object to the list of object files.
-  if (!source->GetPropertyAsBool("EXTERNAL_SOURCE"))
-    this->Objects.push_back(objectFileName);
+  this->Objects.push_back(objectFileName);
 
   cmNinjaDeps explicitDeps;
   std::string sourceFileName;
@@ -657,23 +642,6 @@ cmNinjaTargetGenerator
                                                 outputList,
                                                 outputs);
   }
-
-  if(const char* objectLocationStr = source->GetProperty("OBJECT_LOCATION")) {
-    std::string objectLocation =
-            this->GetLocalGenerator()
-                  ->Convert(objectLocationStr, cmLocalGenerator::HOME_OUTPUT);
-    if (std::find(outputs.begin(), outputs.end(), objectLocation)
-            == outputs.end()) {
-      std::vector<std::string> outputList;
-      cmSystemTools::ExpandListArgument(objectLocation, outputList);
-      std::transform(outputList.begin(), outputList.end(), outputList.begin(),
-                     MapToNinjaPath());
-      this->GetGlobalGenerator()->WritePhonyBuild(this->GetBuildFileStream(),
-                                                  "Location output file.",
-                                                  outputList,
-                                                  outputs);
-    }
-  }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index a851e2a..ec98c2c 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -392,22 +392,3 @@ void cmSourceFile::SetCustomCommand(cmCustomCommand* cc)
   this->CustomCommand = cc;
   delete old;
 }
-
-
-
-/*
-  //TODO
-
-  cm->DefineProperty
-    ("EXTERNAL_SOURCE", cmProperty::SOURCE_FILE,
-     "If set to true then this is a source file.",
-     "If this property is set to true then file is a source file"
-     "and will be compiled but it will not be linked into the target");
-
-
-  cm->DefineProperty
-    ("OBJECT_LOCATION", cmProperty::SOURCE_FILE,
-     "Path to output file name.",
-     "The output will be created at the given path."
-     "A relative path is interpreted as relative to CMAKE_BINARY_DIR.");
-*/
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e6294e7..f7a320a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -249,7 +249,6 @@ if(BUILD_TESTING)
   ADD_TEST_MACRO(SetLang SetLang)
   ADD_TEST_MACRO(EmptyProperty EmptyProperty)
   ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
-  ADD_TEST_MACRO(SourceFileProperties SourceFileProperties)
   ADD_TEST_MACRO(LoadCommand LoadedCommand)
   ADD_TEST_MACRO(LinkDirectory bin/LinkDirectory)
   ADD_TEST_MACRO(LinkLanguage LinkLanguage)
diff --git a/Tests/SourceFileProperties/CMakeLists.txt b/Tests/SourceFileProperties/CMakeLists.txt
deleted file mode 100644
index 553ac66..0000000
--- a/Tests/SourceFileProperties/CMakeLists.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-cmake_minimum_required (VERSION 2.8)
-
-project (SourceFileProperties)
-
-
-
-# linking with external would fail because of two main() definitions
-set(src ${CMAKE_CURRENT_BINARY_DIR}/src)
-file(WRITE ${src}1.cpp "int main() { return 0; }\n")
-file(WRITE ${src}2.cpp "int main() { return 0; }\n")
-
-set_source_files_properties(${src}2.cpp PROPERTIES EXTERNAL_SOURCE TRUE)
-
-add_executable(SourceFileProperties ${src}1.cpp ${src}2.cpp)
-
-
-
-# build with manual set object file name
-file(WRITE ${src}3.cpp "int main() { return 0; }\n")
-set(obj ${CMAKE_CURRENT_BINARY_DIR}/object_location${CMAKE_C_OUTPUT_EXTENSION})
-
-set_source_files_properties(${src}3.cpp PROPERTIES OBJECT_LOCATION ${obj})
-
-add_executable(SourceFileProperties2 ${src}3.cpp)
-
-
-
-# ensure the defined object filenname was used
-set_source_files_properties(external_object PROPERTIES
-    EXTERNAL_OBJECT TRUE
-    GENERATED TRUE
-    OBJECT_LOCATION ${obj}
-    LANGUAGE CXX)
-
-add_executable(SourceFileProperties3 external_object)
-
-
-
-
-###########################################
-# Precompiled header like tests
-
-set(all_headers ${CMAKE_CURRENT_BINARY_DIR}/all_headers.h)
-set(gch ${all_headers}.gch)
-
-file(WRITE ${all_headers} "#include <string>\n")
-file(WRITE ${src}4.cpp "std::string foo() { return std::string(); }\n")
-
-
-if(NOT MSVC)
-
-    set_source_files_properties(${all_headers} PROPERTIES
-        HEADER_FILE_ONLY FALSE
-        LANGUAGE CXX
-        EXTERNAL_SOURCE TRUE
-        OBJECT_LOCATION ${gch})
-
-    set_source_files_properties(${src}4.cpp PROPERTIES
-        COMPILE_FLAGS "-Winvalid-pch -include ${all_headers}"
-        OBJECT_DEPENDS ${gch})
-
-    set(pch_support ${all_headers})
-
-else()
-
-    file(WRITE ${all_headers}.cpp "#include \"${all_headers}\"\n")
-
-    set_source_files_properties(${all_headers}.cpp PROPERTIES
-        COMPILE_FLAGS "/Yc\"${all_headers}\" /Fp${gch}"
-        OBJECT_OUTPUTS ${gch})
-
-     set_source_files_properties(${src}4.cpp PROPERTIES
-        COMPILE_FLAGS "/FI${all_headers} /Yu${all_headers} /Fp${gch}"
-        OBJECT_DEPENDS ${gch})
-
-     set(pch_support ${all_headers}.cpp)
-
-endif()
-
-add_library(test_with_pch ${src}4.cpp ${pch_support})

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

Summary of changes:
 Source/cmLocalGenerator.cxx               |   15 -----
 Source/cmMakefileTargetGenerator.cxx      |   52 ++----------------
 Source/cmNinjaTargetGenerator.cxx         |   36 +------------
 Source/cmSourceFile.cxx                   |   19 -------
 Tests/CMakeLists.txt                      |    1 -
 Tests/SourceFileProperties/CMakeLists.txt |   80 -----------------------------
 6 files changed, 8 insertions(+), 195 deletions(-)
 delete mode 100644 Tests/SourceFileProperties/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list