# Source directory does not appear to contain CMakeLists.txt?

**URL:** https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654
**Category:** Usage
**Created:** [June 29, 2021, 3:49pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654 "2021-06-29T15:49:38Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![bc19](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@bc19](https://discourse.cmake.org/u/bc19)
#### Post date: [June 29, 2021, 3:49pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/1 "2021-06-29T15:49:38Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 29, 2021, 4:03pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/2 "2021-06-29T16:03:48Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![bc19](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@bc19](https://discourse.cmake.org/u/bc19)
#### Post date: [June 29, 2021, 4:42pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/3 "2021-06-29T16:42:53Z")

</div>

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

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

 ![Screen Shot 2021-06-29 at 12.42.07 PM](https://discourse.cmake.org/uploads/default/original/2X/4/41e0aafe9a54c16f68343dbc41f72d577a2f63dd.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 29, 2021, 5:04pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/4 "2021-06-29T17:04:02Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![bc19](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@bc19](https://discourse.cmake.org/u/bc19)
#### Post date: [June 29, 2021, 5:09pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/5 "2021-06-29T17:09:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 29, 2021, 5:13pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/6 "2021-06-29T17:13:46Z")

</div>

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

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

```

---

<div class="post-metadata">

### Author: ![bc19](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@bc19](https://discourse.cmake.org/u/bc19)
#### Post date: [June 29, 2021, 6:11pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/7 "2021-06-29T18:11:14Z")

</div>

Thank you so much!

---

<div class="post-metadata">

### Author: ![Rubayet\_Alam](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rubayet_alam/32/3295_2.png) [@Rubayet\_Alam](https://discourse.cmake.org/u/Rubayet_Alam)
#### Post date: [March 30, 2023, 8:06am UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/8 "2023-03-30T08:06:15Z")

</div>

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.**

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 3, 2023, 11:38am UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/9 "2023-04-03T11:38:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [April 3, 2023, 4:30pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/10 "2023-04-03T16:30:25Z")

</div>

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)

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

cmake --build /tmp/build 

```

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

---

<div class="post-metadata">

### Author: ![giammafer](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/f08c70/32.png) [@giammafer](https://discourse.cmake.org/u/giammafer)
#### Post date: [May 15, 2023, 2:28pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/11 "2023-05-15T14:28:11Z")

</div>

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](https://github.com/aqlaboratory/openfold)).

**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:

```auto
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:

```auto
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.

---

<div class="post-metadata">

### Author: ![Afnaan\_Qureshi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/afnaan_qureshi/32/4446_2.png) [@Afnaan\_Qureshi](https://discourse.cmake.org/u/Afnaan_Qureshi)
#### Post date: [March 28, 2024, 3:50am UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/12 "2024-03-28T03:50:38Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 29, 2024, 12:14pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/13 "2024-03-29T12:14:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Afnaan\_Qureshi](https://discourse.cmake.org/user_avatar/discourse.cmake.org/afnaan_qureshi/32/4446_2.png) [@Afnaan\_Qureshi](https://discourse.cmake.org/u/Afnaan_Qureshi)
#### Post date: [March 29, 2024, 12:43pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/14 "2024-03-29T12:43:31Z")

</div>

![image](https://discourse.cmake.org/uploads/default/original/2X/1/16156490b99cba9c8f48d1168fe0bfe11f51c6bd.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 29, 2024, 1:32pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/15 "2024-03-29T13:32:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![vido](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/v/f6c823/32.png) [@vido](https://discourse.cmake.org/u/vido)
#### Post date: [March 31, 2024, 7:40pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/16 "2024-03-31T19:40:32Z")

</div>

Hi friend. When I enter these commands

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

```

Getting this

```auto
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.

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [April 10, 2024, 10:29pm UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/17 "2024-04-10T22:29:54Z")

</div>

Is that your full command line?

---

<div class="post-metadata">

### Author: ![Price\_Cheap](https://discourse.cmake.org/user_avatar/discourse.cmake.org/price_cheap/32/4791_2.png) [@Price\_Cheap](https://discourse.cmake.org/u/Price_Cheap)
#### Post date: [July 23, 2024, 3:29am UTC](https://discourse.cmake.org/t/source-directory-does-not-appear-to-contain-cmakelists-txt/3654/18 "2024-07-23T03:29:52Z")

</div>

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

```shell
[<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

```auto
[<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.
