I know that if I want CMake to find my custom FindBlabla.cmake
file I can put the path leading to it to CMAKE_MODULE_PATH
variable. But what if have a BlablaConfig.cmake
file and want to tell CMake where it's located. I know also I can set -DBlabla_DIR=/path/to/BlablaConfig.cmake
flag and I'll get what I want. But what if I have several such config files? I would like to avoid setting *_DIR
variables for each of them.
To be more concrete we can consider the example of Qt config files. If I have e.g. Gentoo and install qt5 from Portage then the config files will be put to /usr/lib/cmake/Qt5*/Qt5*Config.cmake
and CMake will be able to find it by default. But if I build qt5 from sources and install it to /usr/local/Qt-some.version
then I have to tell CMake where to find those config files since /usr/local/Qt-some.version/lib/cmake/Qt5*/Qt5*.Config.cmake
files are not visible to CMake by default.
Any ideas?