ENH: Ok, when doing cmake -P you should not have to squish filename next to -P, There should be space between

This commit is contained in:
Andy Cedilnik 2004-02-20 14:46:33 -05:00
parent 413a595d37
commit 51516613e8
4 changed files with 10 additions and 3 deletions

View File

@ -217,7 +217,8 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
} }
else if(arg.find("-P",0) == 0) else if(arg.find("-P",0) == 0)
{ {
std::string path = arg.substr(strlen("-P")); i++;
std::string path = args[i];
if ( path.size() == 0 ) if ( path.size() == 0 )
{ {
cmSystemTools::Error("No cmake scrpt provided."); cmSystemTools::Error("No cmake scrpt provided.");

View File

@ -185,8 +185,14 @@ int do_cmake(int ac, char** av)
} }
else if (strncmp(av[i], "-P", strlen("-P")) == 0) else if (strncmp(av[i], "-P", strlen("-P")) == 0)
{ {
if ( i == ac -1 )
{
cmSystemTools::Error("No script specified for argument -P");
}
script_mode = true; script_mode = true;
args.push_back(av[i]); args.push_back(av[i]);
i++;
args.push_back(av[i]);
} }
else else
{ {

View File

@ -71,7 +71,7 @@ ADD_CUSTOM_COMMAND(
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
ARGS ${EXTRA_INSTALL_FLAGS} ARGS ${EXTRA_INSTALL_FLAGS}
"-P${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake"
COMMENT "Install Project" COMMENT "Install Project"
) )

View File

@ -71,7 +71,7 @@ ADD_CUSTOM_COMMAND(
POST_BUILD POST_BUILD
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
ARGS ${EXTRA_INSTALL_FLAGS} ARGS ${EXTRA_INSTALL_FLAGS}
"-P${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake"
COMMENT "Install Project" COMMENT "Install Project"
) )