Fix CMakeLists missing GLEW and typos for CMake#797
Open
philipandresen wants to merge 2 commits intoTurningWheel:masterfrom
Open
Fix CMakeLists missing GLEW and typos for CMake#797philipandresen wants to merge 2 commits intoTurningWheel:masterfrom
philipandresen wants to merge 2 commits intoTurningWheel:masterfrom
Conversation
Small fixes required to successfully build on CLion
Stops the "clamp isn't a thing" errors
philipandresen
commented
Oct 5, 2023
| # None of the above will be defined unles zlib can be found. | ||
| # PNG depends on Zlib | ||
| INCLUDE(FindZLIB) | ||
| find_package(ZLIB QUIET REQUIRED) |
Author
There was a problem hiding this comment.
Caused a compiler warning.
Using "Include" here feels like using eval("x = x + 1"). Just a tiny code smell. I didn't find many opinions online but the few I found tended to agree
The warning given when using INCLUDE(FindZLIB):
CMake Warning (dev) at ...FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (ZLIB) does
not match the name of the calling package (PNG). This can lead to problems
in calling code that expects `find_package` result variables (e.g.,
`_FOUND`) to follow a certain pattern.
philipandresen
commented
Oct 5, 2023
Comment on lines
28
to
29
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(RAPID_JSON DEFAULT_MSG RAPID_JSON_INCLUDE_DIR ) No newline at end of file | ||
| find_package_handle_standard_args(RapidJson DEFAULT_MSG RAPID_JSON_INCLUDE_DIR ) |
Author
There was a problem hiding this comment.
Fixes the following Compiler warning:
CMake Warning (dev) at .../FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (RAPID_JSON)
does not match the name of the calling package (RapidJson). This can lead
to problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
The variables automatically set by this call (Eg: RAPID_JSON_FOUND) aren't used - from what I can see - so this change shouldn't have any effect on the build. I tested it with the windows build obviously, but, looking through the build pipeline I didn't see any references that would be broken by this.
Contributor
There was a problem hiding this comment.
will take a look on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small fixes - a few that were benign, and two that were required to successfully build on CLion.
Most of the diff is the Readme I put together to help the next person that tries this on CLion. The readme can obviously be excluded if y'all would prefer not to have it on the official repo.
The necessary fixes:
find_package,include_directories, andtarget_link_librariescalls for GLEW which were previously omitted.The cosmetic improvements:
The not-completely-necessary-but-prudent fixes
QuietandRequiredbits are bonus perks for using the more powerfulfind_package.RAPID_JSONlib variable name toRapidJsonto match the casing of theFindRapidJsonfilename as recommended by the compiler.But after these changes everything compiles just fine with zero warnings. Tested with debug / release builds on x64 windows.
Happy to re-submit with only the necessary fixes if this is too much.