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

fix(cmake): fixes #413 #457

Merged
merged 1 commit into from
Jun 11, 2022
Merged

fix(cmake): fixes #413 #457

merged 1 commit into from
Jun 11, 2022

Conversation

zjeffer
Copy link
Contributor

@zjeffer zjeffer commented Jun 11, 2022

PULL REQUEST DESCRIPTION

This pull request fixes #413. I'm not that familiar with CMake, but it seems to be fixed by just building as g3log instead of G3LOG. I'm not sure if this has any other negative implications, but the tests run successfully.

Testing

  • This new/modified code was covered by unit tests.

  • (insight) Was all tests written using TDD (Test Driven Development) style?

  • The CI (Windows, Linux, OSX) are working without issues.

  • Was new functionality documented?

  • The testing steps 1 - 2 below were followed

step 1

mkdir build; cd build; cmake -DADD_G3LOG_UNIT_TEST=ON ..

// linux/osx alternative, simply run: ./scripts/buildAndRunTests.sh

step 2: use one of these alternatives to run tests:

  • Cross-Platform: ctest
  • or ctest -V for verbose output
  • Linux: make test

@KjellKod
Copy link
Owner

Nice fix.

In the build of g3sinks I currently see this warning when building and installing g3log with this approach

CMake Warning (dev) at /usr/local/Cellar/cmake/3.21.4/share/cmake/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 (G3LOG).  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/lib/cmake/g3log/G3LOGConfig.cmake:74 (find_package_handle_standard_args)
  CMakeLists.txt:49 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found g3log: /usr/local/include
g3log package:
        found: 1
        include dir: /usr/local/include
        libraries: /usr/local/lib/libg3log.1.3.2-195.dylib;Threads::Threads

When adjusting g3sinks with find_package(g3log) then the g3sinks build output here reduces to

-- Found g3log: /usr/local/include
g3log package:
        found: TRUE
        include dir: /usr/local/include
        libraries: /usr/local/lib/libg3log.1.3.2-195.dylib;Threads::Threads
g3log library: /usr/local/lib/libg3log.1.3.2-195.dylib;Threads::Threads
g3log include should be: /usr/local/include

Ideally, g3log should have a library or executable test that verifies that it can find g3log as an installed library.
If you feel ambitious that would be a sweet add on to the CI. Since this was a pure warning removal the CI would have passed regardless (CMake spits out some nonsensical warnings so triggering on warnings to fail the build probably wouldn't be of interest)

@KjellKod
Copy link
Owner

follow-up PR in g3sinks: KjellKod/g3sinks#125

KjellKod pushed a commit to KjellKod/g3sinks that referenced this pull request Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning calling find_package(g3log) in newer CMake
2 participants