Questions tagged [cmake-modules]

Use this tag for questions regarding CMake modules that are part of the CMake distribution, or loading custom CMake modules into the current CMake context.

CMake Modules are CMake source files (typically .cmake files) that can be loaded into the current context using the include() command. CMake provides many modules that can be used out-of-the-box; these are split into two general types:

  • Utility modules
  • Find modules

Utility modules are loaded using the include() command, while Find modules are loaded by calling the find_package() command. Custom user-defined modules can also be written and loaded in a similar manner, but their location must be specified in the CMAKE_MODULE_PATH variable.

132 questions
1
vote
3 answers

could not get version from cmake.dir

when I build syc my android project it comes like this local.properties How can I solve this error?
Pradeep Simba
  • 282
  • 5
  • 15
1
vote
1 answer

How can I scope a CMake function so it can't be accessed from outside a file?

I'm trying to write some CMake code in a relatively complex project and I have a module that internally includes another module. The problem is, whenever I include my module, all of the functioned defined in the module it internally includes become…
tjwrona1992
  • 8,614
  • 8
  • 35
  • 98
1
vote
0 answers

Adding support to new compiler vendor in CMake (cross-compiling)

I want to cross compile an embedded application using Tasking TriCore toolchain and CMake (3.16 is ok). I started with a complete toolchain file, where all paths to binaries and rules were specified, but then I read this thread and used the…
Natxo.Piq
  • 105
  • 2
  • 9
1
vote
1 answer

Using an interface library with check_c_source_runs() or try_run()

Use case: I'm trying to compile a test program that probes for a list of TrueType(tm) fonts using SDL2_ttf (with SDL2, Freetype, PNG and Zlib). The SDL2_ttf::SDL2_ttf interface library exists and links successfully with target executables. My…
scooter me fecit
  • 1,053
  • 5
  • 15
1
vote
0 answers

Executable built with CMake(Visual Studio 2015) needs Qt5SVG.dll but original Visual Studio 2015 does not. Why?

Situation I learned a lot over the last year, but this is something I just could not wrap my head around. Project is C++. CMake 1.15.2. Visual Studio 2015. I converted a whole Solution *.sln file with cmake-converter and wrote FindXXX.cmake Modules…
1
vote
0 answers

How to fix cmGLobalNInjaGenerator.cxx.o" error of cmake?

I am installing a newer version of cmake which is cmake 3.10.1 and the make command is giving me error while building CXX object source. I have installed the ninja 1.5.1 but still getting the same error. used this to install the cmake: wget
Baig
  • 11
  • 1
1
vote
0 answers

Why is this find_package failing in newer CMake versions?

I am experiencing a problem in a project, when upgrading from CMake 3.8 to 3.14. I have reduced this to the following issue. Note that project is before find_package (the other way around I do not have the issue I am…
Bernhard
  • 3,619
  • 1
  • 25
  • 50
1
vote
0 answers

CMAKE passing variable into included cmake sub-file

I'm currently configuring build of my project and decided to split CMakeLists.txt into subfiles which are responsible for a single build sub-task (like testing, packaging, compiling, etc...). The problem is the cmake subfiles needs info about how to…
St.Antario
  • 26,175
  • 41
  • 130
  • 318
1
vote
1 answer

CMake error "include could not find load file: FetchContent"

I am getting the following error while executing the cmake command on Ubuntu. CMake version - 3.10.2. mapp@ubuntu:~/Desktop/LocatePro$ cmake . -- Enable testing: ON CMake Error at CMakeLists.txt:40 (include): include could not find load file: …
mapppppp
  • 25
  • 1
  • 6
1
vote
0 answers

How to check where does pkg_check_modules find a module?

I'm new to CMAKE and now I'm trying to build a C++ library and faced some problem. I'm trying to understand how does PKG_CHECK_MODULES (3RD_PARTY_LIB REQUIRED stream) work. I read the documentation and it is said: When the ‘REQUIRED’ argument was…
St.Antario
  • 26,175
  • 41
  • 130
  • 318
1
vote
1 answer

How to overwrite settings from cmake modules from toolchain file?

I have a CMake Toolchain file that cross compiles for arm-linux on an x86_64-linux host. During configuration, my toolchain file is parsed and it (correcty) finds a GNU compiler. Therefore it will load GNU.cmake (in my case…
kuga
  • 1,483
  • 1
  • 17
  • 38
1
vote
1 answer

CMake & C++ - What is the best approach to share library between several git submodules

I am working with large C++ project (using cLion) which containing 4 submodules. I wrote small C++ library which provides the ability to read from .properties file (most common in Java..). The "Application.properties" file should includes common…
Kobi
  • 106
  • 2
  • 9
1
vote
1 answer

CMake is searching for packages in a strange location

I have been trying to track down why CMake find_package is finding the wrong package in my build. From CMake find_package: where did it find the package? I learned how to get it to tell me what paths it was searching, and thus where it found the…
Ben Farmer
  • 2,387
  • 1
  • 25
  • 44
1
vote
1 answer

How to deploy a Find*.cmake file for an Autotools library in the correct place for Yocto?

I created a new layer over an existing Yocto git for my company project. In this layer I added a few external autotools based libraries. A few applications need to link against this libraries and the application projects are all cmake based. Taking…
j4x
  • 3,595
  • 3
  • 33
  • 64
1
vote
1 answer

Making a Unix-specific CMake procedure cross-platform

I've written a small CMake module for, well, it doesn't matter what for. The point is that it acts as follows: When the appropriate CMake function is invoked, a shell script with relative path scripts/whatever.sh (under the project directory) is…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1 2 3
8 9