diff --git a/CMakeLists.txt b/CMakeLists.txt index 9051ecbd3318b7567d65563d2abb38f91214756e..6be4e23f44a6b6fda0cd6456fe62645a6c0c770e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,12 @@ if(NOT TARGET genopts_virtualenv) DEPENDS ${GENOPTS_VIRTUALENV} DEPENDS ${CMAKE_CURRENT_LIST_DIR}/requirements.txt ) + + # Ensure the virtual environment is removed when cleaning + set_property( + TARGET genopts_virtualenv + APPEND + PROPERTY ADDITIONAL_CLEAN_FILES ${GENOPTS_VIRTUALENV}) endif() # Export a target with the location of the script in case someone needs this