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

CMake 3.17: The package name passed to find_package_handle_standard_args does not match the name of the calling package #3680

Closed
SunBlack opened this issue Feb 26, 2020 · 13 comments · Fixed by #4431
Labels
kind: todo Type of issue module: cmake skill: cmake Skills/areas of expertise needed to tackle the issue

Comments

@SunBlack
Copy link
Contributor

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.

@taketwo taketwo added the status: triage Labels incomplete label Feb 26, 2020
@stale
Copy link

stale bot commented May 19, 2020

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

@stale stale bot added the status: stale label May 19, 2020
@kunaltyagi
Copy link
Member

kunaltyagi commented May 20, 2020

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

I was wrong

@stale stale bot removed the status: stale label May 20, 2020
@kunaltyagi kunaltyagi added module: cmake needs: author reply Specify why not closed/merged yet and removed status: triage Labels incomplete labels May 20, 2020
@SergioRAgostinho
Copy link
Member

FYI: I remember also getting these warnings recently.

@kunaltyagi kunaltyagi added needs: testing Specify why not closed/merged yet and removed needs: author reply Specify why not closed/merged yet labels May 21, 2020
@amitrjaiswal1
Copy link

Still error exists. Anyone has solution for this ?

@SergioRAgostinho
Copy link
Member

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

@larshg
Copy link
Contributor

larshg commented Jul 1, 2020

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.

@kunaltyagi kunaltyagi added kind: todo Type of issue skill: cmake Skills/areas of expertise needed to tackle the issue and removed needs: testing Specify why not closed/merged yet labels Jul 2, 2020
@mrgransky
Copy link

mrgransky commented Aug 21, 2020

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

@sebastian-freitag
Copy link

sebastian-freitag commented Sep 29, 2020

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)

(...)

@nccurry
Copy link

nccurry commented Sep 30, 2020

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:

@mvieth
Copy link
Member

mvieth commented Sep 30, 2020

@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.

fspindle added a commit to fspindle/visp that referenced this issue Nov 5, 2020
This is a temporary workaround.
See here: PointCloudLibrary/pcl#3680
When this PCL issue is fixed, the changes done in this commit should be removed.

CMake Warning (dev) at /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (libusb-1.0)
  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):
  /usr/local/share/pcl-1.11/PCLConfig.cmake:290 (find_package_handle_standard_args)
  /usr/local/share/pcl-1.11/PCLConfig.cmake:337 (find_libusb)
  /usr/local/share/pcl-1.11/PCLConfig.cmake:549 (find_external_library)
  cmake/VISPUtils.cmake:536 (find_package)
  CMakeLists.txt:593 (VP_OPTION)
This warning is for project developers.  Use -Wno-dev to suppress it.
@jackjansen
Copy link

I'm running into the same problem (using PCL as a dependency in my project), and I'm reluctant to apply the workarounds suggested here in my CMakefiles, because it will also silence other instances of the warning that could actually be useful.

Could this issue somehow be fixed in the PCL CMakefiles (or probably find_package) and reset to the previous value afterwards?

@kunaltyagi kunaltyagi linked a pull request Apr 9, 2021 that will close this issue
@CherrryJ
Copy link

So……is there has any solution???

@kunaltyagi
Copy link
Member

#4431 has been merged. For now, please see if you can apply that as a patch. Else use master branch till PCL 1.12 is released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: todo Type of issue module: cmake skill: cmake Skills/areas of expertise needed to tackle the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.