[CMake] cmake-2.8.12: generator expression error when linker flags have comma

Nick Hutchinson nshutchinson at gmail.com
Sun Oct 20 04:24:08 EDT 2013


target_link_libraries() is supposed to work for linker flags as well:

cmake version 2.8.12
  target_link_libraries
       Link a target to given libraries.

         target_link_libraries(<target> [item1 [item2 [...]]]
                               [[debug|optimized|general] <item>] ...)

       Specify libraries or flags to use when linking a given target.  The
       named <target> must have been created in the current directory by a
       command such as add_executable or add_library.  The remaining
       arguments specify library names or flags.


On 20 Oct 2013, at 09:13, Rolf Eike Beer <eike at sf-mail.de> wrote:

> Am Samstag, 19. Oktober 2013, 18:01:55 schrieb Jed Brown:
>> I just upgraded from cmake-2.8.11.2 to 2.8.12 and now get errors when a
>> comma ',' appears in a linker flag.  Test case below.  Note that this is
>> but one of many reasons for a comma to appear in linker flags.
>> 
>> https://gist.github.com/jedbrown/7062540
>> 
>>    $ mkdir build && cd build
>>    $ cmake -DDEP_LIBS:STRING='-Wl,--start-group -llapack -lblas
>> -Wl,--end-group' ..
> 
>> target_link_libraries(foo ${DEP_LIBS})
> 
> target_link_libraries is about libraries. No wonder it breaks if you pass 
> other stuff in there. I wonder if using FindBLAS and FindLAPACK would help you 
> out of that.
> 
> Eike--
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131020/359bd0b3/attachment-0001.htm>


More information about the CMake mailing list