This is the reference page for cmake_find_package generator. Go to Integrations/CMake if you want to learn how to integrate your project or recipes with CMake.

The cmake_find_package generator creates a file for each requirement specified in the conanfile.

The name of the files follow the pattern Find<PKG-NAME>.cmake. So for the zlib/1.2.11@conan/stable package, a Findzlib.cmake file will be generated.

Variables in Find<PKG-NAME>.cmake

Being <PKG-NAME> the package name used in the reference (by default) or the one declared in or in cpp_info.names["cmake_find_package"] if specified:




Set to 1


Package version


Containing all the include directories of the package




Definitions of the library


Library paths to link




List of CMake module files with functionalities for consumers


System libraries to link


Framework names to do a find_library()


Found frameworks to link with after find_library()


Framework directories to perform the find_library() of <PKG-NAME>_FRAMEWORKS

This file uses <PKG-NAME>_BUILD_MODULES values to include the files using the include(…) CMake directive. This makes functions or utilities exported by the package available for consumers just by setting find_package(<PKG-NAME>) in the CMakeLists.txt.

Moreover, this also adjusts CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH to the values declared by the package in cpp_info.buildirs, so modules in those directories can be found.

Target in Find<PKG-NAME>.cmake

A target named <PKG-NAME>::<PKG-NAME> target is generated with the following properties adjusted:

  • INTERFACE_INCLUDE_DIRECTORIES: Containing all the include directories of the package.

  • INTERFACE_LINK_LIBRARIES: Library paths to link.

  • INTERFACE_COMPILE_DEFINITIONS: Definitions of the library.

The targets are transitive. So, if your project depends on a packages A and B, and at the same time A depends on C, the A target will contain automatically the properties of the C dependency, so in your CMakeLists.txt file you only need to find_package(A) and find_package(B).