Pcl: CMake 3.17: The package name passed to `find_package_handle_standard_args` does not match the name of the calling package

Created on 26 Feb 2020  路  10Comments  路  Source: PointCloudLibrary/pcl

I currently tested CMake 3.17(-rc1) on our build machine and currently we are getting following hints by CMake:

CMake Warning (dev) at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PCL_COMMON)
  does not match the name of the calling package (PCL).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /jenkins/workspace/myproj/install/share/pcl-1.9/PCLConfig.cmake:610 (find_package_handle_standard_args)
  CMakeLists.txt:53 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PCL_COMMON: /jenkins/workspace/myproj/install/lib/libpcl_common.so  
-- looking for PCL_KDTREE
CMake Warning (dev) at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (PCL_KDTREE)
  does not match the name of the calling package (PCL).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  /jenkins/workspace/myproj/install/share/pcl-1.9/PCLConfig.cmake:610 (find_package_handle_standard_args)
  CMakeLists.txt:53 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found PCL_KDTREE: /jenkins/workspace/myproj/install/lib/libpcl_kdtree.so  
-- looking for PCL_SAMPLE_CONSENSUS
CMake Warning (dev) at /usr/local/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args`
  (PCL_SAMPLE_CONSENSUS) does not match the name of the calling package
  (PCL).  This can lead to problems in calling code that expects
  `find_package` result variables (e.g., `_FOUND`) to follow a certain
  pattern.
Call Stack (most recent call first):
  /jenkins/workspace/myproj/install/share/pcl-1.9/PCLConfig.cmake:610 (find_package_handle_standard_args)
  CMakeLists.txt:53 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Maybe it helps to pass a max (3.16) version to cmake_minimum_required to fix it until we have time to really improve it. But currently I don't have time to test it.

todo cmake cmake

Most helpful comment

This is what I did to temporarily solve this issue and keep build output minimal and relevant:

CMakeLists.txt in my project:

(...)
# see here: https://github.com/PointCloudLibrary/pcl/issues/3680
# when this is fixed, we can remove the following 3 lines.
if(NOT DEFINED CMAKE_SUPPRESS_DEVELOPER_WARNINGS)
     set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev warnings")
endif()

find_package(PCL REQUIRED)

(...)

All 10 comments

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

I think the issue is resolved in master. I'm using 3.17.2 and can't reproduce it

I was wrong

FYI: I remember also getting these warnings recently.

Still error exists. Anyone has solution for this ?

I believe the fix has been merged already. @larshg was it?

Not the fix I implemented. Mine was about Ensenso, LibUSB and one more I think.

This seems to be a warning when using PCL modules in downstream projects instead.

I got the same warning compiling a package, cartographer_ros, in catkin_ws in ROS running: $ catkin build for both PCL_COMMON and eigen!

This is what I did to temporarily solve this issue and keep build output minimal and relevant:

CMakeLists.txt in my project:

(...)
# see here: https://github.com/PointCloudLibrary/pcl/issues/3680
# when this is fixed, we can remove the following 3 lines.
if(NOT DEFINED CMAKE_SUPPRESS_DEVELOPER_WARNINGS)
     set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS 1 CACHE INTERNAL "No dev warnings")
endif()

find_package(PCL REQUIRED)

(...)

Seeing the same for rt:

CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args` (rt) does
  not match the name of the calling package (RT).  This can lead to problems
  in calling code that expects `find_package` result variables (e.g.,
  `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  Glitter/Vendor/assimp/cmake-modules/FindRT.cmake:19 (find_package_handle_standard_args)
  Glitter/Vendor/assimp/code/CMakeLists.txt:1037 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IRR LWO LWS M3D MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
-- Disabled importer formats:
-- Enabled exporter formats: OBJ OPENGEX PLY 3DS ASSBIN ASSXML M3D COLLADA FBX STL X X3D GLTF 3MF ASSJSON STEP
-- Disabled exporter formats:

@nccurry Your warning seems to come from a different project, not PCL. It appears you are compiling/using assimp? I suggest you open an issue there.

According to this cmake documentation (see note), the warning can be disabled by setting FPHSA_NAME_MISMATCHED. I think it is ok to do that because the function find_package_handle_standard_args is later also called for PCL, not only for the modules, so PCL_FOUND will be set.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BjoB picture BjoB  路  4Comments

dooxe picture dooxe  路  3Comments

SergioRAgostinho picture SergioRAgostinho  路  4Comments

rmsalinas picture rmsalinas  路  3Comments

mgarbade picture mgarbade  路  3Comments