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

docs: Install with conan doc pages #1070

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions docpages/03_installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ There are many ways to install D++, either from a package manager, or from sourc
* \subpage install-windows-clion-vcpkg
* \subpage install-xmake
* \subpage install-brew
* \subpage install-conan
* \subpage install-from-source
52 changes: 52 additions & 0 deletions docpages/install/install-conan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
\page install-conan Installing with Conan

To install D++ into a project using conan 2.0 and cmake:

- Ensure conan is correctly installed, the most popular method is with pip.
- Create a conanfile.txt in the root of the project.

```conanfile
[requires]
dpp/10.0.29

[generators]
CMakeDeps
CMakeToolchain
```

- You may now use the library within a `CMake` based project by adding instructions such as these to your `CMakeLists.txt`:

```cmake
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}/build")
find_package(dpp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} dpp::dpp)
```

- If you recieve any errors about CXX version you may need to set it

```
set(CMAKE_CXX_STANDARD 17)
```

- You will then also want to set your build type to match what you will be using in conan(Debug or Release)

```
set(CMAKE_BUILD_TYPE Debug)
```

OR

```
set(CMAKE_BUILD_TYPE Release)
```

- Now run the following commands

```
mkdir build && cd build
conan install .. --build=missing -of=. -s build_type=Release
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved
cmake ..
make
```

- NOTE: build_type= needs to match whatever was set in your CMake or you will get linker issues.
Loading