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' ..
    -- The C compiler identification is GNU 4.8.2
    -- The CXX compiler identification is GNU 4.8.2
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Configuring done
    CMake Error:
      Error evaluating generator expression:
    
        $<LINK_ONLY:-Wl,--start-group -llapack -lblas -Wl,--end-group>
    
      $<LINK_ONLY> expression requires exactly one parameter.
    
    CMake Warning (dev) in CMakeLists.txt:
      Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
      interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.
    
      Static library target "foo" has a INTERFACE_LINK_LIBRARIES property.  This
      should be preferred as the source of the link interface for this library.
      Ignoring the property and using the link implementation as the link
      interface instead.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /tmp/cmake-comma/build


cmake_minimum_required(VERSION 2.8)
project(foo)

add_library(foo foo.cc)
target_link_libraries(foo ${DEP_LIBS})

add_library(bar bar.cc)
target_link_libraries(bar foo)
int foo() {return 0;}
int bar() {return 0;}

Attachment: pgpk2iKZYIg2i.pgp
Description: PGP signature

--

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

Reply via email to