Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ...

18
votes
6answers
2k views

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,...
1
vote
1answer
63 views

Managing a third party library that is used by multiple independent libraries

I am working on configuring the build environment for a C++ project that uses multiple libraries. These libraries are independent of each other, but they all depend on the same 3rd party library (...
0
votes
1answer
47 views

What should I prefer: An SCM subrepository, 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 ...
-1
votes
1answer
145 views

Multi module project version management

I have a CMake multi module project made of a library and an executable. Both the root project and each sub module has its own version (major.minor.patch). I would like to know how to handle each ...
1
vote
1answer
550 views

How to control optional dependencies of a header-only library in `CMake`?

I am developing my own header-only library that I want to use as a framework in other software. I am using CMake for setting up demo targets, tests, and so on. However, I am unsure how to deal with ...
6
votes
1answer
2k views

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, /...
0
votes
1answer
122 views

How to avoid explicit naming of source files in unit tests

I'm using CMake to build my application and CUnit to test it. And I was wondering if there is a way to avoid including the production source files directly from the test code by name (#include ../src/...
1
vote
0answers
99 views

How to separate source code directories from build directories with VS Xamarin solutions

I've been using CMake for years when developing in C++ using Visual Studio. My directory layout has always seen me separate source code directories from build directories. For those who are not ...
0
votes
2answers
212 views

How to deliver binaries and source to customers and developers, if both are the same?

I'm currently working on a project where i am the only developer, but it should be delivered soon to "customers". Since this is actually an application consisting of multiple libraries for physicists ...
1
vote
1answer
123 views

How do I use CMake to build my codebase for different purposes and resolutions?

I'm working on a C++ codebase targeted at multiple platforms, and we've just moved over to CMake as our buildsystem. Previously our buildsystem was a pretty ad-hoc affair; getting our code under a ...
0
votes
1answer
61 views

Sharing Project configuration files for an application with Qt IDE using Cmake and sharing via Git?

Imagine that you are starting to work in a project with a group of people. You want to share your code and the full configuration files of CMake, Qt IDE configuration. So you if you want to test or ...
2
votes
1answer
519 views

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 ...
3
votes
1answer
559 views

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 ...
12
votes
1answer
13k views

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 ...
6
votes
2answers
896 views

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 ...
2
votes
2answers
422 views

What uses are there today for manually writing Makefiles? [closed]

I remember the general gist of writing Makefiles, but, due to CMake, autotools and other such Makefile generators, I've forgotten so many details that, if you were to ask me to write a makefile from ...
25
votes
8answers
7k views

Is directly using Make considered obsolete? [closed]

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 ...
4
votes
3answers
487 views

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....
3
votes
1answer
5k views

Generating CMakeLists.txt [closed]

I got a bunch of C++ sources files and headers. They may use external libraries such as Boost e.g. I am interested in the process of building binaries for Windows and *nix. Makefiles (*nix) and ....
15
votes
4answers
3k views

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 ...
48
votes
5answers
10k views

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 ...
9
votes
2answers
3k views

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 (...