# Code

**URL:** https://discourse.cmake.org/c/code/11.md?page=73

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

**Page:** 74

---

## [Assembler errors: unrecognized opcode:func\_export / unsupported relocation against r3](https://discourse.cmake.org/t/assembler-errors-unrecognized-opcode-func-export-unsupported-relocation-against-r3/722)

<div class="topic-metadata">

**Author:** [@Mike432](https://discourse.cmake.org/u/Mike432)\
**Replies:** 0\
**Last updated:** [February 27, 2020, 7:45pm UTC](https://discourse.cmake.org/t/assembler-errors-unrecognized-opcode-func-export-unsupported-relocation-against-r3/722 "2020-02-27T19:45:28Z")

</div>

I’m getting CMake assembler errors such as: testing.s:137: Error: unrecognized opcode: ‘func\_export(testing)’ testing.s:146: Error: unrecognized opcode: ‘func\_begin(testing)’ testing.s:217: Error: unrecognized opcode…

---

## [Why can't I call an assembly program from C++? I'm getting errors.](https://discourse.cmake.org/t/why-cant-i-call-an-assembly-program-from-c-im-getting-errors/709)

<div class="topic-metadata">

**Author:** [@Mike432](https://discourse.cmake.org/u/Mike432)\
**Replies:** 1\
**Last updated:** [February 26, 2020, 9:08pm UTC](https://discourse.cmake.org/t/why-cant-i-call-an-assembly-program-from-c-im-getting-errors/709 "2020-02-26T21:08:38Z")

</div>

Can anyone give me a simple C++ program that calls a simple (but practical) assembly program (I don’t pass parameters)? What I’m currently trying to use is below. I definitely have to have the options required to do thi…

---

## [Tool for up-grading CMAKE files from Old to New?](https://discourse.cmake.org/t/tool-for-up-grading-cmake-files-from-old-to-new/696)

<div class="topic-metadata">

**Author:** [@Glen\_Langston](https://discourse.cmake.org/u/Glen_Langston)\
**Replies:** 3\
**Last updated:** [February 24, 2020, 9:59pm UTC](https://discourse.cmake.org/t/tool-for-up-grading-cmake-files-from-old-to-new/696 "2020-02-24T21:59:13Z")

</div>

Hello I very much appreciate using the previous version of CMAKE (in 2019) to build my custom software integrated into GNURADIO. However I’m struggling with the conversion to use the newest version of CMAKE. I feel …

---

## [Re: Tool for up-grading CMAKE files from Old to New?](https://discourse.cmake.org/t/re-tool-for-up-grading-cmake-files-from-old-to-new/697)

<div class="topic-metadata">

**Author:** [@Glen\_Langston](https://discourse.cmake.org/u/Glen_Langston)\
**Replies:** 0\
**Last updated:** [February 24, 2020, 9:47pm UTC](https://discourse.cmake.org/t/re-tool-for-up-grading-cmake-files-from-old-to-new/697 "2020-02-24T21:47:25Z")

</div>

Thank you very much for looking at this issue. Several others working on Gnuradio are reporting similar issues. I will relay your answers the them. Very sorry about my typo. This is the link: https://github.com/WVUR…

---

## [Possible issue with BUILD\_INTERFACE](https://discourse.cmake.org/t/possible-issue-with-build-interface/659)

<div class="topic-metadata">

**Author:** [@apaolillo](https://discourse.cmake.org/u/apaolillo)\
**Replies:** 4\
**Last updated:** [February 24, 2020, 8:48pm UTC](https://discourse.cmake.org/t/possible-issue-with-build-interface/659 "2020-02-24T20:48:42Z")

</div>

Hello dear CMake community, I’m very new to this forum, so I don’t really know if this is the right place to post such a message. I may have accidentally found an issue in CMake, so I’ll post it here in order to discus…

---

## [How to add \*.dll or \*.lib into project C++ for Cmake of visual studio IDE ?](https://discourse.cmake.org/t/how-to-add-dll-or-lib-into-project-c-for-cmake-of-visual-studio-ide/654)

<div class="topic-metadata">

**Author:** [@Dung\_Le\_Quang](https://discourse.cmake.org/u/Dung_Le_Quang)\
**Replies:** 2\
**Last updated:** [February 24, 2020, 2:11pm UTC](https://discourse.cmake.org/t/how-to-add-dll-or-lib-into-project-c-for-cmake-of-visual-studio-ide/654 "2020-02-24T14:11:35Z")

</div>

---

## [Best way to create multiple binaries](https://discourse.cmake.org/t/best-way-to-create-multiple-binaries/665)

<div class="topic-metadata">

**Author:** [@satrapes](https://discourse.cmake.org/u/satrapes)\
**Replies:** 2\
**Last updated:** [February 22, 2020, 1:27am UTC](https://discourse.cmake.org/t/best-way-to-create-multiple-binaries/665 "2020-02-22T01:27:29Z")

</div>

Hello cmake noob here. I have a project where I would like to build an executable for various products that have different settings. Folder looks a bit like bin (folder where final binaries are stored) e.g. main.0.deb…

---

## [Best practice for exporting libraries my project uses for dependent projects to use when building](https://discourse.cmake.org/t/best-practice-for-exporting-libraries-my-project-uses-for-dependent-projects-to-use-when-building/631)

<div class="topic-metadata">

**Author:** [@cryos](https://discourse.cmake.org/u/cryos)\
**Replies:** 3\
**Last updated:** [February 21, 2020, 8:54pm UTC](https://discourse.cmake.org/t/best-practice-for-exporting-libraries-my-project-uses-for-dependent-projects-to-use-when-building/631 "2020-02-21T20:54:05Z")

</div>

This has come up in the context of Tomviz as a consumer of ParaView/VTK, and as a producer in the context of Avogadro in the past. When we export libraries they often depend on/build upon other libraries. In the case of …

---

## [How to avoid OpenMP RTL mismatch if MKL and OpenMP are used](https://discourse.cmake.org/t/how-to-avoid-openmp-rtl-mismatch-if-mkl-and-openmp-are-used/678)

<div class="topic-metadata">

**Author:** [@ttz](https://discourse.cmake.org/u/ttz)\
**Replies:** 0\
**Last updated:** [February 21, 2020, 11:05am UTC](https://discourse.cmake.org/t/how-to-avoid-openmp-rtl-mismatch-if-mkl-and-openmp-are-used/678 "2020-02-21T11:05:28Z")

</div>

Hello everybody, I stumbled upon a problem which I couldn’t immediately solve by reading the documentation of FindBLAS and FindOpenMP. Maybe someone here has a hint for me. Let’s say I have project which imports an int…

---

## [ModuleNotFound skbuild](https://discourse.cmake.org/t/modulenotfound-skbuild/573)

<div class="topic-metadata">

**Author:** [@lll](https://discourse.cmake.org/u/lll)\
**Replies:** 5\
**Last updated:** [February 19, 2020, 4:30pm UTC](https://discourse.cmake.org/t/modulenotfound-skbuild/573 "2020-02-19T16:30:56Z")

</div>

I have the following error while doing this command on Linux : pip3 install cmake --upgrade. Collecting cmake Using cached https://files.pythonhosted.org/packages/a5/7c/6525cadf99abbabbcb29676f53de0441e8d2f8d0114ab52a…

---

## [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(…

---

## ["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…

---

## [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…

---

## [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…

---

## [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…

---

## [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…

---

## [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?

---

## [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…

---

## [Need help setting up variations of Descent 2 source on modern compilers IDE's.](https://discourse.cmake.org/t/need-help-setting-up-variations-of-descent-2-source-on-modern-compilers-ides/619)

<div class="topic-metadata">

**Author:** [@Joe\_Villa](https://discourse.cmake.org/u/Joe_Villa)\
**Replies:** 0\
**Last updated:** [February 12, 2020, 11:01am UTC](https://discourse.cmake.org/t/need-help-setting-up-variations-of-descent-2-source-on-modern-compilers-ides/619 "2020-02-12T11:01:01Z")

</div>

I need someone to help setting up the varations of descent 2 source code into modern IDE’s and getting them to compile. Your help would be greatly appreciated. Here’s chocolate descent https://github.com/InsanityBring…

---

## [Library not found (Windows)](https://discourse.cmake.org/t/library-not-found-windows/574)

<div class="topic-metadata">

**Author:** [@Lander](https://discourse.cmake.org/u/Lander)\
**Replies:** 6\
**Last updated:** [February 7, 2020, 3:39pm UTC](https://discourse.cmake.org/t/library-not-found-windows/574 "2020-02-07T15:39:45Z")

</div>

Hello! This is my first post here! I am trying to do my first project with CMake and I am stuck. I am working with windows. Please, can you help me? Currently, there are two issues: I am trying to include an externa…

---

## [where can I find a comprehensive documentation for commands such as find\_package?](https://discourse.cmake.org/t/where-can-i-find-a-comprehensive-documentation-for-commands-such-as-find-package/592)

<div class="topic-metadata">

**Author:** [@Tianfang\_Sun](https://discourse.cmake.org/u/Tianfang_Sun)\
**Replies:** 2\
**Last updated:** [February 6, 2020, 4:15pm UTC](https://discourse.cmake.org/t/where-can-i-find-a-comprehensive-documentation-for-commands-such-as-find-package/592 "2020-02-06T16:15:11Z")

</div>

Hi everyone. I’m just begin to get touch with the cmake and I’m wondering where can I find a complete document for the command. By complete I mean, for example, in the documentation for the find\_package here, it is not t…

---

## [How to build a multi-executable project](https://discourse.cmake.org/t/how-to-build-a-multi-executable-project/543)

<div class="topic-metadata">

**Author:** [@duodiscus92](https://discourse.cmake.org/u/duodiscus92)\
**Replies:** 2\
**Last updated:** [January 28, 2020, 7:52am UTC](https://discourse.cmake.org/t/how-to-build-a-multi-executable-project/543 "2020-01-28T07:52:20Z")

</div>

Hi everybody My project is made of many executable binary files (namely “modules”). My current directory structure is as follows : scav is the name of the toplevel directory It contains the directories src, bin, buil…

[Previous page](https://discourse.cmake.org/c/code/11.md?page=72)

[Next page](https://discourse.cmake.org/c/code/11.md?page=74)
