MacroAddFileDependencies.cmake 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. # - MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
  2. # Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There are usually
  3. # better ways to specify the correct dependencies.
  4. #
  5. # MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a convenience
  6. # wrapper around the OBJECT_DEPENDS source file property. You can just
  7. # use SET_PROPERTY(SOURCE <file> APPEND PROPERTY OBJECT_DEPENDS depend_files) instead.
  8. #=============================================================================
  9. # Copyright 2006-2009 Kitware, Inc.
  10. #
  11. # Distributed under the OSI-approved BSD License (the "License");
  12. # see accompanying file Copyright.txt for details.
  13. #
  14. # This software is distributed WITHOUT ANY WARRANTY; without even the
  15. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. # See the License for more information.
  17. #=============================================================================
  18. # (To distribute this file outside of CMake, substitute the full
  19. # License text for the above reference.)
  20. MACRO (MACRO_ADD_FILE_DEPENDENCIES _file)
  21. GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
  22. IF (_deps)
  23. SET(_deps ${_deps} ${ARGN})
  24. ELSE (_deps)
  25. SET(_deps ${ARGN})
  26. ENDIF (_deps)
  27. SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
  28. ENDMACRO (MACRO_ADD_FILE_DEPENDENCIES)