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