Issue
Is there a variable that stores the path to the found package similar to the package version?
find_package(name)
message("name version: ${name_VERSION}") #something like this but only for path to package?
Solution
If corresponded XXXConfig.cmake
file has been found in find_package(XXX)
call, then variable XXX_CONFIG
contains absolute path to that file.
Also, there is CACHE variable XXX_DIR
which contains directory with the file. Because this is a cached variable, its value can be found in CMakeCache.txt
file after running cmake
.
More about find_package
behavior can be found in documentation.
Answered By - Tsyvarev