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

View File

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

View File

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