ENH: add cmaketest to install targets (so that it can be used in other projects) and pass the rest of its command-line args to cmake

This commit is contained in:
Sebastien Barre 2002-03-06 16:30:55 -05:00
parent e74ebd4e87
commit 3ed2e6d02b
2 changed files with 12 additions and 1 deletions

View File

@ -75,6 +75,7 @@ ADD_EXECUTABLE(ctest ctest.cxx cmSystemTools.cxx cmRegularExpression.cxx)
IF(BUILD_TESTING) IF(BUILD_TESTING)
IF (DART_ROOT) IF (DART_ROOT)
ADD_EXECUTABLE(cmaketest cmaketest.cxx cmSystemTools.cxx) ADD_EXECUTABLE(cmaketest cmaketest.cxx cmSystemTools.cxx)
INSTALL_TARGETS(/bin cmaketest)
CONFIGURE_FILE( CONFIGURE_FILE(
${CMake_SOURCE_DIR}/Source/cmaketest.h.in ${CMake_SOURCE_DIR}/Source/cmaketest.h.in

View File

@ -52,7 +52,8 @@ int main (int argc, char *argv[])
{ {
projectName = argv[5]; projectName = argv[5];
} }
// WARNING: the rest of the args is passed to cmake
/** /**
* Run an executable command and put the stdout in output. * Run an executable command and put the stdout in output.
@ -85,6 +86,15 @@ int main (int argc, char *argv[])
std::string generator = "-G"; std::string generator = "-G";
generator += CMAKE_GENERATOR; generator += CMAKE_GENERATOR;
args.push_back(generator); args.push_back(generator);
if(argc > 6)
{
for (int j = 6; j < argc ; j++)
{
args.push_back(argv[j]);
}
}
std::cout << "Generating build files...\n"; std::cout << "Generating build files...\n";
cmake cm; cmake cm;