Skip to content

Commit aa137c2

Browse files
authored
Merge pull request #1847 from perseoGI/patch-1
Updated conan installation instructions
2 parents 7e6f34b + d22de92 commit aa137c2

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

README.md

+17-18
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,35 @@ The range-v3 port in vcpkg is kept up to date by Microsoft team members and comm
8585
Building range-v3 - Using Conan
8686
-------------------------------
8787

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

90-
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):
90+
Setup your `CMakeLists.txt`:
9191
```cmake
9292
project(myproject CXX)
9393
9494
add_executable(${PROJECT_NAME} main.cpp)
95-
96-
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) # Include Conan-generated file
97-
conan_basic_setup(TARGETS) # Introduce Conan-generated targets
98-
99-
target_link_libraries(${PROJECT_NAME} CONAN_PKG::range-v3)
95+
find_package(range-v3 REQUIRED)
96+
target_link_libraries(${PROJECT_NAME} range-v3::range-v3)
97+
```
98+
Create a `conanfile.txt`:
10099
```
101-
Create `conanfile.txt` in your source dir:
102-
```sh
103100
[requires]
104-
range-v3/0.12.0
101+
range-v3/[*]
105102
106103
[generators]
107-
cmake
104+
CMakeDeps
105+
CMakeToolchain
108106
```
109-
Install and run `conan`, then build your project as always:
107+
Run following commands:
110108
```sh
111-
pip install conan
112-
mkdir build
113-
cd build
114-
conan install ../ --build=missing
115-
cmake ../
116-
cmake --build .
109+
$ conan install . --build=missing --output-folder=build
110+
$ cmake . -B build -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
111+
$ cmake --build build
117112
```
113+
For detailed instructions on how to use Conan, please refer to the [Conan documentation](https://docs.conan.io/2/).
114+
115+
The range-v3 package in Conan Center is kept up to date by Conan team members and Conan community contributors.
116+
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.
118117

119118
Building range-v3 - Using `build2`
120119
----------------------------------

0 commit comments

Comments
 (0)