On 10/16/2013 02:40 PM, James Bigler wrote:
> The documentation for target_link_libraries has this description:
> 
>   target_link_libraries(<target>
>                         <LINK_PRIVATE|LINK_PUBLIC>
>                           [[debug|optimized|general] <lib>] ...
>                         [<LINK_PRIVATE|LINK_PUBLIC>
>                           [[debug|optimized|general] <lib>] ...])
> 
> From my understanding I should be able to do this:
> 
> target_link_libraries(target LINK_PRIVATE lib1 LINK_PRIVATE lib2)
> 
> however CMake 2.8.11.2 returns:
> 
> CMake Error at prime/CMakeLists.txt:128 (target_link_libraries):
>   The LINK_PUBLIC or LINK_PRIVATE option must appear as the second argument,
>   just after the target name.

Steve, I think this is a parsing problem here:

 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTargetLinkLibrariesCommand.cxx;hb=v2.8.12#l151
 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTargetLinkLibrariesCommand.cxx;hb=v2.8.12#l181

It should allow LINK_PUBLIC to occur after another LINK_PUBLIC,
and LINK_PRIVATE to occur after another LINK_PRIVATE.  Currently
it requires that they alternate.  Thew newer PUBLIC/PRIVATE/INTERFACE
options allow any order and repeats.

Thanks,
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to