# \#os:linux

**URL:** https://discourse.cmake.org/tag/os-linux/1.md

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

---

## [Linking LLVM fails with target\_link\_libraries()](https://discourse.cmake.org/t/linking-llvm-fails-with-target-link-libraries/15852)

<div class="topic-metadata">

**Author:** [@TheShiningBoots](https://discourse.cmake.org/u/TheShiningBoots)\
**Replies:** 1\
**Last updated:** [September 26, 2026, 7:55pm UTC](https://discourse.cmake.org/t/linking-llvm-fails-with-target-link-libraries/15852 "2026-09-26T19:55:44Z")

</div>

find\_package(LLVM REQUIRED CONFIG) llvm\_map\_components\_to\_libnames(llvm\_libs core support target irreader ) target\_include\_directories(catguy PRIVATE ${LLVM\_INCLUDE\_DIRS}) target\_compile\_definitions(catguy PRIV…

---

## [Fortran\_PREPROCESS ignored on Linux](https://discourse.cmake.org/t/fortran-preprocess-ignored-on-linux/9105)

<div class="topic-metadata">

**Author:** [@Maarten\_Braakhekke](https://discourse.cmake.org/u/Maarten_Braakhekke)\
**Replies:** 5\
**Last updated:** [September 17, 2026, 3:54pm UTC](https://discourse.cmake.org/t/fortran-preprocess-ignored-on-linux/9105 "2026-09-17T15:54:19Z")

</div>

It seems that the Fortran\_PREPROCESS property is not functioning properly on Linux. The default behavior of CMake on Linux is that source files are not preprocssed and Fortran\_PREPROCESS doesn seem to affect this. I att…

---

## [A method of writing that can handle file name changes.](https://discourse.cmake.org/t/a-method-of-writing-that-can-handle-file-name-changes/15825)

<div class="topic-metadata">

**Author:** [@amagi](https://discourse.cmake.org/u/amagi)\
**Replies:** 5\
**Last updated:** [September 12, 2026, 2:54am UTC](https://discourse.cmake.org/t/a-method-of-writing-that-can-handle-file-name-changes/15825 "2026-09-12T02:54:38Z")

</div>

The following code requires a cmake --build build command to build if the filename is changed. However, emptying and regenerating the build directory is cumbersome, so I’ve assigned a single command to a shortcut key for…

---

## [cmake build maps libre](https://discourse.cmake.org/t/cmake-build-maps-libre/15788)

<div class="topic-metadata">

**Author:** [@impetus](https://discourse.cmake.org/u/impetus)\
**Replies:** 3\
**Last updated:** [August 16, 2026, 9:12am UTC](https://discourse.cmake.org/t/cmake-build-maps-libre/15788 "2026-08-16T09:12:41Z")

</div>

I’m building maps libre Linux - MapLibre Native Developer Documentation Having problem with mbgl-core build FAILED: CMakeFiles/mbgl-core.dir/src/mbgl/layout/symbol\_layout.cpp.o ccache /usr/bin/clang++ -DEGL\_NO\_X11 -DM…

---

## [Cpack ingnore or overwite install options from external dependencies](https://discourse.cmake.org/t/cpack-ingnore-or-overwite-install-options-from-external-dependencies/15754)

<div class="topic-metadata">

**Author:** [@nickvdbroeck](https://discourse.cmake.org/u/nickvdbroeck)\
**Replies:** 3\
**Last updated:** [July 22, 2026, 7:32am UTC](https://discourse.cmake.org/t/cpack-ingnore-or-overwite-install-options-from-external-dependencies/15754 "2026-07-22T07:32:55Z")

</div>

I have the following issue: I am building an SDK. It includes an external project (specifically: GitHub - ouster-lidar/ouster-sdk: Cross-platform C++ and Python SDK for Ouster LiDAR sensors. Includes tools for visualiza…

---

## [CXX-Modules: import std does still not work on Linux with clang++](https://discourse.cmake.org/t/cxx-modules-import-std-does-still-not-work-on-linux-with-clang/15262)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 14\
**Last updated:** [July 17, 2026, 4:37pm UTC](https://discourse.cmake.org/t/cxx-modules-import-std-does-still-not-work-on-linux-with-clang/15262 "2026-07-17T16:37:13Z")

</div>

/root/cmake/cmake-4.0.4-linux-x86\_64/share/cmake-4.0/Modules/CMakeDetermineCompilerId.cmake(357): if(xCXX STREQUAL xCXX AND EXISTS /root/cmake/cmake-4.0.4-linux-x86\_64/share/cmake-4.0/Modules/CXX-DetectStdlib.h AND ( xC…

---

## [Qt 6.10.0 building from sources. GNU C++ compiler error: unrecognized command-line option ‘-R’ while using GCC 14.3.0](https://discourse.cmake.org/t/qt-6-10-0-building-from-sources-gnu-c-compiler-error-unrecognized-command-line-option-r-while-using-gcc-14-3-0/15736)

<div class="topic-metadata">

**Author:** [@mans5647](https://discourse.cmake.org/u/mans5647)\
**Replies:** 0\
**Last updated:** [July 5, 2026, 8:37am UTC](https://discourse.cmake.org/t/qt-6-10-0-building-from-sources-gnu-c-compiler-error-unrecognized-command-line-option-r-while-using-gcc-14-3-0/15736 "2026-07-05T08:37:56Z")

</div>

Hi. I configured QT 6.10.0 from sources using following command: $ ./configure -shared -no-opengl -- -B build/ --fresh After that, It gave me usual and error-free output: -- The CXX compiler identification is GNU 14.3…

---

## [file not found error: /lib/share/libc++/v1/std.cppm with Clang 21.1.7 on Linux](https://discourse.cmake.org/t/file-not-found-error-lib-share-libc-v1-std-cppm-with-clang-21-1-7-on-linux/15368)

<div class="topic-metadata">

**Author:** [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Replies:** 4\
**Last updated:** [June 29, 2026, 6:14pm UTC](https://discourse.cmake.org/t/file-not-found-error-lib-share-libc-v1-std-cppm-with-clang-21-1-7-on-linux/15368 "2026-06-29T18:14:02Z")

</div>

clang++ --version Ubuntu clang version 21.1.7 (++20251127113503+9ed1927442a4-1~exp1~20251127113518.64) Target: x86\_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-21/bin clang++ -print-file-name=libc++.mo…

---

## [CPS doesn't work with Boost::headers](https://discourse.cmake.org/t/cps-doesnt-work-with-boost-headers/15720)

<div class="topic-metadata">

**Author:** [@Yanzhao\_Wang](https://discourse.cmake.org/u/Yanzhao_Wang)\
**Replies:** 4\
**Last updated:** [June 25, 2026, 1:30pm UTC](https://discourse.cmake.org/t/cps-doesnt-work-with-boost-headers/15720 "2026-06-25T13:30:17Z")

</div>

Hi, I have a project which uses the Boost library through the target Boost::headers . I really like the idea of CPS and I would like to use it to install the project. But I encountered a configuration error: CMake Erro…

---

## [The C compiler "/usr/bin/cc" is not able to compile a simple test program.](https://discourse.cmake.org/t/the-c-compiler-usr-bin-cc-is-not-able-to-compile-a-simple-test-program/6258)

<div class="topic-metadata">

**Author:** [@Doug\_Rattmann](https://discourse.cmake.org/u/Doug_Rattmann)\
**Replies:** 8\
**Last updated:** [June 10, 2026, 6:18am UTC](https://discourse.cmake.org/t/the-c-compiler-usr-bin-cc-is-not-able-to-compile-a-simple-test-program/6258 "2026-06-10T06:18:23Z")

</div>

Hi I was triying to install asepire by source i followed this tutorial: How to Compile Aseprite on Ubuntu Linux - YouTube on Linux Mint 19.3 its my first time trying to install something from source and using Cmake so Ia…

---

## [presets: Omitting \`generator\` does not default to regular generator discovery procedure](https://discourse.cmake.org/t/presets-omitting-generator-does-not-default-to-regular-generator-discovery-procedure/7910)

<div class="topic-metadata">

**Author:** [@dabe](https://discourse.cmake.org/u/dabe)\
**Replies:** 2\
**Last updated:** [June 1, 2026, 12:38am UTC](https://discourse.cmake.org/t/presets-omitting-generator-does-not-default-to-regular-generator-discovery-procedure/7910 "2026-06-01T00:38:44Z")

</div>

I have a project that I’d like to use different generators for depending on the OS that is compiling it (specifically, Unix Makefiles for Linux and Visual Studio/Ninja for Windows). I’d like to just let the automatic ge…

---

## [Cannot bootstrap CMake 4.3.2 with nvc++ compiler](https://discourse.cmake.org/t/cannot-bootstrap-cmake-4-3-2-with-nvc-compiler/15663)

<div class="topic-metadata">

**Author:** [@MicPellegrino](https://discourse.cmake.org/u/MicPellegrino)\
**Replies:** 0\
**Last updated:** [May 26, 2026, 11:47am UTC](https://discourse.cmake.org/t/cannot-bootstrap-cmake-4-3-2-with-nvc-compiler/15663 "2026-05-26T11:47:39Z")

</div>

Hi, I am trying to build CMake 4.3.2 (NB not build with CMake) on my local university cluster. Since there’s no CUDA module (sigh) but plenty of NVHPC compiler modules (wrapping CUDA), I am trying to build CMake using n…

---

## [use compilers set by CMAKE\_\*\_COMPILER in ctest](https://discourse.cmake.org/t/use-compilers-set-by-cmake-compiler-in-ctest/15652)

<div class="topic-metadata">

**Author:** [@kkwli](https://discourse.cmake.org/u/kkwli)\
**Replies:** 3\
**Last updated:** [May 13, 2026, 3:54pm UTC](https://discourse.cmake.org/t/use-compilers-set-by-cmake-compiler-in-ctest/15652 "2026-05-13T15:54:50Z")

</div>

I set the CMAKE\_\*\_COMPILER when building cmake from scratch. When I run ctest, it seems that it always uses the one on the system. If I set CXX in running ctest, it will pick up the one set by CXX. Is it the expected beh…

---

## [Generator expression $\<INSTALL\_PREFIX\> doesn't work with env variable DESTDIR](https://discourse.cmake.org/t/generator-expression-install-prefix-doesnt-work-with-env-variable-destdir/15645)

<div class="topic-metadata">

**Author:** [@jst\_mbs](https://discourse.cmake.org/u/jst_mbs)\
**Replies:** 5\
**Last updated:** [May 12, 2026, 2:51pm UTC](https://discourse.cmake.org/t/generator-expression-install-prefix-doesnt-work-with-env-variable-destdir/15645 "2026-05-12T14:51:21Z")

</div>

Using the generator expression $\<INSTALL\_PREFIX\> in install(CODE ) should work with CMake 3.27 and later. But the generator expression doesn’t work with the enviroment variable DESTDIR. I don’t know if this is the intend…

---

## [Experimental SBOM: Statically linked dependencies show up as "Shared"](https://discourse.cmake.org/t/experimental-sbom-statically-linked-dependencies-show-up-as-shared/15648)

<div class="topic-metadata">

**Author:** [@Mythra](https://discourse.cmake.org/u/Mythra)\
**Replies:** 0\
**Last updated:** [May 9, 2026, 7:02pm UTC](https://discourse.cmake.org/t/experimental-sbom-statically-linked-dependencies-show-up-as-shared/15648 "2026-05-09T19:02:25Z")

</div>

I’m attempting to test out the new experimental SBOM generation feature, and it seems I have statically linked libraries showing up as “shared” libraries in the generated SPDX. I know this feature is experimental, but be…

---

## [Cache invalidation doesn't affect compile\_commands.json?](https://discourse.cmake.org/t/cache-invalidation-doesnt-affect-compile-commands-json/15642)

<div class="topic-metadata">

**Author:** [@tali](https://discourse.cmake.org/u/tali)\
**Replies:** 2\
**Last updated:** [May 5, 2026, 10:10pm UTC](https://discourse.cmake.org/t/cache-invalidation-doesnt-affect-compile-commands-json/15642 "2026-05-05T22:10:10Z")

</div>

Hello all - If a build directory is generated with -DCMAKE\_EXPORT\_COMPILE\_COMMANDS=1, and then the CMake command is run again identically but with a (different) value for --DCMAKE\_CXX\_COMPILER or -DCMAKE\_C\_COMPILER, the c…

---

## [Print generated command by add\_custom\_command](https://discourse.cmake.org/t/print-generated-command-by-add-custom-command/15638)

<div class="topic-metadata">

**Author:** [@matdubuisson](https://discourse.cmake.org/u/matdubuisson)\
**Replies:** 1\
**Last updated:** [May 4, 2026, 10:35am UTC](https://discourse.cmake.org/t/print-generated-command-by-add-custom-command/15638 "2026-05-04T10:35:32Z")

</div>

Hello, I have a simple question, is it possible to ask cmake to print all generated commands our I have to do it manually py setting the COMMENT option of add\_custom\_command or adding a log ? Thank you in advance, Bes…

---

## [CMake C++17 "does not name a type" however class is included](https://discourse.cmake.org/t/cmake-c-17-does-not-name-a-type-however-class-is-included/15637)

<div class="topic-metadata">

**Author:** [@matdubuisson](https://discourse.cmake.org/u/matdubuisson)\
**Replies:** 2\
**Last updated:** [May 3, 2026, 8:18am UTC](https://discourse.cmake.org/t/cmake-c-17-does-not-name-a-type-however-class-is-included/15637 "2026-05-03T08:18:27Z")

</div>

Hello everyone, I have upgraded a project from cmake 2.8 to cmake 4.0 and llvm 3.9.0 to 22.1.0 so of course I got compilation issues. For example in the project there is a class not found error for vm.hh file and the cl…

---

## [Beginner: Difficulty understanding CMake impact on include statements](https://discourse.cmake.org/t/beginner-difficulty-understanding-cmake-impact-on-include-statements/15404)

<div class="topic-metadata">

**Author:** [@zlime](https://discourse.cmake.org/u/zlime)\
**Replies:** 6\
**Last updated:** [April 29, 2026, 2:29am UTC](https://discourse.cmake.org/t/beginner-difficulty-understanding-cmake-impact-on-include-statements/15404 "2026-04-29T02:29:05Z")

</div>

Greetings! This is my first post. I am new to writing CMake, and am currently updating a legacy build system. Assume a directory structure like this: A |-CMakeLists.txt |-B | |-CMakeLists.txt | |-some\_class\_in\_B.h | |-s…

---

## [Integrating CDash submission into a normal CI](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587)

<div class="topic-metadata">

**Author:** [@fsimonis](https://discourse.cmake.org/u/fsimonis)\
**Replies:** 8\
**Last updated:** [April 8, 2026, 12:20pm UTC](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587 "2026-04-08T12:20:20Z")

</div>

Hi, I’m having trouble integrating CDash into my project’s CI and haven’t found any good answers, so I’m asking here. I manage a pretty standard CI that configures, builds, and tests a CMake project for a range of confi…

---

## [Possible regression: FindMPI.cmake doesn't locate MPI in non-standard installation location](https://discourse.cmake.org/t/possible-regression-findmpi-cmake-doesnt-locate-mpi-in-non-standard-installation-location/15589)

<div class="topic-metadata">

**Author:** [@jhendersonHDF](https://discourse.cmake.org/u/jhendersonHDF)\
**Replies:** 0\
**Last updated:** [April 1, 2026, 5:38pm UTC](https://discourse.cmake.org/t/possible-regression-findmpi-cmake-doesnt-locate-mpi-in-non-standard-installation-location/15589 "2026-04-01T17:38:48Z")

</div>

Hi all, On Linux, I typically install several different MPI versions to /opt for testing. After updating CMake to 4.3.1 (the behavior probably changed long before this), it seems CMake can no longer fully find and use t…

---

## [Integrating ExternalProject\_Add() with generate-phase target dependencies](https://discourse.cmake.org/t/integrating-externalproject-add-with-generate-phase-target-dependencies/15584)

<div class="topic-metadata">

**Author:** [@wdezell](https://discourse.cmake.org/u/wdezell)\
**Replies:** 0\
**Last updated:** [March 30, 2026, 7:03pm UTC](https://discourse.cmake.org/t/integrating-externalproject-add-with-generate-phase-target-dependencies/15584 "2026-03-30T19:03:17Z")

</div>

Background I have a large project organized as 20+ repos, one being the logical “parent” from which the CMake project is homed and add\_subdirectory() calls chain in the rest, save one. That repo homes a customer-provid…

---

## [Having difficulty compiling with import std; support; cmake can't build std.cppm](https://discourse.cmake.org/t/having-difficulty-compiling-with-import-std-support-cmake-cant-build-std-cppm/15557)

<div class="topic-metadata">

**Author:** [@sebjames](https://discourse.cmake.org/u/sebjames)\
**Replies:** 10\
**Last updated:** [March 15, 2026, 8:41am UTC](https://discourse.cmake.org/t/having-difficulty-compiling-with-import-std-support-cmake-cant-build-std-cppm/15557 "2026-03-15T08:41:15Z")

</div>

Hi there, I’m looking for some help with a cmake-directed build of a C++ modules project containing import std; I’ve followed along with: https://www.kitware.com/import-std-in-cmake-3-30/ The sample provided there co…

---

## [Forcing a locally installed Boost to be used instead of the system-level one](https://discourse.cmake.org/t/forcing-a-locally-installed-boost-to-be-used-instead-of-the-system-level-one/15549)

<div class="topic-metadata">

**Author:** [@rwan](https://discourse.cmake.org/u/rwan)\
**Replies:** 12\
**Last updated:** [March 11, 2026, 11:44pm UTC](https://discourse.cmake.org/t/forcing-a-locally-installed-boost-to-be-used-instead-of-the-system-level-one/15549 "2026-03-11T23:44:01Z")

</div>

Hi all, I have been trying to get Boost working with CMake. What I did almost a year ago is detailed here: CMake with Boost and policy CMP0167 . And that still works, thankfully. :slight\_smile: There is just one pr…

---

## [INTERFACE library target and CXX\_MODULES file set](https://discourse.cmake.org/t/interface-library-target-and-cxx-modules-file-set/15550)

<div class="topic-metadata">

**Author:** [@matwey](https://discourse.cmake.org/u/matwey)\
**Replies:** 0\
**Last updated:** [March 10, 2026, 8:47am UTC](https://discourse.cmake.org/t/interface-library-target-and-cxx-modules-file-set/15550 "2026-03-10T08:47:01Z")

</div>

Hello, I am completely confused with correct usage of C++ modules and INTERFACE targets. Let me please first describe what I currently have and what I want to achieve. I have a project consisting multiple firmwares for…

---

## [CMAKE\_CUDA\_FLAGS passed to linking operations?](https://discourse.cmake.org/t/cmake-cuda-flags-passed-to-linking-operations/15540)

<div class="topic-metadata">

**Author:** [@mblanchard](https://discourse.cmake.org/u/mblanchard)\
**Replies:** 1\
**Last updated:** [March 5, 2026, 10:44am UTC](https://discourse.cmake.org/t/cmake-cuda-flags-passed-to-linking-operations/15540 "2026-03-05T10:44:48Z")

</div>

Upgrading from CMake 3.29.2 to 4.2.2, and building CPU and GPU code with Clang, it seems like CMAKE\_CUDA\_FLAGS are now pass to linking operations with 4.2.2, while they were not (at least with our setup) with 3.29.2. We …

---

## [Trouble with RPATH when building netcdf for Fedora](https://discourse.cmake.org/t/trouble-with-rpath-when-building-netcdf-for-fedora/15532)

<div class="topic-metadata">

**Author:** [@opoplawski](https://discourse.cmake.org/u/opoplawski)\
**Replies:** 2\
**Last updated:** [March 4, 2026, 12:30am UTC](https://discourse.cmake.org/t/trouble-with-rpath-when-building-netcdf-for-fedora/15532 "2026-03-04T00:30:26Z")

</div>

I package netcdf for Fedora. I’m working on switching to cmake for building the project and having trouble with RPATHs ending up in installed files. Fedora forbids rpath in installed files. I get the following message…

---

## [Can I make two separate library packages in one CMakelIsts.txt file?](https://discourse.cmake.org/t/can-i-make-two-separate-library-packages-in-one-cmakelists-txt-file/15168)

<div class="topic-metadata">

**Author:** [@chriskot870](https://discourse.cmake.org/u/chriskot870)\
**Replies:** 2\
**Last updated:** [February 20, 2026, 2:26pm UTC](https://discourse.cmake.org/t/can-i-make-two-separate-library-packages-in-one-cmakelists-txt-file/15168 "2026-02-20T14:26:04Z")

</div>

I am currently creating one library built from two source files. I want to generate both shared library and static library. The static libraries and headers only get loaded when loading a dev version of the package. set…

---

## [Import std - cmake 3.30 - "config mismatch" error](https://discourse.cmake.org/t/import-std-cmake-3-30-config-mismatch-error/12908)

<div class="topic-metadata">

**Author:** [@Kelarov](https://discourse.cmake.org/u/Kelarov)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 5:48am UTC](https://discourse.cmake.org/t/import-std-cmake-3-30-config-mismatch-error/12908 "2026-02-20T05:48:14Z")

</div>

Hi all. I am trying to apply what the import std in CMake 3.30 post does to use in a project, but am facing errors. My setup: CMakeLists.txt CMakePresets.json src/CMakeLists.txt src/kk-intro.cppm src/kk-intro.cc src/m…

---

## [FindICU.cmake and the --with-library-suffix configure parameter](https://discourse.cmake.org/t/findicu-cmake-and-the-with-library-suffix-configure-parameter/14321)

<div class="topic-metadata">

**Author:** [@ADKaster](https://discourse.cmake.org/u/ADKaster)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 2:33am UTC](https://discourse.cmake.org/t/findicu-cmake-and-the-with-library-suffix-configure-parameter/14321 "2026-02-20T02:33:59Z")

</div>

I’m building an application that both relies on qt6 and ICU4C on Linux/non-macOS Unix. My application must be kept up to date with the latest icu releases, regardless of what ends up bundled with Qt. When building with…

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