[ros-users] cmake link_directories warnings for Maverick

Jack O'Quin jack.oquin at gmail.com
Thu Jan 6 01:14:53 UTC 2011


I noticed in some build output lately that under Maverick cmake prints
warnings like this:

CMake Warning (dev) at src/node/CMakeLists.txt:2 (link_directories):
  This command specifies the relative path

    art_map/lib

  as a link directory.

  Policy CMP0015 is not set: link_directories() treats paths relative to the
  source dir.  Run "cmake --help-policy CMP0015" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

I am still running Lucid and Karmic, and I do not see those warnings
during development. The build still seems to work, AFAICT.

I do use link_directories() in some places, based on these ROS build
recommendations:

 http://www.ros.org/wiki/rosbuild/CMakeLists/Examples#Adding_compile_.2BAC8_link_flags

Are those recommendations obsolete?

Some on-line sources suggest that link_directories() should no longer be used:

  "Don't use LINK_DIRECTORIES. Consider it deprecated. Specify the
full path to the library instead in the TARGET_LINK_LIBRARIES call."

Should we start setting absolute path names on target_link_libraries() instead?
-- 
 joq



More information about the ros-users mailing list