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

feat: Adds conan support via a conan 2.0 recipe #1066

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e838136
First test of SCM conan 2.0
MikeRavenelle Sep 24, 2023
7277b21
Fixed requires
MikeRavenelle Jan 19, 2024
60d31d4
Added package info for libs
MikeRavenelle Jan 19, 2024
5947864
renamed libdpp to dpp
MikeRavenelle Jan 19, 2024
25943bb
Made CmakeLists work for both conan and non conan users
MikeRavenelle Jan 19, 2024
f7ee95b
Added documentation for using conan
MikeRavenelle Jan 19, 2024
c2c2854
Merge branch 'dev' into conan_support
MikeRavenelle Jan 19, 2024
3abef91
Changed how conan detected and changed how opus is checked
MikeRavenelle Jan 20, 2024
7e3a98b
Merge branch 'conan_support' of https://github.com/MikeRavenelle/DPP …
MikeRavenelle Jan 20, 2024
857c4fc
Added DPP_NO_CONAN to pipeline, moved conan cmake out of main library…
MikeRavenelle Jan 20, 2024
0c5cbf0
Reset ci.yml since github wont let me commit
MikeRavenelle Jan 20, 2024
84792c8
Fixed 1 error and tabbing
MikeRavenelle Jan 20, 2024
d5dd3f6
Added missing endif()
MikeRavenelle Jan 20, 2024
ffa9cd5
Added parent folder for commit instead of recipe folder and BUILD_VOI…
MikeRavenelle Jan 21, 2024
f4ecfc3
Fixed CMake variables for opus and libsodium
MikeRavenelle Jan 21, 2024
68560d6
Removed load from conan.tools.files and moved conan recipe into libra…
MikeRavenelle Jan 22, 2024
f37ce14
Updated the version number
MikeRavenelle Jan 25, 2024
ea84883
Remove docpage from branch so we can control docpage separately.
MikeRavenelle Jan 26, 2024
3b50591
Rearranged find_packages to top and removed include directories for O…
MikeRavenelle Jan 26, 2024
de0c141
Removed possibly uneeded windows flags and added exclusion for win32 …
MikeRavenelle Jan 28, 2024
2f02ae7
Added flags for tests and BUILD_SHARED_LIBS
MikeRavenelle Mar 29, 2024
4ea4362
Update library-conan/conanfile.py
braindigitalis Oct 23, 2024
6d1dbfa
Update library-conan/conanfile.py
braindigitalis Oct 23, 2024
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
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ else()
message("-- INFO: Using VCPKG if detected")
endif()

if (DPP_NO_CONAN)
message("-- INFO: Explicitly disabling Conan as running inside the CI action.")
else()
message("-- INFO: Using Conan if detected")
endif()

if (WIN32 AND NOT MINGW AND BUILD_SHARED_LIBS)
message("-- INFO: Configuring .rc resource script")
configure_file("${DPP_ROOT_PATH}/src/dpp/dpp.rc.in" "${DPP_ROOT_PATH}/src/dpp/dpp.rc" NEWLINE_STYLE WIN32)
Expand Down Expand Up @@ -99,7 +105,11 @@ else()
enable_testing(${CMAKE_CURRENT_SOURCE_DIR})
endif()

add_subdirectory(library)
if(CONAN_EXPORTED AND NOT DPP_NO_CONAN)
add_subdirectory(library-conan)
else()
add_subdirectory(library)
endif()
endif()

if(DPP_USE_EXTERNAL_JSON)
Expand Down
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 2.0
braindigitalis marked this conversation as resolved.
Show resolved Hide resolved

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.
Loading