diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index ac7fc9065..6084e3a9e 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -38,8 +38,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args) // If the second argument is "SHARED" or "STATIC", then it controls // the type of library. Otherwise, it is treated as a source or - // source list name. - if(s != args.end()) + // source list name. There man be two keyword arguments, check for them + while ( s != args.end() ) { std::string libType = *s; if(libType == "STATIC") @@ -62,6 +62,10 @@ bool cmAddLibraryCommand::InitialPass(std::vector const& args) ++s; in_all = false; } + else + { + break; + } } if (s == args.end())