I am using CMake to build an executable whose source code is written in C++. I had some code passed down to me that finds and helps link to a certain package. The pertinent commands from that are:
find_package(mypackage REQUIRED)
I have used the documentation for find_package
found here and found that I can use the variable mypackage_VERSION
to get the version of the package that CMake finds. Here is the relevant code printing that:
if (mypackage_FOUND)
message(STATUS "Libraries for mypackage found")
message(STATUS "Package Version: "${mypackage_VERSION})
else()
message(FATAL_ERROR "Failed to find mypackage.")
endif()
This works to good effect, but I want more information.
I also found out that the CMake variable mypackage_INCLUDE_DIRS
carries the directory with the header files.
Is there documentation giving a comprehensive list of variables that CMake sets in response to a find_package
execution? So far, I've only been able to find out those two from the documentation and online examples.