purge build folder from within install.py script

This commit is contained in:
Axel Kohlmeyer
2023-03-16 16:29:42 -04:00
parent feb1b9e029
commit 4a66389bf1
2 changed files with 5 additions and 2 deletions

View File

@ -841,8 +841,7 @@ if(BUILD_SHARED_LIBS)
set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX})
if(Python_EXECUTABLE)
add_custom_target(
install-python ${CMAKE_COMMAND} -E remove_directory build
COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps
install-python ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps
-l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR}
COMMENT "Installing LAMMPS Python module")
else()

View File

@ -59,6 +59,10 @@ olddir = os.path.abspath('.')
os.chdir(os.path.dirname(args.package))
# remove any wheel files left over from previous calls
if os.path.isdir(os.path.join(olddir,"build")):
print("Cleaning old build directory")
shutil.rmtree(os.path.join(olddir,"build"))
print("Purging existing wheels...")
for wheel in glob.glob('lammps-*.whl'):
print("deleting " + wheel)