From 51516613e83f15c31156ad0a503f270c746266e1 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 20 Feb 2004 14:46:33 -0500 Subject: ENH: Ok, when doing cmake -P you should not have to squish filename next to -P, There should be space between --- Source/cmake.cxx | 3 ++- Source/cmakemain.cxx | 6 ++++++ Tests/SimpleInstall/CMakeLists.txt | 2 +- Tests/SimpleInstallS2/CMakeLists.txt | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c1c2698..9c4f7d9 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -217,7 +217,8 @@ bool cmake::SetCacheArgs(const std::vector& args) } else if(arg.find("-P",0) == 0) { - std::string path = arg.substr(strlen("-P")); + i++; + std::string path = args[i]; if ( path.size() == 0 ) { cmSystemTools::Error("No cmake scrpt provided."); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 7c9a155..3b29bf5 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -185,8 +185,14 @@ int do_cmake(int ac, char** av) } else if (strncmp(av[i], "-P", strlen("-P")) == 0) { + if ( i == ac -1 ) + { + cmSystemTools::Error("No script specified for argument -P"); + } script_mode = true; args.push_back(av[i]); + i++; + args.push_back(av[i]); } else { diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index 4a315a1..ed46a0f 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -71,7 +71,7 @@ ADD_CUSTOM_COMMAND( POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS ${EXTRA_INSTALL_FLAGS} - "-P${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" + -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" COMMENT "Install Project" ) diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 4a315a1..ed46a0f 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -71,7 +71,7 @@ ADD_CUSTOM_COMMAND( POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS ${EXTRA_INSTALL_FLAGS} - "-P${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" + -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" COMMENT "Install Project" ) -- cgit v0.12