Skip to content

CMake warning: empty command-line option #1311

Closed
@dkroenke

Description

Required information

Operating system:
Ubuntu 20.04 LTS

Compiler version:
CMake 3.23.0 (Released on 29-03-2022)
GCC 9.4.0

Observed result or behaviour:
Taken from #1310 (comment)

When building iceoryx_posh with CMake 3.23, it throws a warning:

Ignoring empty string ("") provided on the command line.

This happens because when CMAKE_TOOLCHAIN_FILE is not
defined, TOOLCHAIN_FILE is also not defined and thus is empty.
Workaround this new behavior by setting a variable that contains
a bunch of things, and may also optionally include the
define for the TOOLCHAIN file, which removes the warning.

This is currently causing a warning in the ROS 2 buildfarm with Windows, like > https://ci.ros2.org/view/nightly/job/nightly_win_rel/2257/cmake/ . Note that I've targeted this to the release_2.0 branch, as that is what > we are using for ROS 2. If you'd prefer me to target to master, I'm happy to do that but then I'll request a backport to the release_2.0 > branch.

Build log:

--- stderr: iceoryx_posh
09:40:11 CMake Warning:
09:40:11   Ignoring empty string ("") provided on the command line.
09:40:11 
09:40:11 
09:40:11 ---
09:40:11 Finished <<< iceoryx_posh [2min 0s]

Expected result or behaviour:
No CMake warning shall be emitted.

Conditions where it occurred / Performed steps:

  1. Download custom CMake version
    wget https://cmake.org/files/v3.23/cmake-3.22.0-linux-x86_64.sh
    
  2. Set custom CMake bin path
    export PATH=/foo/bar/tmp/cmake-3.23.0-linux-x86_64/bin:$PATH
    
  3. Build iceoryx with colcon

Note that this warning does not occur on cmake 3.22 or earlier.

Actions:

  • Merge fix into release_2.0 branch thanks to @clalancette
  • increase version number to 2.0.1 and add changelog entry
  • set git tag v2.0.1 in iceoryx
  • backport changes from release branch to master

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions