Creating directories step fails with ExternalProject_Add

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

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


  INSTALL_COMMAND cmake -E echo "Skipping install step."
  BUILD_COMMAND ${cmake_with_env} --build .
  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sensor_network"   

Is this just another case of the same thing in ExternalProject_Add configure permission denied? If so, let’s continue discussion there and avoid creating new threads that are essentially duplicates.

@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

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.