To help resolve this missing piece we introduced two new generators: We wanted to have the same user experience and results when building a CMake project no matter if doing a conan create, or developing a library calling “cmake” in the command line, or clicking a “build” button in the IDE. We had so many CMake integrations but we felt like we were missing something. Too many CMake integrations, right? A New Approach That’s why we created the cmake_find_package_multi, based on targets, config files instead of modules, and it was able to support multi-configuration projects, using generator expressions.įinally, we created the cmake_paths generator to point the CMAKE_PREFIX_PATH and CMAKE_MODULE_PATH to the packages, in order to support people packaging modules and config cmake files in the Conan packages. The “target approach” assumed that global variables should not be used, and all the information about a library or executable should be associated with a “target.” Soon, a new concept called “modern CMake” was raised. Conan generates different FindXXX.cmake modules for each dependency, so you could call find_package(XXX) and a bunch of variables were set, so you could link with your requirements. The usage of find_package() in the CMake community was getting popular, so we created the cmake_find_package generator. Later the cmake_multi generator gave support to multi-config projects like Visual Studio creating different conanbuildinfo.cmake files for Release or Debug. The way to consume Conan packages with the cmake generator was including a conanbuildinfo.cmake file and calling a conan_basic_setup() macro that adjusted the necessary CMake global variables to locate the include directories, the libraries to link with, and so on. We created the first cmake generator to address this issue. A Bit of History…īack in the day when Conan was first created the CMake approach was based on “global variables.” The concepts of “modern CMake” and “Targets” didn’t exist or were very uncommon. In the near future these new generators will be introduced in the conan-center-index. Building on this evolution we are pleased to present a new unified way to create Conan packages with CMake. The CMake docs splits expressions into Informational, Logical, and Output.The CMake ecosystem and Conan have continually evolved since their conception. They act as if they are evaluated at build/install time, though actually they are evaluated for each build configuration. You can mix it with the positional arguments listed above any remaining arguments (therefore optional positional arguments) are in COMPLEX_PREFIX_UNPARSED_ARGUMENTS. If you look at the official page, you'll see a slightly different method using set to avoid explicitly writing the semicolons in the list feel free to use the structure you like best. Inside the function after this call, you'll find: COMPLEX_PREFIX_SINGLE = TRUEĬOMPLEX_PREFIX_MULTI_VALUES = "some other values" There are a series of all caps keywords you can use inside an if statement, and you can often refer to variables by either directly by name or using the $Ĭomplex(SINGLE ONE_VALUE value MULTI_VALUES some other values) CMake has an if statement, though over the years it has become rather complex.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |