# Latest

**URL:** https://discourse.cmake.org/latest.md?page=180

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

**Page:** 181

---

## [VS generator add switch before /link switch](https://discourse.cmake.org/t/vs-generator-add-switch-before-link-switch/2425)

<div class="topic-metadata">

**Author:** [@amontse](https://discourse.cmake.org/u/amontse)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 9:24am UTC](https://discourse.cmake.org/t/vs-generator-add-switch-before-link-switch/2425 "2020-12-24T09:24:19Z")

</div>

Hello, The following mimic command to be run during the Link stage is generated by CMake with VS generator: cl.exe /Fe"out.exe" main.obj /Zi /WX- /MDd /nologo /link /machine:x64 kernel32.lib user32.lib gdi32.lib winspo…

---

## [Evaluating effective target setting via generator expression](https://discourse.cmake.org/t/evaluating-effective-target-setting-via-generator-expression/2389)

<div class="topic-metadata">

**Author:** [@hsattler](https://discourse.cmake.org/u/hsattler)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 7:34am UTC](https://discourse.cmake.org/t/evaluating-effective-target-setting-via-generator-expression/2389 "2020-12-24T07:34:32Z")

</div>

Hi, I want to add a link flag when the target effectively used LTO optimization. So somwhere top-level I write: add\_link\_options ( $\<$\<BOOL:$\<TARGET\_PROPERTY:INTERPROCEDURAL\_OPTIMIZATION\>\>:-flto=8\> ) This works, if I …

---

## [Kitware/CMake/Tests/VSWindowsFormsResx/CMakeLists.txt: Line 34. Purpose?](https://discourse.cmake.org/t/kitware-cmake-tests-vswindowsformsresx-cmakelists-txt-line-34-purpose/2412)

<div class="topic-metadata">

**Author:** [@Henripru](https://discourse.cmake.org/u/Henripru)\
**Replies:** 0\
**Last updated:** [December 22, 2020, 11:28pm UTC](https://discourse.cmake.org/t/kitware-cmake-tests-vswindowsformsresx-cmakelists-txt-line-34-purpose/2412 "2020-12-22T23:28:07Z")

</div>

Setting up a cmake build for a windows forms application for the first time. Kitware/CMake/Tests/VSWindowsFormsResx/CMakeLists.txt line 34: set(TARGET\_LIBRARIES ${SYSLIBS}). Can someone please explain what this does? M…

---

## [FetchContent path handling changed?](https://discourse.cmake.org/t/fetchcontent-path-handling-changed/2400)

<div class="topic-metadata">

**Author:** [@fry](https://discourse.cmake.org/u/fry)\
**Replies:** 8\
**Last updated:** [December 22, 2020, 2:07pm UTC](https://discourse.cmake.org/t/fetchcontent-path-handling-changed/2400 "2020-12-22T14:07:11Z")

</div>

I have a project that does this: set(JAMBA\_ROOT\_DIR "../../pongasoft/jamba") ... include(FetchContent) if(JAMBA\_ROOT\_DIR) # instructs FetchContent to not download or update but use the location instead set(FETCHCON…

---

## [Checking for target-less components existence in config files](https://discourse.cmake.org/t/checking-for-target-less-components-existence-in-config-files/2364)

<div class="topic-metadata">

**Author:** [@Artemis](https://discourse.cmake.org/u/Artemis)\
**Replies:** 5\
**Last updated:** [December 21, 2020, 11:17am UTC](https://discourse.cmake.org/t/checking-for-target-less-components-existence-in-config-files/2364 "2020-12-21T11:17:21Z")

</div>

Assuming a separated export file for every install component. In the book “Professional CMake” it’s suggested, as a recommended practice, that consumable projects should let users install runtime only components (binari…

---

## [How to delete or rename an imported target using cmake?](https://discourse.cmake.org/t/how-to-delete-or-rename-an-imported-target-using-cmake/2372)

<div class="topic-metadata">

**Author:** [@sunshine\_boycn](https://discourse.cmake.org/u/sunshine_boycn)\
**Replies:** 2\
**Last updated:** [December 21, 2020, 12:42am UTC](https://discourse.cmake.org/t/how-to-delete-or-rename-an-imported-target-using-cmake/2372 "2020-12-21T00:42:24Z")

</div>

Dear every one: When I was using CMake, I encounter a problem. I am trying to use ccd lib from github for my project. However, the ccd lib exports ccd-targets.cmake using the same name for different configurations suc…

---

## [CMake's add\_custom\_command doesnt trigger rebuild of library](https://discourse.cmake.org/t/cmakes-add-custom-command-doesnt-trigger-rebuild-of-library/2376)

<div class="topic-metadata">

**Author:** [@skreyer](https://discourse.cmake.org/u/skreyer)\
**Replies:** 2\
**Last updated:** [December 18, 2020, 12:00pm UTC](https://discourse.cmake.org/t/cmakes-add-custom-command-doesnt-trigger-rebuild-of-library/2376 "2020-12-18T12:00:18Z")

</div>

Hello, Iam using CMake together with ninja to build a library. The library is depending on some code which may be generated before-hand by a custom command. The source for this code is within the source-tree and it must…

---

## [cmake gives current working directory cannot establish error](https://discourse.cmake.org/t/cmake-gives-current-working-directory-cannot-establish-error/2319)

<div class="topic-metadata">

**Author:** [@jalpan](https://discourse.cmake.org/u/jalpan)\
**Replies:** 8\
**Last updated:** [December 18, 2020, 10:55am UTC](https://discourse.cmake.org/t/cmake-gives-current-working-directory-cannot-establish-error/2319 "2020-12-18T10:55:58Z")

</div>

while executing cmake command it gives me the following error “Current working directory cannot be established.” I have executed cmake command from the shell script. rm -rf build && mkdir -p build && cd build && cma…

---

## [unset all variables from find\_package()](https://discourse.cmake.org/t/unset-all-variables-from-find-package/2386)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.cmake.org/u/kerim)\
**Replies:** 6\
**Last updated:** [December 17, 2020, 4:26pm UTC](https://discourse.cmake.org/t/unset-all-variables-from-find-package/2386 "2020-12-17T16:26:46Z")

</div>

Hi, My task is to allow user to decide whether to use superbuild or manually specify \_DIR to a library. I’m interested in the situation when user uses CMake-GUI and at first he set USE\_SUPERBUILD = ON and specify path…

---

## [How to use target\_compile\_options only for Debug build?](https://discourse.cmake.org/t/how-to-use-target-compile-options-only-for-debug-build/2388)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 4\
**Last updated:** [December 17, 2020, 3:53pm UTC](https://discourse.cmake.org/t/how-to-use-target-compile-options-only-for-debug-build/2388 "2020-12-17T15:53:31Z")

</div>

I want to add gcc compiler option -Og for Debug builds only. I have tried: add\_compile\_options("$\<$\<CONFIG:DEBUG\>:-Og\>") but that does not seem to work. I believe target\_compile\_options is preferred. How would I use …

---

## [cmake generates compiler options not supported](https://discourse.cmake.org/t/cmake-generates-compiler-options-not-supported/2391)

<div class="topic-metadata">

**Author:** [@jfavre](https://discourse.cmake.org/u/jfavre)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 3:36pm UTC](https://discourse.cmake.org/t/cmake-generates-compiler-options-not-supported/2391 "2020-12-17T15:36:46Z")

</div>

While compiling ParaView 5.9, my cmake (v3.19.2) generates compilation options which my compiler does not support. How can I prevent that? cd /run/user/1100/ParaView/ParaViewBuild/VTK/Wrapping/Python && /scratch/e1000/…

---

## [Have a log file with a number increment every time ctest is run](https://discourse.cmake.org/t/have-a-log-file-with-a-number-increment-every-time-ctest-is-run/2325)

<div class="topic-metadata">

**Author:** [@jverdicchio](https://discourse.cmake.org/u/jverdicchio)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 3:12pm UTC](https://discourse.cmake.org/t/have-a-log-file-with-a-number-increment-every-time-ctest-is-run/2325 "2020-12-17T15:12:13Z")

</div>

Our group’s BASH driven test suite automatically increments the results to a log file: run001.log and run001.sum next would be run002.log and run002.sum I’m looking at converting the suite to run under CTest. My ini…

---

## [using \<packagename\>\_ROOT does not appear to be used by find\_program(\<packagename\>)](https://discourse.cmake.org/t/using-packagename-root-does-not-appear-to-be-used-by-find-program-packagename/2381)

<div class="topic-metadata">

**Author:** [@grimgort](https://discourse.cmake.org/u/grimgort)\
**Replies:** 5\
**Last updated:** [December 17, 2020, 12:56pm UTC](https://discourse.cmake.org/t/using-packagename-root-does-not-appear-to-be-used-by-find-program-packagename/2381 "2020-12-17T12:56:34Z")

</div>

Hello, the following lines of codes can’t find my sqlite3.exe. Is this normal? set(EXE\_SQLITE3\_ROOT D:/ftarroux/Documents/FRED/BaseGit/simbox\_externalProject/install/Windows-MSVC-1916-Win32/sqlite/bin/) find\_program(E…

---

## [Why is mark\_as\_advanced() considered a scripting command](https://discourse.cmake.org/t/why-is-mark-as-advanced-considered-a-scripting-command/2387)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 1\
**Last updated:** [December 17, 2020, 12:44pm UTC](https://discourse.cmake.org/t/why-is-mark-as-advanced-considered-a-scripting-command/2387 "2020-12-17T12:44:16Z")

</div>

I’m wondering why the mark\_as\_advanced() command is considered a scripting command. It’s sole purpose is for marking cache variables as advanced or not, but cache variables only make sense for projects. Does this command…

---

## [Allow to manually set dependencies for some targets](https://discourse.cmake.org/t/allow-to-manually-set-dependencies-for-some-targets/2355)

<div class="topic-metadata">

**Author:** [@james\_brown](https://discourse.cmake.org/u/james_brown)\
**Replies:** 6\
**Last updated:** [December 17, 2020, 12:21am UTC](https://discourse.cmake.org/t/allow-to-manually-set-dependencies-for-some-targets/2355 "2020-12-17T00:21:56Z")

</div>

Hi, I would like to know if CMake provide a way of fixing dependencies for a particular targets. The use-case is to build once, analyze result’s real dependencies with a custom script(linker map or dwarf+nm, gcc -M), a…

---

## [CMake 3.19.2 available for download](https://discourse.cmake.org/t/cmake-3-19-2-available-for-download/2382)

<div class="topic-metadata">

**Author:** [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)\
**Replies:** 0\
**Last updated:** [December 16, 2020, 4:12pm UTC](https://discourse.cmake.org/t/cmake-3-19-2-available-for-download/2382 "2020-12-16T16:12:20Z")

</div>

We are pleased to announce that CMake 3.19.2 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Starting with CMake 3.19.2 Apple ARM is now supported: T…

---

## [Difference between linking external built and installed library](https://discourse.cmake.org/t/difference-between-linking-external-built-and-installed-library/2369)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.cmake.org/u/kerim)\
**Replies:** 3\
**Last updated:** [December 15, 2020, 11:01pm UTC](https://discourse.cmake.org/t/difference-between-linking-external-built-and-installed-library/2369 "2020-12-15T23:01:42Z")

</div>

Hi, In my project A I use ExternalProject\_Add function to build some third party library B and then I’m going to use this library inside my project A. I guess there two options are available: build B lib build and in…

---

## [add linker/archive options before and after a target](https://discourse.cmake.org/t/add-linker-archive-options-before-and-after-a-target/2373)

<div class="topic-metadata">

**Author:** [@gbug](https://discourse.cmake.org/u/gbug)\
**Replies:** 3\
**Last updated:** [December 15, 2020, 9:12pm UTC](https://discourse.cmake.org/t/add-linker-archive-options-before-and-after-a-target/2373 "2020-12-15T21:12:02Z")

</div>

I have a library which symbols should be imported to an app despite the fact they aren’t used explicitly there. The purpose of the library is to execute static constructors and thus make itself available to an app at run…

---

## [ctest with LABELS to classify tests](https://discourse.cmake.org/t/ctest-with-labels-to-classify-tests/2375)

<div class="topic-metadata">

**Author:** [@jverdicchio](https://discourse.cmake.org/u/jverdicchio)\
**Replies:** 1\
**Last updated:** [December 15, 2020, 4:14pm UTC](https://discourse.cmake.org/t/ctest-with-labels-to-classify-tests/2375 "2020-12-15T16:14:51Z")

</div>

In my software group we have a test suite that is controlled and run using bash scripts. I’m proposing using CTest and some python to replace these scripts. The test suite contains around 50 cases but we are planning on…

---

## [this commond exe in some computers very slowly](https://discourse.cmake.org/t/this-commond-exe-in-some-computers-very-slowly/2378)

<div class="topic-metadata">

**Author:** [@renpengcheng4612](https://discourse.cmake.org/u/renpengcheng4612)\
**Replies:** 2\
**Last updated:** [December 15, 2020, 4:03pm UTC](https://discourse.cmake.org/t/this-commond-exe-in-some-computers-very-slowly/2378 "2020-12-15T16:03:04Z")

</div>

\[cmake\] D:\\HarmonySdk\\3.0.1.93\\native\\3.0.1.93\\build-tools\\cmake\\bin\\cmake.exe -HC:\\Users\\Administrator\\DevEcoStudioProjects\\cpptest\\entry\\src\\main\\cpp\\ -BC:\\Users\\Administrator\\DevEcoStudioProjects\\cpptest\\entry.cxx\\deb…

---

## [compile slowly](https://discourse.cmake.org/t/compile-slowly/2377)

<div class="topic-metadata">

**Author:** [@renpengcheng4612](https://discourse.cmake.org/u/renpengcheng4612)\
**Replies:** 0\
**Last updated:** [December 15, 2020, 3:18pm UTC](https://discourse.cmake.org/t/compile-slowly/2377 "2020-12-15T15:18:46Z")

</div>

https://gitlab.kitware.com/cmake/cmake/-/issues/21602 is the commond have some issue ?

---

## [parralelise ExternalProject](https://discourse.cmake.org/t/parralelise-externalproject/2321)

<div class="topic-metadata">

**Author:** [@grimgort](https://discourse.cmake.org/u/grimgort)\
**Replies:** 4\
**Last updated:** [December 15, 2020, 2:58pm UTC](https://discourse.cmake.org/t/parralelise-externalproject/2321 "2020-12-15T14:58:29Z")

</div>

Hello, I would like to parallel compile with ExternalProject\_add. I use MSVC to compile (VSCODE) the -J N option doesn’t compile in parallel inside externalProject.I tried to switch -jN to the CMAKE\_ARGS option, but it…

---

## [Proposal/RFC: "Since" annotations in CMake documentation](https://discourse.cmake.org/t/proposal-rfc-since-annotations-in-cmake-documentation/960)

<div class="topic-metadata">

**Author:** [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)\
**Replies:** 6\
**Last updated:** [December 15, 2020, 2:06pm UTC](https://discourse.cmake.org/t/proposal-rfc-since-annotations-in-cmake-documentation/960 "2020-12-15T14:06:42Z")

</div>

(I waffled over what section to post this in, before settling on this one. apologies if I got that wrong.) If, like me, you’re involved in a project that requires build-system compatibility with a wide range of CMake ve…

---

## [Get the final install prefix at install-time](https://discourse.cmake.org/t/get-the-final-install-prefix-at-install-time/2357)

<div class="topic-metadata">

**Author:** [@Artemis](https://discourse.cmake.org/u/Artemis)\
**Replies:** 7\
**Last updated:** [December 15, 2020, 2:00pm UTC](https://discourse.cmake.org/t/get-the-final-install-prefix-at-install-time/2357 "2020-12-15T14:00:57Z")

</div>

Hi, I’m working on a C library project that provides some examples. The examples are contained in a self contained subproject, and can be built from both the top library project (as normal executable targets) or instal…

---

## [CMAKE\_INSTALL\_PREFIX in Spanish on Windows](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361)

<div class="topic-metadata">

**Author:** [@MelvinG24](https://discourse.cmake.org/u/MelvinG24)\
**Replies:** 6\
**Last updated:** [December 15, 2020, 3:59am UTC](https://discourse.cmake.org/t/cmake-install-prefix-in-spanish-on-windows/2361 "2020-12-15T03:59:43Z")

</div>

How can I define CMAKE\_INSTALL\_PREFIX if Windows is in English to go to C:\\program file\\ and if Windows is in Spanish to go to C:\\Archivos de Programas\\

---

## [Race condition when multi add\_custom\_target deps on same file generated by add\_custom\_command](https://discourse.cmake.org/t/race-condition-when-multi-add-custom-target-deps-on-same-file-generated-by-add-custom-command/2358)

<div class="topic-metadata">

**Author:** [@hehaoqian](https://discourse.cmake.org/u/hehaoqian)\
**Replies:** 4\
**Last updated:** [December 14, 2020, 5:39pm UTC](https://discourse.cmake.org/t/race-condition-when-multi-add-custom-target-deps-on-same-file-generated-by-add-custom-command/2358 "2020-12-14T17:39:44Z")

</div>

TLDR: I do not understand the behavior of add\_custom\_command/add\_custom\_target when multiple of add\_custom\_command/add\_custom\_target depends on the same generated file created by add\_custom\_command in the same directory…

---

## [Chained compilation](https://discourse.cmake.org/t/chained-compilation/2365)

<div class="topic-metadata">

**Author:** [@robiwano](https://discourse.cmake.org/u/robiwano)\
**Replies:** 3\
**Last updated:** [December 14, 2020, 2:03pm UTC](https://discourse.cmake.org/t/chained-compilation/2365 "2020-12-14T14:03:00Z")

</div>

I’m looking for a way to create a new language, let’s call it LLVM :), and the compilation from C++ to object file would go through: C++ -\> LLVM -\> C -\> object file where LLVM -\> C compilation is defined via https://g…

---

## [A question about cmake-gui](https://discourse.cmake.org/t/a-question-about-cmake-gui/2362)

<div class="topic-metadata">

**Author:** [@Coderx7](https://discourse.cmake.org/u/Coderx7)\
**Replies:** 1\
**Last updated:** [December 13, 2020, 7:10pm UTC](https://discourse.cmake.org/t/a-question-about-cmake-gui/2362 "2020-12-13T19:10:23Z")

</div>

Hello everyone, hope you are having a great day. I’m pretty new to CMake and I have some questions that I’d greatly appreciate if you could lend me a helping hand. Basically, I’m trying to build Pytorch from source on …

---

## [Pull in CMake Files via FetchContent](https://discourse.cmake.org/t/pull-in-cmake-files-via-fetchcontent/2315)

<div class="topic-metadata">

**Author:** [@Leon0402](https://discourse.cmake.org/u/Leon0402)\
**Replies:** 5\
**Last updated:** [December 12, 2020, 9:24pm UTC](https://discourse.cmake.org/t/pull-in-cmake-files-via-fetchcontent/2315 "2020-12-12T21:24:00Z")

</div>

Hi, I wanted to use cmake scripts provided by Catch2 and used the following code: FetchContent\_GetProperties(Catch2) if(NOT catch2\_POPULATED) FetchContent\_Populate(Catch2) add\_subdirectory(${catch2\_SOURCE\_DIR} …

---

## [Python3\_FIND\_STRATEGY missing python3 link](https://discourse.cmake.org/t/python3-find-strategy-missing-python3-link/2056)

<div class="topic-metadata">

**Author:** [@gruenich](https://discourse.cmake.org/u/gruenich)\
**Replies:** 8\
**Last updated:** [December 12, 2020, 7:18pm UTC](https://discourse.cmake.org/t/python3-find-strategy-missing-python3-link/2056 "2020-12-12T19:18:38Z")

</div>

FindPython3 offers two strategies: VERSION and LOCATION. From a user’s point of view, the best strategy would be to check what python3 is referring to. Assume two version of Python are installed (3.6 and 3.7) and 3.6 is…

[Previous page](https://discourse.cmake.org/latest.md?page=179)

[Next page](https://discourse.cmake.org/latest.md?page=181)
