Skip to content

Commit 7e41d6a

Browse files
docs: Install with conan doc pages (#1070)
Co-authored-by: Craig Edwards (Brain) <[email protected]>
1 parent 1592c68 commit 7e41d6a

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

docpages/03_installing.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ There are many ways to install D++, either from a package manager, or from sourc
1111
* \subpage install-windows-vs-zip
1212
* \subpage install-xmake
1313
* \subpage install-brew
14+
* \subpage install-conan
1415
* \subpage install-from-source

docpages/install/install-conan.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
\page install-conan Installing with Conan
2+
3+
To install D++ into a project using conan 2.0 and cmake:
4+
5+
- Ensure conan is correctly installed, the most popular method is with pip.
6+
- Create a conanfile.txt in the root of the project.
7+
8+
```conanfile
9+
[requires]
10+
dpp/10.0.34
11+
12+
[generators]
13+
CMakeDeps
14+
CMakeToolchain
15+
```
16+
17+
- You may now use the library within a `CMake` based project by adding instructions such as these to your `CMakeLists.txt`:
18+
19+
```cmake
20+
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/build")
21+
find_package(dpp CONFIG REQUIRED)
22+
target_link_libraries(${PROJECT_NAME} dpp::dpp)
23+
```
24+
25+
- If you recieve any errors about CXX version you may need to set it
26+
27+
```
28+
set(CMAKE_CXX_STANDARD 17)
29+
```
30+
31+
- You will then also want to set your build type to match what you will be using in conan(Debug or Release)
32+
33+
```
34+
set(CMAKE_BUILD_TYPE Debug)
35+
```
36+
37+
OR
38+
39+
```
40+
set(CMAKE_BUILD_TYPE Release)
41+
```
42+
43+
- Now run the following commands
44+
45+
```
46+
mkdir build
47+
conan install . --output-folder=build --build=missing -s build_type=Release
48+
cd build
49+
cmake .. -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
50+
cmake --build build --config Release
51+
```
52+
53+
- NOTE: build_type= needs to match whatever was set in your CMake or you will get linker issues.

0 commit comments

Comments
 (0)