Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
862f5df2
Commit
862f5df2
authored
Mar 10, 2006
by
Andy Cedilnik
Browse files
STYLE: Fix some style issues
parent
c0161e9e
Changes
45
Expand all
Hide whitespace changes
Inline
Side-by-side
Source/CTest/cmCTestBuildAndTestHandler.cxx
View file @
862f5df2
...
...
@@ -26,30 +26,31 @@
//----------------------------------------------------------------------
cmCTestBuildAndTestHandler
::
cmCTestBuildAndTestHandler
()
{
m_
BuildTwoConfig
=
false
;
m_
BuildNoClean
=
false
;
m_
BuildNoCMake
=
false
;
this
->
BuildTwoConfig
=
false
;
this
->
BuildNoClean
=
false
;
this
->
BuildNoCMake
=
false
;
}
//----------------------------------------------------------------------
void
cmCTestBuildAndTestHandler
::
Initialize
()
{
m_BuildTargets
.
erase
(
m_BuildTargets
.
begin
(),
m_BuildTargets
.
end
());
this
->
BuildTargets
.
erase
(
this
->
BuildTargets
.
begin
(),
this
->
BuildTargets
.
end
());
this
->
Superclass
::
Initialize
();
}
//----------------------------------------------------------------------
const
char
*
cmCTestBuildAndTestHandler
::
GetOutput
()
{
return
m_
Output
.
c_str
();
return
this
->
Output
.
c_str
();
}
//----------------------------------------------------------------------
int
cmCTestBuildAndTestHandler
::
ProcessHandler
()
{
m_
Output
=
""
;
this
->
Output
=
""
;
std
::
string
output
;
cmSystemTools
::
ResetErrorOccuredFlag
();
int
retv
=
this
->
RunCMakeAndTest
(
&
m_
Output
);
int
retv
=
this
->
RunCMakeAndTest
(
&
this
->
Output
);
cmSystemTools
::
ResetErrorOccuredFlag
();
return
retv
;
}
...
...
@@ -61,24 +62,24 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
{
unsigned
int
k
;
std
::
vector
<
std
::
string
>
args
;
args
.
push_back
(
m_
CTest
->
GetCMakeExecutable
());
args
.
push_back
(
m_
SourceDir
);
if
(
m_
BuildGenerator
.
size
())
args
.
push_back
(
this
->
CTest
->
GetCMakeExecutable
());
args
.
push_back
(
this
->
SourceDir
);
if
(
this
->
BuildGenerator
.
size
())
{
std
::
string
generator
=
"-G"
;
generator
+=
m_
BuildGenerator
;
generator
+=
this
->
BuildGenerator
;
args
.
push_back
(
generator
);
}
if
(
m_
CTest
->
GetConfigType
().
size
()
>
0
)
if
(
this
->
CTest
->
GetConfigType
().
size
()
>
0
)
{
std
::
string
btype
=
"-DCMAKE_BUILD_TYPE:STRING="
+
m_
CTest
->
GetConfigType
();
=
"-DCMAKE_BUILD_TYPE:STRING="
+
this
->
CTest
->
GetConfigType
();
args
.
push_back
(
btype
);
}
for
(
k
=
0
;
k
<
m_
BuildOptions
.
size
();
++
k
)
for
(
k
=
0
;
k
<
this
->
BuildOptions
.
size
();
++
k
)
{
args
.
push_back
(
m_
BuildOptions
[
k
]);
args
.
push_back
(
this
->
BuildOptions
[
k
]);
}
if
(
cm
->
Run
(
args
)
!=
0
)
{
...
...
@@ -92,12 +93,12 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
}
else
{
cmCTestLog
(
m_
CTest
,
ERROR_MESSAGE
,
out
.
str
()
<<
std
::
endl
);
cmCTestLog
(
this
->
CTest
,
ERROR_MESSAGE
,
out
.
str
()
<<
std
::
endl
);
}
return
1
;
}
// do another config?
if
(
m_
BuildTwoConfig
)
if
(
this
->
BuildTwoConfig
)
{
if
(
cm
->
Run
(
args
)
!=
0
)
{
...
...
@@ -111,7 +112,7 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
}
else
{
cmCTestLog
(
m_
CTest
,
ERROR_MESSAGE
,
out
.
str
()
<<
std
::
endl
);
cmCTestLog
(
this
->
CTest
,
ERROR_MESSAGE
,
out
.
str
()
<<
std
::
endl
);
}
return
1
;
}
...
...
@@ -142,11 +143,11 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
cmSystemTools
::
SetErrorCallback
(
CMakeMessageCallback
,
&
cmakeOutString
);
cmSystemTools
::
SetStdoutCallback
(
CMakeStdoutCallback
,
&
cmakeOutString
);
cmOStringStream
out
;
// What is this? double timeout =
m_
CTest->GetTimeOut();
// What is this? double timeout =
this->
CTest->GetTimeOut();
int
retVal
=
0
;
// if the generator and make program are not specified then it is an error
if
(
!
m_
BuildGenerator
.
size
()
||
!
m_
BuildMakeProgram
.
size
())
if
(
!
this
->
BuildGenerator
.
size
()
||
!
this
->
BuildMakeProgram
.
size
())
{
if
(
outstring
)
{
...
...
@@ -160,18 +161,20 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// make sure the binary dir is there
std
::
string
cwd
=
cmSystemTools
::
GetCurrentWorkingDirectory
();
out
<<
"Internal cmake changing into directory: "
<<
m_BinaryDir
<<
"
\n
"
;
if
(
!
cmSystemTools
::
FileIsDirectory
(
m_BinaryDir
.
c_str
()))
out
<<
"Internal cmake changing into directory: "
<<
this
->
BinaryDir
<<
std
::
endl
;
if
(
!
cmSystemTools
::
FileIsDirectory
(
this
->
BinaryDir
.
c_str
()))
{
cmSystemTools
::
MakeDirectory
(
m_
BinaryDir
.
c_str
());
cmSystemTools
::
MakeDirectory
(
this
->
BinaryDir
.
c_str
());
}
cmSystemTools
::
ChangeDirectory
(
m_
BinaryDir
.
c_str
());
cmSystemTools
::
ChangeDirectory
(
this
->
BinaryDir
.
c_str
());
// should we cmake?
cmake
cm
;
cm
.
SetGlobalGenerator
(
cm
.
CreateGlobalGenerator
(
m_BuildGenerator
.
c_str
()));
cm
.
SetGlobalGenerator
(
cm
.
CreateGlobalGenerator
(
this
->
BuildGenerator
.
c_str
()));
if
(
!
m_
BuildNoCMake
)
if
(
!
this
->
BuildNoCMake
)
{
// do the cmake step
if
(
this
->
RunCMake
(
outstring
,
out
,
cmakeOutString
,
cwd
,
&
cm
))
...
...
@@ -182,19 +185,19 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// do the build
std
::
vector
<
std
::
string
>::
iterator
tarIt
;
if
(
m_
BuildTargets
.
size
()
==
0
)
if
(
this
->
BuildTargets
.
size
()
==
0
)
{
m_
BuildTargets
.
push_back
(
""
);
this
->
BuildTargets
.
push_back
(
""
);
}
for
(
tarIt
=
m_
BuildTargets
.
begin
();
tarIt
!=
m_
BuildTargets
.
end
();
for
(
tarIt
=
this
->
BuildTargets
.
begin
();
tarIt
!=
this
->
BuildTargets
.
end
();
++
tarIt
)
{
std
::
string
output
;
retVal
=
cm
.
GetGlobalGenerator
()
->
Build
(
m_
SourceDir
.
c_str
(),
m_
BinaryDir
.
c_str
(),
m_
BuildProject
.
c_str
(),
tarIt
->
c_str
(),
&
output
,
m_
BuildMakeProgram
.
c_str
(),
m_
CTest
->
GetConfigType
().
c_str
(),
!
m_
BuildNoClean
);
this
->
SourceDir
.
c_str
(),
this
->
BinaryDir
.
c_str
(),
this
->
BuildProject
.
c_str
(),
tarIt
->
c_str
(),
&
output
,
this
->
BuildMakeProgram
.
c_str
(),
this
->
CTest
->
GetConfigType
().
c_str
(),
!
this
->
BuildNoClean
);
out
<<
output
;
// if the build failed then return
...
...
@@ -213,7 +216,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
// if not test was specified then we are done
if
(
!
m_
TestCommand
.
size
())
if
(
!
this
->
TestCommand
.
size
())
{
return
0
;
}
...
...
@@ -223,9 +226,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std
::
vector
<
std
::
string
>
failed
;
std
::
string
tempPath
;
std
::
string
filepath
=
cmSystemTools
::
GetFilenamePath
(
m_
TestCommand
);
cmSystemTools
::
GetFilenamePath
(
this
->
TestCommand
);
std
::
string
filename
=
cmSystemTools
::
GetFilenameName
(
m_
TestCommand
);
cmSystemTools
::
GetFilenameName
(
this
->
TestCommand
);
// if full path specified then search that first
if
(
filepath
.
size
())
{
...
...
@@ -233,17 +236,17 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
tempPath
+=
"/"
;
tempPath
+=
filename
;
attempted
.
push_back
(
tempPath
);
if
(
m_
CTest
->
GetConfigType
().
size
())
if
(
this
->
CTest
->
GetConfigType
().
size
())
{
tempPath
=
filepath
;
tempPath
+=
"/"
;
tempPath
+=
m_
CTest
->
GetConfigType
();
tempPath
+=
this
->
CTest
->
GetConfigType
();
tempPath
+=
"/"
;
tempPath
+=
filename
;
attempted
.
push_back
(
tempPath
);
// If the file is an OSX bundle then the configtyp
// will be at the start of the path
tempPath
=
m_
CTest
->
GetConfigType
();
tempPath
=
this
->
CTest
->
GetConfigType
();
tempPath
+=
"/"
;
tempPath
+=
filepath
;
tempPath
+=
"/"
;
...
...
@@ -255,26 +258,26 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
else
{
attempted
.
push_back
(
filename
);
if
(
m_
CTest
->
GetConfigType
().
size
())
if
(
this
->
CTest
->
GetConfigType
().
size
())
{
tempPath
=
m_
CTest
->
GetConfigType
();
tempPath
=
this
->
CTest
->
GetConfigType
();
tempPath
+=
"/"
;
tempPath
+=
filename
;
attempted
.
push_back
(
tempPath
);
}
}
// if
m_
ExecutableDirectory is set try that as well
if
(
m_
ExecutableDirectory
.
size
())
// if
this->
ExecutableDirectory is set try that as well
if
(
this
->
ExecutableDirectory
.
size
())
{
tempPath
=
m_
ExecutableDirectory
;
tempPath
=
this
->
ExecutableDirectory
;
tempPath
+=
"/"
;
tempPath
+=
m_
TestCommand
;
tempPath
+=
this
->
TestCommand
;
attempted
.
push_back
(
tempPath
);
if
(
m_
CTest
->
GetConfigType
().
size
())
if
(
this
->
CTest
->
GetConfigType
().
size
())
{
tempPath
=
m_
ExecutableDirectory
;
tempPath
=
this
->
ExecutableDirectory
;
tempPath
+=
"/"
;
tempPath
+=
m_
CTest
->
GetConfigType
();
tempPath
+=
this
->
CTest
->
GetConfigType
();
tempPath
+=
"/"
;
tempPath
+=
filename
;
attempted
.
push_back
(
tempPath
);
...
...
@@ -314,8 +317,8 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
if
(
!
cmSystemTools
::
FileExists
(
fullPath
.
c_str
()))
{
out
<<
"Could not find path to executable, perhaps it was not built: "
<<
m_
TestCommand
<<
"
\n
"
;
out
<<
"Could not find path to executable, perhaps it was not built: "
<<
this
->
TestCommand
<<
"
\n
"
;
out
<<
"tried to find it in these places:
\n
"
;
out
<<
fullPath
.
c_str
()
<<
"
\n
"
;
for
(
unsigned
int
i
=
0
;
i
<
failed
.
size
();
++
i
)
...
...
@@ -328,7 +331,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
else
{
cmCTestLog
(
m_
CTest
,
ERROR_MESSAGE
,
out
.
str
());
cmCTestLog
(
this
->
CTest
,
ERROR_MESSAGE
,
out
.
str
());
}
// return to the original directory
cmSystemTools
::
ChangeDirectory
(
cwd
.
c_str
());
...
...
@@ -337,27 +340,27 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std
::
vector
<
const
char
*>
testCommand
;
testCommand
.
push_back
(
fullPath
.
c_str
());
for
(
k
=
0
;
k
<
m_
TestCommandArgs
.
size
();
++
k
)
for
(
k
=
0
;
k
<
this
->
TestCommandArgs
.
size
();
++
k
)
{
testCommand
.
push_back
(
m_
TestCommandArgs
[
k
].
c_str
());
testCommand
.
push_back
(
this
->
TestCommandArgs
[
k
].
c_str
());
}
testCommand
.
push_back
(
0
);
std
::
string
outs
;
int
retval
=
0
;
// run the test from the
m_
BuildRunDir if set
if
(
m_
BuildRunDir
.
size
())
// run the test from the
this->
BuildRunDir if set
if
(
this
->
BuildRunDir
.
size
())
{
out
<<
"Run test in directory: "
<<
m_
BuildRunDir
<<
"
\n
"
;
cmSystemTools
::
ChangeDirectory
(
m_
BuildRunDir
.
c_str
());
out
<<
"Run test in directory: "
<<
this
->
BuildRunDir
<<
"
\n
"
;
cmSystemTools
::
ChangeDirectory
(
this
->
BuildRunDir
.
c_str
());
}
out
<<
"Running test executable: "
<<
fullPath
<<
" "
;
for
(
k
=
0
;
k
<
m_
TestCommandArgs
.
size
();
++
k
)
for
(
k
=
0
;
k
<
this
->
TestCommandArgs
.
size
();
++
k
)
{
out
<<
m_
TestCommandArgs
[
k
]
<<
" "
;
out
<<
this
->
TestCommandArgs
[
k
]
<<
" "
;
}
out
<<
"
\n
"
;
// What is this?
m_
TimeOut = timeout;
int
runTestRes
=
m_
CTest
->
RunTest
(
testCommand
,
&
outs
,
&
retval
,
0
);
// What is this?
this->
TimeOut = timeout;
int
runTestRes
=
this
->
CTest
->
RunTest
(
testCommand
,
&
outs
,
&
retval
,
0
);
if
(
runTestRes
!=
cmsysProcess_State_Exited
||
retval
!=
0
)
{
out
<<
"Failed to run test command: "
<<
testCommand
[
0
]
<<
"
\n
"
;
...
...
@@ -371,7 +374,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
}
else
{
cmCTestLog
(
m_
CTest
,
OUTPUT
,
out
.
str
()
<<
std
::
endl
);
cmCTestLog
(
this
->
CTest
,
OUTPUT
,
out
.
str
()
<<
std
::
endl
);
}
return
retval
;
}
...
...
@@ -387,17 +390,19 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
if
(
idx
+
2
<
allArgs
.
size
())
{
idx
++
;
m_
SourceDir
=
allArgs
[
idx
];
this
->
SourceDir
=
allArgs
[
idx
];
idx
++
;
m_
BinaryDir
=
allArgs
[
idx
];
this
->
BinaryDir
=
allArgs
[
idx
];
// dir must exist before CollapseFullPath is called
cmSystemTools
::
MakeDirectory
(
m_BinaryDir
.
c_str
());
m_BinaryDir
=
cmSystemTools
::
CollapseFullPath
(
m_BinaryDir
.
c_str
());
m_SourceDir
=
cmSystemTools
::
CollapseFullPath
(
m_SourceDir
.
c_str
());
cmSystemTools
::
MakeDirectory
(
this
->
BinaryDir
.
c_str
());
this
->
BinaryDir
=
cmSystemTools
::
CollapseFullPath
(
this
->
BinaryDir
.
c_str
());
this
->
SourceDir
=
cmSystemTools
::
CollapseFullPath
(
this
->
SourceDir
.
c_str
());
}
else
{
cmCTestLog
(
m_
CTest
,
ERROR_MESSAGE
,
cmCTestLog
(
this
->
CTest
,
ERROR_MESSAGE
,
"--build-and-test must have source and binary dir"
<<
std
::
endl
);
return
0
;
}
...
...
@@ -405,45 +410,45 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
if
(
currentArg
.
find
(
"--build-target"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
BuildTargets
.
push_back
(
allArgs
[
idx
]);
this
->
BuildTargets
.
push_back
(
allArgs
[
idx
]);
}
if
(
currentArg
.
find
(
"--build-nocmake"
,
0
)
==
0
)
{
m_
BuildNoCMake
=
true
;
this
->
BuildNoCMake
=
true
;
}
if
(
currentArg
.
find
(
"--build-run-dir"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
BuildRunDir
=
allArgs
[
idx
];
this
->
BuildRunDir
=
allArgs
[
idx
];
}
if
(
currentArg
.
find
(
"--build-two-config"
,
0
)
==
0
)
{
m_
BuildTwoConfig
=
true
;
this
->
BuildTwoConfig
=
true
;
}
if
(
currentArg
.
find
(
"--build-exe-dir"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
ExecutableDirectory
=
allArgs
[
idx
];
this
->
ExecutableDirectory
=
allArgs
[
idx
];
}
if
(
currentArg
.
find
(
"--build-generator"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
BuildGenerator
=
allArgs
[
idx
];
this
->
BuildGenerator
=
allArgs
[
idx
];
}
if
(
currentArg
.
find
(
"--build-project"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
BuildProject
=
allArgs
[
idx
];
this
->
BuildProject
=
allArgs
[
idx
];
}
if
(
currentArg
.
find
(
"--build-makeprogram"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
idx
++
;
m_
BuildMakeProgram
=
allArgs
[
idx
];
this
->
BuildMakeProgram
=
allArgs
[
idx
];
}
if
(
currentArg
.
find
(
"--build-noclean"
,
0
)
==
0
)
{
m_
BuildNoClean
=
true
;
this
->
BuildNoClean
=
true
;
}
if
(
currentArg
.
find
(
"--build-options"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
...
...
@@ -451,7 +456,7 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
bool
done
=
false
;
while
(
idx
<
allArgs
.
size
()
&&
!
done
)
{
m_
BuildOptions
.
push_back
(
allArgs
[
idx
]);
this
->
BuildOptions
.
push_back
(
allArgs
[
idx
]);
if
(
idx
+
1
<
allArgs
.
size
()
&&
(
allArgs
[
idx
+
1
]
==
"--build-target"
||
allArgs
[
idx
+
1
]
==
"--test-command"
))
...
...
@@ -467,11 +472,11 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments(
if
(
currentArg
.
find
(
"--test-command"
,
0
)
==
0
&&
idx
<
allArgs
.
size
()
-
1
)
{
++
idx
;
m_
TestCommand
=
allArgs
[
idx
];
this
->
TestCommand
=
allArgs
[
idx
];
while
(
idx
+
1
<
allArgs
.
size
())
{
++
idx
;
m_
TestCommandArgs
.
push_back
(
allArgs
[
idx
]);
this
->
TestCommandArgs
.
push_back
(
allArgs
[
idx
]);
}
}
return
1
;
...
...
Source/CTest/cmCTestBuildAndTestHandler.h
View file @
862f5df2
...
...
@@ -59,22 +59,22 @@ protected:
std
::
string
&
cmakeOutString
,
std
::
string
&
cwd
,
cmake
*
cm
);
cmStdString
m_
Output
;
std
::
string
m_
BuildGenerator
;
std
::
vector
<
std
::
string
>
m_
BuildOptions
;
bool
m_
BuildTwoConfig
;
std
::
string
m_
BuildMakeProgram
;
std
::
string
m_
SourceDir
;
std
::
string
m_
BinaryDir
;
std
::
string
m_
BuildProject
;
std
::
string
m_
TestCommand
;
bool
m_
BuildNoClean
;
std
::
string
m_
BuildRunDir
;
std
::
string
m_
ExecutableDirectory
;
std
::
vector
<
std
::
string
>
m_
TestCommandArgs
;
std
::
vector
<
std
::
string
>
m_
BuildTargets
;
bool
m_
BuildNoCMake
;
cmStdString
Output
;
std
::
string
BuildGenerator
;
std
::
vector
<
std
::
string
>
BuildOptions
;
bool
BuildTwoConfig
;
std
::
string
BuildMakeProgram
;
std
::
string
SourceDir
;
std
::
string
BinaryDir
;
std
::
string
BuildProject
;
std
::
string
TestCommand
;
bool
BuildNoClean
;
std
::
string
BuildRunDir
;
std
::
string
ExecutableDirectory
;
std
::
vector
<
std
::
string
>
TestCommandArgs
;
std
::
vector
<
std
::
string
>
BuildTargets
;
bool
BuildNoCMake
;
};
#endif
...
...
Source/CTest/cmCTestBuildCommand.cxx
View file @
862f5df2
...
...
@@ -25,16 +25,16 @@
//----------------------------------------------------------------------------
cmCTestBuildCommand
::
cmCTestBuildCommand
()
{
m_
GlobalGenerator
=
0
;
this
->
GlobalGenerator
=
0
;
}
//----------------------------------------------------------------------------
cmCTestBuildCommand
::~
cmCTestBuildCommand
()
{
if
(
m_
GlobalGenerator
)
if
(
this
->
GlobalGenerator
)
{
delete
m_
GlobalGenerator
;
m_
GlobalGenerator
=
0
;
delete
this
->
GlobalGenerator
;
this
->
GlobalGenerator
=
0
;
}
}
...
...
@@ -91,10 +91,11 @@ bool cmCTestBuildCommand::InitialPass(
if
(
build_dir
)
{
m_
CTest
->
SetCTestConfiguration
(
"BuildDirectory"
,
build_dir
);
this
->
CTest
->
SetCTestConfiguration
(
"BuildDirectory"
,
build_dir
);
}
cmCTestGenericHandler
*
handler
=
m_CTest
->
GetInitializedHandler
(
"build"
);
cmCTestGenericHandler
*
handler
=
this
->
CTest
->
GetInitializedHandler
(
"build"
);
if
(
!
handler
)
{
this
->
SetError
(
"internal CTest error. Cannot instantiate build handler"
);
...
...
@@ -105,7 +106,7 @@ bool cmCTestBuildCommand::InitialPass(
=
m_Makefile
->
GetDefinition
(
"CTEST_BUILD_COMMAND"
);
if
(
ctestBuildCommand
&&
*
ctestBuildCommand
)
{
m_
CTest
->
SetCTestConfiguration
(
"MakeCommand"
,
ctestBuildCommand
);
this
->
CTest
->
SetCTestConfiguration
(
"MakeCommand"
,
ctestBuildCommand
);
}
else
{
...
...
@@ -124,28 +125,29 @@ bool cmCTestBuildCommand::InitialPass(
{
cmakeBuildConfiguration
=
"Release"
;
}
if
(
m_
GlobalGenerator
)
if
(
this
->
GlobalGenerator
)
{
if
(
strcmp
(
m_GlobalGenerator
->
GetName
(),
cmakeGeneratorName
)
!=
0
)
if
(
strcmp
(
this
->
GlobalGenerator
->
GetName
(),
cmakeGeneratorName
)
!=
0
)
{
delete
m_
GlobalGenerator
;
m_
GlobalGenerator
=
0
;
delete
this
->
GlobalGenerator
;
this
->
GlobalGenerator
=
0
;
}
}
if
(
!
m_
GlobalGenerator
)
if
(
!
this
->
GlobalGenerator
)
{
m_
GlobalGenerator
=
this
->
GlobalGenerator
=
m_Makefile
->
GetCMakeInstance
()
->
CreateGlobalGenerator
(
cmakeGeneratorName
);
}
m_
GlobalGenerator
->
FindMakeProgram
(
m_Makefile
);
this
->
GlobalGenerator
->
FindMakeProgram
(
m_Makefile
);
const
char
*
cmakeMakeProgram
=
m_Makefile
->
GetDefinition
(
"CMAKE_MAKE_PROGRAM"
);
std
::
string
buildCommand
=
m_
GlobalGenerator
->
GenerateBuildCommand
(
cmakeMakeProgram
,
=
this
->
GlobalGenerator
->
GenerateBuildCommand
(
cmakeMakeProgram
,
cmakeProjectName
,
cmakeBuildAdditionalFlags
,
0
,
cmakeBuildConfiguration
,
true
);
m_
CTest
->
SetCTestConfiguration
(
"MakeCommand"
,
buildCommand
.
c_str
());
this
->
CTest
->
SetCTestConfiguration
(
"MakeCommand"
,
buildCommand
.
c_str
());
}
else
{
...
...
Source/CTest/cmCTestBuildCommand.h
View file @
862f5df2
...
...
@@ -9,8 +9,8 @@
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
...
...
@@ -32,15 +32,15 @@ public:
cmCTestBuildCommand
();
~
cmCTestBuildCommand
();
/**
* This is a virtual constructor for the command.
*/
virtual
cmCommand
*
Clone
()
virtual
cmCommand
*
Clone
()
{
cmCTestBuildCommand
*
ni
=
new
cmCTestBuildCommand
;
ni
->
m_
CTest
=
this
->
m_
CTest
;
ni
->
m_
CTestScriptHandler
=
this
->
m_
CTestScriptHandler
;
ni
->
CTest
=
this
->
CTest
;
ni
->
CTestScriptHandler
=
this
->
CTestScriptHandler
;
return
ni
;
}
...
...
@@ -58,11 +58,11 @@ public:
/**
* Succinct documentation.
*/
virtual
const
char
*
GetTerseDocumentation
()
virtual
const
char
*
GetTerseDocumentation
()
{
return
"Builds the repository."
;
}
/**
* More documentation.
*/
...
...
@@ -75,7 +75,7 @@ public:
cmTypeMacro
(
cmCTestBuildCommand
,
cmCTestCommand
);
cmGlobalGenerator
*
m_
GlobalGenerator
;
cmGlobalGenerator
*
GlobalGenerator
;
};
...
...
Source/CTest/cmCTestBuildHandler.cxx
View file @
862f5df2
This diff is collapsed.
Click to expand it.
Source/CTest/cmCTestBuildHandler.h
View file @
862f5df2
...
...
@@ -66,21 +66,21 @@ private:
{
public:
cmCTestCompileErrorWarningRex
()
{}
int
m_
FileIndex
;
int
m_
LineIndex
;
cmsys
::
RegularExpression
m_
RegularExpression
;
int
FileIndex
;
int
LineIndex
;
cmsys
::
RegularExpression
RegularExpression
;
};
struct
cmCTestBuildErrorWarning
{
bool
m_
Error
;