Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [cmakelists-options]

The mechanism available with the CMake build-system generator for explicitly declaring builder-settable options of various types for generating build files. These options are declared in CMakeLists.txt files with the set() and option() commands.

cmakelists-options
0 votes
0 answers
6 views

CMake - Set compile flag for singular file in project [duplicate]

I have a C++ file in a project that uses multithreading and I can't compile it without adding the compiler flag "-pthread". I am compiling using CMake and want to add the flag for only this ...
VSL612's user avatar
  • 1
0 votes
0 answers
13 views

CMake Cannot Find SDL2TTF package

I installed SDL2ttf for a project and SDL2_image and it seems that cmake cannot find the package only of SDL2ttf although i applied the same logic. Specifically i downloaded the libraries, i created a ...
Axilleas Xoumkoslis's user avatar
0 votes
2 answers
65 views

Avoid ifdef in my project for multiple hardware

I have a project written in C on STM32 platform. My project source code will be available for multiple hardware. I use CMakeLists For example I have 2 header for the moment hardware1.h and hardware2....
simon's user avatar
  • 1,214
0 votes
1 answer
50 views

CMake : get_target_property called on non-existent target "xyz"

This is a C/C++ project. I want to exclude a particular compilation target (say "xyz") from my setup. There are macros already in place for that (say, XYZ), which I have successfully set to ...
Charles's user avatar
  • 1,165
-1 votes
0 answers
32 views

Passing CMake command with cache entry not working and automatically ignored

I want to design some cmake cache entry as alias from the automake/autoconf like CC to CMAKE_C_COMPILER, CXX to CMAKE_CXX_COMPILER, CFLAGS to CMAKE_C_FLAGS etc, but cmake always ignore my passed -D ...
TaiXeflar's user avatar
0 votes
1 answer
23 views

How to include cxxopts.hpp in clion

I'm not fluent in C++/cmake and I'm trying to figure out how to use conan package management in Jetbrains CLion. I was able to get a json library working but while I can manage to install cxxopts, ...
Scott Wood's user avatar
1 vote
0 answers
43 views

cmake linking libraries in sibling directories problem

I am using cmake for c++. The sample project I am working on looks like this: . ├── CMakeLists.txt ├── Lv1b │   ├── CMakeLists.txt │   ├── b.cpp │   └── b.h ├── Lv1c │   ├── CMakeLists.txt │   └── ...
jho317's user avatar
  • 23
0 votes
0 answers
20 views

Pybind11 CMake configuration on ubuntu with multi .h/.cpp files and dependencies

I'm trying do compile a pybind11 module called CAVSim and import it into python. Everything goes right on Windows (with VS2022), but I've got stuck on ubuntu with cmake. What I expect to do Although ...
LibrarristShalinward's user avatar
0 votes
0 answers
23 views

Modern CMake best practise: How to present and use public compile definitions of a Library

I have read a fair few articles and threads recently about following Modern CMake best practices and one common theme is that you should stay out of other libraries' flags. I'm particularly attracted ...
user25563155's user avatar
0 votes
1 answer
42 views

QT creator can't seem to find the module plugin for a separate directory

I'm relatively new to QT and I've been struggling with keeping the files I use for creating my project organized. Currently I'm trying to store the backend c++ files of my project into a separate ...
Pyrus's user avatar
  • 1
0 votes
0 answers
35 views

Can I use CMake to build 2 libraries with a difference based on a generated config file containing a variable

I'm trying to generate to shared libraries with the difference between them is a slight variation in code , what I had in mind is define a variable using a cmake generated header called ENGINE_TYPE ...
mohamed Elmodather's user avatar
0 votes
0 answers
27 views

failed to link the ".a" library into the project

I faced challenges in linking the library file to my project. I created a static library named "libadd.a" using e2 Studio IDE. Later, I initiated a Renesas microcontroller project in Visual ...
Vinay hs's user avatar
0 votes
1 answer
65 views

Problems while trying to compile a program with cmake

We have a program named: xyano_prorate.c This code We need to run through it with Sonarcube to identify potential coding errors, because after migration it is showing segmentation error in the core ...
supertren's user avatar
0 votes
0 answers
60 views

ros2 colon build error in g++ 11.4 ubuntu 22.04

build code with ros2 and see this error is there not install something? or i make wrong in cmakelist? i want create a socket with ros2 in ubuntu 22.04 $ colcon build Starting >>> socket --- ...
yueting liu's user avatar
0 votes
1 answer
68 views

How to correctly link modules in cpp using CMake

I'm starting to learn C++ and CMake is a bigger struggle for me. I've written a little code to get me started and also wanted to write tests from the very beginning. Except that I get Undefined ...
Aymane EL Jahrani's user avatar

15 30 50 per page
1
2 3 4 5
14