# Usage

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

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

**Page:** 63

---

## [I want to use the latest cmake on a PC with VisualStudio2022 installed.](https://discourse.cmake.org/t/i-want-to-use-the-latest-cmake-on-a-pc-with-visualstudio2022-installed/5582)

<div class="topic-metadata">

**Author:** [@gee\_bobbb](https://discourse.cmake.org/u/gee_bobbb)\
**Replies:** 1\
**Last updated:** [April 30, 2022, 3:16pm UTC](https://discourse.cmake.org/t/i-want-to-use-the-latest-cmake-on-a-pc-with-visualstudio2022-installed/5582 "2022-04-30T15:16:39Z")

</div>

Hello. Can I update cmake in VisualStudio2022 to the latest version? Or, can I use it by installing it independently from VisualStudio2022? My OS is Windows 10.

---

## [Link DLL](https://discourse.cmake.org/t/link-dll/5580)

<div class="topic-metadata">

**Author:** [@Tom\_Bell](https://discourse.cmake.org/u/Tom_Bell)\
**Replies:** 1\
**Last updated:** [April 30, 2022, 1:47pm UTC](https://discourse.cmake.org/t/link-dll/5580 "2022-04-30T13:47:19Z")

</div>

How do I link a DLL I’ve made to a CMAKE project?

---

## [Generator expression question](https://discourse.cmake.org/t/generator-expression-question/5570)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 5\
**Last updated:** [April 30, 2022, 12:45am UTC](https://discourse.cmake.org/t/generator-expression-question/5570 "2022-04-30T00:45:33Z")

</div>

Hi, I have a simple generator expression question. I want to add a source file conditionally based on a cache variable value. My code is: set(ARM\_PLATFORM "ModelSim" CACHE STRING "Target platform on which this executab…

---

## [Problema con CMake ..](https://discourse.cmake.org/t/problema-con-cmake/5574)

<div class="topic-metadata">

**Author:** [@DarioGR](https://discourse.cmake.org/u/DarioGR)\
**Replies:** 1\
**Last updated:** [April 29, 2022, 3:22pm UTC](https://discourse.cmake.org/t/problema-con-cmake/5574 "2022-04-29T15:22:04Z")

</div>

Buen día, podrian ayudarme por favor. Cuando ingreso cmake … me muestra lo siguiente: CMake Deprecation Warning at CMakeLists.txt:1 (cmake\_minimum\_required): Compatibility with CMake \< 2.8.12 will be removed from a fut…

---

## [macOS: sign/package a Framework and a Bundle which embeddes that Framework](https://discourse.cmake.org/t/macos-sign-package-a-framework-and-a-bundle-which-embeddes-that-framework/5522)

<div class="topic-metadata">

**Author:** [@jcarl](https://discourse.cmake.org/u/jcarl)\
**Replies:** 2\
**Last updated:** [April 28, 2022, 9:57pm UTC](https://discourse.cmake.org/t/macos-sign-package-a-framework-and-a-bundle-which-embeddes-that-framework/5522 "2022-04-28T21:57:35Z")

</div>

I have project with a macOS Framework and Bundle: The framework is consumed by the app/bundle by embedding it. I also want to create two package: One is the Framework as SDK and one is the App/Bundle with the embedded Fr…

---

## [macOS framework questions](https://discourse.cmake.org/t/macos-framework-questions/5568)

<div class="topic-metadata">

**Author:** [@vre](https://discourse.cmake.org/u/vre)\
**Replies:** 0\
**Last updated:** [April 28, 2022, 7:48pm UTC](https://discourse.cmake.org/t/macos-framework-questions/5568 "2022-04-28T19:48:46Z")

</div>

When building a framework on macOS using CMake do one should provide pkg config files (\*.pc) and CMake config files (\*Config.cmake) for the framework? The project can be built in multiple ways on macOS, either as static…

---

## [use cmake with intel oneAPI base toolkit](https://discourse.cmake.org/t/use-cmake-with-intel-oneapi-base-toolkit/5562)

<div class="topic-metadata">

**Author:** [@Daniel\_Droste](https://discourse.cmake.org/u/Daniel_Droste)\
**Replies:** 4\
**Last updated:** [April 28, 2022, 12:00pm UTC](https://discourse.cmake.org/t/use-cmake-with-intel-oneapi-base-toolkit/5562 "2022-04-28T12:00:33Z")

</div>

Hi, I try since some weeks to compile a simple C++ program with the Intel oneAPI dpcpp Compiler and cmake: using namespace std; int main() { cout \<\< “Hello CMake.” \<\< endl; return 0; } What I did is this: Insta…

---

## [CMake target\_link\_libraries Dependencies](https://discourse.cmake.org/t/cmake-target-link-libraries-dependencies/5564)

<div class="topic-metadata">

**Author:** [@swaraj\_somala](https://discourse.cmake.org/u/swaraj_somala)\
**Replies:** 1\
**Last updated:** [April 28, 2022, 10:56am UTC](https://discourse.cmake.org/t/cmake-target-link-libraries-dependencies/5564 "2022-04-28T10:56:22Z")

</div>

I’m new to CMake and am attempting to figure out what the link requirements for ‘target link libraries’ are (Public,Private,Interface). I understand the concepts of public, private, and Interface dependencies, but I’m no…

---

## [How use custom Post Build Steps with Multi Config Generators](https://discourse.cmake.org/t/how-use-custom-post-build-steps-with-multi-config-generators/5554)

<div class="topic-metadata">

**Author:** [@JuliusCaesar](https://discourse.cmake.org/u/JuliusCaesar)\
**Replies:** 2\
**Last updated:** [April 27, 2022, 11:28am UTC](https://discourse.cmake.org/t/how-use-custom-post-build-steps-with-multi-config-generators/5554 "2022-04-27T11:28:22Z")

</div>

Hey guys, we are using Ninja Multi Config for Windows and Cross Platform ARM embedded builds. On Windows (native) Ninja multi Config Works fine, however our Cross Platform Target Build needs some extra custom commands. …

---

## [Interfaces, implementations, and unresolved symbols](https://discourse.cmake.org/t/interfaces-implementations-and-unresolved-symbols/5283)

<div class="topic-metadata">

**Author:** [@ingolf](https://discourse.cmake.org/u/ingolf)\
**Replies:** 14\
**Last updated:** [April 27, 2022, 10:20am UTC](https://discourse.cmake.org/t/interfaces-implementations-and-unresolved-symbols/5283 "2022-04-27T10:20:43Z")

</div>

Hi, how should we model the following situation in CMake? There is an interface specification (e.g. set of C language header files): H There are two (static) libraries L1 and L2, each of them implementing this interf…

---

## [cmake\_install.cmake using wrong CMAKE\_INSTALL\_CONFIG\_NAME](https://discourse.cmake.org/t/cmake-install-cmake-using-wrong-cmake-install-config-name/5545)

<div class="topic-metadata">

**Author:** [@janhieber](https://discourse.cmake.org/u/janhieber)\
**Replies:** 2\
**Last updated:** [April 26, 2022, 2:32pm UTC](https://discourse.cmake.org/t/cmake-install-cmake-using-wrong-cmake-install-config-name/5545 "2022-04-26T14:32:58Z")

</div>

Hey, I use CMake 3.17.2 on Windows with the generator “Visual Studio 14 2015 Win64”. When I create my project, CMake also creates the file cmake\_install.cmake. This file contains the wrong default CMAKE\_INSTALL\_CONFIG…

---

## [How to determine chosen CMake version (or existence of specific feature)?](https://discourse.cmake.org/t/how-to-determine-chosen-cmake-version-or-existence-of-specific-feature/5489)

<div class="topic-metadata">

**Author:** [@dbahadir](https://discourse.cmake.org/u/dbahadir)\
**Replies:** 5\
**Last updated:** [April 22, 2022, 12:03pm UTC](https://discourse.cmake.org/t/how-to-determine-chosen-cmake-version-or-existence-of-specific-feature/5489 "2022-04-22T12:03:50Z")

</div>

tl;dr Is there any way to determine the existence of a CMake feature if it does not have a policy? I am trying to extend my CMake project with (optional) support for the new FILE\_SET feature introduced with CMake 3.23. …

---

## [Authentication For File Download - CMake 3.2.3](https://discourse.cmake.org/t/authentication-for-file-download-cmake-3-2-3/5543)

<div class="topic-metadata">

**Author:** [@cmacd122](https://discourse.cmake.org/u/cmacd122)\
**Replies:** 2\
**Last updated:** [April 26, 2022, 12:08pm UTC](https://discourse.cmake.org/t/authentication-for-file-download-cmake-3-2-3/5543 "2022-04-26T12:08:45Z")

</div>

Currently we are using CMake version 3.2.3. We work on a closed/secured network and trying to get new software cleared and installed on the network makes upgrading to a newer version of CMake not possible. I say this b…

---

## [Where does the Component parts of CPack + Wix go](https://discourse.cmake.org/t/where-does-the-component-parts-of-cpack-wix-go/5532)

<div class="topic-metadata">

**Author:** [@jshanab](https://discourse.cmake.org/u/jshanab)\
**Replies:** 0\
**Last updated:** [April 25, 2022, 8:22pm UTC](https://discourse.cmake.org/t/where-does-the-component-parts-of-cpack-wix-go/5532 "2022-04-25T20:22:13Z")

</div>

I need to generate a Wix Package for a windows service which seems to require me to create custom wix template. I tried the same with NSIS and was successfull unitl they asked for some Wix specific stuff. So I copied t…

---

## [Having problems with CMake building SDL2 for msys mingw64 and CodeBlocks](https://discourse.cmake.org/t/having-problems-with-cmake-building-sdl2-for-msys-mingw64-and-codeblocks/5495)

<div class="topic-metadata">

**Author:** [@PaulUK](https://discourse.cmake.org/u/PaulUK)\
**Replies:** 4\
**Last updated:** [April 23, 2022, 7:59pm UTC](https://discourse.cmake.org/t/having-problems-with-cmake-building-sdl2-for-msys-mingw64-and-codeblocks/5495 "2022-04-23T19:59:45Z")

</div>

Hello, first post here. I’m getting errors when trying to select configure for building SDL2 using CodeBlocks and the non bundled mingw compiler. I will list the versions then the errors below. OS: Win 7 CMake: 3.23.…

---

## [CMake error is different than CMake version](https://discourse.cmake.org/t/cmake-error-is-different-than-cmake-version/5503)

<div class="topic-metadata">

**Author:** [@clinton2022](https://discourse.cmake.org/u/clinton2022)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 4:29pm UTC](https://discourse.cmake.org/t/cmake-error-is-different-than-cmake-version/5503 "2022-04-21T16:29:10Z")

</div>

Now I have the same old problem in CLion: CMake Error at CMakeLists.txt:1 (cmake\_minimum\_required): CMake 3.23.1 or higher is required. You are running version 3.21.1 – Configuring incomplete, errors occurred! I inst…

---

## [CTest execution much slower than running the executable](https://discourse.cmake.org/t/ctest-execution-much-slower-than-running-the-executable/5508)

<div class="topic-metadata">

**Author:** [@tooEarlyForThis](https://discourse.cmake.org/u/tooEarlyForThis)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 2:03pm UTC](https://discourse.cmake.org/t/ctest-execution-much-slower-than-running-the-executable/5508 "2022-04-21T14:03:53Z")

</div>

I’ve got some issues with my tests, when running with CTest. The tests are written using GTest, in particular there is a parametrized test case with about a hundred cases. But the same holds for other test (cases) as wel…

---

## [MODULE library and copying TARGET\_RUNTIME\_DLLS](https://discourse.cmake.org/t/module-library-and-copying-target-runtime-dlls/5488)

<div class="topic-metadata">

**Author:** [@bukuli.norbert](https://discourse.cmake.org/u/bukuli.norbert)\
**Replies:** 3\
**Last updated:** [April 20, 2022, 5:48am UTC](https://discourse.cmake.org/t/module-library-and-copying-target-runtime-dlls/5488 "2022-04-20T05:48:53Z")

</div>

Hi community, This topic is about the usage of $\<TARGET\_RUNTIME\_DLLS:tgt\> but there is a slight possibility that I’ve misunderstood something in the documentation, that states the following: List of DLLs that the targe…

---

## [Is whitespace in quoted generator expressions allowed?](https://discourse.cmake.org/t/is-whitespace-in-quoted-generator-expressions-allowed/5473)

<div class="topic-metadata">

**Author:** [@ecorm](https://discourse.cmake.org/u/ecorm)\
**Replies:** 2\
**Last updated:** [April 19, 2022, 10:38pm UTC](https://discourse.cmake.org/t/is-whitespace-in-quoted-generator-expressions-allowed/5473 "2022-04-19T22:38:05Z")

</div>

I have a long, complex, quoted generator expression that I’d like to make more readable with whitespace, as well as splitting across several lines. For example: set(MYPROJ\_LINK\_TO\_JSON\_ENABLED "$\<AND:\\ $\<NOT…

---

## [Cross compile a project to vxWorks on Windows 10 host](https://discourse.cmake.org/t/cross-compile-a-project-to-vxworks-on-windows-10-host/5468)

<div class="topic-metadata">

**Author:** [@piet](https://discourse.cmake.org/u/piet)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 2:02pm UTC](https://discourse.cmake.org/t/cross-compile-a-project-to-vxworks-on-windows-10-host/5468 "2022-04-18T14:02:19Z")

</div>

Hi, I am trying to cross compile an existing project to vxWorks. From the research I have done, it seems that a simple tool chain file should accomplish this. However, it seems CMake does not detect the cross compiler. …

---

## [Force Specific Library to be Release in a "--config debug" Build](https://discourse.cmake.org/t/force-specific-library-to-be-release-in-a-config-debug-build/5387)

<div class="topic-metadata">

**Author:** [@Boooke](https://discourse.cmake.org/u/Boooke)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 9:26am UTC](https://discourse.cmake.org/t/force-specific-library-to-be-release-in-a-config-debug-build/5387 "2022-04-18T09:26:57Z")

</div>

Hey, I want to use OpenCV that does not out of the box allow for a debug build, and I was hoping if there was somehow a way of forcing a --config debug build to use the Release version of this library? If CMake is set t…

---

## [The NAMES of find\_path cause cannot open file](https://discourse.cmake.org/t/the-names-of-find-path-cause-cannot-open-file/5457)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 5\
**Last updated:** [April 15, 2022, 5:12pm UTC](https://discourse.cmake.org/t/the-names-of-find-path-cause-cannot-open-file/5457 "2022-04-15T17:12:24Z")

</div>

Continuing the discussion from window env variable and cmake path: Arguments following NAMES cannot include a directory, they must be file names only. And I follow this. I will happen cannot open file error. The belo…

---

## [BOOST\_ROOT transitive behavior problem](https://discourse.cmake.org/t/boost-root-transitive-behavior-problem/5462)

<div class="topic-metadata">

**Author:** [@tct](https://discourse.cmake.org/u/tct)\
**Replies:** 2\
**Last updated:** [April 15, 2022, 1:11am UTC](https://discourse.cmake.org/t/boost-root-transitive-behavior-problem/5462 "2022-04-15T01:11:27Z")

</div>

Hello folks! I’m observing a problem I’d consider “weird” that I’ve been trying to track down & resolve unsuccessfully for a few days. Let there be three projects, A, B and C. C is a C++ library which depends on Boo…

---

## [Run cmake with batch file and double click](https://discourse.cmake.org/t/run-cmake-with-batch-file-and-double-click/5430)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 4\
**Last updated:** [April 14, 2022, 10:27pm UTC](https://discourse.cmake.org/t/run-cmake-with-batch-file-and-double-click/5430 "2022-04-14T22:27:19Z")

</div>

I write a batch file to install lib. If I run it install.bat on command prompt. It can generate the release folder. But I try to double click the install.bat. It will not generate the release folder. Here is this ins…

---

## [CMake '-s' argument - recent change in behaviour](https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463)

<div class="topic-metadata">

**Author:** [@mschorm](https://discourse.cmake.org/u/mschorm)\
**Replies:** 1\
**Last updated:** [April 14, 2022, 2:36pm UTC](https://discourse.cmake.org/t/cmake-s-argument-recent-change-in-behaviour/5463 "2022-04-14T14:36:58Z")

</div>

Hello, I am a maintainer of several packages that use CMake in the Fedora Linux. Recently, after the following commit: https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/7001 and this release: cmake-3.23.0-0.…

---

## [repeat variable](https://discourse.cmake.org/t/repeat-variable/5437)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 4\
**Last updated:** [April 14, 2022, 6:31am UTC](https://discourse.cmake.org/t/repeat-variable/5437 "2022-04-14T06:31:07Z")

</div>

Is it a good method for declare twice set build\_type? set build\_type=release cmake -Dbuild-type=%build\_type% set build\_type=debug cmake -Dbuild-type=%build\_type% Because c++ only declare 1 times. int a=0; dosomething…

---

## [How to install an interface library with generated source in build folder](https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449)

<div class="topic-metadata">

**Author:** [@gabyx](https://discourse.cmake.org/u/gabyx)\
**Replies:** 4\
**Last updated:** [April 13, 2022, 8:49pm UTC](https://discourse.cmake.org/t/how-to-install-an-interface-library-with-generated-source-in-build-folder/5449 "2022-04-13T20:49:02Z")

</div>

We have a header-only library apiDefines (INTERFACE) which has a generated API.h (declspec imports/exports) as source which is used as a helper target to link to in other library targets: set(generatedFile ${CMAKE\_CUR…

---

## [Unquoted Special Characters in CFLAGS cause sh explain in unexcepted ways using Makefile Generator](https://discourse.cmake.org/t/unquoted-special-characters-in-cflags-cause-sh-explain-in-unexcepted-ways-using-makefile-generator/5431)

<div class="topic-metadata">

**Author:** [@manageryzy](https://discourse.cmake.org/u/manageryzy)\
**Replies:** 3\
**Last updated:** [April 13, 2022, 5:08pm UTC](https://discourse.cmake.org/t/unquoted-special-characters-in-cflags-cause-sh-explain-in-unexcepted-ways-using-makefile-generator/5431 "2022-04-13T17:08:20Z")

</div>

CMake Version: All Original Problem: I was using CMake in Bazel Foreign CC with custom toolchain with my own sysroot. Some CMake project failed to detect C ABI for there were special CFLAGS set in my project. Detecting…

---

## [parse / and \\ on cmake](https://discourse.cmake.org/t/parse-and-on-cmake/5396)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 10\
**Last updated:** [April 13, 2022, 2:49am UTC](https://discourse.cmake.org/t/parse-and-on-cmake/5396 "2022-04-13T02:49:56Z")

</div>

if I let DJPEG\_INCLUDE\_DIRS=…\\ …\\libjpeg-turbo\\include the error will say can’t parse “\\l” until I change \\ to / But other parameter DCMAKE\_INSTALL\_PREFIX or DOPENCV\_EXTRA\_MODULES\_PATH can use the \\ Why? How to know w…

---

## [find\_package not work](https://discourse.cmake.org/t/find-package-not-work/5401)

<div class="topic-metadata">

**Author:** [@alice](https://discourse.cmake.org/u/alice)\
**Replies:** 3\
**Last updated:** [April 12, 2022, 11:59am UTC](https://discourse.cmake.org/t/find-package-not-work/5401 "2022-04-12T11:59:49Z")

</div>

work set(ZLIB\_ROOT "D:\\TEST\\zlib") find\_package(ZLIB) not work find\_package(ZLIB PATHS "D:\\TEST\\zlib" ) What does I lack of with find\_package?

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

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