summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-01-03 15:19:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-01-03 15:19:03 (GMT)
commit1529dfaa2f7f79d7e8b549e7b3d3d3d015bf1f70 (patch)
tree1ecdf068e74852471d45002455633b592ad27f6a /Source
parente72b0ba6b1b43424930c385fafb6c2e038acc8ca (diff)
downloadCMake-1529dfaa2f7f79d7e8b549e7b3d3d3d015bf1f70.zip
CMake-1529dfaa2f7f79d7e8b549e7b3d3d3d015bf1f70.tar.gz
CMake-1529dfaa2f7f79d7e8b549e7b3d3d3d015bf1f70.tar.bz2
ENH: merge in fixes from main tree
This commit was manufactured by cvs2svn to create tag 'CMake-2-4-6'.
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt13
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h3
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx10
-rw-r--r--Source/cmMakefileTargetGenerator.h4
-rw-r--r--Source/cmMakefileUtilityTargetGenerator.cxx13
-rw-r--r--Source/cmTarget.cxx2
9 files changed, 41 insertions, 10 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 694ba9d..19f56a8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -402,6 +402,7 @@ IF(BUILD_TESTING)
--test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
+
ADD_TEST(LibName ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/LibName"
@@ -414,6 +415,18 @@ IF(BUILD_TESTING)
--test-command foobar
)
+ ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CustComDepend"
+ "${CMake_BINARY_DIR}/Tests/CustComDepend"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-project CustComDepend
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
+ --test-command foo bar.c
+ )
+
ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/CustomCommand"
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index f074510..7bf675c 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -115,6 +115,9 @@ public:
no rule. This is used for multiple output dependencies. */
std::string GetEmptyCommandHack() { return this->EmptyCommandsHack; }
+ /** Get the fake dependency to use when a rule has no real commands
+ or dependencies. */
+ std::string GetEmptyRuleHackDepends() { return this->EmptyRuleHackDepends; }
// change the build command for speed
virtual std::string GenerateBuildCommand
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 7afdb31..27fdf10 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1865,6 +1865,8 @@ std::string cmLocalGenerator::GetRealDependency(const char* inName,
tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(
std::string(inName));
+ depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
+ tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
if(depLocation != tLocation)
{
// it is a full path to a depend that has the same name
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 5905f84..7096dbf 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 9c3b973..5bc030a 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileLibraryTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index ecc4699..3082495 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -65,7 +65,8 @@ cmMakefileTargetGenerator::New(cmLocalUnixMakefileGenerator3 *lg,
result->TargetName = tgtName;
result->Target = tgt;
result->LocalGenerator = lg;
- result->GlobalGenerator = lg->GetGlobalGenerator();
+ result->GlobalGenerator =
+ static_cast<cmGlobalUnixMakefileGenerator3*>(lg->GetGlobalGenerator());
result->Makefile = lg->GetMakefile();
return result;
}
@@ -891,9 +892,7 @@ void cmMakefileTargetGenerator
depends.clear();
depends.push_back(*o);
commands.clear();
- cmGlobalUnixMakefileGenerator3* gg =
- static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
- std::string emptyCommand = gg->GetEmptyCommandHack();
+ std::string emptyCommand = this->GlobalGenerator->GetEmptyCommandHack();
if(!emptyCommand.empty())
{
commands.push_back(emptyCommand);
@@ -911,7 +910,8 @@ void cmMakefileTargetGenerator
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
o->c_str(), depends, commands,
symbolic);
- gg->AddMultipleOutputPair(o->c_str(), depends[0].c_str());
+ this->GlobalGenerator->AddMultipleOutputPair(o->c_str(),
+ depends[0].c_str());
}
}
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index dd6bbe6..fb6562b 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -23,7 +23,7 @@ class cmCustomCommand;
class cmDependInformation;
class cmDepends;
class cmGeneratedFileStream;
-class cmGlobalGenerator;
+class cmGlobalUnixMakefileGenerator3;
class cmLocalUnixMakefileGenerator3;
class cmMakeDepend;
class cmMakefile;
@@ -121,7 +121,7 @@ protected:
cmStdString TargetName;
cmTarget *Target;
cmLocalUnixMakefileGenerator3 *LocalGenerator;
- cmGlobalGenerator *GlobalGenerator;
+ cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
cmMakefile *Makefile;
bool DriveCustomCommandsOnDepends;
diff --git a/Source/cmMakefileUtilityTargetGenerator.cxx b/Source/cmMakefileUtilityTargetGenerator.cxx
index 51a848f..6ab1863 100644
--- a/Source/cmMakefileUtilityTargetGenerator.cxx
+++ b/Source/cmMakefileUtilityTargetGenerator.cxx
@@ -17,7 +17,7 @@
#include "cmMakefileUtilityTargetGenerator.h"
#include "cmGeneratedFileStream.h"
-#include "cmGlobalGenerator.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
@@ -58,6 +58,17 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles()
objTarget += this->BuildFileName;
this->LocalGenerator->AppendRuleDepend(depends, objTarget.c_str());
+ // If the rule is empty add the special empty rule dependency needed
+ // by some make tools.
+ if(depends.empty() && commands.empty())
+ {
+ std::string hack = this->GlobalGenerator->GetEmptyRuleHackDepends();
+ if(!hack.empty())
+ {
+ depends.push_back(hack);
+ }
+ }
+
// Write the rule.
this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
this->Target->GetName(),
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 80031f4..1509c14 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -253,6 +253,8 @@ void cmTarget::TraceVSDependencies(std::string projFile,
tLocation = cmSystemTools::GetFilenamePath(tLocation);
std::string depLocation = cmSystemTools::GetFilenamePath(
std::string(fullName));
+ depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
+ tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
if(depLocation == tLocation)
{
isUtility = true;