[Cmake-commits] [cmake-commits] king committed cmTargetLinkLibrariesCommand.cxx 1.27 1.28 cmTargetLinkLibrariesCommand.h 1.17 1.18

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Aug 18 10:11:31 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv26796/Source

Modified Files:
	cmTargetLinkLibrariesCommand.cxx 
	cmTargetLinkLibrariesCommand.h 
Log Message:
ENH: Make link interface mode more distinct

Rename the recently added INTERFACE mode of the target_link_libraries()
command to LINK_INTERFACE_LIBRARIES.  This makes it much more distinct
from a normal call to the command, and clearly states its connection to
the property of the same name.  Also require the option to appear
immediately after the target name to make it a mode rather than an
option.


Index: cmTargetLinkLibrariesCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C 2 -d -r1.17 -r1.18
*** cmTargetLinkLibrariesCommand.h	11 Aug 2008 20:23:02 -0000	1.17
--- cmTargetLinkLibrariesCommand.h	18 Aug 2008 14:11:29 -0000	1.18
***************
*** 65,69 ****
      {
      return
!       "  target_link_libraries(<target> [INTERFACE]\n"
        "                        [[debug|optimized|general] <lib>] ...)\n"
        "Specify a list of libraries to be linked into the specified target.  "
--- 65,69 ----
      {
      return
!       "  target_link_libraries(<target> [lib1 [lib2 [...]]]\n"
        "                        [[debug|optimized|general] <lib>] ...)\n"
        "Specify a list of libraries to be linked into the specified target.  "
***************
*** 91,95 ****
        "set of transitive link dependencies for a target."
        "\n"
!       "The INTERFACE option tells the command to append the libraries "
        "to the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
        "target properties instead of using them for linking.  "
--- 91,97 ----
        "set of transitive link dependencies for a target."
        "\n"
!       "  target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
!       "                        [[debug|optimized|general] <lib>] ...)\n"
!       "The LINK_INTERFACE_LIBRARIES mode appends the libraries "
        "to the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
        "target properties instead of using them for linking.  "

Index: cmTargetLinkLibrariesCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTargetLinkLibrariesCommand.cxx,v
retrieving revision 1.27
retrieving revision 1.28
diff -C 2 -d -r1.27 -r1.28
*** cmTargetLinkLibrariesCommand.cxx	11 Aug 2008 20:23:02 -0000	1.27
--- cmTargetLinkLibrariesCommand.cxx	18 Aug 2008 14:11:28 -0000	1.28
***************
*** 65,77 ****
    // add libraries, nothe that there is an optional prefix 
    // of debug and optimized than can be used
!   std::vector<std::string>::const_iterator i = args.begin();
!   
!   for(++i; i != args.end(); ++i)
      {
!     if(*i == "INTERFACE")
        {
        this->DoingInterface = true;
        }
!     else if(*i == "debug")
        {
        if(haveLLT)
--- 65,84 ----
    // add libraries, nothe that there is an optional prefix 
    // of debug and optimized than can be used
!   for(unsigned int i=1; i < args.size(); ++i)
      {
!     if(args[i] == "LINK_INTERFACE_LIBRARIES")
        {
        this->DoingInterface = true;
+       if(i != 1)
+         {
+         this->Makefile->IssueMessage(
+           cmake::FATAL_ERROR,
+           "The LINK_INTERFACE_LIBRARIES option must appear as the second "
+           "argument, just after the target name."
+           );
+         return true;
+         }
        }
!     else if(args[i] == "debug")
        {
        if(haveLLT)
***************
*** 82,86 ****
        haveLLT = true;
        }
!     else if(*i == "optimized")
        {
        if(haveLLT)
--- 89,93 ----
        haveLLT = true;
        }
!     else if(args[i] == "optimized")
        {
        if(haveLLT)
***************
*** 91,95 ****
        haveLLT = true;
        }
!     else if(*i == "general")
        {
        if(haveLLT)
--- 98,102 ----
        haveLLT = true;
        }
!     else if(args[i] == "general")
        {
        if(haveLLT)
***************
*** 104,108 ****
        // The link type was specified by the previous argument.
        haveLLT = false;
!       this->HandleLibrary(i->c_str(), llt);
        }
      else
--- 111,115 ----
        // The link type was specified by the previous argument.
        haveLLT = false;
!       this->HandleLibrary(args[i].c_str(), llt);
        }
      else
***************
*** 130,134 ****
            }
          }
!       this->HandleLibrary(i->c_str(), llt);
        }
      } 
--- 137,141 ----
            }
          }
!       this->HandleLibrary(args[i].c_str(), llt);
        }
      } 



More information about the Cmake-commits mailing list