make2cmake.cmake
上传用户:chinafayin
上传日期:2022-04-05
资源大小:153k
文件大小:2k
源码类别:

并行计算

开发平台:

Visual C++

  1. #  For more information, please see: http://software.sci.utah.edu
  2. #
  3. #  The MIT License
  4. #
  5. #  Copyright (c) 2007
  6. #  Scientific Computing and Imaging Institute, University of Utah
  7. #
  8. #  License for the specific language governing rights and limitations under
  9. #  Permission is hereby granted, free of charge, to any person obtaining a
  10. #  copy of this software and associated documentation files (the "Software"),
  11. #  to deal in the Software without restriction, including without limitation
  12. #  the rights to use, copy, modify, merge, publish, distribute, sublicense,
  13. #  and/or sell copies of the Software, and to permit persons to whom the
  14. #  Software is furnished to do so, subject to the following conditions:
  15. #
  16. #  The above copyright notice and this permission notice shall be included
  17. #  in all copies or substantial portions of the Software.
  18. #
  19. #  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  20. #  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. #  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  22. #  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. #  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  24. #  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  25. #  DEALINGS IN THE SOFTWARE.
  26. # Make2cmake CMake Script
  27. # Abe Stephens and James Bigler
  28. # (c) 2007 Scientific Computing and Imaging Institute, University of Utah
  29. # Note that the REGEX expressions may need to be tweaked for different dependency generators.
  30. FILE(READ ${input_file} depend_text)
  31. IF (${depend_text} MATCHES ".+")
  32.   # MESSAGE("FOUND DEPENDS")
  33.   # Remember, four backslashes is escaped to one backslash in the string.
  34.   STRING(REGEX REPLACE "\\ " " " depend_text ${depend_text})
  35.   
  36.   # This works for the nvcc -M generated dependency files.
  37.   STRING(REGEX REPLACE "^.* : " "" depend_text ${depend_text})
  38.   STRING(REGEX REPLACE "[ \\]*n" ";" depend_text ${depend_text})
  39.   FOREACH(file ${depend_text})
  40.     STRING(REGEX REPLACE "^ +" "" file ${file})
  41.     IF(NOT IS_DIRECTORY ${file})
  42.       SET(cuda_nvcc_depend "${cuda_nvcc_depend} "${file}"n")
  43.     ENDIF(NOT IS_DIRECTORY ${file})
  44.   
  45.   ENDFOREACH(file) 
  46. ELSE()
  47.   # MESSAGE("FOUND NO DEPENDS")
  48. ENDIF()
  49. FILE(WRITE ${output_file} "# Generated by: make2cmake.cmakenSET(CUDA_NVCC_DEPENDn ${cuda_nvcc_depend})nn")