# Adding CMakelist.txt to source directory

**URL:** https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124
**Category:** Usage
**Created:** [July 21, 2022, 8:32pm UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124 "2022-07-21T20:32:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mali.solangi](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)
#### Post date: [July 21, 2022, 8:32pm UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/1 "2022-07-21T20:32:38Z")

</div>

Hello sir,  
I am trying to setting up this ([aviso-fes/INSTALL.md at main · CNES/aviso-fes · GitHub](https://github.com/CNES/aviso-fes/blob/main/INSTALL.md)).

1. installed successfully this command (conda install pyfes -c fbriol )
2. Then successfully ran this command ( mkdir build && cd build)
3. Problem starts here when i run this command( cmake … -DCMAKE\_INSTALL\_PREFIX=/opt/local )

for this third command I receive following massage

(avisofes7) C:\Users\hp\build\>cmake … -DCMAKE\_INSTALL\_PREFIX=/opt/local  
CMake Warning:  
Ignoring extra path from command line:

“…”

CMake Error: The source directory “C:/Users/hp” does not appear to contain CMakeLists.txt.  
Specify --help for usage, or press the help button on the CMake GUI.

I am using windows 10, anaconda env, created this particular enviroment on python 3.7, as newer pythons do not allow to install first command

I am phd student in geology trying to work on remote sensing of coasts. At this perticular point I am hanged…please please help me.

regards

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [July 22, 2022, 4:58am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/2 "2022-07-22T04:58:19Z")

</div>

Judging from the error message what you did was something like

```auto
git clone <repo> aviso-fes
mkdir build && cd build
cmake ... -DCMAKE_INSTALL_PREFIX=/opt/local

```

What you should have done:

```auto
git clone <repo> aviso-fes
cd aviso-fes
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=C:/aviso-fes

```

or

```auto
git clone <repo> aviso-fes
mkdir build && cd build
cmake ../aviso-fes -DCMAKE_INSTALL_PREFIX=C:/aviso-fes

```

To sum up:

- you’re in a wrong directory, trying to give wrong relative path to source
- even if you were in the right directory, its `..` not `...`
- since you’re apparently on Windows, `/opt/local` is most probably not what you want. Use a path where you want it to be installed

---

<div class="post-metadata">

### Author: ![mali.solangi](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)
#### Post date: [July 26, 2022, 8:41am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/3 "2022-07-26T08:41:21Z")

</div>

(avisofesgit) C:\Users\hp\aviso-fes\build\>cmake … -DCMAKE\_INSTALL\_PREFIX=/users/hp  
– Building for: NMake Makefiles  
CMake Error at CMakeLists.txt:34 (project):  
Running

‘nmake’ ‘-?’

failed with:  
The system cannot find the file specified

CMake Error: CMAKE\_C\_COMPILER not set, after EnableLanguage  
CMake Error: CMAKE\_CXX\_COMPILER not set, after EnableLanguage  
– Configuring incomplete, errors occurred!  
See also “C:/Users/hp/aviso-fes/build/CMakeFiles/CMakeOutput.log”.

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [July 26, 2022, 9:17am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/4 "2022-07-26T09:17:42Z")

</div>

On windows you need to run CMake from the Visual Studio Command Prompt so that it can find the needed tools.

---

<div class="post-metadata">

### Author: ![mali.solangi](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)
#### Post date: [July 26, 2022, 9:37am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/5 "2022-07-26T09:37:06Z")

</div>

(avisofesgit) C:\Users\hp\aviso-fes\build\>cmake … -DCMAKE\_INSTALL\_PREFIX=C:/aviso-fes  
– Building for: NMake Makefiles  
CMake Error at CMakeLists.txt:34 (project):  
Running

‘nmake’ ‘-?’

failed with:

The system cannot find the file specified

CMake Error: CMAKE\_C\_COMPILER not set, after EnableLanguage  
CMake Error: CMAKE\_CXX\_COMPILER not set, after EnableLanguage  
– Configuring incomplete, errors occurred!  
See also “C:/Users/hp/aviso-fes/build/CMakeFiles/CMakeOutput.log”.

---

<div class="post-metadata">

### Author: ![mali.solangi](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/3e96dc/32.png) [@mali.solangi](https://discourse.cmake.org/u/mali.solangi)
#### Post date: [July 27, 2022, 7:12am UTC](https://discourse.cmake.org/t/adding-cmakelist-txt-to-source-directory/6124/6 "2022-07-27T07:12:45Z")

</div>

ok sir. Thank you. should I run CMake GUI to use Visual studio to find/generate needed tools or any other method please?
