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

[CMake] Unifying the Find*.cmake files #324

Open
piotaixr opened this issue Apr 21, 2015 · 2 comments
Open

[CMake] Unifying the Find*.cmake files #324

piotaixr opened this issue Apr 21, 2015 · 2 comments
Labels

Comments

@piotaixr
Copy link

Currently, all the cmake files used to find dependencies are different:

  • Some have if(WIN32), some not
  • Some allows us to set an environment variable to specify where to search the library, some don't
  • It seems that the libraries are not correctly found in ProgramFiles on 64-Bit Windows

I think it can be interesting to have some part of the files 'in common' like:

  • Don't use if(WIN32): it forces non-needed code duplication
  • Add a line starting with $ENV{ProgramW6432} if not already present
  • Add the option to set a custom environment variable named "DEPENDENCYNAME_ROOT" which contains a path in which cmake should check for the headers/libs

What do you think? If accepted, I can do the changes and submit a pull request.

@piotaixr piotaixr changed the title [CMake] Unifying the Find%.cmake files [CMake] Unifying the Find*.cmake files Apr 21, 2015
@mloskot
Copy link
Contributor

mloskot commented Apr 22, 2015

I've started developing those CMake modules long time ago. They often use outdated techniques. So, cleaning them up is on my TODO list.

Your suggestions sound good, apart from the use of environment variables specifically. I'm not sure it's canonical way of handling XXX_ROOT locations.

Generally, if I was going to update the CMake modules, I'd follow so called FindPackageHandleStandardArgs idiom. Some time ago I asked on CMake ml about Canonical use of FindPackageHandleStandardArgs and I received pretty good list of guidelines. I think, the FindVRPN.cmake suggested in that thread is a good example to follow.

@Krzmbrzl
Copy link
Contributor

Krzmbrzl commented Feb 2, 2025

#1118 has gotten rid of most of the find modules. The remaining ones have been modernized a bit but I suppose there is always room for further improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants