Skip to content

Commit

Permalink
Fix conan_cmake_install example in README and add note about cmake_fi…
Browse files Browse the repository at this point in the history
…nd_package generator (#339)

* fix example

* add note about cmake_find_package

* minor changes
  • Loading branch information
czoido authored Aug 17, 2021
1 parent 3b17ece commit 168a941
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ recommended flow to use cmake-conan is successively calling to `conan_cmake_conf
`conan_cmake_autodetect` and `conan_cmake_install`. This flow is recommended from v0.16 where these
functions were introduced.

The example above is using the Conan `cmake_find_package` generator which is less intrusive than the
`cmake` generator and more aligned with the direction Conan is taking for the 2.0 version. If you
want to continue using the `cmake` generator with `conan_cmake_configure`, `conan_cmake_autodetect`
and `conan_cmake_install` flow, you should manually include the `conanbuildinfo.cmake` file generated
and also call to `conan_basic_setup`:

```cmake
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
```

Please [check the cmake generator documentation](https://docs.conan.io/en/latest/integrations/build_system/cmake/cmake_generator.html#cmake-generator)
for further details.

## conan_cmake_configure()

This function will accept the same arguments as the sections of the
Expand Down Expand Up @@ -103,11 +118,10 @@ It will also accept `OUTPUT_QUIET` and `ERROR_QUIET` arguments so that when it r
command the output is quiet or the error is bypassed (or both).

```cmake
conan_cmake_run(REQUIRES fmt/1.9.4
cgal/5.0.2
OPTIONS Pkg:shared=True
OtherPkg:option=value
SETTINGS build_type=Debug)
conan_cmake_install(PATH_OR_REFERENCE .
BUILD missing
REMOTE conan-center
SETTINGS ${settings})
```

## Using conan_cmake_autodetect() and conan_cmake_install() with Multi Configuration generators
Expand Down

0 comments on commit 168a941

Please sign in to comment.