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&...
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 ...
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 ...
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,...
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&...
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).
...
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/...
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 (...
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 ...
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.
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 ...
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 "${...
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’...
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 ...
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 ...
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 "/...
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 ...
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-...
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-...
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/...
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 ...
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.
...
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 --...
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 ..
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 ...
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 ...
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-...
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/...
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
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
cmake × 149make × 32
compiling × 26
ubuntu × 16
software-installation × 15
linux × 14
debian × 9
arch-linux × 8
fedora × 8
gcc × 6
libraries × 6
centos × 5
rpm × 5
qt × 5
opencv × 5
bash × 4
c++ × 4
dynamic-linking × 4
permissions × 3
x11 × 3
kde × 3
c × 3
openssl × 3
packaging × 3
shared-library × 3