Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy CMP0009 warning when symlink-installing a directory that contains a symlink #546

Open
Roboterbastler opened this issue Sep 2, 2024 · 0 comments

Comments

@Roboterbastler
Copy link

Roboterbastler commented Sep 2, 2024

I have some packages that print a cmake policy warning when I try to install directories:

CMake Warning (dev) at ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:62 (file):
  Policy CMP0009 is not set: FILE GLOB_RECURSE calls should not follow
  symlinks by default.  Run "cmake --help-policy CMP0009" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:314 (ament_cmake_symlink_install_directory)
  cmake_install.cmake:46 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

As far as I know there is no way to fix this warning from my side, the policy should probably be set inside ament_cmake_core (I would say it should be set to NEW in order not to follow the links).

A minimal example package setup to show this warning looks as follows:

  • CMakeLists.txt
  • package.xml
  • config
    • some_dir
      • foo.yaml
    • alias_dir --> some_dir

CMakeLists.txt like this:

cmake_minimum_required(VERSION 3.8)
project(test_pkg)
find_package(ament_cmake REQUIRED)
install(
  DIRECTORY config
  DESTINATION share/${PROJECT_NAME}
)
ament_package()

Then build with --symlink-install.

(version: ROS 2 Jazzy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant