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
0
votes
0 answers

Using find_library() in cmake function

In my project I use function, which calles find_library(...). Function is defined in SomeScript.cmake. It works fine if called one time. But now I want to use it several time in my project. The problem is that find_library caches the first result,…
bidjiz
  • 1
  • 1
0
votes
0 answers

CMake find_package(...) not able to find wolfSSL

I have installed a wolfSSL version 5.4.0 in my ubuntu(configured to /usr/local (default)). I am trying to find the wolfSSL package using below find_package arguments in my project's root CMakeLists file but nothing worked. find_package(wolfssl…
skumar
  • 1
  • 1
0
votes
0 answers

Add to cmake search path

I am compiling a cmake file[1] that needs a common library[2]. How do you tell cmake where to find FindXXXX.cmake? More concretely, cmake runs find_package(Eigen3 REQUIRED) and gets angry because I haven't sent CMAKE_MODULE_PATH or…
Test
  • 962
  • 9
  • 26
0
votes
0 answers

file strings requires and filename and output variable in cmake

target_link_libraries(${PROJECT_NAME} serializer iothub_client iothub_client_mqtt_transport umqtt aziotsharedutil …
0
votes
0 answers

Build generated source files after specific custom target build to create objects

I have a multiple source files getting generated using custom command and custom target in the cmake_binary_dir. These source files are not getting build as they are generated during buildtime. I don't want to use execute_process to create the…
deb
  • 15
  • 7
0
votes
1 answer

Cmake cant find boost which installed from source in CentOS 7

I installed boost from the source file in CentOS7, I do these steps : wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz tar -xzf boost_1_* cd boost_1_* ./bootstrap.sh --prefix=/opt/boost ./b2 install --prefix=/opt/boost…
Parisa.H.R
  • 3,303
  • 3
  • 19
  • 38
0
votes
1 answer

Use CMake binares to build cpp projects without installing CMake

I want to use specific version of CMake 3.19.0 for Ubuntu 14.04 (32-bits) without installing CMake (use only binaries). I tried to build CMake 3.19.0 on my test machine. It builded and installed successfully. In install_manifest.txt I see lot of…
a.wise
  • 164
  • 1
  • 10
0
votes
0 answers

CMake's find_path finds path on Windows but not on macOS

I have a cmake project for a third-party library which targets both Windows and macOS (let's call it Foo) which I hope to include with a cmake Find module. The library stashes its includes in ${CMAKE_SOURCE_DIR}/ThirdParty/include/Foo, and I'm…
RAM
  • 2,257
  • 2
  • 19
  • 41
0
votes
0 answers

How can I include headers from find_package() function in CMake?

I have a CMake project in C++ and I have been struggling how to setup the CMakeLists.txt files properly. In the external folder there are some dependencies located, which are added to the root CMakelists.txt by the add_subdirectory command. It is…
Fox1942
  • 276
  • 2
  • 18
0
votes
2 answers

Can I use the environment to add/replace to the CMAKE_MODULE_PATH?

Within a CMakeLists.txt file, you can write something like: list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") but what if I want to "prime" that variable before the invocation of CMake? Using the environment, perhaps? Is…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

Trying to build Assimp as a submodule in Cmake it can't find zlib

I am building zlib & assimp as submodules for my project. Assimp fails to build after Zlib successfully compiles saying it can't find zlib.h This is how I'm building my current submodule directory. Zlib.h seems to be a built as part of the zlib…
Chase R Lewis
  • 2,119
  • 1
  • 22
  • 47
0
votes
1 answer

Print check_cxx_source_runs() detailed output

I have a find package module that utilizes check_cxx_source_runs() to test if package was loaded properly. However, it fails and I am not sure what causes it to. Is there any way I can print the actual error (as one would see on terminal) from…
User 10482
  • 855
  • 1
  • 9
  • 22
0
votes
1 answer

How to Create .cmake File

I was working on a project which requires me to add a user.cmake file in the root directory. Can anyone help me out hot to create the .cmake file... Link to Project Directory
0
votes
0 answers

How to build namespaced subprojects in cmake that find each other

I am trying to get a basic cmake project to work with 2 subprojects (each a library) where one depends on the other. As such I have a self-contained project for lib1 and a self-contained project for lib2 (but that depends on lib1). Some lib2 authors…
Mike
  • 3,775
  • 8
  • 39
  • 79
0
votes
0 answers

Conditionally run CMake's CHECK_TYPE_SIZE

Is there a way to conditionally run CMake's CHECK_TYPE_SIZE command? CHECK_TYPE_SIZE is great for figuring out what the size of a struct is, but the problem is that over time someone might modify the header file with the struct to add new fields. …
FuriousGeorge
  • 4,561
  • 5
  • 29
  • 52
1 2 3
8 9