remove trailing slash from findpath command

This commit is contained in:
Bill Hoffman 2003-01-17 10:28:41 -05:00
parent 0510292b9e
commit 68d9a5d404
4 changed files with 17 additions and 10 deletions

View File

@ -86,7 +86,11 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
tryPath += args[1];
if(cmSystemTools::FileExists(tryPath.c_str()))
{
path[k] = cmSystemTools::CollapseFullPath(path[k].c_str());
path[k] = cmSystemTools::CollapseFullPath(path[k].c_str());
if(path[k].size() && path[k][path[k].size()-1] == '/')
{
path[k] = path[k].substr(0, path[k].size()-1);
}
m_Makefile->AddCacheDefinition(args[0].c_str(),
path[k].c_str(),
helpString.c_str(),

View File

@ -42,9 +42,9 @@ void ForceStringUse()
// ======================================================================
void cmFailed(const char* Message, const char* m2= "")
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << "\n";
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
@ -774,10 +774,11 @@ int main()
#ifndef REGISTRY_TEST_PATH
cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined.");
#else
std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0)
{
cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ",
REGISTRY_TEST_PATH);
REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir");
}
else
{

View File

@ -42,9 +42,9 @@ void ForceStringUse()
// ======================================================================
void cmFailed(const char* Message, const char* m2= "")
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << "\n";
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
@ -774,10 +774,11 @@ int main()
#ifndef REGISTRY_TEST_PATH
cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined.");
#else
std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0)
{
cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ",
REGISTRY_TEST_PATH);
REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir");
}
else
{

View File

@ -42,9 +42,9 @@ void ForceStringUse()
// ======================================================================
void cmFailed(const char* Message, const char* m2= "")
void cmFailed(const char* Message, const char* m2= "", const char* m3 = "")
{
std::cout << "FAILED: " << Message << m2 << "\n";
std::cout << "FAILED: " << Message << m2 << m3 << "\n";
cm_failed++;
}
@ -774,10 +774,11 @@ int main()
#ifndef REGISTRY_TEST_PATH
cmFailed("the CONFIGURE_FILE command is broken, REGISTRY_TEST_PATH is not defined.");
#else
std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n";
if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0)
{
cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ",
REGISTRY_TEST_PATH);
REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir");
}
else
{