diff --git a/CMakeLists.txt b/CMakeLists.txt index 52b6fcecb9..c3e3b587f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,3 +342,9 @@ endif() if(BUILD_BENCHMARK) add_subdirectory(bench) endif() + +get_directory_property(clean_files ADDITIONAL_CLEAN_FILES) +list(APPEND clean_files "${OPEN_SRC_INSTALL_PREFIX}") +list(APPEND clean_files "${CMAKE_CURRENT_SOURCE_DIR}/build") +set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES "${clean_files}") + diff --git a/README.md b/README.md index de73b31d6f..5d5a0d021a 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,8 @@ You can pass the following options to `cmake ..`. * `-DUNDEFINED_BEHAVIOR_SANITIZER` -- Build with UndefinedBehaviorSanitizer * `-DLINK_PROFILER` -- Link with gperftools (available profiler options are listed [here](https://github.com/gperftools/gperftools)) +To clean up the `open-source` and `build` folders from previous build, use `cmake --build . --target clean` from the `build` folder + For windows builds, you will have to include additional flags for libwebsockets CMake. Add the following flags to your cmake command, or edit the CMake file in ./CMake/Dependencies/libwebsockets-CMakeLists.txt with the following: ```