Skip to main content

Questions tagged [cmake]

CMake is a cross-platform, open-source build system. It generates native makefiles and project files that can be used from the command line or integrated development environment of your choice.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

CMakeList with non classical directory tree, for libraries building, installation and packaging

In order to simplify my projects management, I'm relying on a custom directories organisation, and a template of reusable configuration file: ...
Oersted's user avatar
  • 337
2 votes
3 answers
143 views

Othello (Reversi) in C++17 and CMake

Othello is a two-player strategy game typically played over the board. I implemented Othello in C++17 with CMake as the build system. I'm looking for feedback on cleanness, readability, and ...
aadithyaa's user avatar
4 votes
1 answer
173 views

A slightly unconventional CMake project

Introduction This is my first CMake project. I had a bit of help with the initial setup but I have since made a lot of changes myself. It's working well but I think I am doing things in a slightly ...
Dan's user avatar
  • 341
2 votes
1 answer
67 views

API Implementation guidance and improvement

I have recently made significant progress in overcoming beginner barriers related to using Git, CMake, libraries, and successfully implementing an API in C++. Despite my achievements, I acknowledge ...
user avatar
2 votes
1 answer
233 views

Reimplementation of Diep.io in C++ with SFML and Box2D

Here's my attempt at reimplementing part of https://diep.io/, a 2D game where tanks battle with each other. The tanks are circular and they have cannons which fire bullets. The bullets can hit other ...
eesiraed's user avatar
  • 123
2 votes
2 answers
130 views

Astronomical calculations in C for python bindings

I've started teaching myself c/c++ with the intent of being able to writing python bindings to c code. I have a c library used ...
Jason Leaver's user avatar
1 vote
1 answer
153 views

CMake - Usual Build System

After wrestling with CMake I now have a fully working solution. It works, however, I completely massacred the CMake File: This is my main cmake file: ...
TVSuchty's user avatar
  • 595
2 votes
1 answer
56 views

Portable Build System for Virtual Machine with Editor and Unit Tests

I am automating the building and unit testing of a personal project using shell scripts , CMake and make on the latest version of Fedora Linux. I have also tested building on the latest version of ...
pacmaninbw's user avatar
  • 24k
3 votes
0 answers
665 views

Modern CMake/c++ and vcpkg project setup for large projects

I am starting up a project with some people, because there will be developed for and on multiple platforms we chose to use CMake to build our project. Because the project will get quite large we are ...
Rick Nijhuis's user avatar
1 vote
0 answers
487 views

CMake setup for Project with multiple .exe for game engine

I am working on a game engine using CMake, this being the first CMake project I worked on I am looking for some feedback. The project has the following structure: ...
Rick Nijhuis's user avatar
2 votes
1 answer
386 views

Validating Swedish social security numbers (Luhn algorithm and dates)

I've been writing code for some time but never had the need (or opportunity) to write C/C++ code. Did a small project to learn some C++ and would appreciate feedback on code, testing, project ...
Simon S.'s user avatar
  • 123
1 vote
0 answers
2k views

GTK+ CMake setup

I'm mainly working with Java and Gradle, but for my current project I have to use C++ with CMake and thus I would like to have some feedback on my current folder structure and project setup. ...
ShadowDragon's user avatar
0 votes
1 answer
309 views

CMakeLists and Clang sanitization options for an ncurses program

I would like some feedback on a CMakeLists.txt file I created for compiling my project. I have pasted the CMakeLists as well as my source code below. One thing I would specifically appreciate feedback ...
Faraz's user avatar
  • 513
3 votes
2 answers
309 views

cmake for a toy programming language

I have very little experience with cmake, this is really the first time I used it for a project. In the past I used some ...
gruszczy's user avatar
  • 237
23 votes
1 answer
4k views

CMake Project Template for a General Cross Platform C++14 Project

UPDATE: I am no longer updating this post with the contents of my actual project since they have changed significantly (Unit testing is now done with doctest, code coverage is included, etc.). This ...
Arnav Borborah's user avatar
10 votes
1 answer
15k views

Basic CMake C++ project structure

I started working on a C++ project using Google Test framework for unit testing and header-only CImg library for internal operations. I want to use CMake build system to compile it. ...
Nykakin's user avatar
  • 473
2 votes
1 answer
1k views

CMake Solution Setup

I am new to CMake and got currently a setup of my Visual Studio solution working via CMake. My goal now is to have a professional CMake setup. Here is my folder structure: ...
ShadowDragon's user avatar
2 votes
1 answer
337 views

FindQScintilla.cmake

I'm using QScintilla in my project. There's no good FindQScintilla.cmake out there, so I'm writing one myself. However, I don't really know what I'm doing. This ...
JesseTG's user avatar
  • 459
2 votes
1 answer
273 views

GNU Makefile for google benchmark

I've decided to write a common Makefile for Google benchmark library. You could say I could have taken generated Makefile, but it's not appropriate solution (or maybe I'm wrong?). ...
c4pQ's user avatar
  • 135
2 votes
1 answer
14k views

Translating a makefile to cmake

My makefile looks like this and I translated it to cmake: ...
Niklas Rosencrantz's user avatar
3 votes
1 answer
4k views

CMakeList to compile and link an executable using Boost

I'm beginner with CMake and C++ compilation but it's seems that unlike Java I need to be very explicit with my CMakeList.txt in order to link src with correct header and libraries in my project. Here ...
melkir's user avatar
  • 141
20 votes
1 answer
458 views

From new Q to compiler in 30 seconds

Reviewing code doesn't necessarily require actually building it, but it's often helpful to do so in order to evaluate fully. I usually create a CMake project and ...
Edward's user avatar
  • 66.5k
4 votes
1 answer
69 views

Initializing static, machine-specific data in C using a compile-time generated header

I'm using some rather old C code (circa 1996, written in K&R style) to do robust geometric computations, available here, for a library I'm trying to write. In order to work properly, this code has ...
Daniel Shapero's user avatar
3 votes
1 answer
371 views

Cmake module that improves upon CheckLibrariesExists

The following module AssertLibraryFunction improves upon CheckLibrariesExists in two respects: It honors the optional argument <...
Joachim W's user avatar
  • 131
15 votes
1 answer
263 views

Khronos: Primary CMake file

So recently I made a large project of mine open source: Khronos. I will be dissecting parts of it so that I can have it reviewed more easily here and so that the project as a whole will be improved. ...
syb0rg's user avatar
  • 21.8k
4 votes
1 answer
4k views

CMake module to make executable as small as possible

I wrote this .cmake script when I needed to make smallest possible executables. It makes CMake prefer static libraries, and adds custom command to strip and UPX the end result. I used it only with ...
Nazar554's user avatar
  • 331
7 votes
1 answer
620 views

CMake build system

I wasn't quite sure where to go with this, and this seemed to be the best place I could think of so I thought why not. I threw together a build system for C++ projects today using CMake and I wanted ...
Michael's user avatar
  • 171
10 votes
4 answers
1k views

Knowledge is power

Resurrecting my C++ saga, I was given this project for my CS2 class: This problem considers several ways to compute \$ x^n \$ for some \$ n \ge 0 \$. Write an iterative function ...
syb0rg's user avatar
  • 21.8k