# Usage

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

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

**Page:** 94

---

## [Install CMake on Mint](https://discourse.cmake.org/t/install-cmake-on-mint/997)

<div class="topic-metadata">

**Author:** [@Wilmar](https://discourse.cmake.org/u/Wilmar)\
**Replies:** 23\
**Last updated:** [May 11, 2020, 3:09am UTC](https://discourse.cmake.org/t/install-cmake-on-mint/997 "2020-05-11T03:09:18Z")

</div>

I had installed CMake on Mint, I guess. When I execute it notthing happens! Even a negative message appear! Someone could help me?

---

## [What is the proper way of using IMPORTED\_TARGET](https://discourse.cmake.org/t/what-is-the-proper-way-of-using-imported-target/1156)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 2:10pm UTC](https://discourse.cmake.org/t/what-is-the-proper-way-of-using-imported-target/1156 "2020-05-10T14:10:57Z")

</div>

Following up on the What is the proper way to use FindPkgConfig and FindPkgConfighttps://cmake.org/cmake/help/v3.17/module/FindPkgConfig.html?highlight=pkg\_search\_module#command:pkg\_search\_module Could you please advis…

---

## [CMAKE\_FIND\_DEBUG\_MODE is not enabling debug output of find\_ command](https://discourse.cmake.org/t/cmake-find-debug-mode-is-not-enabling-debug-output-of-find-command/1157)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 3\
**Last updated:** [May 10, 2020, 6:21am UTC](https://discourse.cmake.org/t/cmake-find-debug-mode-is-not-enabling-debug-output-of-find-command/1157 "2020-05-10T06:21:39Z")

</div>

I tried to use set(CMAKE\_FIND\_DEBUG\_MODE TRUE) find\_xxx set(CMAKE\_FIND\_DEBUG\_MODE FALSE) and it was working for several runs with find\_path, find\_package, find\_jar. However after several runs I see no effect on find\_…

---

## [Encapsulating Link Arguments](https://discourse.cmake.org/t/encapsulating-link-arguments/1171)

<div class="topic-metadata">

**Author:** [@stefansjs](https://discourse.cmake.org/u/stefansjs)\
**Replies:** 1\
**Last updated:** [May 9, 2020, 1:23pm UTC](https://discourse.cmake.org/t/encapsulating-link-arguments/1171 "2020-05-09T13:23:03Z")

</div>

Hey CMake community, I’m trying to figure out how to encapsulate linker flags in one of the subdirectories of my cmake project. Is there a way for be to set link flags on a target so that when it is linked against, thos…

---

## [how to find\_jar for external .jar file](https://discourse.cmake.org/t/how-to-find-jar-for-external-jar-file/1137)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 12\
**Last updated:** [May 7, 2020, 3:58pm UTC](https://discourse.cmake.org/t/how-to-find-jar-for-external-jar-file/1137 "2020-05-07T15:58:36Z")

</div>

Could you please advise why the following is not working. find\_package(Java COMPONENTS Development) include(UseJava) set(MY\_JAR\_PACKAGE\_INCLUDE\_DIR “${CMAKE\_SOURCE\_DIR}/mvngened”) find\_jar(myJavaJar, ext.jar NAMES …

---

## [cmake -D \<var\>:\<type\>=\<value\>](https://discourse.cmake.org/t/cmake-d-var-type-value/1135)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 2\
**Last updated:** [May 7, 2020, 5:00pm UTC](https://discourse.cmake.org/t/cmake-d-var-type-value/1135 "2020-05-07T17:00:07Z")

</div>

As far as I can recall, I have only passed command line arguments to cmake with cmake -D \<var\>=\<value\>. However, I just discovered that people on my team do the following cmake -D \<var\>:\<type\>=\<value\>. I knew that this f…

---

## [Can't export top level lib with dependency on subdir lib](https://discourse.cmake.org/t/cant-export-top-level-lib-with-dependency-on-subdir-lib/1084)

<div class="topic-metadata">

**Author:** [@yisseamake](https://discourse.cmake.org/u/yisseamake)\
**Replies:** 22\
**Last updated:** [May 7, 2020, 3:25pm UTC](https://discourse.cmake.org/t/cant-export-top-level-lib-with-dependency-on-subdir-lib/1084 "2020-05-07T15:25:34Z")

</div>

Could you please advise on this issue. I found similar issue to one that has been posted as “Cannot build sub-directory library if top-level CMakeLists.txt call install(EXPORT …)” but was not answered at https://cmake.or…

---

## [RelWithDebInfo default MSVC flags are pessimising](https://discourse.cmake.org/t/relwithdebinfo-default-msvc-flags-are-pessimising/1160)

<div class="topic-metadata">

**Author:** [@zakalawe](https://discourse.cmake.org/u/zakalawe)\
**Replies:** 0\
**Last updated:** [May 7, 2020, 11:25am UTC](https://discourse.cmake.org/t/relwithdebinfo-default-msvc-flags-are-pessimising/1160 "2020-05-07T11:25:05Z")

</div>

Have discovered a performance regression with Windows builds after switching to RelWithDebInfo (to enable crash reporting) RelWithDebInfo uses /Ob1 whereas Release uses /Ob2 : and for modern C++ code, this is a large pe…

---

## [The 'cmake-server(7)' is deprecated](https://discourse.cmake.org/t/the-cmake-server-7-is-deprecated/1129)

<div class="topic-metadata">

**Author:** [@Kimare\_De\_Kostu](https://discourse.cmake.org/u/Kimare_De_Kostu)\
**Replies:** 7\
**Last updated:** [May 4, 2020, 2:37pm UTC](https://discourse.cmake.org/t/the-cmake-server-7-is-deprecated/1129 "2020-05-04T14:37:12Z")

</div>

Hello i got problem with cmake server i got something like this: 1\> Configuring incomplete, errors occurred! See also “C:/Users/kryst/OneDrive/Pulpit/va/out/build/x64-Debug/CMakeFiles/CMakeOutput.log”. 1\> CMake Depre…

---

## [add\_compile\_options append factorisation.](https://discourse.cmake.org/t/add-compile-options-append-factorisation/1133)

<div class="topic-metadata">

**Author:** [@Phi](https://discourse.cmake.org/u/Phi)\
**Replies:** 2\
**Last updated:** [May 1, 2020, 9:02am UTC](https://discourse.cmake.org/t/add-compile-options-append-factorisation/1133 "2020-05-01T09:02:07Z")

</div>

Hi All, I am new to cmake, so may be this is a trivial question. I am trying to use add\_compile\_options() and I got the impression that compile options gets kind fatorised, i.e multiple -v -v would end up as a single -…

---

## [Configurable in CMAKE\_TOOLCHAIN\_FILE files](https://discourse.cmake.org/t/configurable-in-cmake-toolchain-file-files/1122)

<div class="topic-metadata">

**Author:** [@Guru\_Gajah](https://discourse.cmake.org/u/Guru_Gajah)\
**Replies:** 2\
**Last updated:** [April 30, 2020, 9:20pm UTC](https://discourse.cmake.org/t/configurable-in-cmake-toolchain-file-files/1122 "2020-04-30T21:20:54Z")

</div>

Consider having constructs like the following i a CMAKE\_TOOLCHAIN\_FILE: set(SOME\_VAR “some\_default” CACHE STRING “some text”) What would be the drawback pitfall with it? Will cache always work? ccmake? Would option p…

---

## [project(..), cmake\_minimum\_required(..)](https://discourse.cmake.org/t/project-cmake-minimum-required/953)

<div class="topic-metadata">

**Author:** [@Guru\_Gajah](https://discourse.cmake.org/u/Guru_Gajah)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 3:40pm UTC](https://discourse.cmake.org/t/project-cmake-minimum-required/953 "2020-04-29T15:40:43Z")

</div>

Hello, I’m concerned about cmake version-race and project maintainability especially in deeply embedded project. I have inherited certain habits/practices since cmake 2.6 which I’m reluctant to change. One of the reaso…

---

## [No verbose output when building an external project with ninja](https://discourse.cmake.org/t/no-verbose-output-when-building-an-external-project-with-ninja/1113)

<div class="topic-metadata">

**Author:** [@Sunpip](https://discourse.cmake.org/u/Sunpip)\
**Replies:** 1\
**Last updated:** [April 28, 2020, 1:11pm UTC](https://discourse.cmake.org/t/no-verbose-output-when-building-an-external-project-with-ninja/1113 "2020-04-28T13:11:59Z")

</div>

This is my example project: CMakeLists.txt a.cpp main.cpp And this is CMakeLists.txt file. It contains two local source files and an external project GTest from a git repository: cmake\_minimum\_required(VERSION 3.16…

---

## [Issue using CMake with CodeBlocks and MSYS](https://discourse.cmake.org/t/issue-using-cmake-with-codeblocks-and-msys/1090)

<div class="topic-metadata">

**Author:** [@Arisotura](https://discourse.cmake.org/u/Arisotura)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 12:21pm UTC](https://discourse.cmake.org/t/issue-using-cmake-with-codeblocks-and-msys/1090 "2020-04-28T12:21:40Z")

</div>

Hello there! Arisotura here, from melonDS land. So, here’s the thing. When I started development on melonDS, I used CodeBlocks as my IDE, along with the msys64 toolchain. The idea was to avoid using MSVC, and also keep …

---

## [Find WindowsSDK library (SetupApi)](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906)

<div class="topic-metadata">

**Author:** [@zakalawe](https://discourse.cmake.org/u/zakalawe)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 7:32am UTC](https://discourse.cmake.org/t/find-windowssdk-library-setupapi/906 "2020-04-28T07:32:25Z")

</div>

Is there an official way to ensure that the active Windows SDK library path is searched by find\_library()? I can find via Google various 3rdparty CMake files, but hoped there might be a recommend best practice? Eg on my…

---

## [Prefix for CTest ?](https://discourse.cmake.org/t/prefix-for-ctest/1081)

<div class="topic-metadata">

**Author:** [@robiwano](https://discourse.cmake.org/u/robiwano)\
**Replies:** 1\
**Last updated:** [April 27, 2020, 1:52pm UTC](https://discourse.cmake.org/t/prefix-for-ctest/1081 "2020-04-27T13:52:43Z")

</div>

Hi all, I’m trying to make a test cache script which will cache outputs of tests and return the cached values if nothing has changed. Question: Is it possible to prefix the “test executable” in the same manner as with C…

---

## [How to set warning level correctly in modern CMake?](https://discourse.cmake.org/t/how-to-set-warning-level-correctly-in-modern-cmake/1103)

<div class="topic-metadata">

**Author:** [@Resurr3ction](https://discourse.cmake.org/u/Resurr3ction)\
**Replies:** 2\
**Last updated:** [April 26, 2020, 5:19am UTC](https://discourse.cmake.org/t/how-to-set-warning-level-correctly-in-modern-cmake/1103 "2020-04-26T05:19:27Z")

</div>

I believe this is a simple question about some of the most basic of requirements - setting a warning level. Yet I cannot find anything half sane about how to actually achieve this. The common suggestion is: if (MSVC) …

---

## [CMake Error at cmake\_uninstall.cmake:17 (message): Problem when removing "/usr/local/doc/cmake-3.17/Copyright.txt"](https://discourse.cmake.org/t/cmake-error-at-cmake-uninstall-cmake-17-message-problem-when-removing-usr-local-doc-cmake-3-17-copyright-txt/1105)

<div class="topic-metadata">

**Author:** [@111](https://discourse.cmake.org/u/111)\
**Replies:** 0\
**Last updated:** [April 26, 2020, 2:33am UTC](https://discourse.cmake.org/t/cmake-error-at-cmake-uninstall-cmake-17-message-problem-when-removing-usr-local-doc-cmake-3-17-copyright-txt/1105 "2020-04-26T02:33:50Z")

</div>

hello,when i use \[sudo make install \]to install cmake itself, once i want remove it use\[sudo make uninstall \] it output a error (base) lzw@resplendent-star:~/3d\_lib/cmake-3.17.1$ sudo make uninstall Scanning depende…

---

## [Include directories not working in header files](https://discourse.cmake.org/t/include-directories-not-working-in-header-files/1086)

<div class="topic-metadata">

**Author:** [@123099](https://discourse.cmake.org/u/123099)\
**Replies:** 0\
**Last updated:** [April 23, 2020, 11:37pm UTC](https://discourse.cmake.org/t/include-directories-not-working-in-header-files/1086 "2020-04-23T23:37:06Z")

</div>

Hello, I have very little experience with CMake and I am trying to set up a simple library. The library depends on other external libraries and adds them using the add\_subdirectory and target\_link\_library commands. Ev…

---

## [FindPythonLibs and pypy](https://discourse.cmake.org/t/findpythonlibs-and-pypy/1050)

<div class="topic-metadata">

**Author:** [@KrisThielemans](https://discourse.cmake.org/u/KrisThielemans)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 9:21am UTC](https://discourse.cmake.org/t/findpythonlibs-and-pypy/1050 "2020-04-18T09:21:18Z")

</div>

I’m somewhat out of my depth here, but trying to get a auto-generated conda PR https://github.com/conda-forge/stir-feedstock/pull/16 to work with pypy. Our CMakeLists.txt uses simply find\_package(PythonInterp) FIN…

---

## [LLVM build error](https://discourse.cmake.org/t/llvm-build-error/1048)

<div class="topic-metadata">

**Author:** [@afernandezody](https://discourse.cmake.org/u/afernandezody)\
**Replies:** 2\
**Last updated:** [April 17, 2020, 4:10pm UTC](https://discourse.cmake.org/t/llvm-build-error/1048 "2020-04-17T16:10:31Z")

</div>

Hello, I’m using cmake (3.16.5) to build the LLVM environment from source. However, the command cmake -DLLVM\_ENABLE\_PROJECTS=“clang;clang-tools-extra;libcxx;libunwind;lldb;compiler-rt;lld” -G “Unix Makefiles” -DCMAKE\_…

---

## [add\_test() has different behaviour for VS and Ninja generator](https://discourse.cmake.org/t/add-test-has-different-behaviour-for-vs-and-ninja-generator/1046)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 4\
**Last updated:** [April 17, 2020, 4:07pm UTC](https://discourse.cmake.org/t/add-test-has-different-behaviour-for-vs-and-ninja-generator/1046 "2020-04-17T16:07:36Z")

</div>

I have this CMakeList: add\_test( NAME with\_command\_and\_configuration COMMAND ${CMAKE\_COMMAND} --version CONFIGURATIONS one another ) Now I configure it. It results in different ctest code: MINGW64 /c/Temp/cte…

---

## [CTest build-and-test with multi-config generators](https://discourse.cmake.org/t/ctest-build-and-test-with-multi-config-generators/1008)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cmake.org/u/alex)\
**Replies:** 6\
**Last updated:** [April 17, 2020, 3:05pm UTC](https://discourse.cmake.org/t/ctest-build-and-test-with-multi-config-generators/1008 "2020-04-17T15:05:01Z")

</div>

What is the right way to call CTest in build-and-test mode with a multi-config generator? I see there’s a flag --build-config-sample, but it doesn’t let me set the build config directly.

---

## [CTest able to daemonize fixtures?](https://discourse.cmake.org/t/ctest-able-to-daemonize-fixtures/1012)

<div class="topic-metadata">

**Author:** [@warmcat](https://discourse.cmake.org/u/warmcat)\
**Replies:** 9\
**Last updated:** [April 17, 2020, 10:34am UTC](https://discourse.cmake.org/t/ctest-able-to-daemonize-fixtures/1012 "2020-04-17T10:34:11Z")

</div>

Thanks for the work on CMake, it’s a huge help with cross-platform build. We have been using CMake for a long time and at the moment I am trying to transfer our bash scripted testing into CTest… it can handle simple “on…

---

## [Any way to tell cmake to prioritise a file in compile order?](https://discourse.cmake.org/t/any-way-to-tell-cmake-to-prioritise-a-file-in-compile-order/1005)

<div class="topic-metadata">

**Author:** [@asm](https://discourse.cmake.org/u/asm)\
**Replies:** 3\
**Last updated:** [April 16, 2020, 8:44pm UTC](https://discourse.cmake.org/t/any-way-to-tell-cmake-to-prioritise-a-file-in-compile-order/1005 "2020-04-16T20:44:49Z")

</div>

I have a large project with many, many files. One file takes a very long time to compile - about 2.5 minutes. I don’t have control over that file because it’s a third party dependency. The build (across cores) looks li…

---

## [Is there a way to query the value of RUNTIME DESTINATION for a target after an install(TARGETS) call](https://discourse.cmake.org/t/is-there-a-way-to-query-the-value-of-runtime-destination-for-a-target-after-an-install-targets-call/1042)

<div class="topic-metadata">

**Author:** [@alcroito](https://discourse.cmake.org/u/alcroito)\
**Replies:** 1\
**Last updated:** [April 16, 2020, 5:45pm UTC](https://discourse.cmake.org/t/is-there-a-way-to-query-the-value-of-runtime-destination-for-a-target-after-an-install-targets-call/1042 "2020-04-16T17:45:35Z")

</div>

Same for LIBRARY DESTINATION / ARCHIVE DESTINATION add\_executable(foo) install(TARGETS foo RUNTIME DESTINATION my\_prefix) # ....... get\_property(TARGET foo PROPERTY ????) It seems that install commands are a separate e…

---

## [MemoryCheckCommand for CTest Memcheck with \[Address/Thread/Memory\]Sanitizer](https://discourse.cmake.org/t/memorycheckcommand-for-ctest-memcheck-with-address-thread-memory-sanitizer/1019)

<div class="topic-metadata">

**Author:** [@shaq](https://discourse.cmake.org/u/shaq)\
**Replies:** 13\
**Last updated:** [April 15, 2020, 9:42pm UTC](https://discourse.cmake.org/t/memorycheckcommand-for-ctest-memcheck-with-address-thread-memory-sanitizer/1019 "2020-04-15T21:42:49Z")

</div>

Hi, I’m trying to setup CTest memcheck for build with sanitizers. I have an issue with missing MemoryCheckCommand/CTEST\_MEMORYCHECK\_COMMAND setting: Memory checker (MemoryCheckCommand) not set, or cannot find the spec…

---

## [How do I properly build OpenCV 4.3 with CUDA 10.1 support ?](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033)

<div class="topic-metadata">

**Author:** [@raisa](https://discourse.cmake.org/u/raisa)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 4:09pm UTC](https://discourse.cmake.org/t/how-do-i-properly-build-opencv-4-3-with-cuda-10-1-support/1033 "2020-04-15T16:09:58Z")

</div>

Anyone successfully build OpenCV with Cuda using CMake on Linux (Ubuntu) ? I encountered this error : OpenCV requires enabled 'cudev' module from 'opencv\_contrib' I’m using OpenCV 4.3, with Cuda 10.1 and my machine i…

---

## [Running commands in spec file install section using CPackRPM](https://discourse.cmake.org/t/running-commands-in-spec-file-install-section-using-cpackrpm/993)

<div class="topic-metadata">

**Author:** [@praetorian](https://discourse.cmake.org/u/praetorian)\
**Replies:** 6\
**Last updated:** [April 14, 2020, 11:51am UTC](https://discourse.cmake.org/t/running-commands-in-spec-file-install-section-using-cpackrpm/993 "2020-04-14T11:51:38Z")

</div>

Hello, I’m trying to package a project using CPack RPM. During packaging, I need to post process some of the installed files after they’ve been copied to RPM\_BUILD\_ROOT (or whatever temp location install copies them to)…

---

## [XCode 11 / command line tools SDK confusion](https://discourse.cmake.org/t/xcode-11-command-line-tools-sdk-confusion/984)

<div class="topic-metadata">

**Author:** [@zakalawe](https://discourse.cmake.org/u/zakalawe)\
**Replies:** 9\
**Last updated:** [April 14, 2020, 10:28am UTC](https://discourse.cmake.org/t/xcode-11-command-line-tools-sdk-confusion/984 "2020-04-14T10:28:13Z")

</div>

I’m seeing an issue with CMake 3.17 (doesn’t seem to occur with CMake 3.16.5) where the generated command line includes two different macOS SDK locations. The actual active SDK (based on XCode-select) is included via -is…

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

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