# Usage

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

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

**Page:** 75

---

## [Undefined symbols for some ObjC files](https://discourse.cmake.org/t/undefined-symbols-for-some-objc-files/3912)

<div class="topic-metadata">

**Author:** [@paulocoutinho](https://discourse.cmake.org/u/paulocoutinho)\
**Replies:** 2\
**Last updated:** [August 12, 2021, 11:50pm UTC](https://discourse.cmake.org/t/undefined-symbols-for-some-objc-files/3912 "2021-08-12T23:50:25Z")

</div>

Hi guys. Im breaking my head for days because a problem. Im getting undefined error without any reason apparently: Undefined symbol: \_OBJC\_CLASS\_$\_EZRLoggerPlatformServiceImpl Undefined symbol: \_OBJC\_CLASS\_$\_EZRHttpCli…

---

## [CMake Linux cross-compilation with (custom?) Clang toolchain on Windows host system](https://discourse.cmake.org/t/cmake-linux-cross-compilation-with-custom-clang-toolchain-on-windows-host-system/3906)

<div class="topic-metadata">

**Author:** [@x6herbius](https://discourse.cmake.org/u/x6herbius)\
**Replies:** 3\
**Last updated:** [August 12, 2021, 10:59am UTC](https://discourse.cmake.org/t/cmake-linux-cross-compilation-with-custom-clang-toolchain-on-windows-host-system/3906 "2021-08-12T10:59:52Z")

</div>

Hi all, I’m looking to get my CMake project set up to cross-compile a library for Linux from a Windows host. Because what I’m compiling has to be compatible with a specific version of the Unreal Engine, I want to use th…

---

## [FetchContent\_Declare with temporarily unreachable repositories](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908)

<div class="topic-metadata">

**Author:** [@rhodanos](https://discourse.cmake.org/u/rhodanos)\
**Replies:** 3\
**Last updated:** [August 12, 2021, 6:02am UTC](https://discourse.cmake.org/t/fetchcontent-declare-with-temporarily-unreachable-repositories/3908 "2021-08-12T06:02:53Z")

</div>

Hi everybody, I’ve recently started using the methods around FetchContent\_Declare to pull my external project components (Git, SVN) to my current CMake project and it works great so far. Today however was the first time…

---

## [I need help to change SWIG\_ADD\_MODULE at SWIG\_ADD\_LIBRARY in the CMakeLists.txt](https://discourse.cmake.org/t/i-need-help-to-change-swig-add-module-at-swig-add-library-in-the-cmakelists-txt/3910)

<div class="topic-metadata">

**Author:** [@amina](https://discourse.cmake.org/u/amina)\
**Replies:** 0\
**Last updated:** [August 11, 2021, 6:28pm UTC](https://discourse.cmake.org/t/i-need-help-to-change-swig-add-module-at-swig-add-library-in-the-cmakelists-txt/3910 "2021-08-11T18:28:08Z")

</div>

Hi; It gives me a message change SWIG\_ADD\_MODULE at SWIG\_ADD\_LIBRARY in the CMakeLists.txt The error is as follows : CMake Deprecation Warning at C:/Program Files/CMake/share/cmake-3.21/Modules/UseSWIG.cmake:724 (mess…

---

## [Establish dependency on header files generated by configure\_file](https://discourse.cmake.org/t/establish-dependency-on-header-files-generated-by-configure-file/3878)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 11\
**Last updated:** [August 6, 2021, 9:37am UTC](https://discourse.cmake.org/t/establish-dependency-on-header-files-generated-by-configure-file/3878 "2021-08-06T09:37:45Z")

</div>

My script generates a configure .h file from a template file by calling command configure\_file: configure\_file(config.h.in efc\_fw\_config.h) But my source files do not directly #include “efc\_fw\_config.h”. Instead, we …

---

## [FindPython3 cannot locate python3](https://discourse.cmake.org/t/findpython3-cannot-locate-python3/3873)

<div class="topic-metadata">

**Author:** [@oscarh](https://discourse.cmake.org/u/oscarh)\
**Replies:** 8\
**Last updated:** [August 6, 2021, 11:23am UTC](https://discourse.cmake.org/t/findpython3-cannot-locate-python3/3873 "2021-08-06T11:23:25Z")

</div>

My Centos7 has python2.7 in /usr/local/bin. I installed python3.6.8 in /bin The PATH variable has “/usr/local/bin:/bin”, so /usr/local/bin is ahead of /bin. The following command in my script fails: #Python3.6 or lat…

---

## [Should I be using types with -D options?](https://discourse.cmake.org/t/should-i-be-using-types-with-d-options/3877)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 6\
**Last updated:** [August 5, 2021, 10:43pm UTC](https://discourse.cmake.org/t/should-i-be-using-types-with-d-options/3877 "2021-08-05T22:43:21Z")

</div>

Just a general query for the CMake gurus on here. I’ve always done things like: cmake .. -DCMAKE\_BUILD\_TYPE=Release -DBUILD\_SHARED\_LIBS=OFF ... but I do see others using the more explicit typing: cmake .. -DCMAKE\_BUIL…

---

## [CMAKE\_INCLUDE\_CURRENT\_DIR\_IN\_INTERFACE does not add the current folder as a target property](https://discourse.cmake.org/t/cmake-include-current-dir-in-interface-does-not-add-the-current-folder-as-a-target-property/3880)

<div class="topic-metadata">

**Author:** [@laszlo](https://discourse.cmake.org/u/laszlo)\
**Replies:** 0\
**Last updated:** [August 5, 2021, 5:43am UTC](https://discourse.cmake.org/t/cmake-include-current-dir-in-interface-does-not-add-the-current-folder-as-a-target-property/3880 "2021-08-05T05:43:08Z")

</div>

Hey all, the cmake documentation says: If this variable is enabled, CMake automatically adds for each shared library target, static library target, module target and executable target, CMAKE\_CURRENT\_SOURCE\_DIR and CMA…

---

## [CTest log permissions/ownership behavior change?](https://discourse.cmake.org/t/ctest-log-permissions-ownership-behavior-change/3870)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 1\
**Last updated:** [August 4, 2021, 7:22pm UTC](https://discourse.cmake.org/t/ctest-log-permissions-ownership-behavior-change/3870 "2021-08-04T19:22:30Z")

</div>

When you run ctest, it Test logs. It moves old test logs before running new test logs. I have seen a behavior change switching from CMake 3.10.1 and CMake 3.20.5: The permissions/ownership of copy of the old log change…

---

## [Cmake log messages configuration](https://discourse.cmake.org/t/cmake-log-messages-configuration/3875)

<div class="topic-metadata">

**Author:** [@AverageLearner](https://discourse.cmake.org/u/AverageLearner)\
**Replies:** 5\
**Last updated:** [August 4, 2021, 2:21pm UTC](https://discourse.cmake.org/t/cmake-log-messages-configuration/3875 "2021-08-04T14:21:29Z")

</div>

Hello, I want to know how does the Cmake messages such as warning messages get displayed or logged in the the logfile. For example, if there is a find\_package(“one”) in the cmakelist.txt, and this package does not exist,…

---

## [How to propagate source\_group from INTERFACE library?](https://discourse.cmake.org/t/how-to-propagate-source-group-from-interface-library/2034)

<div class="topic-metadata">

**Author:** [@SSPkrolik](https://discourse.cmake.org/u/SSPkrolik)\
**Replies:** 3\
**Last updated:** [August 3, 2021, 9:41am UTC](https://discourse.cmake.org/t/how-to-propagate-source-group-from-interface-library/2034 "2021-08-03T09:41:12Z")

</div>

Hi. I build a C++ project with CMake and currently use an INTERFACE add\_library for including a header-only library. It works nicely propagating headers to library it linked to via target\_sources / target\_include\_direc…

---

## [Cannot find 'gettext' explicitly specifying the search PATHS in find\_package](https://discourse.cmake.org/t/cannot-find-gettext-explicitly-specifying-the-search-paths-in-find-package/3859)

<div class="topic-metadata">

**Author:** [@jjELT](https://discourse.cmake.org/u/jjELT)\
**Replies:** 2\
**Last updated:** [August 1, 2021, 3:27pm UTC](https://discourse.cmake.org/t/cannot-find-gettext-explicitly-specifying-the-search-paths-in-find-package/3859 "2021-08-01T15:27:58Z")

</div>

I downloaded and extracted the latest Gettext archive to a folder ${gettext\_PATH\_TO\_BIN\_FOLDER}. Additionally I have MSYS2 with gettext installed in C:\\msys64\\mingw64\\bin. That path is part of my PATH environmental vari…

---

## [Objects of target "X" referenced but is not an OBJECT library](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857)

<div class="topic-metadata">

**Author:** [@Wirtos](https://discourse.cmake.org/u/Wirtos)\
**Replies:** 2\
**Last updated:** [July 31, 2021, 4:24pm UTC](https://discourse.cmake.org/t/objects-of-target-x-referenced-but-is-not-an-object-library/3857 "2021-07-31T16:24:30Z")

</div>

I have a library that uses another third-party cmake subproject, which has library target X. In newer cmake versions (3.16+) I’m able to use $\<TARGET\_OBJECTS:X\> in order to make third party library an embedded part of my…

---

## [CMake build issue using MSYS2](https://discourse.cmake.org/t/cmake-build-issue-using-msys2/3855)

<div class="topic-metadata">

**Author:** [@Engr309](https://discourse.cmake.org/u/Engr309)\
**Replies:** 1\
**Last updated:** [July 29, 2021, 11:30pm UTC](https://discourse.cmake.org/t/cmake-build-issue-using-msys2/3855 "2021-07-29T23:30:23Z")

</div>

Greetings, I’m looking to utilize CMake in setting up OpenCV and am trying to follow their instructions which calls for an install of CMake. In the README file under “Windows” OS it suggest the following "Bootstrap wit…

---

## [Cmake error at cmake/FindSIP.cmake](https://discourse.cmake.org/t/cmake-error-at-cmake-findsip-cmake/3850)

<div class="topic-metadata">

**Author:** [@MohamadHalwani](https://discourse.cmake.org/u/MohamadHalwani)\
**Replies:** 2\
**Last updated:** [July 29, 2021, 10:38am UTC](https://discourse.cmake.org/t/cmake-error-at-cmake-findsip-cmake/3850 "2021-07-29T10:38:33Z")

</div>

I have an issue trying to build cura-build-environment, after running sudo make in build file I’m getting this… \[ 43%\] Performing configure step for 'Savitar' -- Find shared libpython: /usr/local/lib/libpython3.8.so Fa…

---

## [Setting the working directory for a C# project (MSVC)](https://discourse.cmake.org/t/setting-the-working-directory-for-a-c-project-msvc/3838)

<div class="topic-metadata">

**Author:** [@Harald\_Scheirich](https://discourse.cmake.org/u/Harald_Scheirich)\
**Replies:** 0\
**Last updated:** [July 27, 2021, 12:36pm UTC](https://discourse.cmake.org/t/setting-the-working-directory-for-a-c-project-msvc/3838 "2021-07-27T12:36:44Z")

</div>

I have a C# project created through cmake, but i can’t find a way to set the working directory for the resulting executable using VS\_DEBUGGER\_WORKING\_DIRECTORY doesn’t seem to work. Is that a bug or just not the correct …

---

## [Link shared library without use soversion](https://discourse.cmake.org/t/link-shared-library-without-use-soversion/3831)

<div class="topic-metadata">

**Author:** [@gabridc](https://discourse.cmake.org/u/gabridc)\
**Replies:** 2\
**Last updated:** [July 25, 2021, 5:19pm UTC](https://discourse.cmake.org/t/link-shared-library-without-use-soversion/3831 "2021-07-25T17:19:04Z")

</div>

Hi, I am trying to build an android application using QT and QML. The problem is that Android does not support soversion libraries (.s0.X), in the .apk package i can only include .so files. My Cmake project create a li…

---

## [Configure Cmake to only use OBJC linker only on MacOS (with PCH)](https://discourse.cmake.org/t/configure-cmake-to-only-use-objc-linker-only-on-macos-with-pch/3795)

<div class="topic-metadata">

**Author:** [@triscuitcircuit](https://discourse.cmake.org/u/triscuitcircuit)\
**Replies:** 5\
**Last updated:** [July 24, 2021, 11:45am UTC](https://discourse.cmake.org/t/configure-cmake-to-only-use-objc-linker-only-on-macos-with-pch/3795 "2021-07-24T11:45:07Z")

</div>

Im working on a cross platform project that I want to be compatible with MacOS, Linux and Windows however im encountering a weird issue with Cmake. Within my project I have Objc++ .mm files that I want only compiled on …

---

## [clang on Windows detected with MSVC interface](https://discourse.cmake.org/t/clang-on-windows-detected-with-msvc-interface/3470)

<div class="topic-metadata">

**Author:** [@vallant](https://discourse.cmake.org/u/vallant)\
**Replies:** 11\
**Last updated:** [July 23, 2021, 6:05am UTC](https://discourse.cmake.org/t/clang-on-windows-detected-with-msvc-interface/3470 "2021-07-23T06:05:20Z")

</div>

Hello, i try to compile a program on windows with ninja using clang++ (not clang-cl), in order to be able to use the same flags as on macOS and simplify the cmake scripts. However i encountered some strange behaviour, …

---

## [\[macOS\] CMake refuses to do a debug build](https://discourse.cmake.org/t/macos-cmake-refuses-to-do-a-debug-build/3807)

<div class="topic-metadata">

**Author:** [@Adam\_Sindelar](https://discourse.cmake.org/u/Adam_Sindelar)\
**Replies:** 4\
**Last updated:** [July 22, 2021, 7:20pm UTC](https://discourse.cmake.org/t/macos-cmake-refuses-to-do-a-debug-build/3807 "2021-07-22T19:20:29Z")

</div>

Hi there! I’m trying to get cmake to pass -g2 to clang on macOS, and having tried everything in the man page and on Stack Overflow, I’m at a loss. Nothing I do seems to change its mind about whether its doing a Release …

---

## [CMAKE's undefined variable in document 3.21.but could be used](https://discourse.cmake.org/t/cmakes-undefined-variable-in-document-3-21-but-could-be-used/3743)

<div class="topic-metadata">

**Author:** [@niyujin](https://discourse.cmake.org/u/niyujin)\
**Replies:** 13\
**Last updated:** [July 22, 2021, 5:48am UTC](https://discourse.cmake.org/t/cmakes-undefined-variable-in-document-3-21-but-could-be-used/3743 "2021-07-22T05:48:20Z")

</div>

hi, i’m a new cmake. now using cmake(v3.21) + ninja(v1.5) build cross-compiler enviroment by compiler Tasking v6.2r2 cause the compiler’s arguments are a little bit different from gcc, I have to use custom commands an…

---

## [After copy\_directory, the content in dSYM is changed](https://discourse.cmake.org/t/after-copy-directory-the-content-in-dsym-is-changed/3812)

<div class="topic-metadata">

**Author:** [@naeco2008](https://discourse.cmake.org/u/naeco2008)\
**Replies:** 0\
**Last updated:** [July 22, 2021, 5:04am UTC](https://discourse.cmake.org/t/after-copy-directory-the-content-in-dsym-is-changed/3812 "2021-07-22T05:04:47Z")

</div>

I am using cmake3.20.1. My CMakeList.txt looks like below: add\_custom\_command(TARGET ${target} POST\_BUILD COMMAND ${CMAKE\_COMMAND} -E copy\_directory “$\<TARGET\_FILE:${target}\>.dSYM” “${j\_default\_sym\_path}/$\<TARGET\_FILE…

---

## [Let CMakeLists search .pc instead of .cmake?](https://discourse.cmake.org/t/let-cmakelists-search-pc-instead-of-cmake/3810)

<div class="topic-metadata">

**Author:** [@jiapei100](https://discourse.cmake.org/u/jiapei100)\
**Replies:** 1\
**Last updated:** [July 22, 2021, 2:52am UTC](https://discourse.cmake.org/t/let-cmakelists-search-pc-instead-of-cmake/3810 "2021-07-22T02:52:15Z")

</div>

Hi, all: I wonder if there is a convenient way to let CMakeLists.txt search for packages installed with ONLY .pc (package config) files, instead of .cmake files? It seems find\_package() can ONLY search those packages w…

---

## [CTest can I change the location of where to run the tests?](https://discourse.cmake.org/t/ctest-can-i-change-the-location-of-where-to-run-the-tests/3797)

<div class="topic-metadata">

**Author:** [@echo](https://discourse.cmake.org/u/echo)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 1:35am UTC](https://discourse.cmake.org/t/ctest-can-i-change-the-location-of-where-to-run-the-tests/3797 "2021-07-21T01:35:43Z")

</div>

Is it possible to set the location of where to run the cunit tests to a different machine?

---

## [duplication of test execution with ctest\_memcheck() and sanitizers](https://discourse.cmake.org/t/duplication-of-test-execution-with-ctest-memcheck-and-sanitizers/3784)

<div class="topic-metadata">

**Author:** [@acioba](https://discourse.cmake.org/u/acioba)\
**Replies:** 2\
**Last updated:** [July 20, 2021, 2:30pm UTC](https://discourse.cmake.org/t/duplication-of-test-execution-with-ctest-memcheck-and-sanitizers/3784 "2021-07-20T14:30:41Z")

</div>

Hi, We use CTest to drive CMake to run unit tests which get published on CDash. Inspired by the blog post in \[1\] we aim at the following: run unit tests with memory checks (in our case AddressSanitizer) publish any m…

---

## [Preset and --trace(-expand) option](https://discourse.cmake.org/t/preset-and-trace-expand-option/3787)

<div class="topic-metadata">

**Author:** [@Neumann-A](https://discourse.cmake.org/u/Neumann-A)\
**Replies:** 1\
**Last updated:** [July 19, 2021, 8:29pm UTC](https://discourse.cmake.org/t/preset-and-trace-expand-option/3787 "2021-07-19T20:29:36Z")

</div>

Is there a way to pass --trace(-expand) via presets? Or is it currently missing from cmake?

---

## [Better way to work by modules with CMake and GTest or any library.](https://discourse.cmake.org/t/better-way-to-work-by-modules-with-cmake-and-gtest-or-any-library/3699)

<div class="topic-metadata">

**Author:** [@xhustango](https://discourse.cmake.org/u/xhustango)\
**Replies:** 6\
**Last updated:** [July 16, 2021, 9:57am UTC](https://discourse.cmake.org/t/better-way-to-work-by-modules-with-cmake-and-gtest-or-any-library/3699 "2021-07-16T09:57:17Z")

</div>

Hey there, I am finding myself stuck to integrate some libraries of my own that are using CMake into a product. I am integrating this into the main project. The different structure of the libraries is the following: L…

---

## [Derive DLLs for INSTALL (to be used with CPack)](https://discourse.cmake.org/t/derive-dlls-for-install-to-be-used-with-cpack/3757)

<div class="topic-metadata">

**Author:** [@SamuelMarks](https://discourse.cmake.org/u/SamuelMarks)\
**Replies:** 4\
**Last updated:** [July 16, 2021, 1:09am UTC](https://discourse.cmake.org/t/derive-dlls-for-install-to-be-used-with-cpack/3757 "2021-07-16T01:09:24Z")

</div>

I have written a little example project to show how to integrate vcpkg with various CMake features, including cmake, ctest, and cpack: GitHub - SamuelMarks/cmake-example-with-vcpkg: CMake example project with vcpkg depen…

---

## [Escaped double quotes](https://discourse.cmake.org/t/escaped-double-quotes/3759)

<div class="topic-metadata">

**Author:** [@Wieckowski\_Christoph](https://discourse.cmake.org/u/Wieckowski_Christoph)\
**Replies:** 2\
**Last updated:** [July 15, 2021, 7:25pm UTC](https://discourse.cmake.org/t/escaped-double-quotes/3759 "2021-07-15T19:25:19Z")

</div>

Hello, I am using cmake to create ninja build scripts to build my embedded firmware. I have to use some special pre-processor flags (-D\_\_UVISION\_VERSION=“533”) to be able to compile the project. But if I set the preproc…

---

## [Help with ctest and jobs](https://discourse.cmake.org/t/help-with-ctest-and-jobs/3765)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 3\
**Last updated:** [July 15, 2021, 7:18pm UTC](https://discourse.cmake.org/t/help-with-ctest-and-jobs/3765 "2021-07-15T19:18:43Z")

</div>

All, Per my last attempt at presets, I now have CMake 3.21.0 installed and am trying it out again. I think the configure and build stages are doing what I expect, but the test presets seem slow and I think that it’s due…

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

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