-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25943bb
commit f7ee95b
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
\page install-conan Installing with Conan 2.0 | ||
|
||
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.txt | ||
[requires] | ||
dpp/0.1 | ||
[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 | ||
cmake .. | ||
make | ||
``` | ||
|
||
- NOTE: build_type= needs to match whatever was set in your CMake or you will get linker issues. |