1 #checks that the given hard-coded list contains all headers + sources in the given folder 2 function(CheckFileList LIST_VAR FOLDER) 3 set(MESSAGE " should be added to the variable ${LIST_VAR}") 4 set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n") 5 file(GLOB GLOBBED_LIST "${FOLDER}/*.cpp" 6 "${FOLDER}/*.hpp" 7 "${FOLDER}/*.h") 8 list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}}) 9 foreach(EXTRA_ITEM ${GLOBBED_LIST}) 10 string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}") 11 message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}") 12 endforeach() 13 endfunction() 14 15 function(CheckFileListRec LIST_VAR FOLDER) 16 set(MESSAGE " should be added to the variable ${LIST_VAR}") 17 set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n") 18 file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp" 19 "${FOLDER}/*.hpp" 20 "${FOLDER}/*.h") 21 list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}}) 22 foreach(EXTRA_ITEM ${GLOBBED_LIST}) 23 string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}") 24 message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}") 25 endforeach() 26 endfunction() 27