slight change in signature

This commit is contained in:
Ken Martin 2002-09-17 09:16:53 -04:00
parent 40fd3b83dc
commit 83f61619a3
3 changed files with 14 additions and 8 deletions

View File

@ -85,7 +85,7 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
{
makeCommand += "ALL_BUILD";
}
makeCommand += " - Debug\" /REBUILD";
makeCommand += " - Debug\"";
int retVal;
if (!cmSystemTools::RunCommand(makeCommand.c_str(), output, retVal))
@ -96,6 +96,10 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
return 1;
}
cmSystemTools::ChangeDirectory(cwd.c_str());
if (retVal)
{
cmSystemTools::Error("Generator: msdev returned a failure.");
}
return retVal;
}

View File

@ -26,8 +26,8 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
}
// where will the binaries be stored
const char* binaryDirectory = argv[2].c_str();
const char* sourceDirectory = argv[1].c_str();
const char* binaryDirectory = argv[1].c_str();
const char* sourceDirectory = argv[2].c_str();
const char* projectName = 0;
const char* targetName = 0;
std::string tmpString;
@ -36,10 +36,13 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
// signature
if (argv.size() == 3)
{
tmpString = argv[2] + "/CMakeTmp";
tmpString = argv[1] + "/CMakeTmp";
binaryDirectory = tmpString.c_str();
}
// make sure the binary directory exists
cmSystemTools::MakeDirectory(binaryDirectory);
// do not allow recursive try Compiles
if (!strcmp(binaryDirectory,m_Makefile->GetHomeOutputDirectory()))
{
@ -58,7 +61,6 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
// we need to create a directory and CMakeList file etc...
// first create the directories
sourceDirectory = binaryDirectory;
cmSystemTools::MakeDirectory(binaryDirectory);
// now create a CMakeList.txt file in that directory
std::string outFileName = tmpString + "/CMakeLists.txt";
@ -70,7 +72,7 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
return false;
}
fprintf(fout,"PROJECT(CMAKE_TRY_COMPILE)\n");
fprintf(fout,"ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",argv[1].c_str());
fprintf(fout,"ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",argv[2].c_str());
fclose(fout);
projectName = "CMAKE_TRY_COMPILE";
targetName = "cmTryCompileExec";

View File

@ -62,11 +62,11 @@ public:
virtual const char* GetFullDocumentation()
{
return
"TRY_COMPILE(RESULT_VAR srcdir bindir projectName <targetName>)\n"
"TRY_COMPILE(RESULT_VAR bindir srcdir projectName <targetName>)\n"
"Try compiling a program. Return the success or failure in RESULT_VAR "
"If <target name> is specified then build just that target "
"otherwise the all or ALL_BUILD target is built.\n"
"TRY_COMPILE(RESULT_VAR srcfile bindir)\n"
"TRY_COMPILE(RESULT_VAR bindir srcfile)\n"
"Try compiling a srcfile. Return the success or failure in RESULT_VAR.";
}