# \#os:linux

**URL:** https://discourse.cmake.org/tag/os-linux/1.md?match_all_tags=true&page=2&tags%5B%5D=os%3Alinux

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

**Page:** 3

---

## [FILE\_SET Usage](https://discourse.cmake.org/t/file-set-usage/15144)

<div class="topic-metadata">

**Author:** [@ArmanMass](https://discourse.cmake.org/u/ArmanMass)\
**Replies:** 0\
**Last updated:** [September 2, 2025, 12:45am UTC](https://discourse.cmake.org/t/file-set-usage/15144 "2025-09-02T00:45:38Z")

</div>

Project Directory: . ├── CMakeLists.txt ├── CMakeUserPresets.json ├── README.md ├── build\_all.sh ├── conanfile.py ├── include │ ├── itch\_msg.h │ ├── itchparser.h │ ├── orderbook │ │ ├── LevelInfo.h …

---

## [Why can't I find curl when cross compiling?](https://discourse.cmake.org/t/why-cant-i-find-curl-when-cross-compiling/11041)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.cmake.org/u/bertulli)\
**Replies:** 14\
**Last updated:** [August 31, 2025, 9:48pm UTC](https://discourse.cmake.org/t/why-cant-i-find-curl-when-cross-compiling/11041 "2025-08-31T21:48:46Z")

</div>

EDIT: to reach more people, cross posted here Hi all! I’m trying to add curl to my project. I made some tests on native build, and it works fine like this: find\_package(CURL REQUIRED) include\_directories(${CURL\_INCLUDE…

---

## [protobuf\_generate() seems to be generating incorrect paths. Usage error or bug?](https://discourse.cmake.org/t/protobuf-generate-seems-to-be-generating-incorrect-paths-usage-error-or-bug/15112)

<div class="topic-metadata">

**Author:** [@GarrettK](https://discourse.cmake.org/u/GarrettK)\
**Replies:** 2\
**Last updated:** [August 27, 2025, 4:34pm UTC](https://discourse.cmake.org/t/protobuf-generate-seems-to-be-generating-incorrect-paths-usage-error-or-bug/15112 "2025-08-27T16:34:21Z")

</div>

I’m working on a larger project which currently performs in-tree out-of-build protobuf generation. I’m looking at converting to using in-build protobuf generation with CMake’s support. Unfortunately, I’m running into iss…

---

## [CMAKE\_CXX\_CPPCHECK - scope leak](https://discourse.cmake.org/t/cmake-cxx-cppcheck-scope-leak/15114)

<div class="topic-metadata">

**Author:** [@Mathias\_B](https://discourse.cmake.org/u/Mathias_B)\
**Replies:** 0\
**Last updated:** [August 27, 2025, 7:31am UTC](https://discourse.cmake.org/t/cmake-cxx-cppcheck-scope-leak/15114 "2025-08-27T07:31:13Z")

</div>

Hello, I am using CMake 4.1.0 with the following generators : Unix Makefiles on Linux MSYS Makefiles on Windows These are used to build a C++ project. My filetree looks like this : Toplevel: - CMakeLists.txt …

---

## [Incorrect log output during clang-tidy error with -p option](https://discourse.cmake.org/t/incorrect-log-output-during-clang-tidy-error-with-p-option/15106)

<div class="topic-metadata">

**Author:** [@Detect1ve](https://discourse.cmake.org/u/Detect1ve)\
**Replies:** 3\
**Last updated:** [August 24, 2025, 10:06pm UTC](https://discourse.cmake.org/t/incorrect-log-output-during-clang-tidy-error-with-p-option/15106 "2025-08-24T22:06:18Z")

</div>

So, in continuation of issue 27160 TL;DR Using the Ninja generator, I see an incorrect command for clang-tidy launch with the -p option in case of error. Is it a problem on the Ninja side or CMake? It appears that the c…

---

## [compiler options after LINK\_FLAGS and](https://discourse.cmake.org/t/compiler-options-after-link-flags-and/15071)

<div class="topic-metadata">

**Author:** [@anon74639460](https://discourse.cmake.org/u/anon74639460)\
**Replies:** 3\
**Last updated:** [August 19, 2025, 8:58pm UTC](https://discourse.cmake.org/t/compiler-options-after-link-flags-and/15071 "2025-08-19T20:58:16Z")

</div>

I am sure I did something stupid but one of these things also appears to be platform specific. I don’t generally create cmake scripts for shared libraries from scratch, but am trying for a new project now. Created an em…

---

## [add\_test() assumes test executable is first string after COMMAND](https://discourse.cmake.org/t/add-test-assumes-test-executable-is-first-string-after-command/15012)

<div class="topic-metadata">

**Author:** [@chriskot870](https://discourse.cmake.org/u/chriskot870)\
**Replies:** 5\
**Last updated:** [August 16, 2025, 10:43pm UTC](https://discourse.cmake.org/t/add-test-assumes-test-executable-is-first-string-after-command/15012 "2025-08-16T22:43:47Z")

</div>

I am using cmake through vscode to cross-compile from a Ubuntu host to a Raspberry Pi Zero 2W target. I need to run the tests on the remote host. I created the following add\_test: add\_test( NAME UnitsPressureTests W…

---

## [Confused by OBJECT library](https://discourse.cmake.org/t/confused-by-object-library/14453)

<div class="topic-metadata">

**Author:** [@Adam\_BZH](https://discourse.cmake.org/u/Adam_BZH)\
**Replies:** 3\
**Last updated:** [August 13, 2025, 11:43am UTC](https://discourse.cmake.org/t/confused-by-object-library/14453 "2025-08-13T11:43:39Z")

</div>

My project was compile each subfolder cmake project to an STATIC library, but in this way gcc may strip some codes while compile or link, if later other things dependens on that library, symbol could not be found After …

---

## [Build with "RelWithDebInfo" flag is much bigger than "Debug"](https://discourse.cmake.org/t/build-with-relwithdebinfo-flag-is-much-bigger-than-debug/14461)

<div class="topic-metadata">

**Author:** [@zer0deck](https://discourse.cmake.org/u/zer0deck)\
**Replies:** 2\
**Last updated:** [July 30, 2025, 7:57am UTC](https://discourse.cmake.org/t/build-with-relwithdebinfo-flag-is-much-bigger-than-debug/14461 "2025-07-30T07:57:24Z")

</div>

I have a large project with three main dependencies: drogon, swredis and hiredis. All three dependencies are shared libraries. Project itself contains multiple static libs (tools, models, schemas, services, etc.) linkin…

---

## [Override the default \`-O3 -DNDEBUG\` Release flags?](https://discourse.cmake.org/t/override-the-default-o3-dndebug-release-flags/11085)

<div class="topic-metadata">

**Author:** [@intelfx](https://discourse.cmake.org/u/intelfx)\
**Replies:** 13\
**Last updated:** [July 26, 2025, 2:34pm UTC](https://discourse.cmake.org/t/override-the-default-o3-dndebug-release-flags/11085 "2025-07-26T14:34:48Z")

</div>

Hi, What is the least-breaking way to override the -O3 -DNDEBUG flags automatically set by CMake for Release configurations, without touching any flags that the build system itself might have set in addition? This ques…

---

## [CPACK\_INSTALLED\_DIRECTORIES, How to use?](https://discourse.cmake.org/t/cpack-installed-directories-how-to-use/11496)

<div class="topic-metadata">

**Author:** [@Li\_Haohuang](https://discourse.cmake.org/u/Li_Haohuang)\
**Replies:** 1\
**Last updated:** [July 25, 2025, 4:08pm UTC](https://discourse.cmake.org/t/cpack-installed-directories-how-to-use/11496 "2025-07-25T16:08:41Z")

</div>

Too less description! I don’t know how to specify value to this variable to meet my needs Packaging With CPack — Mastering CMake Can I get a demo please!! Thank you very much :sob:! How should I specify the pairs o…

---

## [install(EXPORT) does not properly take into account of paths containing '..'](https://discourse.cmake.org/t/install-export-does-not-properly-take-into-account-of-paths-containing/14408)

<div class="topic-metadata">

**Author:** [@WildCard65](https://discourse.cmake.org/u/WildCard65)\
**Replies:** 3\
**Last updated:** [July 22, 2025, 1:18pm UTC](https://discourse.cmake.org/t/install-export-does-not-properly-take-into-account-of-paths-containing/14408 "2025-07-22T13:18:10Z")

</div>

The command install(EXPORT) in its current state is vastly incompatible with making packages with non-standard install directories (for example /lib instead of /usr/lib) resulting in extra get\_filename\_component(\_IMPORT\_…

---

## [cmake --install and passing -j arg](https://discourse.cmake.org/t/cmake-install-and-passing-j-arg/11310)

<div class="topic-metadata">

**Author:** [@jsykes15](https://discourse.cmake.org/u/jsykes15)\
**Replies:** 3\
**Last updated:** [July 22, 2025, 9:16am UTC](https://discourse.cmake.org/t/cmake-install-and-passing-j-arg/11310 "2025-07-22T09:16:23Z")

</div>

The following command works in 3.20: cmake --install . -prefix \<path\> -- -j8 but in 3.30 it results in: Unknown argument -- The documentation for the cmake --install command in both 3.20 and the latest 3.30 don’t say…

---

## [Manually simulating target namespaces for building multi-architecture repos](https://discourse.cmake.org/t/manually-simulating-target-namespaces-for-building-multi-architecture-repos/11397)

<div class="topic-metadata">

**Author:** [@buergi](https://discourse.cmake.org/u/buergi)\
**Replies:** 3\
**Last updated:** [July 20, 2025, 11:54pm UTC](https://discourse.cmake.org/t/manually-simulating-target-namespaces-for-building-multi-architecture-repos/11397 "2025-07-20T23:54:29Z")

</div>

This is an issue which I have since several years now and which always kept preventing me from transitioning to cmake for a larger STM32 project. I never found a reasonable solution so far, until I recently found a semi-…

---

## [install ceres-solver-master](https://discourse.cmake.org/t/install-ceres-solver-master/14187)

<div class="topic-metadata">

**Author:** [@blank09white](https://discourse.cmake.org/u/blank09white)\
**Replies:** 1\
**Last updated:** [July 20, 2025, 2:48am UTC](https://discourse.cmake.org/t/install-ceres-solver-master/14187 "2025-07-20T02:48:33Z")

</div>

When I run ‘sudo make install’ on Ubuntu 24, it reports at the end that it cannot find the Abseil version. How can I solve this?

---

## [Dumping compiler definitions](https://discourse.cmake.org/t/dumping-compiler-definitions/11166)

<div class="topic-metadata">

**Author:** [@SeeMakeDo](https://discourse.cmake.org/u/SeeMakeDo)\
**Replies:** 1\
**Last updated:** [July 17, 2025, 5:27pm UTC](https://discourse.cmake.org/t/dumping-compiler-definitions/11166 "2025-07-17T17:27:49Z")

</div>

Allegedly, giving the gcc compiler the options “-E -dM” will make it dump out all the #define definitions it knows. I tried putting this into a target\_compile\_options but it did not seem to have any effect. This is cro…

---

## [On nonstandard extensions and subdirectories](https://discourse.cmake.org/t/on-nonstandard-extensions-and-subdirectories/11115)

<div class="topic-metadata">

**Author:** [@owlingbishop](https://discourse.cmake.org/u/owlingbishop)\
**Replies:** 1\
**Last updated:** [July 17, 2025, 4:13pm UTC](https://discourse.cmake.org/t/on-nonstandard-extensions-and-subdirectories/11115 "2025-07-17T16:13:11Z")

</div>

Hello there !! I have a project that compiles correctly with the following CMakeLists.txt /CMakeLists.txt # Set the project name and language project(myProject LANGUAGES CXX) # Set the C++20 standard globally set(CMA…

---

## [The list of include directories is empty by default.](https://discourse.cmake.org/t/the-list-of-include-directories-is-empty-by-default/14360)

<div class="topic-metadata">

**Author:** [@gerogaga](https://discourse.cmake.org/u/gerogaga)\
**Replies:** 1\
**Last updated:** [July 14, 2025, 8:39pm UTC](https://discourse.cmake.org/t/the-list-of-include-directories-is-empty-by-default/14360 "2025-07-14T20:39:22Z")

</div>

I have a file with 2 target\_include\_directories() commands, but outside of the directories specified in them, nothing else gets searched for headers, including system directories, and printing the INCLUDE\_DIRECTORIES dir…

---

## [Is there any command line option to force static build?](https://discourse.cmake.org/t/is-there-any-command-line-option-to-force-static-build/14336)

<div class="topic-metadata">

**Author:** [@leo9800](https://discourse.cmake.org/u/leo9800)\
**Replies:** 0\
**Last updated:** [July 9, 2025, 5:56pm UTC](https://discourse.cmake.org/t/is-there-any-command-line-option-to-force-static-build/14336 "2025-07-09T17:56:49Z")

</div>

Hi, folks I am currently trying to build static binary of a C++ & CMake based project, qbittorrent-enhanced-edition to be specific. My goal would be producing a ELF which is completely static, i.e. ldd shows statically…

---

## [INTERFACE\_INCLUDE\_DIRECTORIES do not work as documented](https://discourse.cmake.org/t/interface-include-directories-do-not-work-as-documented/14332)

<div class="topic-metadata">

**Author:** [@Adam\_BZH](https://discourse.cmake.org/u/Adam_BZH)\
**Replies:** 4\
**Last updated:** [July 9, 2025, 4:09am UTC](https://discourse.cmake.org/t/interface-include-directories-do-not-work-as-documented/14332 "2025-07-09T04:09:51Z")

</div>

Using version 3.28, Linux Ubuntu 24.04 As title suggests, having issue with a simple library and consumer use case. library’s INTERFACE\_INCLUDE\_DIRECTORIES is populated, but when I use add\_subdirectory(library) to inclu…

---

## [Building Go/Golang Android app using Gradle and Cmake](https://discourse.cmake.org/t/building-go-golang-android-app-using-gradle-and-cmake/14306)

<div class="topic-metadata">

**Author:** [@ziik](https://discourse.cmake.org/u/ziik)\
**Replies:** 1\
**Last updated:** [July 8, 2025, 9:03pm UTC](https://discourse.cmake.org/t/building-go-golang-android-app-using-gradle-and-cmake/14306 "2025-07-08T21:03:47Z")

</div>

Hi, I am trying to build the Golang Android native application using Gradle and CMake. And I would like to ask for help with the CMake configuration. I uploaded the project I’m testing on to GitHub GitHub - tomas-mraz/s…

---

## [No SOURCES given to target: \_\_CMAKE\_\_CXX26 on ubuntu 25.04](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 17\
**Last updated:** [July 7, 2025, 6:41pm UTC](https://discourse.cmake.org/t/no-sources-given-to-target-cmake-cxx26-on-ubuntu-25-04/14240 "2025-07-07T18:41:16Z")

</div>

import std does also not work with gcc-15 on ubuntu 25.04! builder@5b11ff1f2350:~/workdir$ cmake -S . -B build -G Ninja --fresh -- The CXX compiler identification is GNU 15.0.1 -- Detecting CXX compiler ABI info -- Detec…

---

## [CMake Link.txt generated during CMake configuration does not contain any link flags or source files when using riscv toolchain](https://discourse.cmake.org/t/cmake-link-txt-generated-during-cmake-configuration-does-not-contain-any-link-flags-or-source-files-when-using-riscv-toolchain/14304)

<div class="topic-metadata">

**Author:** [@Atul\_Joshi](https://discourse.cmake.org/u/Atul_Joshi)\
**Replies:** 4\
**Last updated:** [July 2, 2025, 10:29am UTC](https://discourse.cmake.org/t/cmake-link-txt-generated-during-cmake-configuration-does-not-contain-any-link-flags-or-source-files-when-using-riscv-toolchain/14304 "2025-07-02T10:29:58Z")

</div>

I have 2 source files, one is C (cstart.c) and another is assembly (startup.S) using which i am trying to make an riscv executable. Here is how my CMakeLists.txt Looks Like =============================================…

---

## [Strange executable name when setting SUFFIX and VERSION](https://discourse.cmake.org/t/strange-executable-name-when-setting-suffix-and-version/14292)

<div class="topic-metadata">

**Author:** [@JonTheBurger](https://discourse.cmake.org/u/JonTheBurger)\
**Replies:** 0\
**Last updated:** [June 27, 2025, 12:37pm UTC](https://discourse.cmake.org/t/strange-executable-name-when-setting-suffix-and-version/14292 "2025-06-27T12:37:27Z")

</div>

On Windows, the following snippet creates a main-1.2.3.elf (with both GCC and MSVC). However on Linux, it creates main.elf-1.2.3. I tried to also set OUTPUT\_NAME main-1.2.3 to override the version string it added, but th…

---

## [Customize compiler warnings/definitions/includes on a per-source or per-directory basis](https://discourse.cmake.org/t/customize-compiler-warnings-definitions-includes-on-a-per-source-or-per-directory-basis/14278)

<div class="topic-metadata">

**Author:** [@sk\_anduril](https://discourse.cmake.org/u/sk_anduril)\
**Replies:** 0\
**Last updated:** [June 21, 2025, 1:34am UTC](https://discourse.cmake.org/t/customize-compiler-warnings-definitions-includes-on-a-per-source-or-per-directory-basis/14278 "2025-06-21T01:34:34Z")

</div>

I’d like to enhance my CMake build system so that I can “crank up” the warning level (ie, -Wall -Werror) on most of my code, but there are pieces of the source tree (maybe third-party vendor code or old legacy code we do…

---

## [How to mark GMock as a required component](https://discourse.cmake.org/t/how-to-mark-gmock-as-a-required-component/10106)

<div class="topic-metadata">

**Author:** [@Ryanf55](https://discourse.cmake.org/u/Ryanf55)\
**Replies:** 5\
**Last updated:** [June 19, 2025, 8:38pm UTC](https://discourse.cmake.org/t/how-to-mark-gmock-as-a-required-component/10106 "2025-06-19T20:38:59Z")

</div>

I’m using CMake 3.27 and use both GTest and GMock in a package. There are a few options I’ve seen to pull this in: With the FindGTest module include(FindGTest) Directly with find\_package find\_package(GTest CONFIG …

---

## [Linker configuration in toolchain file for cross-compiling](https://discourse.cmake.org/t/linker-configuration-in-toolchain-file-for-cross-compiling/14192)

<div class="topic-metadata">

**Author:** [@nickvdbroeck](https://discourse.cmake.org/u/nickvdbroeck)\
**Replies:** 0\
**Last updated:** [June 3, 2025, 1:53pm UTC](https://discourse.cmake.org/t/linker-configuration-in-toolchain-file-for-cross-compiling/14192 "2025-06-03T13:53:03Z")

</div>

I am trying to setup cross compilation using cmake. I am working on windows 11. I am using WSL 2 with an Ubuntu-22.04 as host system to build on and my target system is an aarch64 embedded ARM processor running somethin…

---

## [/usr/bin/ld: unable to find -lstdc++: No such file or directory](https://discourse.cmake.org/t/usr-bin-ld-unable-to-find-lstdc-no-such-file-or-directory/14145)

<div class="topic-metadata">

**Author:** [@Yan\_Titarenko](https://discourse.cmake.org/u/Yan_Titarenko)\
**Replies:** 0\
**Last updated:** [May 23, 2025, 4:05pm UTC](https://discourse.cmake.org/t/usr-bin-ld-unable-to-find-lstdc-no-such-file-or-directory/14145 "2025-05-23T16:05:10Z")

</div>

Hi there. I was trying to build mysql server: https://github.com/mysql/mysql-server I have created a folder “build” and tried to run cmake from there: yantitarenko5@localhost:~/mysql-server/build\> cmake .. – Running…

---

## [FetchContent Does Not Isolate Host from Target](https://discourse.cmake.org/t/fetchcontent-does-not-isolate-host-from-target/14134)

<div class="topic-metadata">

**Author:** [@Drue\_Peters](https://discourse.cmake.org/u/Drue_Peters)\
**Replies:** 2\
**Last updated:** [May 23, 2025, 5:23pm UTC](https://discourse.cmake.org/t/fetchcontent-does-not-isolate-host-from-target/14134 "2025-05-23T17:23:53Z")

</div>

Hey, I’m not sure how to word the title correctly. I’m working on integrating libarchive (GitHub - libarchive/libarchive: Multi-format archive and compression library) for a project. Because of the nature of the projec…

---

## [Customize CMAKE\_XXX\_LINK\_EXECUTABLE with -Wl options when linking shared libraries](https://discourse.cmake.org/t/customize-cmake-xxx-link-executable-with-wl-options-when-linking-shared-libraries/14124)

<div class="topic-metadata">

**Author:** [@Believer](https://discourse.cmake.org/u/Believer)\
**Replies:** 2\
**Last updated:** [May 21, 2025, 9:13am UTC](https://discourse.cmake.org/t/customize-cmake-xxx-link-executable-with-wl-options-when-linking-shared-libraries/14124 "2025-05-21T09:13:53Z")

</div>

Hi, I am a new beginner who is trying to write a new language in cmake, writing files such as CMakeXXXInformation.cmake. I am confused at how -Wl option is passed in CMAKE\_CXX\_LINK\_EXECUTABLE. Among those variables I saw…

[Previous page](https://discourse.cmake.org/tag/os-linux/1.md?match_all_tags=true&page=1&tags%5B%5D=os%3Alinux)

[Next page](https://discourse.cmake.org/tag/os-linux/1.md?match_all_tags=true&page=3&tags%5B%5D=os%3Alinux)
