# Usage

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

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

**Page:** 98

---

## [wrong build order with generator expression TARGET\_LINKER\_FILE](https://discourse.cmake.org/t/wrong-build-order-with-generator-expression-target-linker-file/380)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 4\
**Last updated:** [December 13, 2019, 3:56pm UTC](https://discourse.cmake.org/t/wrong-build-order-with-generator-expression-target-linker-file/380 "2019-12-13T15:56:49Z")

</div>

top-level CMakeLists.txt has add\_subdirectory(MyLib) add\_subdirectory(Tests) MyLib/CMakeLists.txt has add\_library(MyLib \<sources\>) ... Tests/CMakeLists.txt has add\_executable(Test1 \<sources\>) target\_link\_libraries(T…

---

## [Build ID](https://discourse.cmake.org/t/build-id/354)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 8\
**Last updated:** [December 13, 2019, 2:44pm UTC](https://discourse.cmake.org/t/build-id/354 "2019-12-13T14:44:36Z")

</div>

When running CI it would be great to post a link to the build on cdash. Is it possible to generate the link? If not, it seems like I just need the buildid e.g.: https://mycdashserver.com/cdash/buildSummary.php?buildid=1…

---

## [How to call ninja-build instead of ninja?](https://discourse.cmake.org/t/how-to-call-ninja-build-instead-of-ninja/352)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 4\
**Last updated:** [December 12, 2019, 10:16am UTC](https://discourse.cmake.org/t/how-to-call-ninja-build-instead-of-ninja/352 "2019-12-12T10:16:39Z")

</div>

I am using Visual Studio 2017 to remotely build software on a Centos 7 machine, using CMake. On the Centos machine we installed the ninja-build package. So the ninja command is ‘ninja-build’. How do I tell CMake to cal…

---

## [Upload file to dashboard file generated during CI](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 13\
**Last updated:** [December 12, 2019, 4:20am UTC](https://discourse.cmake.org/t/upload-file-to-dashboard-file-generated-during-ci/152 "2019-12-12T04:20:35Z")

</div>

I am generating a file that captures all of the steps that occur during CI such that devs can grab the file login to a cluster and run the script to reproduce the environment, config, build etc. steps that occured during…

---

## [Is target specific stuff transitive to dependencies?](https://discourse.cmake.org/t/is-target-specific-stuff-transitive-to-dependencies/336)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 10\
**Last updated:** [December 10, 2019, 12:30am UTC](https://discourse.cmake.org/t/is-target-specific-stuff-transitive-to-dependencies/336 "2019-12-10T00:30:33Z")

</div>

We have some libraries that are to be consumed by multiple applications, but with different compile definitions or flags. For example, when compiled with app-A, we need -DappA. When compiled with app-B, we need -DappB. I…

---

## [The nightmare of copy paste of FindXXX.cmake via the case of libvorbis](https://discourse.cmake.org/t/the-nightmare-of-copy-paste-of-findxxx-cmake-via-the-case-of-libvorbis/334)

<div class="topic-metadata">

**Author:** [@Hinara](https://discourse.cmake.org/u/Hinara)\
**Replies:** 2\
**Last updated:** [December 9, 2019, 1:21pm UTC](https://discourse.cmake.org/t/the-nightmare-of-copy-paste-of-findxxx-cmake-via-the-case-of-libvorbis/334 "2019-12-09T13:21:45Z")

</div>

Hello, I would like to speak with the CMake community about something that I’ve discovered and which is freaking scary. I know that people don’t like to write by themselves the FindXXX.cmake files, making them copied a…

---

## [permission problem when installing files while I do have write permission](https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292)

<div class="topic-metadata">

**Author:** [@KrisThielemans](https://discourse.cmake.org/u/KrisThielemans)\
**Replies:** 1\
**Last updated:** [December 4, 2019, 2:24pm UTC](https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292 "2019-12-04T14:24:08Z")

</div>

Hi I’m trying to install files in a directory (let’s call it /install) where I have write permissions, but that we share with people in the same “group” Doing “make install” runs fine until I get CMake Error at src/cm…

---

## [Newer CMake v. 3.12.4 v. OP25 project](https://discourse.cmake.org/t/newer-cmake-v-3-12-4-v-op25-project/320)

<div class="topic-metadata">

**Author:** [@op25](https://discourse.cmake.org/u/op25)\
**Replies:** 4\
**Last updated:** [December 4, 2019, 1:59pm UTC](https://discourse.cmake.org/t/newer-cmake-v-3-12-4-v-op25-project/320 "2019-12-04T13:59:37Z")

</div>

Many users are following tutorials/HOWTO/FAQ’s etc. on installing the OP25 radio software for use with SDR’s… http://osmocom.org/issues/4225 OP25 Project: https://github.com/boatbod/op25 https://github.com/boatbod/o…

---

## [PDF documentation](https://discourse.cmake.org/t/pdf-documentation/293)

<div class="topic-metadata">

**Author:** [@Phi](https://discourse.cmake.org/u/Phi)\
**Replies:** 1\
**Last updated:** [December 2, 2019, 8:30am UTC](https://discourse.cmake.org/t/pdf-documentation/293 "2019-12-02T08:30:44Z")

</div>

HI, Is there a .pdf documentation somewhere (didn’t find it), or is there a way to build it ‘easily’. The rationale is to be able to browse the docco, beside beeing able to put it off line on my tablet and read it on th…

---

## [CMAKE\_EXPORT\_COMPILE\_COMMANDS does not list assembly code files in the generated json file](https://discourse.cmake.org/t/cmake-export-compile-commands-does-not-list-assembly-code-files-in-the-generated-json-file/283)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 7:24am UTC](https://discourse.cmake.org/t/cmake-export-compile-commands-does-not-list-assembly-code-files-in-the-generated-json-file/283 "2019-12-02T07:24:55Z")

</div>

My project has both C and ASM source files. With -DCMAKE\_EXPORT\_COMPILE\_COMMANDS=ON from the command line, a compile\_commands.json file is generated with all C source files listed in it, but none of ASM files are listed.…

---

## [How to cpack dependent shared libraries along with my executable?](https://discourse.cmake.org/t/how-to-cpack-dependent-shared-libraries-along-with-my-executable/267)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 2\
**Last updated:** [November 27, 2019, 11:15pm UTC](https://discourse.cmake.org/t/how-to-cpack-dependent-shared-libraries-along-with-my-executable/267 "2019-11-27T23:15:53Z")

</div>

I have a cmake project which builds an executable. The executable depends on a 3rd party .so file to run: … add\_executable(myapp …) target\_link\_libraries(myapp ${3rd\_party\_so}) #install rules: set(CMAKE\_INSTALL\_PR…

---

## [How to force 64-bit build using Ninja on Windows?](https://discourse.cmake.org/t/how-to-force-64-bit-build-using-ninja-on-windows/271)

<div class="topic-metadata">

**Author:** [@DavidA](https://discourse.cmake.org/u/DavidA)\
**Replies:** 1\
**Last updated:** [November 27, 2019, 1:24pm UTC](https://discourse.cmake.org/t/how-to-force-64-bit-build-using-ninja-on-windows/271 "2019-11-27T13:24:37Z")

</div>

I have two x64 Windows machines. One has Visual Studio Build Tools 2017 installed, the other has Visual Studio Build Tools 2019 installed. On the machine with Visual Studio Build Tools 2019 I see: \>cmake -G Ninja .. --…

---

## [Debian 9, getting cmake-3.9 or above](https://discourse.cmake.org/t/debian-9-getting-cmake-3-9-or-above/251)

<div class="topic-metadata">

**Author:** [@Christian\_Koberg](https://discourse.cmake.org/u/Christian_Koberg)\
**Replies:** 2\
**Last updated:** [November 25, 2019, 1:35pm UTC](https://discourse.cmake.org/t/debian-9-getting-cmake-3-9-or-above/251 "2019-11-25T13:35:55Z")

</div>

I am running Debian 9 an need cmake v3.9 or higher. Debian 9 has a package of cmake v3.7. I go to the page https://cmake.org/install/ and download cmake-3.15.5.tar.gz source. First i followed your instructions: Or, …

---

## [mscoree.lib not found when compiling C++/CLI project with CMake using Build Tools](https://discourse.cmake.org/t/mscoree-lib-not-found-when-compiling-c-cli-project-with-cmake-using-build-tools/234)

<div class="topic-metadata">

**Author:** [@Kerstin\_Keller](https://discourse.cmake.org/u/Kerstin_Keller)\
**Replies:** 0\
**Last updated:** [November 19, 2019, 5:03pm UTC](https://discourse.cmake.org/t/mscoree-lib-not-found-when-compiling-c-cli-project-with-cmake-using-build-tools/234 "2019-11-19T17:03:32Z")

</div>

I am not quite sure if this issue is a CMake or a VS2019 Build Tools error: I am trying to build a C++/CLI application using CMake and only the Visual Studio 2019 Build Tools installed. Pure C++ applications I can comp…

---

## [CPack/NSIS Generator Issues](https://discourse.cmake.org/t/cpack-nsis-generator-issues/209)

<div class="topic-metadata">

**Author:** [@Ravi\_Ramaseshan](https://discourse.cmake.org/u/Ravi_Ramaseshan)\
**Replies:** 2\
**Last updated:** [November 18, 2019, 3:23pm UTC](https://discourse.cmake.org/t/cpack-nsis-generator-issues/209 "2019-11-18T15:23:22Z")

</div>

Problem 1: I think there might be an issue with CPack’s NSIS generator where if the components (specified through CPACK\_COMPONENTS\_ALL contains a-\` (eg. llvm-nm, llvm-libtool) then the generator creates variables with t…

---

## [Visual studio update 15.9.17 breaks CUDA support](https://discourse.cmake.org/t/visual-studio-update-15-9-17-breaks-cuda-support/214)

<div class="topic-metadata">

**Author:** [@mgagnon](https://discourse.cmake.org/u/mgagnon)\
**Replies:** 1\
**Last updated:** [November 15, 2019, 2:55pm UTC](https://discourse.cmake.org/t/visual-studio-update-15-9-17-breaks-cuda-support/214 "2019-11-15T14:55:48Z")

</div>

After the 15.9.17 update of Visual studio 2017 Professionnal, CMAKE was no longer able to find CUDA on my computer. I figured out that the 15 9.17 update had created a new folder named C:\\Program Files (x86)\\Microsoft …

---

## [How to take advantage of INTERFACE\_INCLUDE\_DIRECTORIES when building static or OBJECT libraries?](https://discourse.cmake.org/t/how-to-take-advantage-of-interface-include-directories-when-building-static-or-object-libraries/207)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 1\
**Last updated:** [November 15, 2019, 9:11am UTC](https://discourse.cmake.org/t/how-to-take-advantage-of-interface-include-directories-when-building-static-or-object-libraries/207 "2019-11-15T09:11:04Z")

</div>

It seems that INTERFACE\_INCLUDE\_DIRECTORIES is only read and used to populate the include search paths by target\_link\_libraries. When building a static or OBJECT library, there is no linking step, so it does not make sen…

---

## [Custom Build Type](https://discourse.cmake.org/t/custom-build-type/201)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 2\
**Last updated:** [November 14, 2019, 3:13pm UTC](https://discourse.cmake.org/t/custom-build-type/201 "2019-11-14T15:13:30Z")

</div>

Is there a idiomatic way to provide a custom build type? For example, if I want to have Release flags plus march=native and mtune=native how should I go about doing this? Certainly, I could add them to CMAKE\_CXX\_FLAGS wh…

---

## [Cmake not detecting the CXX compiler](https://discourse.cmake.org/t/cmake-not-detecting-the-cxx-compiler/190)

<div class="topic-metadata">

**Author:** [@rmadhuraj](https://discourse.cmake.org/u/rmadhuraj)\
**Replies:** 2\
**Last updated:** [November 14, 2019, 4:26am UTC](https://discourse.cmake.org/t/cmake-not-detecting-the-cxx-compiler/190 "2019-11-14T04:26:35Z")

</div>

HI My Cmake by default not taking the CXX compiler, taking only C for the compilation. So the cpp files in the project were not being compiled. My tool chain file is like this set(CMAKE\_SYSTEM\_PROCESSOR aarch64) To…

---

## [Possible bugs with armclang toolchain](https://discourse.cmake.org/t/possible-bugs-with-armclang-toolchain/168)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 8\
**Last updated:** [November 12, 2019, 3:46pm UTC](https://discourse.cmake.org/t/possible-bugs-with-armclang-toolchain/168 "2019-11-12T15:46:08Z")

</div>

I have a project to cross compile firmware for ARM Cortex A53 platform. At the very beginning of my CMakeLists.txt, I defined armclang toolchain by: cmake\_minimum\_required(VERSION 3.10) set(CMAKE\_SYSTEM\_NAME Generic) …

---

## [Wrong CMake version being applied for cmake-gui](https://discourse.cmake.org/t/wrong-cmake-version-being-applied-for-cmake-gui/181)

<div class="topic-metadata">

**Author:** [@abdekker](https://discourse.cmake.org/u/abdekker)\
**Replies:** 8\
**Last updated:** [November 12, 2019, 3:39pm UTC](https://discourse.cmake.org/t/wrong-cmake-version-being-applied-for-cmake-gui/181 "2019-11-12T15:39:45Z")

</div>

On Ubuntu 18.04, I had CMake 3.10.2 installed (in /usr/bin). Following instructions on the kitware.com website, I was able to update CMake to 3.13.5. The 3.13.5 binaries are installed in /usr/local/bin/cmake. The origina…

---

## [Best practices on finding third party libraries for a project?](https://discourse.cmake.org/t/best-practices-on-finding-third-party-libraries-for-a-project/170)

<div class="topic-metadata">

**Author:** [@thomthom](https://discourse.cmake.org/u/thomthom)\
**Replies:** 6\
**Last updated:** [November 8, 2019, 7:45pm UTC](https://discourse.cmake.org/t/best-practices-on-finding-third-party-libraries-for-a-project/170 "2019-11-08T19:45:43Z")

</div>

I’m new to CMake. Trying to read up on best practices and common concepts. One thing which eludes me is how to be able to provide CMake with paths for external libraries such that find\_library finds them. The documentat…

---

## [How to add additional commands in target recipes](https://discourse.cmake.org/t/how-to-add-additional-commands-in-target-recipes/138)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 4\
**Last updated:** [November 7, 2019, 2:11pm UTC](https://discourse.cmake.org/t/how-to-add-additional-commands-in-target-recipes/138 "2019-11-07T14:11:08Z")

</div>

I’m investigating if we can move from linux make to cmake. One of the issues I’m facing is, in our current makefile, on compiling each source file, we run a home-made tool to inspect the source code for some information: …

---

## [CMake 3.16-rc3 with the Xcode generator generates invalid entry for CMakeLists.txt](https://discourse.cmake.org/t/cmake-3-16-rc3-with-the-xcode-generator-generates-invalid-entry-for-cmakelists-txt/115)

<div class="topic-metadata">

**Author:** [@remyjette](https://discourse.cmake.org/u/remyjette)\
**Replies:** 2\
**Last updated:** [November 5, 2019, 6:58pm UTC](https://discourse.cmake.org/t/cmake-3-16-rc3-with-the-xcode-generator-generates-invalid-entry-for-cmakelists-txt/115 "2019-11-05T18:58:36Z")

</div>

Hopefully this is the right location to post this. I gave a try with CMake 3.16-rc3 on one of our projects, and noticed that when I viewed the generated .xcodeproj in the Xcode IDE each target had a weird empty entry th…

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