Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated conan installation instructions #1847

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,35 @@ The range-v3 port in vcpkg is kept up to date by Microsoft team members and comm
Building range-v3 - Using Conan
-------------------------------

You can download and install range-v3 using the [Conan](https://github.com/conan-io/conan) dependency manager.
You can install pre-built binaries for range-v3 or build it from source using [Conan](https://conan.io/).

Setup your CMakeLists.txt (see [Conan documentation](https://docs.conan.io/en/latest/integrations/build_system.html) on how to use MSBuild, Meson and others):
Setup your `CMakeLists.txt`:
```cmake
project(myproject CXX)

add_executable(${PROJECT_NAME} main.cpp)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) # Include Conan-generated file
conan_basic_setup(TARGETS) # Introduce Conan-generated targets

target_link_libraries(${PROJECT_NAME} CONAN_PKG::range-v3)
find_package(range-v3 REQUIRED)
target_link_libraries(${PROJECT_NAME} range-v3::range-v3)
```
Create a `conanfile.txt`:
```
Create `conanfile.txt` in your source dir:
```sh
[requires]
range-v3/0.12.0
range-v3/[*]

[generators]
cmake
CMakeDeps
CMakeToolchain
```
Install and run `conan`, then build your project as always:
Run following commands:
```sh
pip install conan
mkdir build
cd build
conan install ../ --build=missing
cmake ../
cmake --build .
$ conan install . --build=missing --output-folder=build
$ cmake . -B build -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
$ cmake --build build
```
For detailed instructions on how to use Conan, please refer to the [Conan documentation](https://docs.conan.io/2/).

The range-v3 package in Conan Center is kept up to date by Conan team members and Conan community contributors.
If the version is out of date, please [create an issue or pull request](https://github.com/conan-io/conan-center-index) on the conan repository.

Building range-v3 - Using `build2`
----------------------------------
Expand Down