CMake: How to get rid of "This warning is for project developers. Use -Wno-dev to suppress it." warnings?

Viewed 2035

CMake spams a lot of warnings about PCL and Boost like this:

-- Found Boost: /usr/include (found suitable version "1.65.1", minimum required is "1.63.0") found components: system thread filesystem chrono date_time atomic 
CMake Warning (dev) at /snap/cmake/619/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (eigen) 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/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:153 (find_package_handle_standard_args)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:638 (find_eigen)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:850 (find_external_library)
  src/server/CMakeLists.txt:118 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

If I add -Wno-dev to my flags like this:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fopenmp -fexceptions -Wall -Wextra -Wpedantic -Wno-dev")

...it has no effect at all. I still get all those warnings. How do I get rid of them?

PCL, for example, is used like this in my CMakeLists.txt:

find_package(PCL 1.8.1 REQUIRED)
include_directories(SYSTEM ${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

CMake version:

$ cmake -version
cmake version 3.18.4
0 Answers
Related