Clean CMake Files

If you run into an error like this

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/environment/regression-tests/contracts/eos
âšĢ Scanning dependencies of target thezeostoken
â—ŧī¸ [  1%] Creating directories for 'thezeostoken'
â—ŧī¸ [  1%] No download step for 'thezeostoken'
â—ŧī¸ [  2%] No patch step for 'thezeostoken'
â—ŧī¸ [  2%] No update step for 'thezeostoken'
â—ŧī¸ [  2%] Performing configure step for 'thezeostoken'
CMake Error: The current CMakeCache.txt directory /home/ubuntu/environment/regression-tests/contracts/eos/thezeostoken/CMakeCache.txt is different than the directory /contracts/thezeostoken where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMakeFiles/thezeostoken.dir/build.make:106: recipe for target 'thezeostoken-prefix/src/thezeostoken-stamp/thezeostoken-configure' failed
â—ŧī¸ make[2]: *** [thezeostoken-prefix/src/thezeostoken-stamp/thezeostoken-configure] Error 1
â—ŧī¸ make[1]: *** [CMakeFiles/thezeostoken.dir/all] Error 2
â—ŧī¸ make: *** [all] Error 2
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/thezeostoken.dir/all' failed
Makefile:83: recipe for target 'all' failed
☚ī¸ eos contracts compile failed, if you want to use docker add --docker

Or if you're swapping between CDT versions or having cmake issues in general..

If you're using a legacy CDT < v3.0.0 be sure to unbox, compile, test with --legacy-cdt

You can use the bash script below to clear those directories.

find ./contracts/eos/ -type d -name *prefix -prune -exec rm -rf {} \;
find ./contracts/eos/ -type d -name CMakeFiles -prune -exec rm -rf {} \;
find ./contracts/eos/ -type f -name 'CMakeCache.txt' -delete
find ./contracts/eos/ -type f -name 'Makefile' -delete
find ./contracts/eos/ -type f -name 'cmake_install.cmake' -delete

Last updated