ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to disable "Policy CMP0045 is not set" warnings?

asked 2015-12-08 08:24:31 -0600

sam gravatar image

I only create catkin package without edit anything.

When I catkin_make , it shows a lots of warnings.

It makes me very hard to see the other error or warnings.

The full log:

sam@sam:~/code/ros_hydro$ catkin_make
Base path: /home/sam/code/ros_hydro
Source space: /home/sam/code/ros_hydro/src
Build space: /home/sam/code/ros_hydro/build
Devel space: /home/sam/code/ros_hydro/devel
Install space: /home/sam/code/ros_hydro/install
####
#### Running command: "make cmake_check_build_system" in "/home/sam/code/ros_hydro/build"
####
####
#### Running command: "make -j8 -l8" in "/home/sam/code/ros_hydro/build"
####
sam@sam:~/code/ros_hydro$ catkin_make
Base path: /home/sam/code/ros_hydro
Source space: /home/sam/code/ros_hydro/src
Build space: /home/sam/code/ros_hydro/build
Devel space: /home/sam/code/ros_hydro/devel
Install space: /home/sam/code/ros_hydro/install
####
#### Running command: "cmake /home/sam/code/ros_hydro/src -DCATKIN_DEVEL_PREFIX=/home/sam/code/ros_hydro/devel -DCMAKE_INSTALL_PREFIX=/home/sam/code/ros_hydro/install" in "/home/sam/code/ros_hydro/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/sam/code/ros_hydro/devel
-- Using CMAKE_PREFIX_PATH: /home/sam/code/ros_hydro/devel;/opt/ros/hydro
-- This workspace overlays: /home/sam/code/ros_hydro/devel;/opt/ros/hydro
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/sam/code/ros_hydro/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
CMake Warning (dev) at /opt/ros/hydro/share/catkin/cmake/tools/doxygen.cmake:40 (GET_TARGET_PROPERTY):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  get_target_property() called with non-existent target "doxygen".
Call Stack (most recent call first):
  /opt/ros/hydro/share/catkin/cmake/all.cmake:148 (include)
  /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:20 (include)
  CMakeLists.txt:52 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- catkin 0.5.90
-- BUILD_SHARED_LIBS is on
WARNING: Package "ompl" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
WARNING: Package "libg2o" does not follow the version conventions. It should not contain leading zeros (unless the number is 0).
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - sam_industrial_robot1
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'sam_industrial_robot1'
-- ==> add_subdirectory(sam_industrial_robot1)
CMake Warning (dev) at /opt/ros/hydro/share/cpp_common/cmake/cpp_commonConfig.cmake:100 (elseif):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "include" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  /opt/ros/hydro/share/roscpp/cmake/roscppConfig.cmake:165 (find_package)
  /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:75 (find_package)
  sam_industrial_robot1/CMakeLists.txt:7 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /opt/ros/hydro ...
(more)
edit retag flag offensive close merge delete

Comments

Which version of cmake are you using? Which OS, which version? Which version of ROS? etc

gvdhoorn gravatar image gvdhoorn  ( 2015-12-08 11:19:38 -0600 )edit

I remember I install cmake 3.0 due to caffe CNN lib. I use ubuntu 12.04 64 bits. I use Hydro.

sam gravatar image sam  ( 2015-12-09 10:00:27 -0600 )edit

As most of ROS' CMakeLists.txt are written against CMake 2.8.x, I can imagine that there will be some issues when using them with newer versions of CMake. I'm not sure what the most efficient way would be to work around this I'm afraid.

gvdhoorn gravatar image gvdhoorn  ( 2015-12-09 10:30:18 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-06-16 12:52:47 -0600

Kuro9206 gravatar image

Hi!

To solve this, I use the following in the header of the CMakeLists.txt of the package ..

cmake_minimum_required(VERSION 2.8)

project(Name)

cmake_policy(SET CMP0054 OLD)
cmake_policy(SET CMP0045 OLD)

edit flag offensive delete link more

Comments

Wow! I add these two lines into every catkin packages, and it works! Thank you~~^^

sam gravatar image sam  ( 2017-04-08 06:20:36 -0600 )edit

Thank you for this. I was having the same problem and your solution worked!

MoodyDevta gravatar image MoodyDevta  ( 2022-07-08 01:17:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-12-08 08:24:31 -0600

Seen: 11,183 times

Last updated: Dec 08 '15