[cmake-developers] Possible regression in cmake_parse_arguments in CMake v3.5.0-rc2
Matthias Männich
matthias at maennich.net
Fri Feb 12 07:16:47 EST 2016
Hi,
the problem becomes obvious if one does:
message("_FOO1_FOO=${_FOO1_FOO}")
message("_FOO1_UNPARSED_ARGUMENTS=${_FOO1_UNPARSED_ARGUMENTS}")
message("_FOO2_FOO=${_FOO2_FOO}")
message("_FOO2_UNPARSED_ARGUMENTS=${_FOO2_UNPARSED_ARGUMENTS}")
unfortunately I assumed that the vector of args I get in
::InitialPass() is already sanitized in regards to cmake list
expansion.
Fortunately the fix is rather small and we will send a patch here
along with a test case.
Sorry for the inconvenience and best regards,
Matthias
2016-02-12 9:59 GMT+01:00 Daniele E. Domenichelli <ddomenichelli at drdanz.it>:
> From (at least) CMake 2.8.9 to CMake 3.4, this CMakeLists.txt
>
> ---
> cmake_minimum_required(VERSION 2.8.9)
> project(bar)
>
> include(CMakeParseArguments)
>
> macro(foo)
> set(_options )
> set(_oneValueArgs FOO)
> set(_multiValueArgs )
> cmake_parse_arguments(_FOO1 "${_options}"
> "${_oneValueArgs}"
> "${_multiValueArgs}"
> "${ARGN}")
> cmake_parse_arguments(_FOO2 "${_options}"
> "${_oneValueArgs}"
> "${_multiValueArgs}"
> ${ARGN})
>
> message("_FOO1_FOO=${_FOO1_FOO}")
> message("_FOO2_FOO=${_FOO2_FOO}")
>
> endmacro()
>
> foo(FOO foo)
> ---
>
>
> would produce this output:
>
> _FOO1_FOO=foo
> _FOO2_FOO=foo
>
>
> In CMake v3.5.0-rc2 the output is the following:
>
> _FOO1_FOO=
> _FOO2_FOO=foo
>
>
> This means that the last argument is no longer handled in the same way
> as it was before.
>
>
> Is this an intended change? If it is, I think this is worth a policy,
> since I believe it will break a lot of code...
>
>
>
> Cheers,
> Daniele
>
> --
>
> 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://public.kitware.com/mailman/listinfo/cmake-developers
More information about the cmake-developers
mailing list