For a ROOT project, I have a CMakeFile.txt, and as it needs ROOT to compile, I’m happy to do:
# Check ROOT and Mathmore
FIND_PACKAGE( ROOT REQUIRED COMPONENTS MathMore )
if ( NOT ROOT_FOUND )
message(FATAL_ERROR "ROOT is required but missing !")
endif ( NOT ROOT_FOUND )
But, then that project also depends on xxHash, so I did:
# Find xxHash
FIND_PACKAGE( xxHash REQUIRED )
if ( NOT xxHash_FOUND )
message(FATAL_ERROR "xxHash is required but missing !")
endif ( NOT xxHash_FOUND )
But as FindxxHash.cmake is not distributed with ROOT, it failed.
Would that make sense to also install them?
Thanks.
Right, that’s what I suggest, beside the currently distributed FindRoot macro.
As it may happens, like here, that a program that is build using ROOT libs may also need some of its dependencies.
We need to discuss internally whether we want to become also maintainer of those macros for others.
If that’s necessary for your use case, you can always be inspired by our code and improve it for your own Find* macro (and maybe contribute it back as a PR, if you think that could be helpful for others)…