diff --git a/CMakeLists.txt b/CMakeLists.txt index 55fc44a13..7ff514737 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,9 @@ include(CPack) # Generate docs before creating source package include(src/Filelists.cmake) -add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) -if (TARGET lwipdocs) - add_dependencies(dist lwipdocs) +if (NOT TARGET dist) + add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) + if (TARGET lwipdocs) + add_dependencies(dist lwipdocs) + endif() endif()