Hot answers tagged

24 votes

Why should makefiles have an "install" target?

Many build scripts or Makefiles have an installation target because they were created before package managers existed, and because even today lots of systems don't have package managers. Plus, there ...
Jörg W Mittag's user avatar
17 votes
Accepted

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

After asking the community here and continuing my search online, I have not been able to find significant engineering justification for using in-source builds. (There are many examples of reasons to ...
DiB's user avatar
  • 467
6 votes

Organizing Git repositories with common nested sub-modules

I'm very late to this party, but your question still doesn't seem to have a complete answer, and it's a pretty prominent hit from google. I have the exact same problem with C++/CMake/Git/Submodules ...
chadsgilbert's user avatar
5 votes

Why should makefiles have an "install" target?

A makefile might have no install target, and more importantly, you can have programs which are not even supposed to be installable (e.g. because they should run from their build directory, or because ...
Basile Starynkevitch's user avatar
5 votes
Accepted

Should Visual Studio specific files be excluded from version control?

According to this Stackoverflow answer from 2017 and this question from the CMake FAQ, CMake uses always absolute paths in the generated build files "by design" (credits to @Jan Dorniak's ...
Doc Brown's user avatar
  • 206k
3 votes
Accepted

What is the right way to create a build system?

Disclaimer: I know practically nothing about CMake; therefore, my answer would be about the general build systems instead of CMake specifically. The goal of a build is to take the source code and to ...
Arseni Mourzenko's user avatar
3 votes

Why should makefiles have an "install" target?

There are several reasons which come to mind. Many package creating software - the Debian build system for example, and IIRC rpm as well - already expect from the building script to "install" the ...
max630's user avatar
  • 2,567
2 votes
Accepted

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

Normally, when you build and install some software, you decide which features will be available when you build the software, not when you use it, therefore I'd say that the approach makes sense. ...
Daniele E. Domenichelli's user avatar
2 votes
Accepted

development environment for C++ GUI applications

This is difficult. C++ is difficult. Cross-platform is difficult. GUI is difficult. You mentioned the idea to have platform-specific scripts, and that this increases maintenance burden. CMake is ...
amon's user avatar
  • 134k
2 votes
Accepted

Global vs local CMake functions for compiler flags

Global CMake configuration has its uses. It’s a nightmare to maintain if you’re not careful with it, and in some cases it’s simply wrong. That’s why all the modern CMake guidelines advise against it. ...
besc's user avatar
  • 1,153
1 vote

App that can be deployed both as monolith and microservices?

This kind of flexibility comes at a cost. Cost to design, development, testing, and deployment. Be sure the flexibility gains outweigh these costs. You may think this is taking baby steps towards your ...
candied_orange's user avatar
1 vote

Should Visual Studio specific files be excluded from version control?

If my colleague and I need identical files, and me changing the file means it must be changed for my colleague, then it must be checked in. If the files cannot be the same for me and my colleague then ...
gnasher729's user avatar
  • 44.7k
1 vote

code for a try_run() invocation - where do I place it?

Regarding the "generate from string" option your are considering: CMakeFiles is internal to CMake and not intended for projects to access manually, but nothing prevents you from using file(WRITE ${...
Angew is no longer proud of SO's user avatar
1 vote

Why should makefiles have an "install" target?

Well, application developers are the ones that know where each file should go. They could leave that in documentation, and have package maintainers read that and build a script for each package. Maybe ...
JoL's user avatar
  • 119
1 vote

Why should makefiles have an "install" target?

Linux distributions generally separate program maintenance from package maintenance. A build system that integrates package generation would force program maintainers to also perform package ...
Simon Richter's user avatar
1 vote

Why should makefiles have an "install" target?

One reason not mentioned is there's a lot of times when you are not using the current version of the software or using a modified version of the software. Trying to create a custom package is not only ...
Dom's user avatar
  • 169
1 vote

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

Build and install GTest somewhere on my system and have all 3 libraries link to the same GTest library. I'm from the school of thought that says any code dependency, is also my code. Therefor treat ...
Kain0_0's user avatar
  • 16.1k
1 vote

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

Vendoring the other project can be a suitable stopgap measure in the absence of a suitable dependency management tool. In particular, operating in a SCM level can be appropriate if the other project ...
amon's user avatar
  • 134k
1 vote

Multi module project version management

Both the root project and each sub module has its own version (major.minor.patch) Why? I'd contend that this decision was a mistake and has created the problem situation you are asking for help with, ...
David Arno's user avatar
  • 39.2k
1 vote

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

Let me suggest an "answer" specific to your user community, based on my experience with that similar community... ...when I was a physics graduate student at CCNY (a >>long<< time ago), about ...
John Forkosh's user avatar
1 vote

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

I believe it is more a matter of educating your customer than of delivering them some "installer" binary. I would suggest to document very carefully and well your building procedure. (BTW, I won't ...
Basile Starynkevitch's user avatar
1 vote

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

Just create multiple targets, one target per component: # Setup three "components" add_library(first source1.cpp source2.cpp) add_library(second source3.cpp source4.cpp) add_executable(third source5....
Mario's user avatar
  • 1,499

Only top scored, non community-wiki answers of a minimum length are eligible