# Latest

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

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

**Page:** 192

---

## [How to statically link external library by target\_link\_libraries()?](https://discourse.cmake.org/t/how-to-statically-link-external-library-by-target-link-libraries/1718)

<div class="topic-metadata">

**Author:** [@yosukesan](https://discourse.cmake.org/u/yosukesan)\
**Replies:** 4\
**Last updated:** [August 19, 2020, 5:37pm UTC](https://discourse.cmake.org/t/how-to-statically-link-external-library-by-target-link-libraries/1718 "2020-08-19T17:37:32Z")

</div>

I am trying to achieve the equivalent of following command by CMake. gcc -static -O0 -g main.c /usr/lib/x86\_64-linux-gnu/libpthread.a My cmake script successfully built executable file, but gave segmentation fault at r…

---

## [Support for \`git describe\` output in a SemVer prerelease string](https://discourse.cmake.org/t/support-for-git-describe-output-in-a-semver-prerelease-string/1714)

<div class="topic-metadata">

**Author:** [@relliott](https://discourse.cmake.org/u/relliott)\
**Replies:** 4\
**Last updated:** [August 19, 2020, 4:16pm UTC](https://discourse.cmake.org/t/support-for-git-describe-output-in-a-semver-prerelease-string/1714 "2020-08-19T16:16:14Z")

</div>

Hello, I would like to have my project use the current output from git describe as the prerelease component of its SemVer version. I have a solution that seems to work in all but one corner case. I’m hoping to find a w…

---

## [orhestration](https://discourse.cmake.org/t/orhestration/1713)

<div class="topic-metadata">

**Author:** [@Tomasz](https://discourse.cmake.org/u/Tomasz)\
**Replies:** 0\
**Last updated:** [August 17, 2020, 7:29pm UTC](https://discourse.cmake.org/t/orhestration/1713 "2020-08-17T19:29:58Z")

</div>

Hi I have mid size project. Project is split trough modules(libs/exe) It also depends on external libs and framework. I have make constructed this project in that way: For all internal exe or libs I create it own CMa…

---

## [Unexpected/inconsistent behavior of cmake -E compare\_files](https://discourse.cmake.org/t/unexpected-inconsistent-behavior-of-cmake-e-compare-files/1680)

<div class="topic-metadata">

**Author:** [@arclight](https://discourse.cmake.org/u/arclight)\
**Replies:** 4\
**Last updated:** [August 17, 2020, 6:06pm UTC](https://discourse.cmake.org/t/unexpected-inconsistent-behavior-of-cmake-e-compare-files/1680 "2020-08-17T18:06:25Z")

</div>

I’m attempting to compare code output with reference text using CTest (add\_test()) and I’m getting some strange results which makes me think I’m not using cmake -E compare\_files correctly. The documentation and examples …

---

## [Skipping/selecting platform specific source files](https://discourse.cmake.org/t/skipping-selecting-platform-specific-source-files/1702)

<div class="topic-metadata">

**Author:** [@johan556](https://discourse.cmake.org/u/johan556)\
**Replies:** 1\
**Last updated:** [August 14, 2020, 5:21am UTC](https://discourse.cmake.org/t/skipping-selecting-platform-specific-source-files/1702 "2020-08-14T05:21:27Z")

</div>

I’m looking for a good way to select when platform specific source files should be included in the build. If I for example have “foo\_linux.cpp” and “foo\_windows.cpp”, I would like to select the appropriate version with a…

---

## [Issue building third party libraries and including them in same project](https://discourse.cmake.org/t/issue-building-third-party-libraries-and-including-them-in-same-project/1695)

<div class="topic-metadata">

**Author:** [@mattchabala](https://discourse.cmake.org/u/mattchabala)\
**Replies:** 1\
**Last updated:** [August 13, 2020, 3:43pm UTC](https://discourse.cmake.org/t/issue-building-third-party-libraries-and-including-them-in-same-project/1695 "2020-08-13T15:43:55Z")

</div>

Hello, I’m working on a simple project that uses a third party application to handle data. I’m using CMake to check if the third party application already exists on the machine and if it’s not then CMake downloads the l…

---

## [Generate CMake using .NET](https://discourse.cmake.org/t/generate-cmake-using-net/1682)

<div class="topic-metadata">

**Author:** [@Kush.Mishra](https://discourse.cmake.org/u/Kush.Mishra)\
**Replies:** 0\
**Last updated:** [August 10, 2020, 5:03am UTC](https://discourse.cmake.org/t/generate-cmake-using-net/1682 "2020-08-10T05:03:23Z")

</div>

Hi, I have just started to look into the CMake process and trying to create a .NET application that would generate or modify new or existing CMakeLists.txt at the given directory path. So, just wanted to know if there …

---

## [Cmake Cortex-M multitarget build](https://discourse.cmake.org/t/cmake-cortex-m-multitarget-build/1536)

<div class="topic-metadata">

**Author:** [@aphardt](https://discourse.cmake.org/u/aphardt)\
**Replies:** 8\
**Last updated:** [August 7, 2020, 11:06am UTC](https://discourse.cmake.org/t/cmake-cortex-m-multitarget-build/1536 "2020-08-07T11:06:12Z")

</div>

Hi Im trying to achieve a cmake build environment where i can build multiple targets (binaries) at once. cmake and make/ninja actually run successfully, but the generated ELF’s somehow do not run at all. When i run the…

---

## [Define a pre-build command without creating a new target](https://discourse.cmake.org/t/define-a-pre-build-command-without-creating-a-new-target/1623)

<div class="topic-metadata">

**Author:** [@Artemis](https://discourse.cmake.org/u/Artemis)\
**Replies:** 12\
**Last updated:** [August 5, 2020, 2:13pm UTC](https://discourse.cmake.org/t/define-a-pre-build-command-without-creating-a-new-target/1623 "2020-08-05T14:13:43Z")

</div>

After reading Professional CMake (almost) back to back, I’m once again asking for your support :upside\_down\_face: I’m struggling to define a fixed pre-build command for a target. I need to generate a header with the cur…

---

## [Feature Request: CURL\_EXECUTABLE](https://discourse.cmake.org/t/feature-request-curl-executable/1619)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 5\
**Last updated:** [August 4, 2020, 7:00pm UTC](https://discourse.cmake.org/t/feature-request-curl-executable/1619 "2020-08-04T19:00:02Z")

</div>

I was wondering if it would be possible to add to FindCURL.cmake the ability to return CURL\_EXECUTABLE much like FindWget.cmake returns WGET\_EXECUTABLE. I found myself recently having to figure out how to detect if I am…

---

## [cmake 3.17.0 generates target-NOTFOUND for configured target](https://discourse.cmake.org/t/cmake-3-17-0-generates-target-notfound-for-configured-target/1642)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 1:33pm UTC](https://discourse.cmake.org/t/cmake-3-17-0-generates-target-notfound-for-configured-target/1642 "2020-08-04T13:33:05Z")

</div>

Could you please advise what causes cmake to fail finding existing imported library target when generating build.make \_EXTERNAL\_OBJECTS list. cmake generates file ./build/mingw64/myprjsrc/CMakeFiles/myshared.dir/build.…

---

## [CPack + Wix + WixFirewallExtension - can I add a new xmlns to the filex.wxs file?](https://discourse.cmake.org/t/cpack-wix-wixfirewallextension-can-i-add-a-new-xmlns-to-the-filex-wxs-file/1569)

<div class="topic-metadata">

**Author:** [@bolz](https://discourse.cmake.org/u/bolz)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 12:08pm UTC](https://discourse.cmake.org/t/cpack-wix-wixfirewallextension-can-i-add-a-new-xmlns-to-the-filex-wxs-file/1569 "2020-08-04T12:08:56Z")

</div>

Hello, I’m rather new at using CPack, so please bear with me. I have a project for which I use CPack and Wix to create an msi. I need to add a firewall exception for the installed executable, but I get this error in wi…

---

## [How to use CPack IFW to generate desktop shortcuts?](https://discourse.cmake.org/t/how-to-use-cpack-ifw-to-generate-desktop-shortcuts/1663)

<div class="topic-metadata">

**Author:** [@Mr-jiayunfei](https://discourse.cmake.org/u/Mr-jiayunfei)\
**Replies:** 0\
**Last updated:** [August 4, 2020, 2:50am UTC](https://discourse.cmake.org/t/how-to-use-cpack-ifw-to-generate-desktop-shortcuts/1663 "2020-08-04T02:50:14Z")

</div>

How to use CPack IFW to generate desktop shortcuts? How to use CPack IFW to overwrite an existing installation? I use the Install frame work that comes with Qt to write scripts that can complete the function, but I wan…

---

## [CROSSCOMPILING\_EMULATOR property with emulator arguments for GoogleTest](https://discourse.cmake.org/t/crosscompiling-emulator-property-with-emulator-arguments-for-googletest/1659)

<div class="topic-metadata">

**Author:** [@jacand](https://discourse.cmake.org/u/jacand)\
**Replies:** 2\
**Last updated:** [August 3, 2020, 1:39pm UTC](https://discourse.cmake.org/t/crosscompiling-emulator-property-with-emulator-arguments-for-googletest/1659 "2020-08-03T13:39:22Z")

</div>

The CROSSCOMPILING\_EMULATOR property is a list where the first value is the executable and remaining values are arguments. Until (at least) 3.17.3 this property worked correctly with GoogleTest’s gtest\_discover\_tests. Si…

---

## [cmake part](https://discourse.cmake.org/t/cmake-part/1646)

<div class="topic-metadata">

**Author:** [@Tomasz](https://discourse.cmake.org/u/Tomasz)\
**Replies:** 2\
**Last updated:** [August 2, 2020, 6:00am UTC](https://discourse.cmake.org/t/cmake-part/1646 "2020-08-02T06:00:49Z")

</div>

Hi I have a part of CMake code ( to generate documentation in doxygen ) which I want to use in many not related each other projects. What is the best way to do this?

---

## [how to implement only configuration in the header file folder to add a folder?](https://discourse.cmake.org/t/how-to-implement-only-configuration-in-the-header-file-folder-to-add-a-folder/1652)

<div class="topic-metadata">

**Author:** [@mirro187](https://discourse.cmake.org/u/mirro187)\
**Replies:** 0\
**Last updated:** [July 31, 2020, 5:14am UTC](https://discourse.cmake.org/t/how-to-implement-only-configuration-in-the-header-file-folder-to-add-a-folder/1652 "2020-07-31T05:14:52Z")

</div>

---

## [CMake 3.18.1 available for download](https://discourse.cmake.org/t/cmake-3-18-1-available-for-download/1650)

<div class="topic-metadata">

**Author:** [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)\
**Replies:** 0\
**Last updated:** [July 30, 2020, 7:33pm UTC](https://discourse.cmake.org/t/cmake-3-18-1-available-for-download/1650 "2020-07-30T19:33:26Z")

</div>

We are pleased to announce that CMake 3.18.1 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Thanks for your support! Changes in 3.18.1 since 3.18.0: …

---

## [CMake 3.17.4 available for download](https://discourse.cmake.org/t/cmake-3-17-4-available-for-download/1649)

<div class="topic-metadata">

**Author:** [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)\
**Replies:** 0\
**Last updated:** [July 30, 2020, 7:32pm UTC](https://discourse.cmake.org/t/cmake-3-17-4-available-for-download/1649 "2020-07-30T19:32:08Z")

</div>

We are pleased to announce that CMake 3.17.4 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Thanks for your support! Changes in 3.17.4 since 3.17.3: …

---

## [MSVC\_RUNTIME\_LIBRARY ignored on command line](https://discourse.cmake.org/t/msvc-runtime-library-ignored-on-command-line/1644)

<div class="topic-metadata">

**Author:** [@SpareSimian](https://discourse.cmake.org/u/SpareSimian)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 3:37pm UTC](https://discourse.cmake.org/t/msvc-runtime-library-ignored-on-command-line/1644 "2020-07-30T15:37:56Z")

</div>

I’m trying to build libtiff on Win32 as a static library with static runtime linkage. I can’t seem to get the project to change the runtime library to static. Here’s my commands: cd g:\\devel\\libtiff\_out cmake.exe -G "Vi…

---

## [Add cmake.org as a search engine?](https://discourse.cmake.org/t/add-cmake-org-as-a-search-engine/1596)

<div class="topic-metadata">

**Author:** [@anon45792294](https://discourse.cmake.org/u/anon45792294)\
**Replies:** 9\
**Last updated:** [July 29, 2020, 8:03pm UTC](https://discourse.cmake.org/t/add-cmake-org-as-a-search-engine/1596 "2020-07-29T20:03:22Z")

</div>

I often need to look stuff up in cmake. It would be really nice if I could add cmake as a search engine in my browser. Example: cppreference.com (https://en.cppreference.com/w/Main\_Page) offers this functionality an…

---

## [fetchcontent how to override dependency details](https://discourse.cmake.org/t/fetchcontent-how-to-override-dependency-details/1639)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 1\
**Last updated:** [July 29, 2020, 3:00pm UTC](https://discourse.cmake.org/t/fetchcontent-how-to-override-dependency-details/1639 "2020-07-29T15:00:36Z")

</div>

When using FetchContent: I need to override dependency details for an already populated content. How do I do this? More specifically, I need to change the tag used for checkout on a git repository.

---

## [CPack / CPACK\_COMPONENTS\_ALL](https://discourse.cmake.org/t/cpack-cpack-components-all/1631)

<div class="topic-metadata">

**Author:** [@John\_Eivind\_Helset](https://discourse.cmake.org/u/John_Eivind_Helset)\
**Replies:** 1\
**Last updated:** [July 28, 2020, 10:58pm UTC](https://discourse.cmake.org/t/cpack-cpack-components-all/1631 "2020-07-28T22:58:55Z")

</div>

CPack clears out CPACK\_COMPONENTS\_ALL if there is only one component in it, event though the component was explicitly specified in the install commands, and CPACK\_EXTERNAL\_COMPONENT\_INSTALL was set to 1 (I was using an e…

---

## [Compatibility with gcc 4.9.2](https://discourse.cmake.org/t/compatibility-with-gcc-4-9-2/1637)

<div class="topic-metadata">

**Author:** [@Tamir\_Shmilovich](https://discourse.cmake.org/u/Tamir_Shmilovich)\
**Replies:** 1\
**Last updated:** [July 28, 2020, 8:16pm UTC](https://discourse.cmake.org/t/compatibility-with-gcc-4-9-2/1637 "2020-07-28T20:16:49Z")

</div>

Which versions of cmake are compatible with Gcc 4.9.2?

---

## [Makefile Generator indepent definition of compiler / linker options containing shell meta characters](https://discourse.cmake.org/t/makefile-generator-indepent-definition-of-compiler-linker-options-containing-shell-meta-characters/1534)

<div class="topic-metadata">

**Author:** [@raik](https://discourse.cmake.org/u/raik)\
**Replies:** 2\
**Last updated:** [July 28, 2020, 1:45pm UTC](https://discourse.cmake.org/t/makefile-generator-indepent-definition-of-compiler-linker-options-containing-shell-meta-characters/1534 "2020-07-28T13:45:32Z")

</div>

Hello, we are facing problems to define compiler or linker options inside cmake files that contain characters having some special meaning for make target commands interpreter in a CMakeGenerator independent way. Eg. When…

---

## [Why is not accessible the library built on top level directory under the test subdirectory?](https://discourse.cmake.org/t/why-is-not-accessible-the-library-built-on-top-level-directory-under-the-test-subdirectory/1614)

<div class="topic-metadata">

**Author:** [@tiborkiss](https://discourse.cmake.org/u/tiborkiss)\
**Replies:** 4\
**Last updated:** [July 28, 2020, 12:15pm UTC](https://discourse.cmake.org/t/why-is-not-accessible-the-library-built-on-top-level-directory-under-the-test-subdirectory/1614 "2020-07-28T12:15:08Z")

</div>

I have a library module which has some tests under test subdirectory. The test binaries are built and linked to the library from the top level, but when the tests are executed, does not find the shared object. The share…

---

## [Finding library names and locations](https://discourse.cmake.org/t/finding-library-names-and-locations/1622)

<div class="topic-metadata">

**Author:** [@normvcr](https://discourse.cmake.org/u/normvcr)\
**Replies:** 2\
**Last updated:** [July 27, 2020, 1:22am UTC](https://discourse.cmake.org/t/finding-library-names-and-locations/1622 "2020-07-27T01:22:28Z")

</div>

The command ‘’‘find\_package(Qt5 COMPONENTS Widgets REQUIRED CONFIG)’’’ seems to work, as Qt5\_FOUND is true, and Qt5Widgets\_INCLUDE\_DIRS has the correct include folders. However, Qt5Widgets\_LIBRARIES only has “Qt5::Wi…

---

## [FindMPI error: Failed with exit code 1](https://discourse.cmake.org/t/findmpi-error-failed-with-exit-code-1/1616)

<div class="topic-metadata">

**Author:** [@danlipsa](https://discourse.cmake.org/u/danlipsa)\
**Replies:** 1\
**Last updated:** [July 24, 2020, 11:27pm UTC](https://discourse.cmake.org/t/findmpi-error-failed-with-exit-code-1/1616 "2020-07-24T23:27:37Z")

</div>

This is the full error: \[ 96%\] Performing configure step for 'paraview' Not searching for unused variables given on the command line. -- Could not use git to determine source version, using version 5.8.1-RC2 -- Could NO…

---

## [cmake 3.17.0-3.17.2 won't bootstrap with icpc (Parallel Studio 2020 SP1 on CentOS8.1)](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131)

<div class="topic-metadata">

**Author:** [@arwild01](https://discourse.cmake.org/u/arwild01)\
**Replies:** 3\
**Last updated:** [July 24, 2020, 10:45am UTC](https://discourse.cmake.org/t/cmake-3-17-0-3-17-2-wont-bootstrap-with-icpc-parallel-studio-2020-sp1-on-centos8-1/1131 "2020-07-24T10:45:39Z")

</div>

icpc version number is actually 19.1.1.217 I haven’t tested other parallel studio’s but I had no problems building 3.16.2 with it. The issue appears to be this line that appeared in bootstrap in 3.17.0 #if (\_\_cplusplu…

---

## [CPack: distributing both shared and static libraries](https://discourse.cmake.org/t/cpack-distributing-both-shared-and-static-libraries/1225)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cmake.org/u/alex)\
**Replies:** 9\
**Last updated:** [July 23, 2020, 11:49pm UTC](https://discourse.cmake.org/t/cpack-distributing-both-shared-and-static-libraries/1225 "2020-07-23T23:49:00Z")

</div>

Before switching to CMake we were able to distribute tarballs containing our library as both a static library and a shared library (at least on Linux and macOS). What is the preferred way to do this with CMake 3.16+?

---

## [Delay in operation of file(GENERATE ...](https://discourse.cmake.org/t/delay-in-operation-of-file-generate/1611)

<div class="topic-metadata">

**Author:** [@EosPengwern](https://discourse.cmake.org/u/EosPengwern)\
**Replies:** 6\
**Last updated:** [July 23, 2020, 10:42pm UTC](https://discourse.cmake.org/t/delay-in-operation-of-file-generate/1611 "2020-07-23T22:42:12Z")

</div>

This little bit of code: file(GENERATE OUTPUT ${CMAKE\_CURRENT\_BINARY\_DIR}/empty\_pch.cxx CONTENT "/\* empty file \*/") target\_sources(CommonPCH\_Lib PRIVATE ${CMAKE\_CURRENT\_BINARY\_DIR}/empty\_pch.cxx) … works perf…

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

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