Commit 1529dfaa authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in fixes from main tree

This commit was manufactured by cvs2svn to create tag 'CMake-2-4-6'.
parent e72b0ba6
......@@ -5,9 +5,9 @@ MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
# The CMake version number.
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 4)
SET(CMake_VERSION_PATCH 5)
SET(CMake_VERSION_PATCH 6)
# for an actual release this should not be defined
#SET(CMake_VERSION_RC 4)
SET(CMake_VERSION_RC 1)
SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
......
Changes in CMake 2.4.6
* Fix for finding custom commands from a full path with CMAKE_CFG_INTDIR.
* Fix for Borland make and custom commands that do nothing
Changes in CMake 2.4.5
* Fix for seg fault when a macro runs a bad command BUG# 3815
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -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());
}
}
......
......@@ -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;
......
......@@ -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(),
......
......@@ -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;
......
project(CustComDepend)
include_directories("${CustComDepend_SOURCE_DIR}")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE=1)
set(EXECUTABLE_OUTPUT_PATH ${CustComDepend_BINARY_DIR}/bin)
add_executable(foo foo.cxx)
add_custom_command(
OUTPUT ${CustComDepend_BINARY_DIR}/bar.c
COMMAND ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo
${CustComDepend_BINARY_DIR}/bar.c
DEPENDS ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo
)
add_library(bar SHARED ${CustComDepend_BINARY_DIR}/bar.c)
#ifdef _WIN32
# ifdef bar_EXPORTS
# define BAR_EXPORT __declspec( dllexport )
# else
# define BAR_EXPORT __declspec( dllimport )
# endif
#else
# define BAR_EXPORT
#endif
#include <stdio.h>
int main(int ac, char** av)
{
FILE* fout = fopen(av[1], "w");
printf("create %s\n", av[1]);
if(!fout)
{
return -1;
}
fprintf(fout, "#include <bar.h>\nBAR_EXPORT int bar(){ return 10;}\n");
fclose(fout);
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment