You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h3id="generatelocalpackage">Generate local package</h3>
96
96
<p>After version 2.5.5, we have provided a new local package packaging solution that will seamlessly integrate <code>add_requires</code> and <code>add_packages</code>.</p>
97
97
<p>We can execute the <code>xmake package</code> command to generate the default new version of the packaging format.</p>
<h4id="stepbysteplocalpackagingtutorial">Step by Step Local Packaging Tutorial</h4>
154
+
<p>In this tutorial we will package a static library called foo, upload it to a GitHub repository and consume it similar to a manner of CMake FetchContent</p>
<p>Out of the local package format, <code>xmake package</code> now also supports generating remote packages, so that users can quickly submit them to remote warehouses.</p>
155
246
<p>We only need to modify the package format when packaging.</p>
<p>xmake will also read the relevant configuration information from the target's <code>set_license</code> and <code>set_version</code> configurations.</p>
276
+
<h4id="stepbystepremotepackagingtutorial">Step by Step Remote Packaging Tutorial</h4>
277
+
<h5id="introduction">Introduction</h5>
278
+
<p>A remote package is a package that is compiled from source. If you're developing cross-platform libraries, remote packages allow you to avoid manually compiling for every library and platform.</p>
279
+
<p>To create remote packages:</p>
280
+
<ol>
281
+
<li>Upload your source code to a repository.</li>
282
+
<li>In a <strong>separate repository</strong>, create a remote package manifest that points to your source repository.</li>
283
+
</ol>
284
+
<p>To consume remote packages, you need to add the repository that contains the remote package manifest to your project, find the package, and then add it to your desired target. </p>
285
+
<h5id="example">Example</h5>
286
+
<p>In this example, we’ll create a remote package for a static library named <code>foo</code>, built using <strong>Windows with MSVC</strong>, and then <strong>consume it on MSYS2 using Clang</strong>.</p>
<p>You can push this repository to <ahref="https://github.com/xxx/mycustom_remote_package_repo.git">https://github.com/xxx/mycustom_remote_package_repo.git</a></p>
356
+
<ul>
357
+
<li>Create a project where you intend on consuming the package</li>
<p>Congratulations, you have packaged a library and consumed it xmake!</p>
382
+
<pre><codeclass="lang-bash">$ xmake build
383
+
$ xmake run
384
+
foo
385
+
</code></pre>
185
386
<h3id="findpackagesfromcmake">Find packages from CMake</h3>
186
387
<p>Now cmake is the de facto standard, so the find_package provided by CMake can already find a large number of libraries and modules. We fully reuse this part of cmake's ecology to expand xmake's integration of packages.</p>
187
388
<p>We can use <code>find_package("cmake::xxx")</code> to find some packages with cmake, xmake will automatically generate a cmake script to call cmake's find_package to find some packages and get the bread information.</p>
@@ -260,97 +461,6 @@ <h4 id="specifythesearchmode">Specify the search mode</h4>
260
461
<p>xmake will automatically append the following configuration internally when it looks for cmake packages.</p>
<h4id="stepbysteplocalpackagingtutorial">Step by Step Local Packaging Tutorial</h4>
264
-
<p>In this tutorial we will package a static library called foo, upload it to a GitHub repository and consume it similar to a manner of CMake FetchContent</p>
0 commit comments