MiscFunctions.cmake 1.2 KB

1234567891011121314151617181920212223242526
  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. function(CheckFileListRec LIST_VAR FOLDER)
  15. set(MESSAGE " should be added to the variable ${LIST_VAR}")
  16. set(MESSAGE "${MESSAGE} in ${CMAKE_CURRENT_LIST_FILE}\n")
  17. file(GLOB_RECURSE GLOBBED_LIST "${FOLDER}/*.cpp"
  18. "${FOLDER}/*.hpp"
  19. "${FOLDER}/*.h")
  20. list(REMOVE_ITEM GLOBBED_LIST ${${LIST_VAR}})
  21. foreach(EXTRA_ITEM ${GLOBBED_LIST})
  22. string(REPLACE "${CATCH_DIR}/" "" RELATIVE_FILE_NAME "${EXTRA_ITEM}")
  23. message(AUTHOR_WARNING "The file \"${RELATIVE_FILE_NAME}\"${MESSAGE}")
  24. endforeach()
  25. endfunction()