From a2fe7601f03555bb4adb13522f0a8470bfb78811 Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Thu, 17 Jan 2002 16:35:26 -0500 Subject: [PATCH] FIX: need a 'make clean' before 'make all' otherwise the post-build custom-command are not run (since a lib might be up to date already for ex.). --- Source/cmaketest.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx index 4e54b11e0b..ced4912208 100644 --- a/Source/cmaketest.cxx +++ b/Source/cmaketest.cxx @@ -110,8 +110,23 @@ int main (int argc, char *argv[]) else { // assume a make sytle program + // clean first + std::string cleanCommand = makeCommand; + cleanCommand += " clean"; + std::cout << "Running make command: " << cleanCommand.c_str() << " ...\n"; + if (!cmSystemTools::RunCommand(cleanCommand.c_str(), output)) + { + std::cerr << "Error: " << cleanCommand.c_str() << " execution failed\n"; + std::cerr << output.c_str() << "\n"; + // return to the original directory + cmSystemTools::ChangeDirectory(cwd.c_str()); + return 1; + } + + // now build makeCommand += " all"; } + std::cout << "Running make command: " << makeCommand.c_str() << " ...\n"; if (!cmSystemTools::RunCommand(makeCommand.c_str(), output)) {