KjellKod / g3log

G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own. G3log is made with plain C++14 (C++11 support up to release 1.3.2) with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros. See Readme below for details of usage.
http://github.com/KjellKod/g3log
The Unlicense
908 stars 271 forks source link

Confusion about package name when using inside another cmake project #535

Closed clauderobi closed 4 months ago

clauderobi commented 4 months ago

The instructions (in docs/building,md) have an error in the section related to using g3log in another cmake project. The name of the package does not match what is produced during installation.

As instructed, using find_package(g3log PATHS <Actual path of install dir> CONFIG REQUIRED)

does not work. and produces this message:

Could not find a package configuration file provided by "g3log" with any of
  the following names:

    g3logConfig.cmake
    g3log-config.cmake

Using find_package(g3logger PATHS <Actual path of install dir> CONFIG REQUIRED)

does work, however I get this warning

CMake Warning (dev) at /usr/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (G3LOG) does
  not match the name of the calling package (g3logger).  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):
  build/g3log_installation/lib/cmake/g3logger/g3loggerConfig.cmake:49 (find_package_handle_standard_args)
  vendors/CMakeLists.txt:17 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find G3LOG (missing: G3LOG_INCLUDE_DIR G3LOG_LIBRARY) 

I am not sure if the warning is problematic as I am not sure what should be the correct find_package; the warning might be related to my false resolution (using g3logger instead of g3log as instructed).

clauderobi commented 4 months ago

My bad. Forgot to upgrade before creating this ticket.... Sorry