summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-11-01 18:26:21 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-11-01 18:26:21 (GMT)
commitc2300e6265400089b8efb5e34e4d33e1425354ac (patch)
tree24175319d47f85e3885064d12143b93aaaf680ca /Source/cmCTest.cxx
parente0d97b672875ab83e4e30ddd00746860e6e1fd87 (diff)
parent76ecdd8d169fd2565466669875b5ed7e7c5c1963 (diff)
downloadCMake-c2300e6265400089b8efb5e34e4d33e1425354ac.zip
CMake-c2300e6265400089b8efb5e34e4d33e1425354ac.tar.gz
CMake-c2300e6265400089b8efb5e34e4d33e1425354ac.tar.bz2
Merge topic 'fix-12539-ctestconfig-from-build-dir'
76ecdd8 CTest: Look for CTestConfig.cmake in build dir first, then source dir
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx32
1 files changed, 26 insertions, 6 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d6806aa..7bb8b27 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -655,10 +655,26 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
cmMakefile* mf = command->GetMakefile();
- std::string fname = src_dir;
- fname += "/CTestConfig.cmake";
- cmSystemTools::ConvertToUnixSlashes(fname);
- if ( cmSystemTools::FileExists(fname.c_str()) )
+ std::string fname;
+
+ std::string src_dir_fname = src_dir;
+ src_dir_fname += "/CTestConfig.cmake";
+ cmSystemTools::ConvertToUnixSlashes(src_dir_fname);
+
+ std::string bld_dir_fname = bld_dir;
+ bld_dir_fname += "/CTestConfig.cmake";
+ cmSystemTools::ConvertToUnixSlashes(bld_dir_fname);
+
+ if ( cmSystemTools::FileExists(bld_dir_fname.c_str()) )
+ {
+ fname = bld_dir_fname;
+ }
+ else if ( cmSystemTools::FileExists(src_dir_fname.c_str()) )
+ {
+ fname = src_dir_fname;
+ }
+
+ if ( !fname.empty() )
{
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
<< fname.c_str() << std::endl);
@@ -674,8 +690,12 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
}
else
{
- cmCTestLog(this, WARNING, "Cannot locate CTest configuration: "
- << fname.c_str() << std::endl);
+ cmCTestLog(this, WARNING,
+ "Cannot locate CTest configuration: in BuildDirectory: "
+ << bld_dir_fname.c_str() << std::endl);
+ cmCTestLog(this, WARNING,
+ "Cannot locate CTest configuration: in SourceDirectory: "
+ << src_dir_fname.c_str() << std::endl);
}
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",