From c7866351494885cee1d1d5747ec2bc03fe845f6f Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 26 Aug 2010 21:02:40 +0200 Subject: [PATCH] Make target_link_libraries() complain if bad target name is used target_link_libraries() did not complain if there was only one argument, and this one (first) argument wasn't a valid target name, e.g. add_executable(hello main.cpp) target_link_libraries(-static-intel) Here the target "hello" was forgotten in the tll() call, but cmake didn't complain. With this commit it does. Alex --- Source/cmTargetLinkLibrariesCommand.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index d99426093..390e39b3b 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -29,12 +29,6 @@ bool cmTargetLinkLibrariesCommand return false; } - // but we might not have any libs after variable expansion - if(args.size() < 2) - { - return true; - } - // Lookup the target for which libraries are specified. this->Target = this->Makefile->GetCMakeInstance() @@ -49,6 +43,12 @@ bool cmTargetLinkLibrariesCommand return true; } + // but we might not have any libs after variable expansion + if(args.size() < 2) + { + return true; + } + // Keep track of link configuration specifiers. cmTarget::LinkLibraryType llt = cmTarget::GENERAL; bool haveLLT = false;