# Usage

**URL:** https://discourse.cmake.org/c/usage/12.md?page=8

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

**Page:** 9

---

## [Using the same namespace for multiple independant projects](https://discourse.cmake.org/t/using-the-same-namespace-for-multiple-independant-projects/8669)

<div class="topic-metadata">

**Author:** [@olivierbichler-cea](https://discourse.cmake.org/u/olivierbichler-cea)\
**Replies:** 8\
**Last updated:** [July 23, 2025, 1:46pm UTC](https://discourse.cmake.org/t/using-the-same-namespace-for-multiple-independant-projects/8669 "2025-07-23T13:46:23Z")

</div>

Hi, Is there a way to use the same namespace accross multiple packages, like: find\_package(prog\_extA) find\_package(prog\_extB) target\_link\_librairies(target PUBLIC prog::extA prog::extB) Or even, register multiple pack…

---

## [cmake install component is installing entire cmakelist.txt](https://discourse.cmake.org/t/cmake-install-component-is-installing-entire-cmakelist-txt/14422)

<div class="topic-metadata">

**Author:** [@akshatjain-tally](https://discourse.cmake.org/u/akshatjain-tally)\
**Replies:** 0\
**Last updated:** [July 23, 2025, 5:46am UTC](https://discourse.cmake.org/t/cmake-install-component-is-installing-entire-cmakelist-txt/14422 "2025-07-23T05:46:00Z")

</div>

So, we have a CMakeList.txt which have around 74 projects in it, And for one project we use install component to install that library, but when ran the custom\_target to run the command: TW\_ADD\_CUSTOM\_TARGET(install\_${pT…

---

## [Override setting from CMAKE\_TOOLCHAIN\_FILE](https://discourse.cmake.org/t/override-setting-from-cmake-toolchain-file/5368)

<div class="topic-metadata">

**Author:** [@gpanders](https://discourse.cmake.org/u/gpanders)\
**Replies:** 2\
**Last updated:** [July 22, 2025, 1:34pm UTC](https://discourse.cmake.org/t/override-setting-from-cmake-toolchain-file/5368 "2025-07-22T13:34:23Z")

</div>

I am using a toolchain file from OpenEmbedded (Yocto Linux). It’s contents include the following: set( CMAKE\_FIND\_ROOT\_PATH $ENV{OECORE\_TARGET\_SYSROOT} $ENV{OECORE\_NATIVE\_SYSROOT} ) set( CMAKE\_FIND\_ROOT\_PATH\_MODE\_PROGRA…

---

## [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…

---

## [FetchContent: incremental commit or full repo?](https://discourse.cmake.org/t/fetchcontent-incremental-commit-or-full-repo/14405)

<div class="topic-metadata">

**Author:** [@franki](https://discourse.cmake.org/u/franki)\
**Replies:** 1\
**Last updated:** [July 21, 2025, 10:06pm UTC](https://discourse.cmake.org/t/fetchcontent-incremental-commit-or-full-repo/14405 "2025-07-21T22:06:32Z")

</div>

I recently learned from discussions here that when FetchContent fetches a particular GIT\_TAG (i.e. a Git commit hash), it first pulls in the entire repo (from pointer to GIT\_REPOSITORY), then checks-out the requested GIT…

---

## [How to identify GraceHopper and GraceGrace nodes?](https://discourse.cmake.org/t/how-to-identify-gracehopper-and-gracegrace-nodes/11335)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 2\
**Last updated:** [July 21, 2025, 12:23pm UTC](https://discourse.cmake.org/t/how-to-identify-gracehopper-and-gracegrace-nodes/11335 "2025-07-21T12:23:27Z")

</div>

All, I’m not sure where to ask about this so I’ll try here. Namely, I maintain code that uses: ## Print out the processor description cmake\_host\_system\_information(RESULT proc\_description QUERY PROCESSOR\_DESCRIPTION) m…

---

## [Struggling to Link Custom-Built libc++ with Modules Across Platforms](https://discourse.cmake.org/t/struggling-to-link-custom-built-libc-with-modules-across-platforms/14401)

<div class="topic-metadata">

**Author:** [@mccakit](https://discourse.cmake.org/u/mccakit)\
**Replies:** 0\
**Last updated:** [July 21, 2025, 10:52am UTC](https://discourse.cmake.org/t/struggling-to-link-custom-built-libc-with-modules-across-platforms/14401 "2025-07-21T10:52:29Z")

</div>

I already have a sysroot or SDK set up for each platform, but they either lack libc++, have an outdated version, or don’t include C++ standard library modules. I want to build and statically link libc++ myself, so I can…

---

## [Build Errors!](https://discourse.cmake.org/t/build-errors/14394)

<div class="topic-metadata">

**Author:** [@Astrox](https://discourse.cmake.org/u/Astrox)\
**Replies:** 1\
**Last updated:** [July 21, 2025, 2:59am UTC](https://discourse.cmake.org/t/build-errors/14394 "2025-07-21T02:59:49Z")

</div>

PS C:\\Users\\...\\coding\\other\\astralixiOS\\build\> cmake .. -- The C compiler identification is GNU 14.2.1 -- The CXX compiler identification is GNU 14.2.1 -- The ASM compiler identification is GNU -- Found assembler: C:/U…

---

## [installing package configuration files: FILES or EXPORT](https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577)

<div class="topic-metadata">

**Author:** [@adaldev](https://discourse.cmake.org/u/adaldev)\
**Replies:** 1\
**Last updated:** [July 21, 2025, 12:30am UTC](https://discourse.cmake.org/t/installing-package-configuration-files-files-or-export/11577 "2025-07-21T00:30:15Z")

</div>

From the tutorial: # generate the config file that includes the exports # creates the file in the build tree configure\_package\_config\_file(${CMAKE\_CURRENT\_SOURCE\_DIR}/Config.cmake.in "${CMAKE\_CURRENT\_BINARY\_DIR}/MathF…

---

## [Exclude some TUs from --parallel](https://discourse.cmake.org/t/exclude-some-tus-from-parallel/11500)

<div class="topic-metadata">

**Author:** [@silverqx](https://discourse.cmake.org/u/silverqx)\
**Replies:** 7\
**Last updated:** [July 21, 2025, 12:08am UTC](https://discourse.cmake.org/t/exclude-some-tus-from-parallel/11500 "2025-07-21T00:08:58Z")

</div>

How to tell cmake not to compile 2-3 TU-s in parallel (eg. from 100 TU-s in total), added as subprojects using add\_subdirectory() - add\_executable() - add\_test() using -G Ninja generator. Is there any solution or workar…

---

## [Where should I define POLICY CMP0116 in a way that it really works?](https://discourse.cmake.org/t/where-should-i-define-policy-cmp0116-in-a-way-that-it-really-works/11446)

<div class="topic-metadata">

**Author:** [@cobo](https://discourse.cmake.org/u/cobo)\
**Replies:** 1\
**Last updated:** [July 20, 2025, 11:58pm UTC](https://discourse.cmake.org/t/where-should-i-define-policy-cmp0116-in-a-way-that-it-really-works/11446 "2025-07-20T23:58:34Z")

</div>

My CMake project is a ParaView “custom application”, CMake files are “borrowed from” or “designed after” those of ParaView and I must admit that I often do not really know what I am doing because it is far too complex fo…

---

## [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-…

---

## [Too restrictive for COFF OBJ files in \_\_create\_def](https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077)

<div class="topic-metadata">

**Author:** [@alkino](https://discourse.cmake.org/u/alkino)\
**Replies:** 1\
**Last updated:** [July 20, 2025, 11:51pm UTC](https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077 "2025-07-20T23:51:52Z")

</div>

Hello, I’m trying to use cmake for windows, and automatically generate symbols files definitions. We can see in the code that a COFF file id accepted as valid if Characteristics is equal to 0, in my case this is not be…

---

## [How to fix cmake\_minimum\_required() deprecation warning?](https://discourse.cmake.org/t/how-to-fix-cmake-minimum-required-deprecation-warning/2487)

<div class="topic-metadata">

**Author:** [@walki](https://discourse.cmake.org/u/walki)\
**Replies:** 12\
**Last updated:** [July 20, 2025, 11:48pm UTC](https://discourse.cmake.org/t/how-to-fix-cmake-minimum-required-deprecation-warning/2487 "2025-07-20T23:48:29Z")

</div>

Hi, Today when I recompiled one of my C++ projects using CMake I got the following deprecation warning: % cmake .. -DCMAKE\_CXX\_FLAGS="-Wall -Wextra -pedantic" CMake Deprecation Warning at CMakeLists.txt:1 (cmake\_minimu…

---

## [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?

---

## [CCache with Visual Studio Generator causing files to be compiled always](https://discourse.cmake.org/t/ccache-with-visual-studio-generator-causing-files-to-be-compiled-always/11342)

<div class="topic-metadata">

**Author:** [@siddmohsin](https://discourse.cmake.org/u/siddmohsin)\
**Replies:** 1\
**Last updated:** [July 19, 2025, 1:55pm UTC](https://discourse.cmake.org/t/ccache-with-visual-studio-generator-causing-files-to-be-compiled-always/11342 "2025-07-19T13:55:11Z")

</div>

Hello All, I picked up compiler caching subject again for C++ on windows using Visual Studio Generator. I was reading ProfessionalCMake\_18th\_Edition.pdf and this book has complete section compiler cache wehere in compil…

---

## [Is it possible to append to a file using generator expressions?](https://discourse.cmake.org/t/is-it-possible-to-append-to-a-file-using-generator-expressions/11326)

<div class="topic-metadata">

**Author:** [@KStocky](https://discourse.cmake.org/u/KStocky)\
**Replies:** 1\
**Last updated:** [July 18, 2025, 8:49pm UTC](https://discourse.cmake.org/t/is-it-possible-to-append-to-a-file-using-generator-expressions/11326 "2025-07-18T20:49:06Z")

</div>

Hi all! I have been searching for a way to append to a file using generator expressions and haven’t been able to find any information on this. At this point, I am wondering if it is even possible. My use case is that I …

---

## [How to append prefix to program and library in the command line?](https://discourse.cmake.org/t/how-to-append-prefix-to-program-and-library-in-the-command-line/11306)

<div class="topic-metadata">

**Author:** [@ikspress](https://discourse.cmake.org/u/ikspress)\
**Replies:** 5\
**Last updated:** [July 18, 2025, 8:27pm UTC](https://discourse.cmake.org/t/how-to-append-prefix-to-program-and-library-in-the-command-line/11306 "2025-07-18T20:27:54Z")

</div>

I attempted to compile LibreSSL using CMake for my self. LibreSSL serves as a drop-in replacement for OpenSSL, thus it may conflicts with the original OpenSSL. My intention is to use LibreSSL exclusively for my own progr…

---

## [find make version used in conda build](https://discourse.cmake.org/t/find-make-version-used-in-conda-build/11304)

<div class="topic-metadata">

**Author:** [@Ayman\_Habib](https://discourse.cmake.org/u/Ayman_Habib)\
**Replies:** 1\
**Last updated:** [July 18, 2025, 8:25pm UTC](https://discourse.cmake.org/t/find-make-version-used-in-conda-build/11304 "2025-07-18T20:25:17Z")

</div>

Hello, I have a project that builds with CMake 3.27 on apple silicon, using GNU Make 3.81. Trying to use this setup to create a conda package, a different make is used resulting in build failure as a build-flag is inter…

---

## [Question about force inclusion with precompiled header](https://discourse.cmake.org/t/question-about-force-inclusion-with-precompiled-header/11255)

<div class="topic-metadata">

**Author:** [@AlexG](https://discourse.cmake.org/u/AlexG)\
**Replies:** 1\
**Last updated:** [July 18, 2025, 8:14pm UTC](https://discourse.cmake.org/t/question-about-force-inclusion-with-precompiled-header/11255 "2025-07-18T20:14:14Z")

</div>

Hello everyone, I am successfully using precompiled header in my project to speed up build times. I noticed while reading the documentation about target\_precompile\_headers the following: The list of header files is use…

---

## [TI Clang support adds --library=stdc++ which breaks all builds](https://discourse.cmake.org/t/ti-clang-support-adds-library-stdc-which-breaks-all-builds/14391)

<div class="topic-metadata">

**Author:** [@FeHeBf](https://discourse.cmake.org/u/FeHeBf)\
**Replies:** 0\
**Last updated:** [July 18, 2025, 12:54pm UTC](https://discourse.cmake.org/t/ti-clang-support-adds-library-stdc-which-breaks-all-builds/14391 "2025-07-18T12:54:11Z")

</div>

Hello, we are working currently mostly with CMake versions 3.22, 3.25 and 3.27. One colleague updated to 3.31 and couldn’t build its application anymore with the TI CLang (LTS 3.2.2). When linking it threw an error “f…

---

## [CMAKE\_OBJC\_EXTENSIONS\_COMPUTED\_DEFAULT should be set for Clang](https://discourse.cmake.org/t/cmake-objc-extensions-computed-default-should-be-set-for-clang/14350)

<div class="topic-metadata">

**Author:** [@mccakit](https://discourse.cmake.org/u/mccakit)\
**Replies:** 3\
**Last updated:** [July 18, 2025, 9:32am UTC](https://discourse.cmake.org/t/cmake-objc-extensions-computed-default-should-be-set-for-clang/14350 "2025-07-18T09:32:16Z")

</div>

Can anyone help? CMake Error at C:/dev/tools/CMake/Modules/Compiler/CMakeCommonCompilerMacros.cmake:42 (message): CMAKE\_OBJC\_STANDARD\_COMPUTED\_DEFAULT and CMAKE\_OBJC\_EXTENSIONS\_COMPUTED\_DEFAULT should be set for Cla…

---

## [Documenting CMake Scripts and Formatting](https://discourse.cmake.org/t/documenting-cmake-scripts-and-formatting/11104)

<div class="topic-metadata">

**Author:** [@sjDan2003](https://discourse.cmake.org/u/sjDan2003)\
**Replies:** 2\
**Last updated:** [July 17, 2025, 8:14pm UTC](https://discourse.cmake.org/t/documenting-cmake-scripts-and-formatting/11104 "2025-07-17T20:14:27Z")

</div>

Hello everybody, I’m working on a project to convert an existing Makefile project to CMake. I want to start documenting all of the variables, macros, functions, and files I’ve created but haven’t found a standardized wa…

---

## [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…

---

## [flutter cmake issue](https://discourse.cmake.org/t/flutter-cmake-issue/8338)

<div class="topic-metadata">

**Author:** [@PrashantSaxena07](https://discourse.cmake.org/u/PrashantSaxena07)\
**Replies:** 3\
**Last updated:** [July 17, 2025, 4:25pm UTC](https://discourse.cmake.org/t/flutter-cmake-issue/8338 "2025-07-17T16:25:04Z")

</div>

hello guys i am facing this issue in building flutter build for linux over snapcraft \[ +1 ms\] CMake Error at /snap/flutter/141/usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:53 (message): \[ +2 ms\] The C++ comp…

---

## [Hiding files generated by UNITY\_BUILD in Visual Studio](https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130)

<div class="topic-metadata">

**Author:** [@KStocky](https://discourse.cmake.org/u/KStocky)\
**Replies:** 1\
**Last updated:** [July 17, 2025, 4:16pm UTC](https://discourse.cmake.org/t/hiding-files-generated-by-unity-build-in-visual-studio/11130 "2025-07-17T16:16:17Z")

</div>

Hi all! I just started configuring my project to build using UNITY\_BUILD and it is great! However, in Visual Studio, the generated source files appear in the “SourceFiles” filter like any other unfiltered source file. I…

---

## [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…

---

## [Problems with fortran an Xcode generator](https://discourse.cmake.org/t/problems-with-fortran-an-xcode-generator/11112)

<div class="topic-metadata">

**Author:** [@Fabian188](https://discourse.cmake.org/u/Fabian188)\
**Replies:** 2\
**Last updated:** [July 17, 2025, 4:06pm UTC](https://discourse.cmake.org/t/problems-with-fortran-an-xcode-generator/11112 "2025-07-17T16:06:28Z")

</div>

I don’t know if this a bug, principally not possible or if I’m doing something wrong. I have a C,C++,Fortran cmake project which builds nicely with Apple clang and gfortran from brew on macOS. Usually I use Eclipse wit…

---

## [find\_package() uses home directory](https://discourse.cmake.org/t/find-package-uses-home-directory/2993)

<div class="topic-metadata">

**Author:** [@abellgithub](https://discourse.cmake.org/u/abellgithub)\
**Replies:** 4\
**Last updated:** [July 17, 2025, 3:59pm UTC](https://discourse.cmake.org/t/find-package-uses-home-directory/2993 "2025-07-17T15:59:39Z")

</div>

Hi, find\_package() on OSX seems to use my home directory as a prefix to which it applies its rules for locating a package. I don’t see $HOME listed in the search procedure. Is it missing from the list? If not, which of …

---

## [How to remove default argument from linker command line](https://discourse.cmake.org/t/how-to-remove-default-argument-from-linker-command-line/14376)

<div class="topic-metadata">

**Author:** [@phx-veronica](https://discourse.cmake.org/u/phx-veronica)\
**Replies:** 2\
**Last updated:** [July 17, 2025, 3:56pm UTC](https://discourse.cmake.org/t/how-to-remove-default-argument-from-linker-command-line/14376 "2025-07-17T15:56:57Z")

</div>

I am using CMake to compile an EFI application for ARM64 with MSVC. EFI applications are not compatible with the /DYNAMICBASE linker command line switch, which CMake adds by default. For x86-64, it’s enough to add /DYNAM…

[Previous page](https://discourse.cmake.org/c/usage/12.md?page=7)

[Next page](https://discourse.cmake.org/c/usage/12.md?page=9)
