# Latest

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

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

**Page:** 190

---

## [How do I pull full paths out of UNRESOLVED\_DEPENDENCIES\_VAR](https://discourse.cmake.org/t/how-do-i-pull-full-paths-out-of-unresolved-dependencies-var/1945)

<div class="topic-metadata">

**Author:** [@NotSven](https://discourse.cmake.org/u/NotSven)\
**Replies:** 2\
**Last updated:** [September 30, 2020, 5:06pm UTC](https://discourse.cmake.org/t/how-do-i-pull-full-paths-out-of-unresolved-dependencies-var/1945 "2020-09-30T17:06:36Z")

</div>

Very first post, please remove if silly. I’ve got something like this in my setup : file(GET\_RUNTIME\_DEPENDENCIES RESOLVED\_DEPENDENCIES\_VAR RES UNRESOLVED\_DEPENDENCIES\_VAR UNRES CONFLICTING\_DEPENDENCIES\_PREFIX CONFL…

---

## [Potential Bug in 'cmake/Modules/Compiler/clang.cmake' (CMAKE\_C(XX)\_COMPILE\_OPTIONS\_PIC)](https://discourse.cmake.org/t/potential-bug-in-cmake-modules-compiler-clang-cmake-cmake-c-xx-compile-options-pic/1933)

<div class="topic-metadata">

**Author:** [@marchani](https://discourse.cmake.org/u/marchani)\
**Replies:** 6\
**Last updated:** [September 30, 2020, 1:32pm UTC](https://discourse.cmake.org/t/potential-bug-in-cmake-modules-compiler-clang-cmake-cmake-c-xx-compile-options-pic/1933 "2020-09-30T13:32:31Z")

</div>

I was attempting to cross-compile gRPC (https://github.com/grpc/grpc) from Windows to Linux as a third-party dependency using CMake and the Clang compiler; however, I encountered what I believe may be incorrect behavior …

---

## ["Mapping" lists of dependents and dependees files?](https://discourse.cmake.org/t/mapping-lists-of-dependents-and-dependees-files/1934)

<div class="topic-metadata">

**Author:** [@swoo.quek](https://discourse.cmake.org/u/swoo.quek)\
**Replies:** 9\
**Last updated:** [September 30, 2020, 8:02am UTC](https://discourse.cmake.org/t/mapping-lists-of-dependents-and-dependees-files/1934 "2020-09-30T08:02:06Z")

</div>

Is there a way to “map” a list of dependants and dependees files? Like below: set(IF\_f \<file1.h file2.h\>) add\_custom\_command( OUTPUT \<file1.obj file2.obj\> COMMAND ${CMAKE\_CXX\_COMPILER} -debug -nofpu -output=obj=\<f…

---

## [Why can't this work? add\_custom\_command, add\_custom\_target?](https://discourse.cmake.org/t/why-cant-this-work-add-custom-command-add-custom-target/1929)

<div class="topic-metadata">

**Author:** [@swoo.quek](https://discourse.cmake.org/u/swoo.quek)\
**Replies:** 4\
**Last updated:** [September 29, 2020, 4:56pm UTC](https://discourse.cmake.org/t/why-cant-this-work-add-custom-command-add-custom-target/1929 "2020-09-29T16:56:42Z")

</div>

Can anyone tell me why the below does not work correctly? I meant to do this: If timer\_cx.h is changed, then timer\_cx.c should be recompiled and timer\_cx.c.obj should be generated Then, MY\_Project should be re-built, …

---

## [When to use cmake and when not?](https://discourse.cmake.org/t/when-to-use-cmake-and-when-not/1930)

<div class="topic-metadata">

**Author:** [@ProTur1](https://discourse.cmake.org/u/ProTur1)\
**Replies:** 5\
**Last updated:** [September 29, 2020, 1:59pm UTC](https://discourse.cmake.org/t/when-to-use-cmake-and-when-not/1930 "2020-09-29T13:59:41Z")

</div>

After trying hard to put cmake working on various OS and for various IDEs, Im not convinced by cmake advantages: unifying all these worlds. There were always pitfalls depending on the IDE or OS. So, Im thinking, I would…

---

## [Cmake configuration build fails on test big endian](https://discourse.cmake.org/t/cmake-configuration-build-fails-on-test-big-endian/1903)

<div class="topic-metadata">

**Author:** [@Oleg\_Karpenko](https://discourse.cmake.org/u/Oleg_Karpenko)\
**Replies:** 11\
**Last updated:** [September 28, 2020, 9:27pm UTC](https://discourse.cmake.org/t/cmake-configuration-build-fails-on-test-big-endian/1903 "2020-09-28T21:27:34Z")

</div>

Hello, Cmake fails in the configuration stage with the following messages when I tried to compile with the iOS toolchain and Xcode generator. Check size of unsigned long - failed CMake Error at /Applications/CMake.app…

---

## [CodeBlocks vs CMAKE\_BUILD\_TYPE](https://discourse.cmake.org/t/codeblocks-vs-cmake-build-type/1931)

<div class="topic-metadata">

**Author:** [@ProTur1](https://discourse.cmake.org/u/ProTur1)\
**Replies:** 3\
**Last updated:** [September 28, 2020, 8:31pm UTC](https://discourse.cmake.org/t/codeblocks-vs-cmake-build-type/1931 "2020-09-28T20:31:35Z")

</div>

It seems that CMAKE\_BUILD\_TYPE cannot be evaluated when using the CodeBlocks IDE ?

---

## [How to Explicitly specify cmake to process a different .txt file](https://discourse.cmake.org/t/how-to-explicitly-specify-cmake-to-process-a-different-txt-file/938)

<div class="topic-metadata">

**Author:** [@rmadhuraj](https://discourse.cmake.org/u/rmadhuraj)\
**Replies:** 5\
**Last updated:** [September 27, 2020, 8:56pm UTC](https://discourse.cmake.org/t/how-to-explicitly-specify-cmake-to-process-a-different-txt-file/938 "2020-09-27T20:56:07Z")

</div>

Hi, Is it possible to have two List.txt files , i,e, CMakeLists1.txt and CMakeLists2.txt in a single directory and while compiling is it possible to inform cmake to consider CMakeLists2.txt for further process ? If yes …

---

## [pow with variable throws error](https://discourse.cmake.org/t/pow-with-variable-throws-error/1893)

<div class="topic-metadata">

**Author:** [@grenmel](https://discourse.cmake.org/u/grenmel)\
**Replies:** 1\
**Last updated:** [September 27, 2020, 7:47pm UTC](https://discourse.cmake.org/t/pow-with-variable-throws-error/1893 "2020-09-27T19:47:04Z")

</div>

Hi, I’m new to C. When I try variable in pow function (for example pow(hightSq,2)) it returns "undefined reference to ‘pow’ ". I’ve read that it has to do something with UNIX compatibility and that you have to add argume…

---

## [CMake to replace Eclipse CDT GNU - how to deal with C\_DEPS?](https://discourse.cmake.org/t/cmake-to-replace-eclipse-cdt-gnu-how-to-deal-with-c-deps/1917)

<div class="topic-metadata">

**Author:** [@swoo.quek](https://discourse.cmake.org/u/swoo.quek)\
**Replies:** 4\
**Last updated:** [September 27, 2020, 6:41pm UTC](https://discourse.cmake.org/t/cmake-to-replace-eclipse-cdt-gnu-how-to-deal-with-c-deps/1917 "2020-09-27T18:41:51Z")

</div>

I am using Eclipse CDT with GNU Make In the project makefile, there are these lines: -include $(C\_DEPS) where: C\_DEPS += time\_cx/src/time\_cx.d where time\_cx.d is: time\_cx/src/time\_cx.obj time\_cx/src/time\_cx.d:…

---

## [gollvm: -fPIC is not supported, if using ld or lld, with Clang++](https://discourse.cmake.org/t/gollvm-fpic-is-not-supported-if-using-ld-or-lld-with-clang/1921)

<div class="topic-metadata">

**Author:** [@Ivan\_Serdyuk](https://discourse.cmake.org/u/Ivan_Serdyuk)\
**Replies:** 1\
**Last updated:** [September 26, 2020, 4:09pm UTC](https://discourse.cmake.org/t/gollvm-fpic-is-not-supported-if-using-ld-or-lld-with-clang/1921 "2020-09-26T16:09:17Z")

</div>

It appears that there is a misconfigured CMake file, for gollvm project. https://github.com/golang/go/issues/41527 - this is my description. So to be short: there is a confusing warning, not proven by build attempts or…

---

## [Why is C++14 mode satisfied with -std=c++1y?](https://discourse.cmake.org/t/why-is-c-14-mode-satisfied-with-std-c-1y/1348)

<div class="topic-metadata">

**Author:** [@oliver](https://discourse.cmake.org/u/oliver)\
**Replies:** 6\
**Last updated:** [September 24, 2020, 2:28pm UTC](https://discourse.cmake.org/t/why-is-c-14-mode-satisfied-with-std-c-1y/1348 "2020-09-24T14:28:20Z")

</div>

Hi, I’m just getting started with CMake and have come upon a corner case related to C++14 support with older compilers. My target platform (RHEL 7) ships with G++ 4.8.5, which does not support C++14 completely. It prov…

---

## [set CMAKE\_CXX\_FLGAS composed of variables without parenthesis, not a good idea ?](https://discourse.cmake.org/t/set-cmake-cxx-flgas-composed-of-variables-without-parenthesis-not-a-good-idea/1907)

<div class="topic-metadata">

**Author:** [@ProTur1](https://discourse.cmake.org/u/ProTur1)\
**Replies:** 2\
**Last updated:** [September 24, 2020, 12:46pm UTC](https://discourse.cmake.org/t/set-cmake-cxx-flgas-composed-of-variables-without-parenthesis-not-a-good-idea/1907 "2020-09-24T12:46:10Z")

</div>

Why does set(CMAKE\_CXX\_FLGAS "${CMAKE\_CXX\_FLAGS} ${extra\_flags}") works, but set(CMAKE\_CXX\_FLGAS ${CMAKE\_CXX\_FLAGS} ${extra\_flags}) doesn’t ? In my case, I got the g++ error: " no input files because of the above.

---

## [Is there any reason to prefer \`include(CTest)\` or \`enable\_testing()\` over the other?](https://discourse.cmake.org/t/is-there-any-reason-to-prefer-include-ctest-or-enable-testing-over-the-other/1905)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cmake.org/u/alex)\
**Replies:** 1\
**Last updated:** [September 24, 2020, 10:46am UTC](https://discourse.cmake.org/t/is-there-any-reason-to-prefer-include-ctest-or-enable-testing-over-the-other/1905 "2020-09-24T10:46:28Z")

</div>

Like it says in the title… the main difference I’m aware of is that include(CTest) has extra features for integrating with CDash and defines the BUILD\_TESTING option. But should one be preferred over the other for new c…

---

## [Can you exclude certain source files from different build configurations?](https://discourse.cmake.org/t/can-you-exclude-certain-source-files-from-different-build-configurations/1897)

<div class="topic-metadata">

**Author:** [@Dave\_R](https://discourse.cmake.org/u/Dave_R)\
**Replies:** 3\
**Last updated:** [September 23, 2020, 7:29pm UTC](https://discourse.cmake.org/t/can-you-exclude-certain-source-files-from-different-build-configurations/1897 "2020-09-23T19:29:00Z")

</div>

I’m working on a project that runs on an embedded board with an ARM9 processor. The board was originally running Linux with a 2.6.0 kernel and we recently upgraded to use a 5.1.0 kernel and I’m now trying to sort out the…

---

## [Cross Compiling toolchain not taken into account](https://discourse.cmake.org/t/cross-compiling-toolchain-not-taken-into-account/1901)

<div class="topic-metadata">

**Author:** [@SadE](https://discourse.cmake.org/u/SadE)\
**Replies:** 3\
**Last updated:** [September 23, 2020, 3:18pm UTC](https://discourse.cmake.org/t/cross-compiling-toolchain-not-taken-into-account/1901 "2020-09-23T15:18:28Z")

</div>

Hi, I’m new to CMAke and trying to set up a cross compile project for ARM using the Armcc tools (from Keil) . I saw the toolchain files are part of the Cmake distribution , so I’m trying to use it … without any success.…

---

## [Getting undefined reference error despite of having the library specified in CMake](https://discourse.cmake.org/t/getting-undefined-reference-error-despite-of-having-the-library-specified-in-cmake/1888)

<div class="topic-metadata">

**Author:** [@Coderx7](https://discourse.cmake.org/u/Coderx7)\
**Replies:** 1\
**Last updated:** [September 23, 2020, 2:50am UTC](https://discourse.cmake.org/t/getting-undefined-reference-error-despite-of-having-the-library-specified-in-cmake/1888 "2020-09-23T02:50:25Z")

</div>

Hello everyone, hope you are having a great time. I’m trying to create a test executable out of a library I made. Lets name them lib1 and lib2. lib1 gets built along with its test just fine. the lib2 is also built wit…

---

## [How to use string(strip..) function?](https://discourse.cmake.org/t/how-to-use-string-strip-function/1872)

<div class="topic-metadata">

**Author:** [@swoo.quek](https://discourse.cmake.org/u/swoo.quek)\
**Replies:** 1\
**Last updated:** [September 22, 2020, 11:37pm UTC](https://discourse.cmake.org/t/how-to-use-string-strip-function/1872 "2020-09-22T23:37:53Z")

</div>

I have the following strings: S1 = “C:/myfolder/abc/myfile.txt” S2 = “C:/myfolder” I want to use string() function such that: S3 = “/abc/myfile.txt”, ie. (S3 = S1 - S2) How can I do that? Should I use string(strip…)…

---

## [INSTALL\_RPATH\_USE\_LINK\_PATH not working when CMAKE\_EXE\_LINKER\_FLAGS (LDFLAGS) is set](https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892)

<div class="topic-metadata">

**Author:** [@ryanofsky](https://discourse.cmake.org/u/ryanofsky)\
**Replies:** 0\
**Last updated:** [September 22, 2020, 6:20pm UTC](https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892 "2020-09-22T18:20:05Z")

</div>

I’m wondering if this is a bug. I’m using INSTALL\_RPATH\_USE\_LINK\_PATH TRUE for a target in my project, and generally it seems to work and set the target’s RUNPATH as expected on install, except it stops working and does…

---

## [abuse / misuse of find\_package?](https://discourse.cmake.org/t/abuse-misuse-of-find-package/1887)

<div class="topic-metadata">

**Author:** [@Rich\_von\_Lehe](https://discourse.cmake.org/u/Rich_von_Lehe)\
**Replies:** 2\
**Last updated:** [September 22, 2020, 4:19pm UTC](https://discourse.cmake.org/t/abuse-misuse-of-find-package/1887 "2020-09-22T16:19:42Z")

</div>

I am reviewing at my work some code that a developer submitted and a big red flag went up for me. I wanted to make sure I’m not the one misunderstanding find\_package before I really dig in with my objections to some cha…

---

## [CMake 3.18.3 available for download](https://discourse.cmake.org/t/cmake-3-18-3-available-for-download/1886)

<div class="topic-metadata">

**Author:** [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)\
**Replies:** 0\
**Last updated:** [September 22, 2020, 2:55pm UTC](https://discourse.cmake.org/t/cmake-3-18-3-available-for-download/1886 "2020-09-22T14:55:25Z")

</div>

We are pleased to announce that CMake 3.18.3 is now available for download. Please use the latest release from our download page: https://cmake.org/download/ Thanks for your support! Changes in 3.18.3 since 3.18.2: …

---

## [How to replicating a mingw32 build with CMake?](https://discourse.cmake.org/t/how-to-replicating-a-mingw32-build-with-cmake/1883)

<div class="topic-metadata">

**Author:** [@mbilyanov](https://discourse.cmake.org/u/mbilyanov)\
**Replies:** 0\
**Last updated:** [September 22, 2020, 9:31am UTC](https://discourse.cmake.org/t/how-to-replicating-a-mingw32-build-with-cmake/1883 "2020-09-22T09:31:58Z")

</div>

I have the following mingw32 build directive and it works. The command successfully builds a Windows DLL on a Linux machine. /usr/bin/x86\_64-w64-mingw32-g++ -march=x86-64 -mtune=x86-64 -O2 -shared -static -static-libgcc…

---

## [Unable to include header files?](https://discourse.cmake.org/t/unable-to-include-header-files/1881)

<div class="topic-metadata">

**Author:** [@mbilyanov](https://discourse.cmake.org/u/mbilyanov)\
**Replies:** 1\
**Last updated:** [September 22, 2020, 9:31am UTC](https://discourse.cmake.org/t/unable-to-include-header-files/1881 "2020-09-22T09:31:12Z")

</div>

Hi, I’m trying to reproduce the following command, so that this works with CMake. /usr/bin/x86\_64-w64-mingw32-g++ -march=x86-64 -mtune=x86-64 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-excep…

---

## [What is the best way to search and replace strings in a file?](https://discourse.cmake.org/t/what-is-the-best-way-to-search-and-replace-strings-in-a-file/1879)

<div class="topic-metadata">

**Author:** [@Shane\_Dev](https://discourse.cmake.org/u/Shane_Dev)\
**Replies:** 3\
**Last updated:** [September 22, 2020, 6:24am UTC](https://discourse.cmake.org/t/what-is-the-best-way-to-search-and-replace-strings-in-a-file/1879 "2020-09-22T06:24:46Z")

</div>

Hi, In my CMake script, I need to modify other source files by searching and replacing specified strings. In my case, the configure\_file command is not a solution because I have no control over the input file. Previousl…

---

## [Skip targets to be built in certain configuration](https://discourse.cmake.org/t/skip-targets-to-be-built-in-certain-configuration/1874)

<div class="topic-metadata">

**Author:** [@andriy](https://discourse.cmake.org/u/andriy)\
**Replies:** 0\
**Last updated:** [September 21, 2020, 6:03pm UTC](https://discourse.cmake.org/t/skip-targets-to-be-built-in-certain-configuration/1874 "2020-09-21T18:03:48Z")

</div>

Hello, I have next problem: I’m using cmake to configure and build my project for both Linux and Windows OSs. For Windows it uses multi-generator to configure the solution with different configs and for Linux I have se…

---

## [CMake doesn't link the actual object to the resulting dll](https://discourse.cmake.org/t/cmake-doesnt-link-the-actual-object-to-the-resulting-dll/1866)

<div class="topic-metadata">

**Author:** [@Coderx7](https://discourse.cmake.org/u/Coderx7)\
**Replies:** 2\
**Last updated:** [September 20, 2020, 6:38am UTC](https://discourse.cmake.org/t/cmake-doesnt-link-the-actual-object-to-the-resulting-dll/1866 "2020-09-20T06:38:33Z")

</div>

I created a C++ library in visual studio and all is fine. However, I’m trying to convert the projects to CMake so I can build them on linux as well. The library in question is implemented as pimple (dont know if it make…

---

## [Remove linker flag needed by library, but not by test programs](https://discourse.cmake.org/t/remove-linker-flag-needed-by-library-but-not-by-test-programs/1860)

<div class="topic-metadata">

**Author:** [@starfire](https://discourse.cmake.org/u/starfire)\
**Replies:** 1\
**Last updated:** [September 19, 2020, 10:36am UTC](https://discourse.cmake.org/t/remove-linker-flag-needed-by-library-but-not-by-test-programs/1860 "2020-09-19T10:36:43Z")

</div>

I am migrating a project from autotools to CMake. One part is a static library with version information and a few testprograms in a subdirectory. So I tried: add\_library(wraster STATIC ${SOURCES}) target\_link\_libraries(…

---

## [Secondary Expansion in the cmake language](https://discourse.cmake.org/t/secondary-expansion-in-the-cmake-language/1779)

<div class="topic-metadata">

**Author:** [@jmon12](https://discourse.cmake.org/u/jmon12)\
**Replies:** 2\
**Last updated:** [September 18, 2020, 8:28pm UTC](https://discourse.cmake.org/t/secondary-expansion-in-the-cmake-language/1779 "2020-09-18T20:28:20Z")

</div>

I have a simple question: is there any concept of secondary expansion (such as !var in bash or GNU make secondary expansion) in the cmake language? One usage example could be in the second step of the cmake tutorial. On…

---

## [cmake 3.18: generator expressions with add\_subdirectory ?](https://discourse.cmake.org/t/cmake-3-18-generator-expressions-with-add-subdirectory/1801)

<div class="topic-metadata">

**Author:** [@ProTur1](https://discourse.cmake.org/u/ProTur1)\
**Replies:** 19\
**Last updated:** [September 17, 2020, 12:05pm UTC](https://discourse.cmake.org/t/cmake-3-18-generator-expressions-with-add-subdirectory/1801 "2020-09-17T12:05:11Z")

</div>

How could I define a binary\_dir dependent on generator expression. The goal is to have a different build directory (binary\_dir) dependent on a configuration, when I call add\_subdirectory. Currently with cmake v3.18 I h…

---

## [parallel build (2) : add\_subdirectory to a non-subdirectory](https://discourse.cmake.org/t/parallel-build-2-add-subdirectory-to-a-non-subdirectory/1841)

<div class="topic-metadata">

**Author:** [@ProTur1](https://discourse.cmake.org/u/ProTur1)\
**Replies:** 8\
**Last updated:** [September 17, 2020, 7:34am UTC](https://discourse.cmake.org/t/parallel-build-2-add-subdirectory-to-a-non-subdirectory/1841 "2020-09-17T07:34:48Z")

</div>

add\_subdirectory(${CMAKE\_CURRENT\_SOURCE\_DIR}/../myStaticLib ${BINARY\_OUTPUT\_PATH}) add\_executable(${EXE\_NAME} ${PROJECT\_SOURCE\_DIR}/exe.cpp) Always fails if a parallel build is triggered (e.g. make -j N), and the the bu…

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

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