diff options
author | Ken Martin <ken.martin@kitware.com> | 2002-09-17 13:16:53 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2002-09-17 13:16:53 (GMT) |
commit | 83f61619a35c85d38655eded8cb35d509e179bef (patch) | |
tree | f79cc18485e9cec807fac078039fa6cacbbabbe2 /Source/cmTryCompileCommand.cxx | |
parent | 40fd3b83dc19c6b51afb73611dcc5be1422e9e26 (diff) | |
download | CMake-83f61619a35c85d38655eded8cb35d509e179bef.zip CMake-83f61619a35c85d38655eded8cb35d509e179bef.tar.gz CMake-83f61619a35c85d38655eded8cb35d509e179bef.tar.bz2 |
slight change in signature
Diffstat (limited to 'Source/cmTryCompileCommand.cxx')
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index e7fe9d1..8638dd9 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -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"; |