<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Developer – Craft</title><link>/docs/getting-started/building/craft/</link><description>Recent content in Craft on Developer</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/getting-started/building/craft/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Building KDE software on Windows with Craft</title><link>/docs/getting-started/building/craft/craft-windows/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/docs/getting-started/building/craft/craft-windows/</guid><description>
&lt;p&gt;Craft is a tool with multiple purposes related to packaging:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It can build for multiple platforms: Windows, Android, macOS and Linux&lt;/li&gt;
&lt;li&gt;It can generate packages in multiple packaging formats: Windows APPX, Android APK, Linux AppImage and macOS DMG&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unlike kde-builder (KDE's build tool of choice on Linux), Craft defaults to downloading precompiled cached packages for the dependencies of your application, with the option to compile these packages locally.&lt;/p&gt;
&lt;p&gt;Craft is also tightly integrated into KDE's continuous integration system, and capable of automatically signing packages in such a way that they can be published to official stores like Microsoft Store and Google Play. You can read more about this in &lt;a href="/docs/packaging/" &gt;Packaging KDE Software&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Given these capabilities, Craft can be an excellent tool to build C++ projects on Windows, even for non-KDE projects.&lt;/p&gt;
&lt;p&gt;This tutorial will teach you how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#changes" &gt;Make changes to existing KDE software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#custom-projects" &gt;Build your own custom projects on Windows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have any issues regarding Craft, visit the &lt;a href="https://go.kde.org/matrix/#/##kde-craft:kde.org" &gt;#kde-craft:kde.org&lt;/a&gt; room on &lt;a href="https://community.kde.org/Matrix" &gt;Matrix&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="craft-setup-on-windows"&gt;Craft setup on Windows&lt;/h2&gt;
&lt;p&gt;On Windows 11, open the Terminal. On Windows 10, open Powershell.&lt;/p&gt;
&lt;p&gt;Type &lt;code&gt;python&lt;/code&gt; and press Enter. If you don’t have Python installed, it will open the Microsoft Store page for the latest release of Python, which you can then install without needing a Microsoft account.&lt;/p&gt;
&lt;p&gt;Install Microsoft Visual Studio by going to &lt;a href="https://visualstudio.microsoft.com/vs/community/" &gt;Visual Studio Community&lt;/a&gt; and downloading the installer. Make sure to select the &amp;quot;Desktop development with C++&amp;quot; workload.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development" &gt;Enable “Developer Mode”&lt;/a&gt; in the settings.&lt;/p&gt;
&lt;p&gt;In the terminal, run:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;Set-ExecutionPolicy&lt;/span&gt; &lt;span class="n"&gt;-Scope&lt;/span&gt; &lt;span class="n"&gt;CurrentUser&lt;/span&gt; &lt;span class="n"&gt;RemoteSigned&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python.exe -m pip install --upgrade certifi&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Lastly, install Craft with the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;iex &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nb"&gt;new-object&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webclient&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="py"&gt;DownloadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It will ask you a series of questions. Press Enter for all options to accept the defaults.&lt;/p&gt;
&lt;p&gt;Now you should have a new app entry called &lt;code&gt;CraftRoot&lt;/code&gt; in the Windows Start menu. You can either use that for everything Craft related, or open Powershell/Terminal and run:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;C:&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;CraftRoot&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;craft&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;craftenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="changes"&gt;Make changes to existing KDE software&lt;/h2&gt;
&lt;p&gt;Let's attempt to make changes to KCalc with Craft.&lt;/p&gt;
&lt;p&gt;The first thing you need to do is to install KCalc and its dependencies:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The first time you attempt to build any program using Craft, it will take a long time to download all dependencies from the Craft cache. Depending on your internet connection and the project you want to hack, even just the dependencies might take more than one hour. This is because Windows lacks many of the default libraries that would be present in other operating systems.&lt;/p&gt;
&lt;p&gt;After the command has finished, you should be able to run KCalc using Craft:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --run kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Craft keeps a cached build of most libraries, but for applications Craft instead downloads a tarball of the last release and builds from that. Because of this, there is no repository with source code for us to modify. Moreover, for development purposes, we want to modify KCalc from the master branch.&lt;/p&gt;
&lt;p&gt;Set the version to master:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --set &lt;span class="nv"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;master kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then rebuild it:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --ignoreInstalled --no-cache kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will force installation of KCalc again, this time pulling the source code from the master branch and building KCalc instead of building from a tarball.&lt;/p&gt;
&lt;p&gt;Now that Craft has pulled the source code repository, you may switch to the directory where the source code is with:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cs kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you run &lt;code&gt;git status&lt;/code&gt;, you should see that the source code has been pulled and it is in the latest &lt;code&gt;master&lt;/code&gt; branch:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;PS &lt;/span&gt;&lt;span class="n"&gt;C:&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;58afbb54&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;kcalc&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;On&lt;/span&gt; &lt;span class="n"&gt;branch&lt;/span&gt; &lt;span class="n"&gt;master&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;Your&lt;/span&gt; &lt;span class="n"&gt;branch&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="n"&gt;up&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;origin/master&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;nothing&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;working&lt;/span&gt; &lt;span class="n"&gt;tree&lt;/span&gt; &lt;span class="n"&gt;clean&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You may then start hacking! For example, try changing the &lt;code&gt;KAboutData aboutData&lt;/code&gt; in &lt;code&gt;kcalc.cpp&lt;/code&gt; to rename KCalc to something else.&lt;/p&gt;
&lt;p&gt;Then, run:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --ignoreInstalled kcalc
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --run kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;And you should see KCalc now has a new name.&lt;/p&gt;
&lt;p&gt;To build on a work branch:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git branch work/yourname/newbranch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git switch work/yourname/newbranch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --compile --install --qmerge kcalc&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Later on, you can then just &lt;code&gt;git switch&lt;/code&gt; to the branch you want to build and run the last command.&lt;/p&gt;
&lt;div class="d-flex align-items-center notecard notecard--danger" role="alert"&gt;
&lt;span&gt;
If you rebuild the project with the default Craft build (&lt;code&gt;craft --ignoreInstalled kcalc&lt;/code&gt;), it will revert to the master branch.
&lt;/span&gt;
&lt;/div&gt;
&lt;h2 id="blueprint"&gt;Adding a blueprint&lt;/h2&gt;
&lt;p&gt;To make Craft build a custom project, you will need a &lt;a href="https://community.kde.org/Craft/Blueprints" &gt;Craft Blueprint&lt;/a&gt;, a recipe written in very simple-to-write Python that Craft uses to know where the source code for a project is and what to do with it.&lt;/p&gt;
&lt;p&gt;For starter projects that still have no repository to pull the source code from, it is possible to run Craft on a project stored in any directory. This works well for making iterative changes in a project before committing.&lt;/p&gt;
&lt;p&gt;We will be using the &lt;a href="/docs/getting-started/kirigami/" &gt;Kirigami Tutorial&lt;/a&gt; as an example.&lt;/p&gt;
&lt;p&gt;Store the project in your home directory on Windows Explorer, in &lt;code&gt;Documents\kirigami-tutorial&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Next, in your &lt;code&gt;CraftRoot&lt;/code&gt; terminal, run the following to enter the Blueprints directory and create a directory for your project:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;cs&lt;/span&gt; &lt;span class="nb"&gt;craft-blueprints&lt;/span&gt;&lt;span class="n"&gt;-kde&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;mkdir&lt;/span&gt; &lt;span class="n"&gt;kde&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="nb"&gt;kirigami-tutorial&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then copy the following Blueprint to &lt;code&gt;kde\kirigami-tutorial\kirigami-tutorial.py&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;info&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Blueprints.CraftPackageObject&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CraftPackageObject&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;subinfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;infoclass&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;setTargets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;displayName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Kirigami Tutorial&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;A test to run a Kirigami app on Windows with Craft&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;webpage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://kde.org&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;setDependencies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;buildDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;kde/frameworks/extra-cmake-modules&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtimeDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;libs/qt/qtdeclarative&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtimeDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;kde/frameworks/tier1/kirigami&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtimeDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;kde/frameworks/tier1/breeze-icons&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtimeDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;kde/frameworks/tier3/kiconthemes&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;runtimeDependencies&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;kde/frameworks/tier3/qqc2-desktop-style&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Package.CMakePackageBase&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CMakePackageBase&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CMakePackageBase&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;createPackage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defines&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;appname&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;kirigami-hello&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defines&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;shortcuts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Kirigami Tutorial&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;target&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;bin/kirigami-hello.exe&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createPackage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="d-flex align-items-center notecard notecard--info" role="alert"&gt;
&lt;span&gt;
&lt;p class="h4 mt-0"&gt;Note&lt;/p&gt;&lt;p&gt;&lt;code&gt;buildDependencies&lt;/code&gt; should be used for build tools, not libraries.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;runtimeDependencies&lt;/code&gt; refers to libraries and tools that are required by the application at build time &lt;em&gt;and&lt;/em&gt; runtime. Despite Kirigami being a build dependency for the project, it is marked as a runtime dependency because without Kirigami the application would not run. Runtime dependencies are shipped with the package when it gets built.&lt;/p&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;h2 id="custom-projects"&gt;Build your own custom projects on Windows&lt;/h2&gt;
&lt;p&gt;Navigate to the directory where your project is:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;&lt;span class="nv"&gt;$env:USERPROFILE&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;OneDrive&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="n"&gt;Documents&lt;/span&gt;&lt;span class="p"&gt;\&lt;/span&gt;&lt;span class="nb"&gt;kirigami-tutorial&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="d-flex align-items-center notecard notecard--info" role="alert"&gt;
&lt;span&gt;
&lt;p class="h4 mt-0"&gt;About Windows user directories&lt;/p&gt;&lt;p&gt;Windows 10 and 11 come with OneDrive enabled. By default, the &lt;code&gt;Documents&lt;/code&gt; directory is backed up by OneDrive, so it is stored in &lt;code&gt;C:\Users\youruser\OneDrive\Documents&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After installation, if you set OneDrive to not back up this folder, then the new path becomes &lt;code&gt;C:\Users\youruser\Documents&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Additionally, the &lt;code&gt;Documents&lt;/code&gt; directory might be localized into your language. Change the command above accordingly.&lt;/p&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Then run:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --ignoreInstalled --options kirigami-tutorial.srcDir&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;Get-Location&lt;span class="k"&gt;)&lt;/span&gt; kirigami-tutorial
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --options kirigami-tutorial.srcDir&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;Get-Location&lt;span class="k"&gt;)&lt;/span&gt; --run kirigami-hello&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This will ignore any repository options and branches and just use the current source directory as is.&lt;/p&gt;
&lt;p&gt;Once your project is pushed to a repository somewhere, you can add it to your blueprint:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;svnTargets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;master&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://invent.kde.org/youruser/kirigami-tutorial.git|master&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defaultTarget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;master&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So that you can simply run:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --ignoreInstalled kirigami-tutorial
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --run kirigami-hello&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Or build a work branch as is:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git branch work/yourname/newbranch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git switch work/yourname/newbranch
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --compile --install --qmerge kirigami-tutorial&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="d-flex align-items-center notecard notecard--danger" role="alert"&gt;
&lt;span&gt;
If you rebuild the project with the default Craft build (&lt;code&gt;craft --ignoreInstalled kirigami-tutorial&lt;/code&gt;), it will revert to the master branch.
&lt;/span&gt;
&lt;/div&gt;
&lt;h2 id="installer"&gt;Making an installer&lt;/h2&gt;
&lt;p&gt;By default, Craft will be able to make an executable package installer using &lt;a href="https://nsis.sourceforge.io" &gt;NSIS&lt;/a&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --package kirigami-tutorial
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Or the following to use the current source directory as is&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;craft --options kirigami-tutorial.srcDir&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;Get-Location&lt;span class="k"&gt;)&lt;/span&gt; --package kirigami-tutorial&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The package installer will be created in &lt;code&gt;C:\CraftRoot\tmp\kirigami-tutorial-latest-master-windows-cl-msvc2022-x86_64.exe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To make the installer create a Start menu launcher entry on Windows, we used this in the above blueprint:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0" class="chroma" style="margin-top: 0;
padding-top: 0.4em;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;Package.CMakePackageBase&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;CMakePackageBase&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CMakePackageBase&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;createPackage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defines&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;appname&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;kirigami-hello&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;defines&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;shortcuts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Kirigami Tutorial&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;target&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;bin/kirigami-hello.exe&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createPackage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The Kirigami tutorial is designed such that the project name and main directory is called &lt;code&gt;kirigami-tutorial&lt;/code&gt; and the binary is called &lt;code&gt;kirigami-hello&lt;/code&gt;, so we set the executable accordingly. Then we override its shortcut to point to the right place.&lt;/p&gt;
&lt;h2 id="troubleshooting"&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If you get a message like this:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;*** Handling package: libs/ffmpeg, action: all ***
*** Action: fetch-binary for libs/ffmpeg ***
SHA256 hash for file C:\CraftRoot\download\cache\25.01\windows\cl\msvc2022\x86_64\RelWithDebInfo\libs\ffmpeg\ffmpeg-7.1-3-796-20250203T195103-windows-cl-msvc2022-x86_64.7z (06d9f639d325d7dbb3c17959dc08bd5e191baebb406af28ff1c2d9711c9f9446) does not match (c3b1c25014c34af9063c2ae121bc63373f2c801fb905c2a4a7e9c09b90614561)
Hash did not match, C:\CraftRoot\download\cache\25.01\windows\cl\msvc2022\x86_64\RelWithDebInfo\libs\ffmpeg\ffmpeg-7.1-3-796-20250203T195103-windows-cl-msvc2022-x86_64.7z might be corrupted
Do you want to delete the files and redownload them?
[0] Yes, [1] No (Default is Yes):&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;All you need to do is to confirm &lt;code&gt;Yes&lt;/code&gt; by pressing Enter.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;If, when attempting to build a project from master, you get a message like this:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;CMake Warning at CMakeLists.txt:7 (find_package):
Could not find a configuration file for package &amp;#34;ECM&amp;#34; that is compatible
with requested version &amp;#34;6.15.0&amp;#34;.
The following configuration files were considered but not accepted:
C:/CraftRoot/share/ECM/cmake/ECMConfig.cmake, version: 6.14.0&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This means a dependency of the project has a too low version.&lt;/p&gt;
&lt;p&gt;You will need to set the dependency to use a valid version or set it to master:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;craft --set version=6.15.0
# or
craft --set version=master extra-cmake-modules&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If the version is invalid, Craft will tell you the available valid options:&lt;/p&gt;
&lt;div class="highlight"&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-" data-lang=""&gt;You defined an invalid target 6.15.0 for kde/frameworks/extra-cmake-modules, available versions are [&amp;#39;6.10.0&amp;#39;, &amp;#39;6.11.0&amp;#39;, &amp;#39;6.12.0&amp;#39;, &amp;#39;6.13.0&amp;#39;, &amp;#39;6.14.0&amp;#39;, &amp;#39;master&amp;#39;]&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description></item></channel></rss>