# Latest

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

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

**Page:** 177

---

## [Linking libraries computed at build time](https://discourse.cmake.org/t/linking-libraries-computed-at-build-time/2617)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 3\
**Last updated:** [January 26, 2021, 2:20pm UTC](https://discourse.cmake.org/t/linking-libraries-computed-at-build-time/2617 "2021-01-26T14:20:04Z")

</div>

I have an interesting use case involving static libraries. Let’s say a particular target needs to link to a set of static libraries that isn’t known when CMake is run. The project builds a tool which scans files and work…

---

## [cmake failed to get the value of VCTargetsPath with VS2019 16.7](https://discourse.cmake.org/t/cmake-failed-to-get-the-value-of-vctargetspath-with-vs2019-16-7/1839)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 16\
**Last updated:** [January 25, 2021, 4:26pm UTC](https://discourse.cmake.org/t/cmake-failed-to-get-the-value-of-vctargetspath-with-vs2019-16-7/1839 "2021-01-25T16:26:16Z")

</div>

Hey guys, I’m using the latest CMake Version fpr Windows 10 64 Bit (at the moment this is 3.18.2) and the latest VS2019 version (16.7.3) Now when i run the Cmake generator with the following cmd cmake -G Visual Studio…

---

## [Can't find ZLIB (missing: ZLIB\_LIBRARY) Ubuntu 20 CMake](https://discourse.cmake.org/t/cant-find-zlib-missing-zlib-library-ubuntu-20-cmake/2610)

<div class="topic-metadata">

**Author:** [@cubbins](https://discourse.cmake.org/u/cubbins)\
**Replies:** 2\
**Last updated:** [January 25, 2021, 3:33pm UTC](https://discourse.cmake.org/t/cant-find-zlib-missing-zlib-library-ubuntu-20-cmake/2610 "2021-01-25T15:33:30Z")

</div>

I am compiling github’s OpenROAD. Following the instructions. github clone cd OpenROAD mkdir build, and cmake … The cmake checks, proceeds and stops, with an error ‘Could NOT find ZLIB’ I have issued the command, w…

---

## [How to include a generated header without referencing the buidl directory manually?](https://discourse.cmake.org/t/how-to-include-a-generated-header-without-referencing-the-buidl-directory-manually/2573)

<div class="topic-metadata">

**Author:** [@MichaWiedenmann](https://discourse.cmake.org/u/MichaWiedenmann)\
**Replies:** 2\
**Last updated:** [January 25, 2021, 10:05am UTC](https://discourse.cmake.org/t/how-to-include-a-generated-header-without-referencing-the-buidl-directory-manually/2573 "2021-01-25T10:05:32Z")

</div>

I have a idl-file. During the build a header gets generated in the intermediate directory. How can I include this header in my source? Currently I am including the header with the path to the intermediate directory. Thi…

---

## [Include directories for target\_precompile\_headers](https://discourse.cmake.org/t/include-directories-for-target-precompile-headers/2607)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)\
**Replies:** 2\
**Last updated:** [January 23, 2021, 6:23pm UTC](https://discourse.cmake.org/t/include-directories-for-target-precompile-headers/2607 "2021-01-23T18:23:24Z")

</div>

I have this CMakeLists.txt: cmake\_minimum\_required(VERSION 3.18) project(ocv VERSION 0.1.0) find\_package(fmt REQUIRED) find\_package(OpenCV REQUIRED) add\_executable(ocv main.cpp grid.cpp) include\_directories( /home/…

---

## [file(GET\_RUNTIME\_DEPENDENCIES) issues](https://discourse.cmake.org/t/file-get-runtime-dependencies-issues/2574)

<div class="topic-metadata">

**Author:** [@YMba9g8j9CJp0wLoQf5y](https://discourse.cmake.org/u/YMba9g8j9CJp0wLoQf5y)\
**Replies:** 18\
**Last updated:** [January 22, 2021, 5:50pm UTC](https://discourse.cmake.org/t/file-get-runtime-dependencies-issues/2574 "2021-01-22T17:50:16Z")

</div>

EDITED: This thread has become more about issues/bugs with file(GET\_RUNTIME\_DEPENDENCIES) which is completely different than the intended topic. To not confuse future readers I’ve edited the issue.

---

## [Filtering symbols from WINDOWS\_EXPORT\_ALL\_SYMBOLS?](https://discourse.cmake.org/t/filtering-symbols-from-windows-export-all-symbols/2598)

<div class="topic-metadata">

**Author:** [@steven-johnson](https://discourse.cmake.org/u/steven-johnson)\
**Replies:** 8\
**Last updated:** [January 22, 2021, 5:20pm UTC](https://discourse.cmake.org/t/filtering-symbols-from-windows-export-all-symbols/2598 "2021-01-22T17:20:00Z")

</div>

When I build a shared library / DLL, I’d like to be able to selectively export only symbols that match certain pattern (e.g. the ‘public’ namespace for my library), excluding things that are internal, or brought in from …

---

## [problems following the CMake library & cross compiling tutorial](https://discourse.cmake.org/t/problems-following-the-cmake-library-cross-compiling-tutorial/2601)

<div class="topic-metadata">

**Author:** [@w461](https://discourse.cmake.org/u/w461)\
**Replies:** 3\
**Last updated:** [January 22, 2021, 3:22pm UTC](https://discourse.cmake.org/t/problems-following-the-cmake-library-cross-compiling-tutorial/2601 "2021-01-22T15:22:21Z")

</div>

Hi, I am tying to combine the CMake library tutorial and Cross Compiling (https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-or-watchos) with the Dart C interoperability tutor…

---

## [How to find third-party header files in /Applications on MacOS?](https://discourse.cmake.org/t/how-to-find-third-party-header-files-in-applications-on-macos/2597)

<div class="topic-metadata">

**Author:** [@tomoreilly](https://discourse.cmake.org/u/tomoreilly)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 1:58pm UTC](https://discourse.cmake.org/t/how-to-find-third-party-header-files-in-applications-on-macos/2597 "2021-01-22T13:58:25Z")

</div>

What CMAKE\_ variable should I include in the PATHS argument to find\_file(), such that /Applications will be searched on MacOS? For example: I’m running MacOS 10.13.6 (“High Sierra”), and I’ve installed a third-party app…

---

## [express the right dependencies in CMake](https://discourse.cmake.org/t/express-the-right-dependencies-in-cmake/2333)

<div class="topic-metadata">

**Author:** [@Massimiliano\_Cialdi](https://discourse.cmake.org/u/Massimiliano_Cialdi)\
**Replies:** 7\
**Last updated:** [January 22, 2021, 11:37am UTC](https://discourse.cmake.org/t/express-the-right-dependencies-in-cmake/2333 "2021-01-22T11:37:45Z")

</div>

Hi, in my projects I have a header file that is generated at build-time. It is included from a single .c file. So the chain of dependencies would be as follows: executable -\> file.o -\> header generated. How is it poss…

---

## [How to select NSIS on a non standard location](https://discourse.cmake.org/t/how-to-select-nsis-on-a-non-standard-location/2570)

<div class="topic-metadata">

**Author:** [@Mathieu\_Westphal](https://discourse.cmake.org/u/Mathieu_Westphal)\
**Replies:** 3\
**Last updated:** [January 22, 2021, 9:12am UTC](https://discourse.cmake.org/t/how-to-select-nsis-on-a-non-standard-location/2570 "2021-01-22T09:12:50Z")

</div>

I have a computer that need to run NSIS for packaging with cpack, however the NSIS installed version on the system is not complete and needs to be patched (by adding an include file) in order to support the needs of my p…

---

## [iMac Catalina and cmake-3.19.3](https://discourse.cmake.org/t/imac-catalina-and-cmake-3-19-3/2572)

<div class="topic-metadata">

**Author:** [@szukw000](https://discourse.cmake.org/u/szukw000)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 12:10am UTC](https://discourse.cmake.org/t/imac-catalina-and-cmake-3-19-3/2572 "2021-01-22T00:10:59Z")

</div>

I have a project that uses fltk, libjpeg and libz. The cmake configuration file contains: cmake \\ -DCMAKE\_BUILD\_TYPE:string=“Release” \\ -DZLIB\_INCLUDE\_DIR:path=“/usr/local/include” \\ -DZLIB\_LIBRARY:path=“/usr/local…

---

## [use cmake to generate pdb](https://discourse.cmake.org/t/use-cmake-to-generate-pdb/2583)

<div class="topic-metadata">

**Author:** [@NanaSeino233](https://discourse.cmake.org/u/NanaSeino233)\
**Replies:** 8\
**Last updated:** [January 21, 2021, 3:24pm UTC](https://discourse.cmake.org/t/use-cmake-to-generate-pdb/2583 "2021-01-21T15:24:22Z")

</div>

我正在使用cmake编译leptonica1.78，在生成sln方案后，我使用了vs2017来生成.dll动态链接库， 当用实用工具cppan-d-b-d来生成pvt.cppan.demo.jpeg-9.2.0.dll等依赖时，并没有生成pdb文件，由于配置属性是utility，在vs2017中无法更改设置。 我想请教一下cmake中有没有指令可以配置utility生成pdb文件。 目前尝试过的指令是 “set(CMAKE\_CXX…

---

## [CMake: Common dependency between different projects](https://discourse.cmake.org/t/cmake-common-dependency-between-different-projects/2593)

<div class="topic-metadata">

**Author:** [@pmylon](https://discourse.cmake.org/u/pmylon)\
**Replies:** 1\
**Last updated:** [January 21, 2021, 3:19pm UTC](https://discourse.cmake.org/t/cmake-common-dependency-between-different-projects/2593 "2021-01-21T15:19:15Z")

</div>

Hello! I have a question regarding a project (C++, CMake) I am working on. Let’s assume the following simplified project structure for demonstration purposes (each folder contains some source and header files): demo\_pr…

---

## [ExternalProject Premature Completion](https://discourse.cmake.org/t/externalproject-premature-completion/1690)

<div class="topic-metadata">

**Author:** [@jameskr97](https://discourse.cmake.org/u/jameskr97)\
**Replies:** 2\
**Last updated:** [January 21, 2021, 7:07am UTC](https://discourse.cmake.org/t/externalproject-premature-completion/1690 "2021-01-21T07:07:36Z")

</div>

Hi CMake Community, I’m currently trying to add crashpad as a dependency to my C++ project. I have chosen to gather all the dependencies from chromium needed to build my project, and even go as far to commit some binari…

---

## [Problem: Differences in detected default WindowsSDK on two different machines](https://discourse.cmake.org/t/problem-differences-in-detected-default-windowssdk-on-two-different-machines/2585)

<div class="topic-metadata">

**Author:** [@sophonet](https://discourse.cmake.org/u/sophonet)\
**Replies:** 6\
**Last updated:** [January 21, 2021, 5:51am UTC](https://discourse.cmake.org/t/problem-differences-in-detected-default-windowssdk-on-two-different-machines/2585 "2021-01-21T05:51:31Z")

</div>

Hi community, there is a strange behavior when running CMake with the Visual Studio 15 2017 Win64 generator on two different machines using the same version of Visual Studio 2017 and the same version of CMake (3.19.3): …

---

## [Exporting renamed/multiple-named configs](https://discourse.cmake.org/t/exporting-renamed-multiple-named-configs/2586)

<div class="topic-metadata">

**Author:** [@ferdnyc](https://discourse.cmake.org/u/ferdnyc)\
**Replies:** 2\
**Last updated:** [January 20, 2021, 10:16pm UTC](https://discourse.cmake.org/t/exporting-renamed-multiple-named-configs/2586 "2021-01-20T22:16:46Z")

</div>

I’m trying to find a way to rename an existing CMake project, but in a way that avoids disrupting existing users. Those users will (at least initially, and for a time) be expecting the project to define the options, targ…

---

## [FindOpenMP.cmake error on Android NDK wrt clang.](https://discourse.cmake.org/t/findopenmp-cmake-error-on-android-ndk-wrt-clang/2579)

<div class="topic-metadata">

**Author:** [@Steven\_Braeger](https://discourse.cmake.org/u/Steven_Braeger)\
**Replies:** 2\
**Last updated:** [January 20, 2021, 8:40pm UTC](https://discourse.cmake.org/t/findopenmp-cmake-error-on-android-ndk-wrt-clang/2579 "2021-01-20T20:40:05Z")

</div>

Android as of NDK r20 does not have support for gcc except through Clang. https://android.googlesource.com/platform/ndk/+/master/docs/ClangMigration.md However, modern versions of Clang on android inside the NDK no lon…

---

## [Can add\_custom\_target(\<name\> SOURCES file1 file2) be used with an fxc compile?](https://discourse.cmake.org/t/can-add-custom-target-name-sources-file1-file2-be-used-with-an-fxc-compile/2548)

<div class="topic-metadata">

**Author:** [@dudge](https://discourse.cmake.org/u/dudge)\
**Replies:** 2\
**Last updated:** [January 20, 2021, 2:55pm UTC](https://discourse.cmake.org/t/can-add-custom-target-name-sources-file1-file2-be-used-with-an-fxc-compile/2548 "2021-01-20T14:55:09Z")

</div>

Directory ${CMAKE\_SOURCE\_DIR}/shaders contains the two files VSFont.hlsl and PSFont.hlsl. This folder also contains a CMAKELists.txt file with these lines: set(VSSrcHLSL “VSFont.hlsl” “PSFont.hlsl”) add\_custom\_target(…

---

## [\[Feature\] Callstack should provide full path to CMakeLists.txt](https://discourse.cmake.org/t/feature-callstack-should-provide-full-path-to-cmakelists-txt/2587)

<div class="topic-metadata">

**Author:** [@anon45792294](https://discourse.cmake.org/u/anon45792294)\
**Replies:** 1\
**Last updated:** [January 20, 2021, 2:20pm UTC](https://discourse.cmake.org/t/feature-callstack-should-provide-full-path-to-cmakelists-txt/2587 "2021-01-20T14:20:08Z")

</div>

This happens to me all the time when writing CMake code. -- Detecting CXX compile features - done CMake Error at D:/Git/hq-cxx/cml/cml\_helpers/CmlHelpers.cmake:11 (message): ===========================================…

---

## [MinGW C compiler “not able to compile a simple test program”](https://discourse.cmake.org/t/mingw-c-compiler-not-able-to-compile-a-simple-test-program/388)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 4\
**Last updated:** [January 20, 2021, 1:50pm UTC](https://discourse.cmake.org/t/mingw-c-compiler-not-able-to-compile-a-simple-test-program/388 "2021-01-20T13:50:56Z")

</div>

I want to run MinGW as a C compiler. MinGW has been installed from Chocolatey. Invocation is from gitlab-runner through CMake: cmake -G "MinGW Makefiles" -DCMAKE\_C\_COMPILER=x86\_64-w64-mingw32-gcc -B. .. This fails with …

---

## [Custom command output location](https://discourse.cmake.org/t/custom-command-output-location/2571)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cmake.org/u/alex)\
**Replies:** 3\
**Last updated:** [January 20, 2021, 8:35am UTC](https://discourse.cmake.org/t/custom-command-output-location/2571 "2021-01-20T08:35:39Z")

</div>

When using a multi-config generator like Visual Studio, objects and libraries are (by default) placed in ${CMAKE\_CURRENT\_BINARY\_DIR}/$\<CONFIG\>. Now, suppose I have a library target, myLib and I want to process it with so…

---

## [CMake wrongly chooses multiarch architecture](https://discourse.cmake.org/t/cmake-wrongly-chooses-multiarch-architecture/2562)

<div class="topic-metadata">

**Author:** [@tgq](https://discourse.cmake.org/u/tgq)\
**Replies:** 1\
**Last updated:** [January 19, 2021, 7:45pm UTC](https://discourse.cmake.org/t/cmake-wrongly-chooses-multiarch-architecture/2562 "2021-01-19T19:45:07Z")

</div>

Hello. Despite the information in toolchain file, CMake chooses host libraries instead of the target ones. My toolchain looks like that: set(CMAKE\_SYSTEM\_NAME Linux) set(CMAKE\_SYSTEM\_PROCESSOR arm) set(triple arm-linux…

---

## [How do you find documentation of -j option](https://discourse.cmake.org/t/how-do-you-find-documentation-of-j-option/2561)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)\
**Replies:** 5\
**Last updated:** [January 19, 2021, 7:43pm UTC](https://discourse.cmake.org/t/how-do-you-find-documentation-of-j-option/2561 "2021-01-19T19:43:54Z")

</div>

AFAIK, cmake --build -j . is a legal command, but I can’t find documentation for -j option. I tried: cmake --help | grep -- "-j" cmake --help-command build\_command | grep -- "-j" as well as searching for -j and option …

---

## [How to find C11 threads](https://discourse.cmake.org/t/how-to-find-c11-threads/2506)

<div class="topic-metadata">

**Author:** [@Wirtos](https://discourse.cmake.org/u/Wirtos)\
**Replies:** 4\
**Last updated:** [January 19, 2021, 7:40pm UTC](https://discourse.cmake.org/t/how-to-find-c11-threads/2506 "2021-01-19T19:40:37Z")

</div>

I was trying to create a project involving the use of C11 threads, but I can’t find the requirements in the CMAKE\_C\_KNOWN\_FEATURES nor in the FindThreads package. Should I write custom detection code for this purpose, or…

---

## [Cmake does not find Opengl during build](https://discourse.cmake.org/t/cmake-does-not-find-opengl-during-build/2517)

<div class="topic-metadata">

**Author:** [@colt](https://discourse.cmake.org/u/colt)\
**Replies:** 3\
**Last updated:** [January 19, 2021, 7:30pm UTC](https://discourse.cmake.org/t/cmake-does-not-find-opengl-during-build/2517 "2021-01-19T19:30:43Z")

</div>

Hello, I am trying to build a software using Cmake. I do so by typing cmake . The result it is: Normal Build Using X11 for Vulkan CMake Error at /home/leopoldo/Arquivos-de-Programas-Linux/Cmake-3.19.2-Linux-x86\_64/…

---

## [A problem with documentation of find\_package](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.cmake.org/u/pauljurczak)\
**Replies:** 3\
**Last updated:** [January 19, 2021, 7:29pm UTC](https://discourse.cmake.org/t/a-problem-with-documentation-of-find-package/2550 "2021-01-19T19:29:36Z")

</div>

I couldn’t find a documentation page specifying how to arrive from a module name, e.g. FindCUDAToolkit to the proper syntax of calling find\_package, i.e. find\_package(CUDAToolkit) in this case. I’m I missing something? I…

---

## [Propagation of FetchContent targets when installing](https://discourse.cmake.org/t/propagation-of-fetchcontent-targets-when-installing/2559)

<div class="topic-metadata">

**Author:** [@tomhh](https://discourse.cmake.org/u/tomhh)\
**Replies:** 11\
**Last updated:** [January 18, 2021, 8:22pm UTC](https://discourse.cmake.org/t/propagation-of-fetchcontent-targets-when-installing/2559 "2021-01-18T20:22:59Z")

</div>

Hi there, I’ve run into this issue I don’t quite understand and was hoping someone could help clarify. I have a simple header-only library (LibA) which is used by a static library (LibB) via FetchContent. I would like …

---

## [Link shared cmake target with prebuilt static libraries (PIC)](https://discourse.cmake.org/t/link-shared-cmake-target-with-prebuilt-static-libraries-pic/2504)

<div class="topic-metadata">

**Author:** [@jazu.dev](https://discourse.cmake.org/u/jazu.dev)\
**Replies:** 2\
**Last updated:** [January 17, 2021, 4:46pm UTC](https://discourse.cmake.org/t/link-shared-cmake-target-with-prebuilt-static-libraries-pic/2504 "2021-01-17T16:46:13Z")

</div>

Greetings, In my CMakeLists.txt I declare a shared library target (for Android/JNI): add\_library(native-lib SHARED native-lib.cpp) That depends on an external static library, which then depends upon a bunch of other s…

---

## [Can't crosscompile CMake itself](https://discourse.cmake.org/t/cant-crosscompile-cmake-itself/2558)

<div class="topic-metadata">

**Author:** [@tgq](https://discourse.cmake.org/u/tgq)\
**Replies:** 3\
**Last updated:** [January 16, 2021, 12:31pm UTC](https://discourse.cmake.org/t/cant-crosscompile-cmake-itself/2558 "2021-01-16T12:31:31Z")

</div>

Hello. I am using clang as a crosscompiler. My toolchain is functional, i can build programs for arm with it. But when i want to bootstrap CMake itself it fails with error: $ cmake .. -DCMAKE\_CROSSCOMPILING=True -DCMAKE…

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

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