Skip to main content
54 votes
Accepted

Why is there `No CMAKE_CXX_COMPILER could be found.` and how to solve?

The "compiler" is a separate package that needs to be installed. One called g++ can be installed on it's own and is also included within a bundle of packages called "build-essential&...
alec's user avatar
  • 1,928
21 votes

How to compile without optimizations -O0 using CMake

At invocation time, normally all that you need to make a debug build with CMake is: cmake -DCMAKE_BUILD_TYPE=Debug .. Doing that adds the -g flag as can be confirmed with: make VERBOSE=1 which shows ...
Ciro Santilli OurBigBook.com's user avatar
17 votes
Accepted

How do I set a cmake policy?

The CMake command cmake_policy() is documented in the CMake documentation. It is usually added to the CMakeLists.txt file of the project to change the behaviour of CMake itself, usually to be able to ...
Kusalananda's user avatar
  • 356k
12 votes
Accepted

fatal error: bsd/string.h: No such file or directory

It’s not clear from your question, but I’m assuming you’re trying to add bsd/string.h because your module failed to build with an error complaining about strlcpy. Since you’re building a kernel module,...
Stephen Kitt's user avatar
8 votes

How do I set a cmake policy?

I use Cmake version 3.22.0 and @kusalananda answer did not fix the issue for me. I added the following line to the top of CMakeLists.txt and the issue was fixed: set(CMAKE_POLICY_DEFAULT_CMP<NNNN&...
Admia's user avatar
  • 312
8 votes
Accepted

Is there a way to make cmakelists.txt more verbose for compilation

When running cmake itself, there are a couple of options you can use to generate more detailed output: cmake --debug-output and cmake --trace (the latter with even more detail than the former). ...
Stephen Kitt's user avatar
7 votes

How do I set a cmake policy?

The CMake policy warnings at the end explicitly inform users that they should not concern themselves with the messages. The messages are there for the project developers. CMake Warning (dev) at c/...
user7610's user avatar
  • 2,198
6 votes
Accepted

What CMake version can I rely on in current popular Linux distributions?

pkgs.org tells me that the available versions of CMake in the Linux distributions it knows about are as follows: Arch Linux: 3.15.2 CentOS: 2.8.12.2 (CentOS 7 and 6) Debian: 3.13.4 (Debian 10), 3.7.2 (...
Stephen Kitt's user avatar
6 votes

What is the Linux equivalent of Inno Setup on Windows?

The closest, widely-used installer on Linux is MojoSetup, which you’ll see in action on lots of Linux games (including all the GOG.com Linux games). You’re comparing apples and oranges though: cmake ...
Stephen Kitt's user avatar
6 votes
Accepted

Installation of libglib2.0-dev on Fedora

The equivalent command is sudo dnf install glib2-devel This will install the glib 2 development headers, libraries and dependencies.
Stephen Kitt's user avatar
6 votes
Accepted

How can I find the cmake variable that holds the path to a package

It's usually <MODULENAME>_LIBRARIES, and that's the case for SDL, as well. But that#s just convention, you might need to read the respective find_<MODULENAME>.cmake script (often in places ...
Marcus Müller's user avatar
5 votes

How to compile without optimizations -O0 using CMake

I found that in some tests my CMAKE_C_FLAGS contained some optimization option by default (i.e. -O2). In this case, the above suggestions to do something like set(CMAKE_CXX_FLAGS_DEBUG "${...
micah's user avatar
  • 59
4 votes
Accepted

some troubles on installing deja-dup from source code

An error of the form Run-time dependency goa-1.0 found: NO (tried pkgconfig and cmake) means that the build is looking for a file named goa-1.0.pc (for pkgconfig) or Findgoa-1.0.cmake file (which isn’...
Stephen Kitt's user avatar
4 votes
Accepted

understanding .sh file terminology and cmake

overly complicated assignment EMBEDDED=`echo $2` This takes the second argument to the script and performs a split and a glob on it (surprise!) and passes the result of that to echo and then assigns ...
thrig's user avatar
  • 35.8k
4 votes

Convention to install files to /etc/ as non-root?

You can't, by design. Your app should store per-user configs somewhere in the user's home directory, e.g. ~/.config/your_app/config.yml System-level configuration files are what belong in /etc/. Like ...
Aaron D. Marasco's user avatar
4 votes
Accepted

building Debian package from Buster fails on Bookworm

The build fails because of Traceback (most recent call last): File "/mnt/src/deb/LINPHONE/linphone-3.12.0/wrappers/cpp/genwrapper.py", line 764, in <module> main() File "/...
Stephen Kitt's user avatar
3 votes
Accepted

Building shared library which is executable and linkable using Cmake

NOTE: First information regarding this is, there is seemingly an open issue related to cmake. Therefore this can be considered as an indirect solution to achieve the same. Now follow the illustration ...
parasrish's user avatar
  • 169
3 votes

Why is there `No CMAKE_CXX_COMPILER could be found.` and how to solve?

I ran into the same issue with Alpine. After installing the following libraries, everything went through as expected: apk add git cmake make clang build-base llvm-static llvm-dev clang-static clang-...
wout's user avatar
  • 131
3 votes

Error #2 when trying to install ECM (Extra Cmake Modules)

Just in case someone else is stumbling upon this error, here's the the follow-up discussion on KDE infrastructure: http://kde.6490.n7.nabble.com/Error-when-trying-to-install-ECM-Extra-Cmake-Modules-...
kfunk's user avatar
  • 131
3 votes

Boost continually fails to download while using cmake for ethminer

Boost has moved downloads to JFrog Artifactory For the users of Boost, the only difference is that there is a new URL to download releases and snapshots. Instead of: https://dl.bintray.com/boostorg/...
quantumtree's user avatar
3 votes

What's overriding my .vimrc tabstop size setting for CMake files?

To see in which startup files an option was set, use :verbose set <option>?. From :help :verbose-cmd: When 'verbose' is non-zero, listing the value of a Vim option or a key map or an ...
muru's user avatar
  • 77.9k
2 votes

What is the Linux equivalent of Inno Setup on Windows?

For those who stumble upon this question. There is NSIS (Nullsoft Scriptable Install System) which runs under Windows and Linux. When I remember correctly there is even an integration for CMake. ...
Martin Fehrs's user avatar
2 votes
Accepted

Remove debuild buildsystem=cmake linker flags

You need to disable the relro hardening configuration; change your debian/rules to #!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=-relro %: dh $@ --buildsystem=cmake --...
Stephen Kitt's user avatar
2 votes
Accepted

Run 'cmake --help' for more information

You are missing the <path-to-source> - either cmake . or (often recommended - it keeps the toplevel directory clean) mkdir build && cd build cmake ..
steeldriver's user avatar
  • 83.8k
2 votes

Why does lxqt-build-tools fail to build?

Short answer: You need the package libglib2.0-dev with a version no less than 2.5 to work. Long answer (see also the comments to the original post): glib-2.0 is the name to refer the package in ...
Weijun Zhou's user avatar
  • 3,558
2 votes

gmodule-2.0 not found while compiling

The libglib2.0-dev package is probably outdated. It provides file /usr/lib/x86_64-linux-gnu/pkgconfig/gmodule-2.0.pc where version is 2.48.2 and does not satisfy requirement for vala-panel build. I ...
mkr's user avatar
  • 346
2 votes
Accepted

KF5 Init package in Kubuntu

The cmake files are provided by the package kinit-dev : /usr/lib/x86_64-linux-gnu/cmake/KF5Init/KF5InitConfig.cmake /usr/lib/x86_64-linux-gnu/cmake/KF5Init/KF5InitConfigVersion.cmake /usr/lib/x86_64-...
Knud Larsen's user avatar
  • 2,174
2 votes

Is it possible to make -jN dynamic based on CPU load?

While a specified N within make -jN is a fixed maximum, there is a way to limit parallel jobs based on system load. See make -l load or make --load-average[=load] References: https://www.gnu.org/...
forest's user avatar
  • 129
2 votes
Accepted

Installing gdcm on CentOS

To get the needed version of cmake: yum install cmake3 That will give you the tools: cmake3 and ccmake3. After that: ccmake3 ../gdcm
Nasir Riley's user avatar
  • 12.3k
2 votes

Packaging CMake components for Debian

A standard debhelper debain/rules file might look like this (buildsystem automatically detects cmake in newer compat levels). %: dh $@ # --buildsystem=cmake <-- older compat levels may ...
Stewart's user avatar
  • 16k

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