Questions tagged [cmake]
CMake is a cross-platform, open-source build system generator. It generates files for build systems like native makefiles, ninja-build and project files for several integrated development environments.
27,880
questions
0
votes
0
answers
16
views
Compiling ffmpeg into wasm with emscripten
I'm trying to integrate ffmpeg directly into my WebAssembly-project.
A friend of mine provided me link to a project https://github.com/alfg/ffmpeg-webassembly-example/tree/master which does almost ...
1
vote
1
answer
25
views
Undefined refrence to static member variables in C++ 20 shared library only when using CMake
I've been migrating my project to use CMake but I've stumbled upon an issue with static member variables. Even when there is a definition for it in the .cpp file.
I've created a minimal reproducable ...
0
votes
0
answers
19
views
How to disable mingw when using qt6 msvc in cmake [duplicate]
I'm using cmake msvc in qt, and when I run the project, it has the error below
enter image description here
It's weird because I'm runing with msvc instead of mingw
by the way, the default CMakeLists....
0
votes
0
answers
12
views
Yocto SDK - Searching find_package build time dependency in native sysroot
I am using yocto (kirkstone) to create a sysroot and toolchain to cross-compile a collection of ROS 2 packages using colcon + CMake and ament-cmake for a robot. I included the relevant layers from ...
0
votes
1
answer
24
views
How to fix CMake Error Could NOT find OpenSSL missing: OPENSSL_CRYPTO_LIBRARY when configuring Azerothcore
When I'm trying to configure CMake in order to build Azerothcore I get the following error:
CMake Error at C:/Program Files/CMake/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230 (...
0
votes
1
answer
38
views
CMakeLists. How to add -fpermissive flag for specific dir with header files
I have a project each I writing in C++. In this project I also use proto-c to generate header and source files (yes, this is mismatched and I would like it to stay that way it is possible ).
When I ...
0
votes
1
answer
20
views
Using Verilator with CMake when RTL uses a SV package
I´m trying to port a Verilator TB from Make to CMake. My CMakeLists looks like this:
add_executable(example ./src/my_tb.cpp)
list(APPEND rtl_sources ../rtl/some_pkg.sv ../rtl/some_module.sv ../rtl/...
0
votes
1
answer
14
views
How to use WIX V4 within CMAKE to build an installation package for Windows
I've tried to build an installation package with CMAKE + WIX. The latest version of WIX is v4.
Unfortunately, CPack fails as it is looking for a tool candle.exe which was dropped in WIX v4, as opposed ...
1
vote
0
answers
14
views
Cannot find header file in CMake project
I can't compile this file. I tried to do this in different ways but it never worked. All headers are in the file.
silabs_files
│ bgm220pc22hna.svd
│ CMakeLists.txt
│
├───autogen
...
0
votes
0
answers
20
views
Make a normal-looking project tree view in Qt Creator(VS)
I'm looking for a way to make a normal looking tree view for a project that includes a lot of modules, static libraries, and several executable projects.
For example, there are 10 static libraries, ...
0
votes
1
answer
75
views
Error while building Qt6 from source using x86_64-w64-mingw32
I am trying to build Qt6 for Windows using x86_64-w64-mingw32 from Linux (Ubuntu 23.10).
My problem is when I am trying to use CMake for the QtBase repo, I encounter this error which I can't fix:
...
0
votes
0
answers
36
views
CMake build issue, "C:/MinGW/bin/c++.exe - broken"
I'm trying to compile a relatively simple CMake project in C++, it was working previously on a different computer, but I recently switched and it no longer is able to build.
CMake gives the following ...
-1
votes
0
answers
27
views
Including RtMidi library into my Qt C++ application
as a musician with pretty poor programming skills I wanted to program a small step sequencer with a gui using Qt and RtMidi on Windows 10. But I just don't get how to include RtMidi into my project.
...
0
votes
0
answers
20
views
Is there a way to get MPI using FetchContent in CMake?
I have the following in my CMake file:
FetchContent_Declare(
mpi
GIT_REPOSITORY https://github.com/open-mpi/ompi.git
GIT_TAG v5.0.0
OVERRIDE_FIND_PACKAGE)
FetchContent_MakeAvailable(mpi)
It ...
2
votes
2
answers
55
views
Cmake : Copy in library file if not present
I have a simple C++ project simple_test that depends on an external prebuilt library mylib.
The project file structure looks like this
CMakeLists.txt
main.cpp
external_dependencies/
libmylib.a
...
0
votes
0
answers
12
views
Can't exlude directory in CLion if there is `target_include_directories` in CMake
In CLion I would like to mark a directory with a library as "Excluded" or "Library Files" so that its contents don't get index by an IDE.
For some reason, this exclusion doesn't ...
0
votes
0
answers
43
views
Poco linking error when using Poco::NetSSL
First of all, I am quite inexperienced when it comes to cmake, as I have only very recently started using it. I wanted to use POCO simply to send a message to a given email address. The code is ...
0
votes
0
answers
16
views
Install scikit-learn 1.3.2 on MacOs through conda or pip
I am trying to install version 1.3.2 of scikit-learn in MacOs. When I am trying to do this with pip I will get the following:
pip3 install scikit-learn==1.3.2
WARNING: Cmake Toolchain failed to ...
0
votes
0
answers
37
views
CMake unable to link my project - the only object file is deleted
I have a c++ cmake project, which I want to use for unit tests, but CMake is unable to link. I pushed the reproducing project here
gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0
My CMakeLists.txt
...
0
votes
0
answers
13
views
Fatal Error During CMake Build: 'caffe/blob.hpp' File Not Found - Seeking Assistance
When using the command
make -j`sysctl -n hw.logicalcpu`
I encountered the following error:
I attempted to use OpenPose for the first time, and the installation process left me feeling hopeless...
I ...
-1
votes
1
answer
61
views
Library multiple linking and binary duplication?
Here is a basic question (so possibly dup, but so far I couldn't find an appropriate answer, even in How does the compilation/linking process work?) regarding library linking in C++ and possible ...
1
vote
0
answers
35
views
How to find out in CMakeLists.txt if a variable in cmake cache is outdated
I have a bunch of variables passed to cmake to be used as preprocessor macros in a C program, which this snippet of CMakeLists.txt enables (at first sight):
if(DEFINED {MYVAR})
...
-1
votes
0
answers
19
views
cmake FetchContent -- No content details recorded
I'm trying to fetch content Pistache repo from github.
Usding the same concept with SQLitec++ which one is working Pistache is throwing error message during the build.
cmake_minimum_required(VERSION 3....
0
votes
0
answers
9
views
Cannot provide link to shared library member functions [duplicate]
Why do I encounter linker errors or undefined references when trying to link against a shared library, specifically when attempting to use member functions from the library? What are common reasons ...
0
votes
0
answers
39
views
How do I set up dependencies in vscode C++ with or without CMake? (Target lib is glfw)
I am trying to set up an glfw project in vscode and I can't seem to get the dependencies working. I can't find anything that helps me on the web.
This is my main.cpp file:
#include <iostream>
#...
0
votes
0
answers
26
views
I cannot find gRPC after I installed grpc using vcpkg
You can i installed grpc successfully, the hint shows:
# this is heuristically generated, and may not be correct
find_package(gRPC CONFIG REQUIRED)
but when i add it to CMakeLists.txt, error occurs:
...
0
votes
0
answers
25
views
How to link libcurl with Qt6 for Android
In our CMakeLists.txt we've got:
find_package(CURL REQUIRED)
which works great for Debian native compiles.
When targeting Android, however, we get:
Could NOT find CURL
What can I do to link libcurl ...
0
votes
0
answers
32
views
CMake error: log4cppD not found in package?
I got an error in CLion caused by CMake. It says that Cmake cannot find the log4cppD package.
Here is a piece of the conanfile.py
def package_info(self):
self.cpp_info.set_property("...
0
votes
0
answers
50
views
CMake project Link to opencv failed for libopencv_highgui.so referencing unresolved avformat_ffmpeg symbols [duplicate]
My project link to opencv lib but the opencv lib my system has depends on libavcodec-* libs.
And after I added these libs via target_link_libraries with the correct full path, I also checked some of ...
0
votes
0
answers
28
views
Unable to find source of linking error in ImGui cpp repository [duplicate]
I am trying to run my main.cpp file in CLion on Macos m1, where I have the ImGui repository cloned to. I opened my main.cpp file inside the ImGui-master. Wrote my application in main.cpp and built a ...
0
votes
0
answers
46
views
What is the difference between the various methods of selecting the C standard in cmake
There are multiple ways of setting a C standard in CMake.
I know of at least 4:
project(Test C)
add_executable(test test.c)
target_compile_features(test PRIVATE c_std_90) # (1)
add_definitions(-std=...
-1
votes
0
answers
23
views
C++ Link error when using class with seperate header and c++ file [duplicate]
I am trying to make a simple QuickSort class.
I am running this code from CLion, MacOS Sonoma 14.1.1
This is my code below.
QuickSort.h
#ifndef LINKTEST_QuickSort
#define LINKTEST_QuickSort
#include &...
0
votes
0
answers
62
views
Building OpenCV with Bazel rules_foreign_cc
I want to integrate OpenCV in my Bazel workspace through rules_foreign_cc and I found this other stack overflow thread that discusses the general setup very well. I followed the setup resulting in a ...
-1
votes
0
answers
33
views
MinGW + CMake Linker Issues with threading (PThreads Multiple Definition Error) C++ [closed]
I've been attempting to create a multithreaded application using the standard thread.h, mutex.h,queue.h, condition_variable.h libraries. The application exists within a workflow with a DLL that reads ...
0
votes
1
answer
32
views
Building your own package for distribution via vcpkg
I'm running into an issue with a local test of (MacOS) as I install my own package from Github via vcpkg, in a brand new c-based project)
Here's what the vcpkg folder structure looks like: x64-osx/...
-1
votes
1
answer
32
views
The Makefile generated by CMake can't find the header file [closed]
I'm trying to write my first CMake script that compiles a dummy project into a shared library, rather than an executable. My CMakeLists.txt currently looks like this:
cmake_minimum_required(VERSION 3....
0
votes
0
answers
31
views
Writing CMake for a Qt fetch with SFML
I want to make a Qt and SFML program which is also cross-platfrom (mainly for Linux and Windows), so I don't want to have any installations, and any downloads required for the user to make when trying ...
0
votes
0
answers
18
views
Installing px4 in ubuntu 20.04 [closed]
I am trying to install px4 in ubuntu 20.04,
cd
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
cd PX4-Autopilot/
these commands executed ...
0
votes
0
answers
16
views
Linking libmodbus in CMake project under Windows (CLion IDE)
I use CLion IDE with MinGW toolchain for my project.
I need to link libmodbus in CMake project in file CMakeLists.txt.
How can I do this?
I have installed libmodbus using Vcpkg GUI in CLion IDE on ...
-1
votes
0
answers
36
views
'ATen/ATen.h' file not found
I've added the torch include_directories. But when I try to include it in my add.cu file. It reports 'ATen/ATen.h' file not found.
set(ENV{Torch_DIR} /home/wtx/miniconda3/envs/dgl/lib/python3.10/site-...
0
votes
0
answers
27
views
How to make Qt Creator show cmake target_include_directories?
Working with fairly recent versions of CMake, I like to use target_include_directories. However, when I just do this, Qt Creator will not display any header files.
How can I write a CMakeLists.txt ...
-4
votes
0
answers
34
views
undefined symbol: _ZTVN [duplicate]
import example
ImportError: /home/../example.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZTVN3iox4popo12ReceiverPortEImportError:
undefined symbol: _ZTVN3iox4popo12ReceiverPortE is there any ...
0
votes
0
answers
17
views
CMake Error: The source directory "/home/lima/gromacs-2022/build/DGMX_BUILD_OWN_FFTW" does not exist
Someone please help me with the installation of Gromacs, I'm a laywoman, so everything I know, I watched on YouTube and read at forums. I understand better with video, but I found none that could help ...
1
vote
0
answers
41
views
CMakeFiles\app.dir/objects.a(main.cpp.obj):main.cpp:(.text+0x1c): undefined reference to `APP::Application::Run()'
I have this CMAKE error:
cmake . -G "MinGW Makefiles"
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check ...
0
votes
1
answer
62
views
Integrating Qt with SFML using cmake for cross-platform development
I want to integrate the Qt framework with SFML, using cmake, hopefully in VS2022. Currently I have SFML already in my repository, and the cmake looks like this:
cmake_minimum_required(VERSION 3.16)
...
-2
votes
1
answer
77
views
I don't see any code errors but I'm getting cmake linker error and I don't know why [closed]
I am using clion to generate cmake for me
Here is my cmakelists.txt
project(Arbie)
set(CMAKE_CXX_STANDARD 17)
add_definitions(-I/usr/include -L/usr/lib )
add_executable(Arbie main.cpp
Body/...
0
votes
0
answers
13
views
Vcpkg port throws error as ninja can't find target "install"
So I'm currently working on the setup of a small vcpkg registry by myself. For testing I tried to create a small package to publish. Yet when I want to integrate this package via vcpkg an error arises ...
-1
votes
0
answers
52
views
CMake: Set language for specific target
I have CMakeList.txt for a project written in C language, but I want to compile some C++ wrappers and link them with the resulting C executable in the same CMakeLists.txt. I have created a library ...
0
votes
1
answer
34
views
Using custom triplets with vcpkg and CMake in manifest mode
I'm trying to configure vcpkg to compile dependencies using address sanitizer and thread sanitizer. To do this, I need to pass the compilation flag -fsanitize=address or fsanitize=thread to all ...
1
vote
2
answers
56
views
ESP-IDF Project Structure Issue: 'Undefined Reference to Function' Error
I've started a project based on the ESP-IDF example 'blink' and am trying to reorganize it into a more structured format. My goal is to have a project structure like this:
BLINK/
├── components/
│ ├─...