[CMake] Cmake 3.5.2 update problem

Jakob van Bethlehem jsvanbethlehem at gmail.com
Tue Apr 26 05:18:10 EDT 2016


Dear users,

Today I tried to bootstrap our app with CMake 3.5.2. Unfortunately it
caused problems in one of our custom functions we created. This is for the
Visual Studio 2013 64bit generator.

We have a function to create tests that accepts an 'INCLUDES' parameter,
and we tend to use generator expressions to pass include directories from
other libraries in the solution, i.e. something like this:

add_test(
    TARGET TestName
    INCLUDES
        $<TARGET_PROPERTY:Lib1,INTERFACE_INCLUDE_DIRECTORIES>
        $<TARGET_PROPERTY:Lib2,INCLUDE_DIRECTORIES>
     LIBRARIES
         AnotherLib
         YetAnotherLib
    SOURCES
        TestSource1.cpp
        TestSource2.cpp
)

Inside the function definition we use cmake_parse_arguments to parse these
arguments, i.e. something like this:
function(add_test)
     cmake_parse_arguments(
     PARSED_ARGS
     ""
     "TARGET"
     "SOURCES;LIBRARIES;INCLUDES"
     ${ARGN}
)

If I now inspect the value of ${PARSED_ARGS_INCLUDES} I see the result I at
least expected, namely
"$<TARGET_PROPERTY:Lib1,INTERFACE_INCLUDE_DIRECTORIES>;$<TARGET_PROPERTY:Lib2,INCLUDE_DIRECTORIES>".
This value is passed on to target_include_directories inside the function,
like so:
target_include_directories(${PARSED_ARGS_TARGET}
  PRIVATE ${PARSE_ARGS_INCLUDES}
)

It is this line that starts producing unexplainable errors that look like
this:
CMake Error in ../CMakeLists.txt:
  Found relative path while evaluating include directories of
  "TestName":

    "PTARGET_PROPERTY:Lib1,INTERFACE_INCLUDE_DIRECTORIES>"

The first letter, here 'P', can be many letters, it seems some random
character appear here, including non-printable characters.

What am I looking at here? Are we using some functionality that was removed
or changed from CMake 3.5.2. From the release notes I don't see anything
that could be related.

Sincerely,
Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160426/0130eecc/attachment-0001.html>


More information about the CMake mailing list