# run cmake pointing it to the source directory

**URL:** https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753
**Category:** Usage
**Created:** [January 1, 2024, 3:40pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753 "2024-01-01T15:40:14Z")
**Posts on this page:** 5
**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: [January 1, 2024, 3:40pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753/1 "2024-01-01T15:40:14Z")

</div>

Building & Installing ([https://github.com/CNES/aviso-fes/blob/main/INSTALL.md#building--installing](https://github.com/CNES/aviso-fes/blob/main/INSTALL.md#building--installing))

One nice and highly recommended feature of CMake is the ability to do out of source builds. In this way you can make all your .o files, various temporary depend files, and even the binary executables without cluttering up your source tree. To use out of source builds, first create a build directory, then change into your build directory and run cmake pointing it to the source directory:

mkdir build && cd build cmake … -DCMAKE\_INSTALL\_PREFIX=/opt/local

Hi, which is the source directory? Is it aviso-fes code folder which contains CMakeLists.txt? Please guide.

If I run this command (cmake … -DCMAKE\_INSTALL\_PREFIX=/opt/local) it responts that the build directory does not contain CMakeLists.txt. But CMakeLists.txt is already present in aviso-fes code folder

please

---

<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: [January 1, 2024, 9:41pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753/2 "2024-01-01T21:41:41Z")

</div>

Can you share how you made the directory you performed `mkdir` in? It should probably be a clone of the `CNES/aviso-fes` project.

---

<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: [January 2, 2024, 7:00pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753/3 "2024-01-02T19:00:34Z")

</div>

Dear Sir,  
As code’s installation instructions say:

1. installed Anaconda, created new enviroment and activated.
2. installed software using conda command (conda install pyfes -c fbriol). This command install the software and the necessary dependencies
3. ran ( mkdir build && cd build)
4. now at this step…ran this line( cmake … -DCMAKE\_INSTALL\_PREFIX=/opt/local)

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [January 3, 2024, 7:27am UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753/4 "2024-01-03T07:27:05Z")

</div>

There are too many `...` in your command line!

Please try it in this way:  
`cmake -G Ninja -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/local --fresh`

---

<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: [January 4, 2024, 7:06pm UTC](https://discourse.cmake.org/t/run-cmake-pointing-it-to-the-source-directory/9753/5 "2024-01-04T19:06:36Z")

</div>

> [@mali.solangi](#):
>
> nstalled software using conda command (conda install pyfes -c fbriol). This command install the software and the necessary dependencies

Then why do you need to build it? This sounds like it is already built to me. If this is for development, you’ll need to find where Anaconda placed the source tree and `cd` there before the `mkdir` commands.
