cmake_multiο
Warning
This is a deprecated feature. Please refer to the Migration Guidelines to find the feature that replaced this one.
The new, under development integration with CMake can be found in conan.tools.cmake. This is the integration that will become the standard one in Conan 2.0, and the below generators and integrations will be deprecated and removed. While they are recommended and usable and we will try not to break them in future releases, some breaking changes might still happen if necessary to prepare for the Conan 2.0 release.
This is the reference page for cmake_multi generator.
Go to Integrations/CMake if you want to learn how to integrate your project or recipes with CMake.
This generator will create 3 files with the general information and specific Debug/Release ones:
- conanbuildinfo_release.cmake: Variables adjusted only for build type Release 
- conanbuildinfo_debug.cmake: Variables adjusted only for build type Debug 
- conanbuildinfo_multi.cmake: Which includes the other two and enables its use and has more generic variables and macros. 
Variables in conanbuildinfo_release.cmakeο
Same as conanbuildinfo.cmake with suffix _RELEASE
Variables in conanbuildinfo_debug.cmakeο
Same as conanbuildinfo.cmake with suffix _DEBUG
Macros available in conanbuildinfo_multi.cmakeο
conan_basic_setup()ο
This is a helper and general purpose macro that uses all the macros below to set all the CMake variables according to the Conan generated variables. See the macros below for detailed information.
macro(conan_basic_setup)
    set(options TARGETS NO_OUTPUT_DIRS SKIP_RPATH KEEP_RPATHS SKIP_STD SKIP_FPIC)
- Parameters:
- TARGETS(Optional): Setup all the CMake variables by target (only CMake > 3.1.2). Activates the call to the macro- conan_target_link_libraries().
- NO_OUTPUT_DIRS(Optional): This variable has no effect and it works as if it was activated by default (does not se fixed output directories and uses the default ones designated by CMake).
- SKIP_RPATH(Optional): [DEPRECATED] Use- KEEP_RPATHSinstead. Activate- CMAKE_SKIP_RPATHvariable in OSX.
- KEEP_RPATHS(Optional): Do not adjust the- CMAKE_SKIP_RPATHvariable in OSX. Activates the call to the macro- conan_set_rpath()
- SKIP_STD(Optional): Do not adjust the C++ standard flag in- CMAKE_CXX_FLAGS. Deactivates the call to the macro- conan_set_std().
- SKIP_FPIC(Optional): Do not adjust the- CMAKE_POSITION_INDEPENDENT_CODEflag. Deactivates the call to the macro- conan_set_fpic().
 
Note
You can also call each of the following macros individually instead of using the conan_basic_setup().
conan_target_link_libraries()ο
Helper to link all libraries to a specified target.
These targets are:
- A - CONAN_PKG::<PKG-NAME>target per package in the dependency graph. This is an- IMPORTED INTERFACEtarget.- IMPORTEDbecause it is external, external, a pre-compiled library.- INTERFACE, because it doesnβt necessarily match a library, it could be a header-only library, or the package could even contain several libraries. It contains all the properties (include paths, compile flags, etc.) that are defined in the consumer. It contains all the properties (include paths, compile flags, etc.) that are defined in the- package_info()method of the recipe.
- Inside each package a - CONAN_LIB::<PKG-NAME>_<LIB-NAME>target will be generated for each library. Its type is- IMPORTED UNKNOWNand its main purpose is to provide a correct link order. Their only properties are the location and the dependencies.
- A - CONAN_PKGdepends on every- CONAN_LIBthat belongs to it, and to its direct public dependencies (e.g. other- CONAN_PKGtargets from its requirements).
- Each - CONAN_LIBdepends on the direct public dependencies- CONAN_PKGtargets of its container package. This guarantees correct link order.
conan_check_compiler()ο
Checks that your compiler matches the one declared in settings.
conan_output_dirs_setup()ο
Adjust the bin/ and lib/ output directories.
conan_global_flags()ο
Set the corresponding variables to CMakeβs include_directories() and link_directories().
You can enable the variable CONAN_SYSTEM_INCLUDES in order to get directories included with the SYSTEM option.
conan_define_targets()ο
Define the targets for each dependency (target flags instead of global flags).
conan_set_rpath()ο
Set CMAKE_SKIP_RPATH=1 in the case of working in OSX.
conan_set_vs_runtime()ο
Adjust the runtime flags /MD, /MDd, /MT or /MTd for Visual Studio.
conan_set_std()ο
Set CMAKE_CXX_STANDARD and CMAKE_CXX_EXTENSIONS to the appropriate values.
conan_set_libcxx()ο
Adjust the standard library flags (libc++`, libstdc++, libstdc++11) in CMAKE_CXX_FLAGS.
conan_set_find_paths()ο
Adjust CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH to the values of deps_cpp_info.build_paths.
conan_include_build_modules()ο
Includes CMake files declared in CONAN_BUILD_MODULES using the include(...) directive. This loads the functions or macros that
packages may export and makes them available for usage in the consumers CMakeLists.txt.
conan_find_apple_frameworks(FRAMEWORKS_FOUND FRAMEWORKS)ο
Find framework library names provided in ${FRAMEWORKS} using find_library() and return the found values in FRAMEWORKS_FOUND.
Input variables for conanbuildinfo_multi.cmakeο
CONAN_CMAKE_SILENT_OUTPUTο
Default to: FALSE
Activate it to silence the Conan message output.