ExternalProject_Add and CMAKE_DISABLE_SOURCE_CHANGES ON
ExternalProject_Add errors with:
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/ExternalProject.cmake:1648 (file):
[cmake] file attempted to create a directory:
[cmake] E:/Repos/CMakeJSON/examples/SimpleProject into a source directory.
[cmake] Call Stack (most recent call first):
if CMAKE_DISABLE_SOURCE_CHANGES
is set to ON
.
(E:/Repos/CMakeJSON/examples/SimpleProject
is passed as a SOURCE_DIR
to ExternalProject_Add
and contains the required sources. It is part of CMAKE_SOURCE_DIR of the calling CMakeLists.txt)
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/ExternalProject.cmake:1648 (file):
is file(MAKE_DIRECTORY "${dir}")
which should probably either check if the directory already exists and not be called or simply not error if CMAKE_DISABLE_SOURCE_CHANGES
is set to ON
and didn't change anything in the sources.