# Creating directories step fails with ExternalProject\_Add

**URL:** https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990
**Category:** Usage
**Tags:** os:linux
**Created:** [November 30, 2022, 7:33pm UTC](https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990 "2022-11-30T19:33:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mpconte](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mpconte/32/2848_2.png) [@mpconte](https://discourse.cmake.org/u/mpconte)
#### Post date: [November 30, 2022, 7:33pm UTC](https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990/1 "2022-11-30T19:33:24Z")

</div>

When trying to build and install a library using ExternalProject\_Add, I receive the following error:

```auto
[70%] Creating directories for 'sensor_network'
/bin/sh: 1: /root/cmake-3.25.0-linux-x86_64/bin/cmake;-Dcfgdir=;-P;/root/workspace/multisensor_framework/build/sensor_network-prefix/tmp/sensor_network-mkdirs.cmake: not found
make[2]: *** [CMakeFiles/sensor_network.dir/build.make:118: sensor_network-prefix/src/sensor_network-stamp/sensor_network-mkdir] Error 127
make[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/sensor_network.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

```

Using the following command in my CMakeLists.txt file:

```auto
set(root_path
${CMAKE_CURRENT_BINARY_DIR}/ros2-android-prefix/src/ros2-android-build/deps
${CMAKE_CURRENT_BINARY_DIR}/sensor_network_interfaces)

ExternalProject_Add(sensor_network
  BUILD_ALWAYS ON
  INSTALL_COMMAND cmake -E echo "Skipping install step."
  CMAKE_COMMAND ${cmake_with_env} -DCMAKE_BUILD_TYPE=RELEASE  
  BUILD_COMMAND ${cmake_with_env} --build .
  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sensor_network"   
  LIST_SEPARATOR ";" 
  CMAKE_ARGS
  -DCMAKE_FIND_ROOT_PATH=${root_path}
  ${android_cmake_args}
  -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/sensor_network
)

```

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 30, 2022, 9:15pm UTC](https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990/2 "2022-11-30T21:15:02Z")

</div>

Is this just another case of the same thing in [ExternalProject\_Add configure permission denied](https://discourse.cmake.org/t/externalproject-add-configure-permission-denied/6984)? If so, let’s continue discussion there and avoid creating new threads that are essentially duplicates.

---

<div class="post-metadata">

### Author: ![mpconte](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mpconte/32/2848_2.png) [@mpconte](https://discourse.cmake.org/u/mpconte)
#### Post date: [November 30, 2022, 9:28pm UTC](https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990/3 "2022-11-30T21:28:08Z")

</div>

@craig.scott I don’t believe so.

I think I resolved the previous issue by updating the ExternalProject\_Add command as shown in this issue, but ran into a different issue here

---

<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: [December 1, 2022, 5:45pm UTC](https://discourse.cmake.org/t/creating-directories-step-fails-with-externalproject-add/6990/4 "2022-12-01T17:45:30Z")

</div>

> [@mpconte](#):
>
> `LIST_SEPARATOR ";" `

This looks suspicious. I think you want something more complex here (I use `-+-` in one of my projects). This is because passing `;` around in CMake is problematic.
