Source directory does not appear to contain CMakeLists.txt?

I am not sure why I am getting an error when I try this command:

cmake -D OpenBLAS_DIR=/usr/local/opt/openblas -D CMAKE_BUILD_TYPE=RELEASE …

It then says:

CMake Error: The source directory “/Users/biancacaproni” does not appear to contain CMakeLists.txt.

Then, when I try this command:

cmake -D OpenBLAS_DIR=/usr/local/opt/openblas -D CMAKE_BUILD_TYPE=RELEASE .

It says:

CMake Error: The source directory “/Users/biancacaproni/build” does not appear to contain CMakeLists.txt.

However, when I am in the “build” folder, I see CMakeLists.txt in there.

I am trying to run OpenFace 2.0 from GitHub if that context helps. I have zero experience with CMake so any help would really, really be appreciated.

1 Like

Could you post your entire cmake configure command line? Are there symlinks involved here at all? It seems odd that CMake thinks your home directory is the source directory. Surely that’s not what is actually intended?

Could you explain what you mean by cmake configure command line?

Here is an image of what I had typed in the original post:

Ah, yeah, that works. Your post has ... which made me think you were eliding them. You need to pass the path to the OpenFace directory that you cloned.

Okay! Thank you. How do you go about doing that?

Presumably you cloned OpenFace somewhere. Replace it in the script with this:

git clone https://url/for/openface.git openface
cd openface
mkdir build
cd build
cmake -D… ..

Thank you so much!

I am also facing the same problem. I am trying to install Geant4. and getting this error.

CMake Error: The source directory “/home/rubayet/softwaress/geant4/Geant4-11.1.1-Linux” does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.

I CAN’T SEE ANY CMakeLists.txt IN THE BUILD FOLDER. PLEASE HELP.

There shouldn’t be one in the build folder; it lives in the source folder. What command(s) did you attempt?

You might want to use the -S and -B options to help make it clear which are the source and build directories. I do this from scripts too. For example, if the desired project with CMakeLists.txt is at ~/my/proj I can type (from anywhere)

cmake -S ~/my/proj -B /tmp/build

cmake --build /tmp/build 

The -B parameter is an arbitrary location that CMake will build under.

I am facing the same issue reported in this post. I am trying to install a software from GitHub named OpenFold (GitHub - aqlaboratory/openfold: Trainable, memory-efficient, and GPU-friendly PyTorch reproduction of AlphaFold 2).

1. I created the directory for OpenFold
2. I launched the setup.py file (from the OpenFold repository) to install the software
At this point I got the error:

435 |     	function(_Functor&& __f)
  	|                                                                                                                                             	^
/usr/include/c++/11/bits/std_function.h:435:145: note:     	‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |     	operator=(_Functor&& __f)
  	|                                                                                                                                              	^
/usr/include/c++/11/bits/std_function.h:530:146: note:     	‘_ArgTypes’
error: command '/usr/bin/nvcc' failed with exit code 1

3. One of the possible solution I found was to downgrade g++ from version 11 to 10
So I launched these commands:

sudo apt install g++-10
cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-10 -B build

4. But I got this error from the second command
CMake Error: The source directory "/SSD/openfold" does not appear to contain CMakeLists.txt

So I followed the solution on this post and I created the /build directory in openfold
Then I launched again the command
cmake -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-10 -B build

5. Unfortunately, I got the same error.
CMake Error: The source directory "/SSD/openfold" does not appear to contain CMakeLists.txt.

I do not know if I am wrong creating the build directory under openfold or the issue come from the setyp.py of the openfold software or something else.

Hope any of you have any idea about that.

Thanks in advance.

I also face the similar type of error while running the cmake command. “CMake Error: The source directory “/” does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.”
What should I do?
can anyone suggest…

Without your full command line, it’s hard to say, but it sounds like you have a stray / argument around somewhere.

image

Is .. resolving to / based on the current working directory used by (what appears to be) your editor?

Hi friend. When I enter these commands

 mkdir build
 cd build
 cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release

Getting this

Release
CMake Warning:
  Ignoring extra path from command line:

   ".."


CMake Error: The source directory "/Users/rbn-bbn-barabek/build/build/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

Is that your full command line?

I have the same problem, cmake regard my build folder as src folder.

[<my_account> ~/llvm-project-18.1.8.src]$ cmake -S llvm -B ./build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=Release
CMake Error: The source directory "/public/home/<my_account>/llvm-project-18.1.8.src/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

While the folder structure is

[<my_account> llvm-project-18.1.8.src]$ ls
bolt   clang              cmake               compiler-rt      cross-project-tests  libc    libcxx     libunwind    lld   llvm         mlir    polly  README.md  SECURITY.md  utils
build  clang-tools-extra  CODE_OF_CONDUCT.md  CONTRIBUTING.md  flang                libclc  libcxxabi  LICENSE.TXT  lldb  llvm-libgcc  openmp  pstl   runtimes   third-party

It is an issue caused by -G "Unix Makefiles". If remove it, then error is clear.