<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cmake on Siddharth Mishra</title><link>http://brightprogrammer.in/tags/cmake/</link><description>Recent content in Cmake on Siddharth Mishra</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 14 Jun 2026 21:53:10 -0700</lastBuildDate><atom:link href="http://brightprogrammer.in/tags/cmake/index.xml" rel="self" type="application/rss+xml"/><item><title>A Build System For C in C</title><link>http://brightprogrammer.in/posts/a-build-system-in-c-for-c/</link><pubDate>Wed, 29 Jan 2025 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/a-build-system-in-c-for-c/</guid><description>&lt;p>I recently started a new project where I had to decide (again) how to build this project. This decision is faced
by any developer who use a language that does not have a standard way of building things. In my case, my project
is to be written in C, my go-to language, and as we all know, it does not have any standard other than the standard
spec. I usually go with CMake, as my go-to build system, because I&amp;rsquo;ve seen many projects use it. It&amp;rsquo;s almost like
the &amp;ldquo;industry&amp;rdquo; standard. It&amp;rsquo;s very old, and regularly updated, to keep itself up to date with available libraries,
frameworks, compiler features etc&amp;hellip; and it might be good for very big projects, but I decided that I&amp;rsquo;ll try something
simpler this time.&lt;/p></description></item><item><title>Project Initialisation</title><link>http://brightprogrammer.in/posts/project-initialisation/</link><pubDate>Sat, 08 Jan 2022 00:00:00 +0000</pubDate><guid>http://brightprogrammer.in/posts/project-initialisation/</guid><description>&lt;p>We&amp;rsquo;ll use &lt;a href="https://github.com/limine-bootloader/limine">limine&lt;/a> bootloader and use stivale2 as our boot protocol. There are multiple boot protocols and stivale2 provides many advanced features. Limine supports stivale2 by default. It also gives us a way to instantly print anything on screen but we won&amp;rsquo;t be using that.
To read more about stivale2 boot specification, read &lt;a href="https://github.com/stivale/stivale/blob/master/STIVALE2.md">here&lt;/a>&lt;/p>
&lt;p>Create project with following directory structure&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── CMakeLists.txt
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── kernel
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── kernel.c
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   ├── kernel.h
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│   └── stivale2.h
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>└── limine
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ├── bochsrc
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ├── build-aux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#40a070">19&lt;/span> directories, &lt;span style="color:#40a070">183&lt;/span> files
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>kernel&lt;/code> will contain our kernel code. Soon we&amp;rsquo;ll be creating many other folders. Use &lt;code>wget&lt;/code> to get &lt;a href="https://raw.githubusercontent.com/stivale/stivale/master/stivale2.h">stivale2&lt;/a> header file. Initialise a git repository and add &lt;a href="https://github.com/limine-bootloader/limine">limine&lt;/a> boot loader as a &lt;code>submodule&lt;/code>.&lt;/p></description></item></channel></rss>