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 invalid usage of OGRE_DIR in CMakeLists.txt #1192

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

olivier-roussel
Copy link
Contributor

The OGRE_DIR cmake variable seems not correctly used here, as it will be set to the directory containing the configuration cmake file (as defined here: https://cmake.org/cmake/help/latest/command/find_package.html#full-signature ).
In other words, the OGRE_DIR variable typically already ends up with a /cmake directory, so the CMAKE_MODULE_PATH should not be appended by an extra /cmake directory.

@olivier-roussel olivier-roussel marked this pull request as draft July 10, 2023 09:53
@olivier-roussel olivier-roussel marked this pull request as ready for review July 10, 2023 12:27
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for this PR.
I would prefer that you add a new path instead of replacing that could lead to side effects.
Your 2 lines are the same.

Since windows is unable to make difference between lower and upper case, put simply

list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, did not paid attention that it lead to duplicated lines.
Ok to me to keep both OGRE_DIR paths (with and without the cmake suffix).

list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")
list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here:

list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake")
list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be list(APPEND CMAKE_MODULE_PATH "${OGRE_DIR}/CMake")

@fspindle fspindle merged commit 2433074 into lagadic:master Jul 11, 2023
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.

2 participants