Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

CMake 3.11 will stop supporting multiline cache strings #2664

@osrf-migration

Description

@osrf-migration

Original report (archived issue) by Martin Pecka (Bitbucket: peci1).


Gazebo uses multiline CMake cache strings in files like https://github.com/osrf/gazebo/blob/45fb70f6a44696739ba853823980fe0a006056a2/gazebo/common/CMakeLists.txt#L219 .

CMake 3.11 will stop supporting this: https://cmake.org/cmake/help/v3.15/release/3.11.html#other-changes .

Practically, it doesn’t seem to be a big problem, because if I understand it correctly, this cache string is actually never loaded from the cache as its only usage is being directly handed off to configure_file. I verified it and the generated file config.hh looks correct and contains many include lines.

This is what CMakeCache.txt looks like when built with CMake 3.15:

//Common Headers
common_headers:INTERNAL= #include "gazebo/common/Animation.hh"
# WARNING: Value of common_headers contained a newline and was
#  truncated. Original value:
#  #include "gazebo/common/Animation.hh"
# \n #include "gazebo/common/Assert.hh"
# \n #include "gazebo/common/AudioDecoder.hh"
# \n #include "gazebo/common/Battery.hh"
# \n #include "gazebo/common/Base64.hh"
# \n #include "gazebo/common/BVHLoader.hh"
...

And these warnings are written to the console:

CMake Warning:                                                                                      
  Value of common_headers contained a newline; truncating   

So, the question is: is it still needed to save these variables to cache?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions