# Build files not written to current directory

**URL:** https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925
**Category:** Usage
**Created:** [April 2, 2020, 1:56pm UTC](https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925 "2020-04-02T13:56:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DavidA](https://discourse.cmake.org/user_avatar/discourse.cmake.org/davida/32/128_2.png) [@DavidA](https://discourse.cmake.org/u/DavidA)
#### Post date: [April 2, 2020, 1:56pm UTC](https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925/1 "2020-04-02T13:56:41Z")

</div>

I have:

sdk/CMakeLists.txt

and I invoke:

cd sdk/myBuild  
cmake -G “Unix Makefiles” -DISA\_AVX512=1 -DCMAKE\_BUILD\_TYPE=Release -DCMAKE\_TOOLCHAIN\_FILE=/opt/flexran/y/sdk/cmake/toolchain-intel-linux.cmake …

(there are two dots at the end of that command line).

The Makefile is written to directory sdk, not the current directory which is sdk/myBuild.

How can that be?

---

<div class="post-metadata">

### Author: ![DavidA](https://discourse.cmake.org/user_avatar/discourse.cmake.org/davida/32/128_2.png) [@DavidA](https://discourse.cmake.org/u/DavidA)
#### Post date: [April 2, 2020, 2:27pm UTC](https://discourse.cmake.org/t/build-files-not-written-to-current-directory/925/2 "2020-04-02T14:27:08Z")

</div>

Found the problem, there existed:

sdk/CMakeCache.txt

I deleted that file and the Makefile etc were correctly written to sdk/myBuild.
