diff --git a/scratch/CMakeLists.txt b/scratch/CMakeLists.txt index 34b8ca48e..06d7dafab 100644 --- a/scratch/CMakeLists.txt +++ b/scratch/CMakeLists.txt @@ -62,7 +62,7 @@ function(create_scratch source_files) endfunction() # Scan *.cc files in ns-3-dev/scratch and build a target for each -file(GLOB single_source_file_scratches ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) +file(GLOB single_source_file_scratches CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cc) foreach(scratch_src ${single_source_file_scratches}) create_scratch(${scratch_src}) endforeach() @@ -71,6 +71,7 @@ endforeach() # subdirectory file( GLOB_RECURSE scratch_subdirectories + CONFIGURE_DEPENDS LIST_DIRECTORIES true ${CMAKE_CURRENT_SOURCE_DIR}/** ) @@ -92,7 +93,7 @@ foreach(subdir ${scratch_subdirectories}) else() # Otherwise we pick all the files in the subdirectory # and create a scratch for them automatically - file(GLOB scratch_sources ${subdir}/*.cc) + file(GLOB scratch_sources CONFIGURE_DEPENDS ${subdir}/*.cc) create_scratch("${scratch_sources}") endif() endforeach()