-
Notifications
You must be signed in to change notification settings - Fork 662
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
Consider making CMake variables case consistent #138
Comments
Yes, that inconsistency can be found in many common libraries and partly the inconsistent style in CMake itself is to blame (e.g. https://cmake.org/cmake/help/v3.0/module/FindOpenMP.html / https://cmake.org/cmake/help/v3.0/module/FindBullet.html / https://cmake.org/cmake/help/v3.0/module/FindQt4.html), even the PackaceConfigHelpers docs use octomap_FOUND is set according to the lowercase package name (the filename of the config file is irrelevant), so I think it's best to stick to that and provide I'm not sure if manually setting |
👍 to using the lowercase package name for all the variables.
I agree with you. Having both of |
Partially relevant. Package names are not well defined in CMake. The key is the lowercase config file name. CMake looks for a case sensitive match |
Wow, that's quite a mess! |
Is there still something to take care of with this issue? If so, then please send a PR. I'm preparing a new release and now would be a good time to change things (backwards-compatible, if possible). |
My suggestion is using In short, it would be good to use one of # (1) OCTOMAPConfig.cmake
find_package(OCTOMAP)
if(OCTOMAP_FOUND)
include_directories(${OCTOMAP_INCLUDE_DIRS})
link_directories(${OCTOMAP_LIBRARY_DIRS})
endif()
or
# (2) octomapConfig.cmake
find_package(octomap)
if(octomap_FOUND)
include_directories(${octomap_INCLUDE_DIRS})
link_directories(${octomap_LIBRARY_DIRS})
endif()
or
# (3) OctomapConfig.cmake
find_package(Octomap)
if(Octomap_FOUND)
include_directories(${Octomap_INCLUDE_DIRS})
link_directories(${Octomap_LIBRARY_DIRS})
endif()
or
# (4) OctoMapConfig.cmake
find_package(OctoMap)
if(OctoMap_FOUND)
include_directories(${OctoMap_INCLUDE_DIRS})
link_directories(${OctoMap_LIBRARY_DIRS})
endif() Please note that this is a breaking change; Users need to change either This issue is not a bug so it's totally up to you @ahornung . Personally, I might be happy with #140. If one of the options I suggest also makes sense to you, then I'll create an PR for it. It's totally fine even if you decline this change. |
Oh, wait. Let me take back my words. We don't need to change anything but the comment in |
Now, that's an easy fix :) |
Thanks for the change! |
The CMake config file for octomap is
octomap-config.cmake
. That means we find octomap in CMake using lower case name asfind_package(octomap)
, and this definesoctomap_FOUND
in success. However,octomap-config.cmake
defines other CMake variables using upper cases likeOCTOMAP_INCLUDE_DIRS
andOCTOMAP_LIBRARIES
. So the usage would be like:It would be good to make them follow one consistent convention.
The text was updated successfully, but these errors were encountered: