Questions tagged [cmake]

Questions about CMake, an open-source cross-platform "meta-make" where you can describe your software project's build, test and deployment process in an abstract way using configuration files. From those configurations it can generate build environments for all sorts of compilers and IDEs on all major operating systems.

30 questions
52
votes
5 answers

Organizing Git repositories with common nested sub-modules

I'm a big fan of Git sub-modules. I like to be able to track a dependency along with its version, so that you can roll-back to a previous version of your project and have the corresponding version of the dependency to build safely and cleanly. …
André Caron
  • 661
  • 1
  • 5
  • 8
45
votes
8 answers

Is directly using Make considered obsolete?

So I have been coming across many comments/posts/etc regarding creating makefiles directly, and how it is a silly thing to do in 2015. I am aware of tools such as CMake, and I actually use CMake quite often. The thing is, CMake is just creating the…
JParrilla
  • 671
  • 1
  • 6
  • 9
19
votes
6 answers

Why should makefiles have an "install" target?

Coming from the world of C and C++, most build system have an install target, notably Makefiles (where it is recommended by GNU for example) or CMake. This target copies the runtime files (executables, libraries, ...) in the operating system (for…
Synxis
  • 307
  • 2
  • 6
18
votes
1 answer

In-Source Build vs. Out-Of-Source Build

In my (primarily C++) development, I have long adhered to using out-of-source builds. That is, my source usually sits in a /project/src directory and the builds live in a /project/build/bin/release, /project/build/bin/debug directories. I have…
DiB
  • 467
  • 3
  • 9
16
votes
1 answer

Directory organization of a CMake (C++) repository containing several projects

I would like some advises on the organization of a set of related but independent C++ projects stored in a single (git) repository. The projects use CMake. For a simplified example we imagine 2 projects A and B, A depending on B. Most people…
Barth
  • 471
  • 1
  • 3
  • 10
15
votes
4 answers

Does it make sense to write build scripts in C++?

I'm using CMake to generate my projects IDE/makefiles, but I still need to call custom "scripts" to manipulate my compiled files or even generate code. In previous projects I've been using Python and it was OK, but now I'm having serious trouble…
Klaim
  • 14,832
  • 3
  • 49
  • 62
9
votes
2 answers

Build automation: Is it usual to use QMake for non-Qt projects?

So, I'm planning to write a C++ library and I want it to be cross-platform, and as this library won't deal with UI and I want it to have as little dependencies as possible, I won't be using Qt (actually Qt won't really help me to achieve what I…
Raphael
  • 2,234
  • 1
  • 22
  • 23
9
votes
2 answers

Should Visual Studio specific files be excluded from version control?

I work on a number of code projects, some open source and some not. Many of these projects are intended to be cross-platform, most often running on either Linux (my natural habitat) or Windows and generally relying on CMake to build. Recently, I…
Edward
  • 204
  • 1
  • 9
7
votes
2 answers

Which should I prefer: A subrepository/submodule, or a CMake ExternalProject?

I'm developing or maintaining a free software project Foo which uses CMake for a build system, as well as source control (e.g. Mercurial or Git), with the repository being available online. Now, this project depends on another project, Bar - say, it…
einpoklum
  • 2,478
  • 1
  • 13
  • 30
6
votes
2 answers

How to setup build system for unit testing + mocking?

We have a legacy code base in entirely C++. Our build system is CMake. My first stab at unit testing was as follows: Define a target (LibraryA). This library contains the code to test. Define a unit test target per CPP test file in LibraryA being…
void.pointer
  • 4,983
  • 8
  • 30
  • 40
5
votes
1 answer

What is the right way to create a build system?

I'm a student, and I don't have much expirience with the building process. In the last few days i've read something about CMake and others build system generators, but other than that I don't know anything about this world. I realized that i should…
4
votes
3 answers

Purpose of building file using Make

I am trying to understand what is the purpose of making files using commands such as cmake .. and make, I have tried looking online but there is no concise explanation on its purpose that i could find. Also, is it necessary to use make on a project…
foo
  • 43
  • 3
3
votes
0 answers

C++ dependency management across projects

We are developing a benchmarking framework in C++, with Make and CMake as build tools. The aim of the framework is to allow others who build algorithms to perform head-to-head comparison against prior work. As such, we have integrated a number of…
3
votes
1 answer

How to frame the concept behind CMake?

I'm using CMake for several years now and found that - in the cases where I'm struggling with CMake - I'm still not completely sure about the concept behind CMake (not taking into account CTest, CPack or CDash also shipped with CMake). When I…
Florian
  • 133
  • 7
3
votes
1 answer

How to deal with relative paths in out of source build?

An out of source build is a build which can be in any directory other than the source directory I have a project which contains relative paths to some resource files, needed at runtime, which are located close to the source directory. But when I…
user695652
  • 529
  • 3
  • 16
1
2