# Latest

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

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

**Page:** 205

---

## [Benefits of using target\_sources() on INTERFACE targets?](https://discourse.cmake.org/t/benefits-of-using-target-sources-on-interface-targets/648)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 3\
**Last updated:** [February 18, 2020, 2:49pm UTC](https://discourse.cmake.org/t/benefits-of-using-target-sources-on-interface-targets/648 "2020-02-18T14:49:46Z")

</div>

Should I, and why should I add my headers to header only libraries? add\_library(headeronly INTERFACE) target\_include\_directories(headeronly "include") target\_sources(headeronly INTERFACE "include/header.h") The headers…

---

## [how to set link flag for specific target (MKL) and deal with the dependence between several libraries](https://discourse.cmake.org/t/how-to-set-link-flag-for-specific-target-mkl-and-deal-with-the-dependence-between-several-libraries/645)

<div class="topic-metadata">

**Author:** [@Crownk](https://discourse.cmake.org/u/Crownk)\
**Replies:** 3\
**Last updated:** [February 18, 2020, 8:07am UTC](https://discourse.cmake.org/t/how-to-set-link-flag-for-specific-target-mkl-and-deal-with-the-dependence-between-several-libraries/645 "2020-02-18T08:07:19Z")

</div>

I write a project which is composed of several libraries and Intel MKL library. I want to use CMake to compile my project and I have two CMakeLists.txt as the following. In the root directory, cmake\_minimum\_required(…

---

## [Unknow system error when using cmake-gui](https://discourse.cmake.org/t/unknow-system-error-when-using-cmake-gui/172)

<div class="topic-metadata">

**Author:** [@Rufus7](https://discourse.cmake.org/u/Rufus7)\
**Replies:** 2\
**Last updated:** [February 17, 2020, 11:27pm UTC](https://discourse.cmake.org/t/unknow-system-error-when-using-cmake-gui/172 "2020-02-17T23:27:47Z")

</div>

Few days ago, I used cmake to configure a package and it worked fine. But for some reason I need to uninstall this package and install it all over again. So I run these commands under /build: $sudo make uninstall $sudo…

---

## ["Multiple definition" error only for additional header file in Qt CMakeFile](https://discourse.cmake.org/t/multiple-definition-error-only-for-additional-header-file-in-qt-cmakefile/640)

<div class="topic-metadata">

**Author:** [@prex](https://discourse.cmake.org/u/prex)\
**Replies:** 7\
**Last updated:** [February 17, 2020, 2:41pm UTC](https://discourse.cmake.org/t/multiple-definition-error-only-for-additional-header-file-in-qt-cmakefile/640 "2020-02-17T14:41:05Z")

</div>

I’m building Qt 5 with CMake. This worked fine so far until I added an additional header file with some message definitions. The header file is called “messages.h” and contains message\_definitions::error\_msgs\_ string. I …

---

## [CPackIFW: what is "@ApplicationsDir@"](https://discourse.cmake.org/t/cpackifw-what-is-applicationsdir/647)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 2\
**Last updated:** [February 17, 2020, 2:08pm UTC](https://discourse.cmake.org/t/cpackifw-what-is-applicationsdir/647 "2020-02-17T14:08:52Z")

</div>

The CPackIFW help page says about the variable CPACK\_IFW\_TARGET\_DIRECTORY: "Default target directory for installation. By default used @ApplicationsDir@/CPACK\_PACKAGE\_INSTALL\_DIRECTORY" What kind of macro is this @Appli…

---

## [Explain target dependencies for custom commands](https://discourse.cmake.org/t/explain-target-dependencies-for-custom-commands/639)

<div class="topic-metadata">

**Author:** [@hex](https://discourse.cmake.org/u/hex)\
**Replies:** 1\
**Last updated:** [February 17, 2020, 11:42am UTC](https://discourse.cmake.org/t/explain-target-dependencies-for-custom-commands/639 "2020-02-17T11:42:51Z")

</div>

If a target is listed, it will be brought up to date any time the custom command’s output files are required to brought up to date. Can I have an example for this? What is the difference between this: project(MyProj…

---

## [defacto directory standard for add\_subdirectory](https://discourse.cmake.org/t/defacto-directory-standard-for-add-subdirectory/642)

<div class="topic-metadata">

**Author:** [@Ben\_M](https://discourse.cmake.org/u/Ben_M)\
**Replies:** 1\
**Last updated:** [February 17, 2020, 11:22am UTC](https://discourse.cmake.org/t/defacto-directory-standard-for-add-subdirectory/642 "2020-02-17T11:22:07Z")

</div>

What do you guys think of cmake and other build systems to support a defacto directory standard like ./lib - for compiled .a .so files ./modules/\<compiler\_id\> for compiled modules using new c++ modules ./include for t…

---

## [How to force the find\_package searching inside a specific directory?](https://discourse.cmake.org/t/how-to-force-the-find-package-searching-inside-a-specific-directory/614)

<div class="topic-metadata">

**Author:** [@Tianfang\_Sun](https://discourse.cmake.org/u/Tianfang_Sun)\
**Replies:** 6\
**Last updated:** [February 17, 2020, 11:20am UTC](https://discourse.cmake.org/t/how-to-force-the-find-package-searching-inside-a-specific-directory/614 "2020-02-17T11:20:06Z")

</div>

Hi all. I’m trying to cross compile a Qt program using cmake. What I’m trying to do is to force the find\_package searching for a directory. From the document I read as follows: The default search order is designed to …

---

## [What is the function of add\_custom\_target in CMake?](https://discourse.cmake.org/t/what-is-the-function-of-add-custom-target-in-cmake/638)

<div class="topic-metadata">

**Author:** [@Crownk](https://discourse.cmake.org/u/Crownk)\
**Replies:** 5\
**Last updated:** [February 17, 2020, 6:55am UTC](https://discourse.cmake.org/t/what-is-the-function-of-add-custom-target-in-cmake/638 "2020-02-17T06:55:35Z")

</div>

From the CMake Cookbook, I see that we can use the command add\_custom\_command and add\_custom\_target to run a custom command at build time. There is a toy example that I want to extract compressed files in subdirecto…

---

## [On usage of ExternalData module](https://discourse.cmake.org/t/on-usage-of-externaldata-module/633)

<div class="topic-metadata">

**Author:** [@Adem\_Budak](https://discourse.cmake.org/u/Adem_Budak)\
**Replies:** 3\
**Last updated:** [February 16, 2020, 1:10am UTC](https://discourse.cmake.org/t/on-usage-of-externaldata-module/633 "2020-02-16T01:10:28Z")

</div>

Hi, I’m trying to fetch an archive file from the remote and want to put it on source directory at build time. So tried the following code: if(CHIP8\_DOWNLOAD\_ROMS) …

---

## [How cmake search custom system and language from specific directories?](https://discourse.cmake.org/t/how-cmake-search-custom-system-and-language-from-specific-directories/607)

<div class="topic-metadata">

**Author:** [@lijianzhong](https://discourse.cmake.org/u/lijianzhong)\
**Replies:** 1\
**Last updated:** [February 16, 2020, 12:57am UTC](https://discourse.cmake.org/t/how-cmake-search-custom-system-and-language-from-specific-directories/607 "2020-02-16T00:57:21Z")

</div>

Our project need to add some custom system and custom language support. But we don’t want to make change to cmake program. So if i put the languange extension in PROJECT\_ROOT/cmake/modules/ and PROJECT\_ROOT/cmake/modules…

---

## [How to put regex string as compiler option](https://discourse.cmake.org/t/how-to-put-regex-string-as-compiler-option/589)

<div class="topic-metadata">

**Author:** [@yurybura](https://discourse.cmake.org/u/yurybura)\
**Replies:** 4\
**Last updated:** [February 16, 2020, 12:49am UTC](https://discourse.cmake.org/t/how-to-put-regex-string-as-compiler-option/589 "2020-02-16T00:49:53Z")

</div>

I want to write a simple function in CMake: function(add\_my\_compiler\_options target\_name regexes) if(NOT "${regexes}" STREQUAL "") target\_compile\_options(${target\_name} PRIVATE "-fprofile-filter-fil…

---

## [cmake -E tar fails to create archive on Windows 10 with "CMake Error: archive\_write\_header: Can't record entry in tar file without pathname"](https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586)

<div class="topic-metadata">

**Author:** [@ivanonys](https://discourse.cmake.org/u/ivanonys)\
**Replies:** 1\
**Last updated:** [February 16, 2020, 12:48am UTC](https://discourse.cmake.org/t/cmake-e-tar-fails-to-create-archive-on-windows-10-with-cmake-error-archive-write-header-cant-record-entry-in-tar-file-without-pathname/586 "2020-02-16T00:48:50Z")

</div>

Hi, c:\\work\\test\_cmake\_tar\>cmake -E tar c out.tar – file.txt CMake Error: archive\_write\_header: Can’t record entry in tar file without pathname CMake Error: Problem creating tar: out.tar c:\\work\\test\_cmake\_tar\>type f…

---

## [feature requests](https://discourse.cmake.org/t/feature-requests/407)

<div class="topic-metadata">

**Author:** [@Lieven](https://discourse.cmake.org/u/Lieven)\
**Replies:** 3\
**Last updated:** [February 16, 2020, 12:41am UTC](https://discourse.cmake.org/t/feature-requests/407 "2020-02-16T00:41:35Z")

</div>

What is the best way to request for some features, pop them up in here for debate, or create an “issue” in the issues tracker ?

---

## [boost consumption, its internal dependencies](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579)

<div class="topic-metadata">

**Author:** [@Lieven](https://discourse.cmake.org/u/Lieven)\
**Replies:** 2\
**Last updated:** [February 16, 2020, 12:40am UTC](https://discourse.cmake.org/t/boost-consumption-its-internal-dependencies/579 "2020-02-16T00:40:58Z")

</div>

Use case : incorporating building some boost libraries via External Project, so no find\_package (since also cross build scenarios), Afterwards in the same CMakeLists.txt I can either turn them into: imported targets ==\>…

---

## [cmake compiled the code perfectly, not sure what to do next](https://discourse.cmake.org/t/cmake-compiled-the-code-perfectly-not-sure-what-to-do-next/535)

<div class="topic-metadata">

**Author:** [@Daddy\_Kwool](https://discourse.cmake.org/u/Daddy_Kwool)\
**Replies:** 1\
**Last updated:** [February 16, 2020, 12:22am UTC](https://discourse.cmake.org/t/cmake-compiled-the-code-perfectly-not-sure-what-to-do-next/535 "2020-02-16T00:22:53Z")

</div>

Hello I am working on a raspberry pi trying to get an LCD to work with an MCP I/O expander. After cloning and compiling the software the files below are left. The logs are here. With Python I end up with a py file I…

---

## [Building v3.16.2 - Failures during make test?](https://discourse.cmake.org/t/building-v3-16-2-failures-during-make-test/477)

<div class="topic-metadata">

**Author:** [@AndyWharton](https://discourse.cmake.org/u/AndyWharton)\
**Replies:** 6\
**Last updated:** [February 16, 2020, 12:04am UTC](https://discourse.cmake.org/t/building-v3-16-2-failures-during-make-test/477 "2020-02-16T00:04:31Z")

</div>

I’m trying to build v3.16.2 from source, using: ./bootstrap --parallel=32 --prefix=~/local -- -DCMAKE\_BUILD\_TYPE:STRING=Release \\ && make -j32 \\ && make test \\ && make install But I’m seeing some failed tests… 99% tes…

---

## [Exclude build directories from cpack source package](https://discourse.cmake.org/t/exclude-build-directories-from-cpack-source-package/423)

<div class="topic-metadata">

**Author:** [@Acsor](https://discourse.cmake.org/u/Acsor)\
**Replies:** 1\
**Last updated:** [February 15, 2020, 11:58pm UTC](https://discourse.cmake.org/t/exclude-build-directories-from-cpack-source-package/423 "2020-02-15T23:58:17Z")

</div>

I have a basic CMake setup for a project whose sources I want to distribute as an archive. My current CPack config. is as follows include(InstallRequiredSystemLibraries) set(CPACK\_PACKAGE\_NAME bikaya) set(CPACK\_RESOURC…

---

## [CMake 3.13 Error Installation of a program](https://discourse.cmake.org/t/cmake-3-13-error-installation-of-a-program/425)

<div class="topic-metadata">

**Author:** [@LordCalvin](https://discourse.cmake.org/u/LordCalvin)\
**Replies:** 1\
**Last updated:** [February 15, 2020, 11:56pm UTC](https://discourse.cmake.org/t/cmake-3-13-error-installation-of-a-program/425 "2020-02-15T23:56:14Z")

</div>

Hi everybody, I have a question for a CMake related issue with installing a program. I use this command to install TensorRT with CMake: cmake .. -DTENSORRT\_ROOT=/usr/src/tensorrt/samples/python/yolov3\_onnx/onnx-tensor…

---

## [SPIR-V compiler custom\_command has unexpected execution order](https://discourse.cmake.org/t/spir-v-compiler-custom-command-has-unexpected-execution-order/353)

<div class="topic-metadata">

**Author:** [@Bodie](https://discourse.cmake.org/u/Bodie)\
**Replies:** 4\
**Last updated:** [February 15, 2020, 11:28pm UTC](https://discourse.cmake.org/t/spir-v-compiler-custom-command-has-unexpected-execution-order/353 "2020-02-15T23:28:56Z")

</div>

Hi all! First post. I’ve been using CMake with C++ for a while, but have avoided custom commands and targets until now. Here’s my CMakeLists.txt: https://paste.ubuntu.com/p/KTMTk473qm/ BackgroundI have a C++ library …

---

## [Quotations in ctest scripts and proper usage of MPIEXEC\_PREFLAGS](https://discourse.cmake.org/t/quotations-in-ctest-scripts-and-proper-usage-of-mpiexec-preflags/338)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 3\
**Last updated:** [February 15, 2020, 11:20pm UTC](https://discourse.cmake.org/t/quotations-in-ctest-scripts-and-proper-usage-of-mpiexec-preflags/338 "2020-02-15T23:20:11Z")

</div>

I use MPIEXEC\_PREFLAGS when adding a test as described in the FindMPI documentation. For example: add\_test( NAME mytest COMMAND ${MPIEXEC\_EXECUTABLE} ${MPIEXEC\_NUMPROC\_FLAG} 4 ${MPIEXEC\_PREFLAGS} mytest ${MPIEXE…

---

## [How to get pkg-config working inside cmake on appveyor-ci / win10 / msys](https://discourse.cmake.org/t/how-to-get-pkg-config-working-inside-cmake-on-appveyor-ci-win10-msys/324)

<div class="topic-metadata">

**Author:** [@shlomif](https://discourse.cmake.org/u/shlomif)\
**Replies:** 1\
**Last updated:** [February 15, 2020, 11:07pm UTC](https://discourse.cmake.org/t/how-to-get-pkg-config-working-inside-cmake-on-appveyor-ci-win10-msys/324 "2020-02-15T23:07:57Z")

</div>

I created a cmake-based installer and a mageia linux package for my rinutils library. Now when trying to get the bhs solver branch to find “librinutils.pc” it works fine in travis-ci but fails in appveyor where it uses M…

---

## [execute\_process buffers and doesn't print question when process is waiting on user input.](https://discourse.cmake.org/t/execute-process-buffers-and-doesnt-print-question-when-process-is-waiting-on-user-input/266)

<div class="topic-metadata">

**Author:** [@Ben\_M](https://discourse.cmake.org/u/Ben_M)\
**Replies:** 1\
**Last updated:** [February 15, 2020, 10:55pm UTC](https://discourse.cmake.org/t/execute-process-buffers-and-doesnt-print-question-when-process-is-waiting-on-user-input/266 "2020-02-15T22:55:54Z")

</div>

I have a script that runs and uses SSH, the script eventually asks for password. However because of buffering the user doesn’t know that a password is being asked, but one can be inputted and the script will continue. Ev…

---

## [cmake\_properties for options](https://discourse.cmake.org/t/cmake-properties-for-options/250)

<div class="topic-metadata">

**Author:** [@eriols](https://discourse.cmake.org/u/eriols)\
**Replies:** 5\
**Last updated:** [February 15, 2020, 10:52pm UTC](https://discourse.cmake.org/t/cmake-properties-for-options/250 "2020-02-15T22:52:53Z")

</div>

Hi, I’d like to have a property that holds all the option that are active that I can then query via the get\_cmake\_property. I can get them printed by running cmake with the -L argument but I’d prefer them available throu…

---

## [Projects/Subprojects in cdash](https://discourse.cmake.org/t/projects-subprojects-in-cdash/222)

<div class="topic-metadata">

**Author:** [@David\_Dixon](https://discourse.cmake.org/u/David_Dixon)\
**Replies:** 7\
**Last updated:** [February 15, 2020, 10:43pm UTC](https://discourse.cmake.org/t/projects-subprojects-in-cdash/222 "2020-02-15T22:43:54Z")

</div>

I work on a project (call it super) that has several subprojects (call them sub1 and sub2) and I have a few issues (I tried to bold the the issues). Also, I had to remove several images because I am a new user… In CDash…

---

## [Does the CPack IFW Generator always include the module CPackIFW?](https://discourse.cmake.org/t/does-the-cpack-ifw-generator-always-include-the-module-cpackifw/615)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 5\
**Last updated:** [February 13, 2020, 8:48pm UTC](https://discourse.cmake.org/t/does-the-cpack-ifw-generator-always-include-the-module-cpackifw/615 "2020-02-13T20:48:33Z")

</div>

The doc page “CPack IFW Generator”, section “Hints”, says: “Generally, the CPack IFW generator automatically finds QtIFW tools …” Does that imply that the IFW generator always includes the module CPackIFW?

---

## [Inconsistencies in case sensitivity and naming of CMake-created build targets](https://discourse.cmake.org/t/inconsistencies-in-case-sensitivity-and-naming-of-cmake-created-build-targets/627)

<div class="topic-metadata">

**Author:** [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Replies:** 4\
**Last updated:** [February 13, 2020, 8:42pm UTC](https://discourse.cmake.org/t/inconsistencies-in-case-sensitivity-and-naming-of-cmake-created-build-targets/627 "2020-02-13T20:42:10Z")

</div>

As highlighted recently in another thread, there are inconsistencies in lower/uppercase and naming between generators for some of the targets that CMake automatically defines. In particular, we have all, ALL and ALL\_BUIL…

---

## [How to use fixup\_bundle for non-OSX targets for library and executable](https://discourse.cmake.org/t/how-to-use-fixup-bundle-for-non-osx-targets-for-library-and-executable/634)

<div class="topic-metadata">

**Author:** [@rdbisme](https://discourse.cmake.org/u/rdbisme)\
**Replies:** 0\
**Last updated:** [February 13, 2020, 6:00pm UTC](https://discourse.cmake.org/t/how-to-use-fixup-bundle-for-non-osx-targets-for-library-and-executable/634 "2020-02-13T18:00:57Z")

</div>

In my library I have a shared library target and an executable target. I’m trying to use BundleUtilities and fixup\_bundle to create a tarball like this (I guess I’ll use cPack for packing) with all the dependencies bundl…

---

## [Types of cmakelist.txt](https://discourse.cmake.org/t/types-of-cmakelist-txt/629)

<div class="topic-metadata">

**Author:** [@Bravepaulo](https://discourse.cmake.org/u/Bravepaulo)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 4:20pm UTC](https://discourse.cmake.org/t/types-of-cmakelist-txt/629 "2020-02-13T16:20:46Z")

</div>

Hello I evaluating the following project and I have some questions regarding the cmakelist.txt files that are part t his project. The structure is the following: proj: -CMakeLists.txt -Subdirectory 1 -CMakeLists.tx…

---

## [Source package vs binary installer; CPackArchive vs other generators](https://discourse.cmake.org/t/source-package-vs-binary-installer-cpackarchive-vs-other-generators/622)

<div class="topic-metadata">

**Author:** [@jwuttke](https://discourse.cmake.org/u/jwuttke)\
**Replies:** 1\
**Last updated:** [February 13, 2020, 12:25am UTC](https://discourse.cmake.org/t/source-package-vs-binary-installer-cpackarchive-vs-other-generators/622 "2020-02-13T00:25:29Z")

</div>

While actively working through the docs, things are slowly getting clearer to me … and new questions arise: Is CPackArchive the only generator for source packages? All other CPack generators generate installers? CPack…

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

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