mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-10 02:19:10 -05:00
Merge topic 'create_test_sourcelist-full-filepath'
a29ca55b1fcreate_test_sourcelist: use the full path to the driver609af7734fcmCreateTestSourceList: simplify string operations Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9060
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
create_test_sourcelist-full-filepath
|
||||
------------------------------------
|
||||
|
||||
* The :command:`create_test_sourcelist` command now provides a full path to
|
||||
the generated driver source file.
|
||||
@@ -81,8 +81,8 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
|
||||
}
|
||||
std::string func_name;
|
||||
if (!cmSystemTools::GetFilenamePath(*i).empty()) {
|
||||
func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(*i);
|
||||
func_name = cmStrCat(cmSystemTools::GetFilenamePath(*i), '/',
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(*i));
|
||||
} else {
|
||||
func_name = cmSystemTools::GetFilenameWithoutLastExtension(*i);
|
||||
}
|
||||
@@ -93,9 +93,7 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
|
||||
tests_func_name.end();
|
||||
tests_func_name.push_back(func_name);
|
||||
if (!already_declared) {
|
||||
forwardDeclareCode += "int ";
|
||||
forwardDeclareCode += func_name;
|
||||
forwardDeclareCode += "(int, char*[]);\n";
|
||||
forwardDeclareCode += cmStrCat("int ", func_name, "(int, char*[]);\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,8 +103,8 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
|
||||
++i, ++j) {
|
||||
std::string func_name;
|
||||
if (!cmSystemTools::GetFilenamePath(*i).empty()) {
|
||||
func_name = cmSystemTools::GetFilenamePath(*i) + "/" +
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(*i);
|
||||
func_name = cmStrCat(cmSystemTools::GetFilenamePath(*i), '/',
|
||||
cmSystemTools::GetFilenameWithoutLastExtension(*i));
|
||||
} else {
|
||||
func_name = cmSystemTools::GetFilenameWithoutLastExtension(*i);
|
||||
}
|
||||
@@ -137,12 +135,12 @@ bool cmCreateTestSourceList(std::vector<std::string> const& args,
|
||||
{
|
||||
cmSourceFile* sf = mf.GetOrCreateSource(driver);
|
||||
sf->SetProperty("ABSTRACT", "0");
|
||||
sourceListValue = args[1];
|
||||
sourceListValue = driver;
|
||||
}
|
||||
for (i = testsBegin; i != tests.end(); ++i) {
|
||||
cmSourceFile* sf = mf.GetOrCreateSource(*i);
|
||||
sf->SetProperty("ABSTRACT", "0");
|
||||
sourceListValue += ";";
|
||||
sourceListValue += ';';
|
||||
sourceListValue += *i;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user