mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
136 lines
6.9 KiB
HTML
136 lines
6.9 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
<meta name="generator" content="Doxygen 1.9.5"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>rippled: depend</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr id="projectrow">
|
|
<td id="projectalign">
|
|
<div id="projectname">rippled
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.5 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<div id="MSearchResults">
|
|
<div class="SRPage">
|
|
<div id="SRIndex">
|
|
<div id="SRResults"></div>
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div><!-- top -->
|
|
<div><div class="header">
|
|
<div class="headertitle"><div class="title">depend </div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><p >We recommend two different methods to depend on libxrpl in your own <a href="https://cmake.org/cmake/help/latest/">CMake</a> project. Both methods add a CMake library target named <code>xrpl::libxrpl</code>.</p>
|
|
<h2><a class="anchor" id="autotoc_md139"></a>
|
|
Conan requirement</h2>
|
|
<p >The first method adds libxrpl as a <a href="https://docs.conan.io/">Conan</a> requirement. With this method, there is no need for a Git <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">submodule</a>. It is good for when you just need a dependency on libxrpl as-is.</p>
|
|
<div class="fragment"><div class="line"># This conanfile.txt is just an example.</div>
|
|
<div class="line">[requires]</div>
|
|
<div class="line">xrpl/1.10.0</div>
|
|
<div class="line"> </div>
|
|
<div class="line">[generators]</div>
|
|
<div class="line">CMakeDeps</div>
|
|
<div class="line">CMakeToolchain</div>
|
|
</div><!-- fragment --><div class="fragment"><div class="line"># If you want to depend on a version of libxrpl that is not in ConanCenter,</div>
|
|
<div class="line"># then you can export the recipe from the rippled project.</div>
|
|
<div class="line">conan export <path></div>
|
|
</div><!-- fragment --><div class="fragment"><div class="line"># Find and link the library in your CMake project.</div>
|
|
<div class="line">find_package(xrpl)</div>
|
|
<div class="line">target_link_libraries(<target> PUBLIC xrpl::libxrpl)</div>
|
|
</div><!-- fragment --><div class="fragment"><div class="line"># Download, build, and connect dependencies with Conan.</div>
|
|
<div class="line">mkdir .build</div>
|
|
<div class="line">cd .build</div>
|
|
<div class="line">mkdir -p build/generators</div>
|
|
<div class="line">conan install \</div>
|
|
<div class="line"> --install-folder build/generators \</div>
|
|
<div class="line"> --build missing \</div>
|
|
<div class="line"> --settings build_type=Release \</div>
|
|
<div class="line"> ..</div>
|
|
<div class="line">cmake \</div>
|
|
<div class="line"> -DCMAKE_TOOLCHAIN_FILE=build/generators/conan_toolchain.cmake \</div>
|
|
<div class="line"> -DCMAKE_BUILD_TYPE=Release \</div>
|
|
<div class="line"> ..</div>
|
|
<div class="line">cmake --build . --parallel</div>
|
|
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md140"></a>
|
|
CMake subdirectory</h2>
|
|
<p >The second method adds the <a href="https://github.com/ripple/rippled">rippled</a> project as a CMake <a href="https://cmake.org/cmake/help/latest/command/add_subdirectory.html">subdirectory</a>. This method works well when you keep the rippled project as a Git <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">submodule</a>. It's good for when you want to make changes to libxrpl as part of your own project. Be careful, though. Your project will inherit all of the same CMake options, so watch out for name collisions. We still recommend using <a href="https://docs.conan.io/">Conan</a> to download, build, and connect dependencies.</p>
|
|
<div class="fragment"><div class="line"># Add the project as a Git submodule.</div>
|
|
<div class="line">mkdir submodules</div>
|
|
<div class="line">git submodule add https://github.com/XRPLF/rippled.git submodules/rippled</div>
|
|
</div><!-- fragment --><div class="fragment"><div class="line"># Add and link the library in your CMake project.</div>
|
|
<div class="line">add_subdirectory(submodules/rippled)</div>
|
|
<div class="line">target_link_libraries(<target> PUBLIC xrpl::libxrpl)</div>
|
|
</div><!-- fragment --><div class="fragment"><div class="line"># Download, build, and connect dependencies with Conan.</div>
|
|
<div class="line">mkdir .build</div>
|
|
<div class="line">cd .build</div>
|
|
<div class="line">conan install \</div>
|
|
<div class="line"> --output-folder . \</div>
|
|
<div class="line"> --build missing \</div>
|
|
<div class="line"> --settings build_type=Release \</div>
|
|
<div class="line"> ../submodules/rippled</div>
|
|
<div class="line">cmake \</div>
|
|
<div class="line"> -DCMAKE_TOOLCHAIN_FILE=build/generators/conan_toolchain.cmake \</div>
|
|
<div class="line"> -DCMAKE_BUILD_TYPE=Release \</div>
|
|
<div class="line"> ..</div>
|
|
<div class="line">cmake --build . --parallel</div>
|
|
</div><!-- fragment --> </div></div><!-- contents -->
|
|
</div><!-- PageDoc -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
|
|
</small></address>
|
|
</body>
|
|
</html>
|