Cannot Find Cmake Profile

Posted : admin On 1/25/2022
Cmake
  1. Link to pthread library using CMake (in CLion) clion add library. Clion cannot find any cmake profile. Undefined reference to pthreadcreate. Cmake link static library. Cmake link two libraries. Clion without cmake. C executable vs c library clion. Cmake include library.
  2. It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.

'Cannot find any CMake Profile' Then when I look in the Cmake feedback window, I get: /usr/bin/cmake -DCMAKEBUILDTYPE=Debug -G 'CodeBlocks - Unix Makefiles' /tmp/tmp.FeN29KEPFR CMake Error: The source directory '/tmp/tmp.FeN29KEPFR' does not appear to contain CMakeLists.txt. Specify -help for usage, or press the help button on the CMake GUI.

Ask questionsconan create fails with can't find conanbuildinfo.cmake

I have been trying to use conan_cmake_run in my CMakeLists.txt files to allow conan to be run in the cmake configure step, such that I can build a project or subproject with (from the source directory) cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build .This all works nicely.

Cannot Find Cmake Profile

However, when I now try to package up my project by running, from the source directory, conan create ., I get errors originating from conan.cmake that it cannot find conanbuildinfo.cmake.

Clion

I have an example below that I've tried my best to make minimal, to demonstrate the problem.

Directory structure:

  • bla
    • CMakeLists.txt
    • conanfile.py
    • bla.cpp

bla/CMakeLists.txt

bla/conanfile.py

Cannot Find Any Cmake Profile Clion

bla/bla.cpp

The example code as presented will fail when calling conan create . from bla. The important bit of the error message from cmake as reported by conan:

conan cmake is complaining that at the path /home/justin/.conan/data/bla/0.1/_/_/build/6e41abfb5a7d95fbe289321565b7c1d2f35255f2/build_folder there is no file conanbuildinfo.cmake. And it's right, there isn't.

However, that file is present, one directory up, at /home/justin/.conan/data/bla/0.1/_/_/build/6e41abfb5a7d95fbe289321565b7c1d2f35255f2/?

This very simple example will work if you remove the build_folder = 'build_folder' in the conanfile.py's cmake.configure call, although this seems more like a coincidence.

My actual use case is more complex and involves nested calls of cmake's add_subdirectory, where those subfolders also can't find conanbuildinfo.cmake and look in the wrong place - they fail with the same kind of error, not being able to find conanbuildinfo.cmake. I have omitted a more complex example (with subdirectories) here as this post is long enough, and I hope if someone can show me a fix for this those may be fixed too.

Ideally a solution would allow me the ability, as I have now, to build my project from the parent or a subproject (each resolving their own conan dependencies) with cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && cmake --build . or similar, and additionally allow conan create . from the parent project directory to work.

I would like to ask:

  • How can I fix this, what am I doing wrong?
  • Is this a poor way to structure a project? If so, what is the alternative? I am presuming what I want is possible but I'm ignorant and perhaps am going about this the wrong way?

Cheers if you've read till here, I realise this is a bit long and appreciate your time.

Cannot Find Cmake Profile

Cmake Find File

Ubuntu, x64, Conan 1.26.0, cmake-conan release 0.15, cmake 3.17

Cmake Find Module

conan-io/cmake-conan