I am running CMake v3.20.0 and trying to do the following:
# Create .zip archive of the project
add_custom_target(
package
COMMAND ${CMAKE_COMMAND} -E tar -cfv "${PROJECT_NAME}-source.tar"
--exclude="build" -C ${CMAKE_SOURCE_DIR}/*
)
Unfortunately, I’m getting this error:
CMake Error: Unknown option to -E tar: --exclude=build
I tried a lot of ways of re-arranging stuff - to no avail.
The command works outside of CMake so I’m not sure what I’m doing wrong here