E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
18 stars 16 forks source link

Fix usage of find_package_handle_standard_args #561

Closed bartgol closed 1 month ago

bartgol commented 5 months ago

I'm resurrecting this branch, rebased on current master, in case there's a renewed interest. This PR removes CMake warnings like the following, which are polluting the output quite a bit.

CMake Warning (dev) at /home/lbertag/workdir/utils/cmake/cmake-install/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PnetCDF_C)
  does not match the name of the calling package (PnetCDF).  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):
  /home/lbertag/workdir/scream/scream-src/master/externals/scorpio/cmake/LibFind.cmake:302 (find_package_handle_standard_args)
  /home/lbertag/workdir/scream/scream-src/master/externals/scorpio/cmake/FindPnetCDF.cmake:51 (find_package_component)
  /home/lbertag/workdir/scream/scream-src/master/externals/scorpio/src/clib/CMakeLists.txt:96 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
bartgol commented 2 months ago

@jayeshkrishna @dqwu any interested in integrating this (or part of it)?

jayeshkrishna commented 2 months ago

Yeah, we can integrate these changes, but IMO it might need to be broken into more commits, add more msgs etc. We will include the changes in the next minor release (after fixing up the branch).