/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dict_hw/cmake/make2cmake.cmake

  • Committer: Suren A. Chilingaryan
  • Date: 2009-12-12 01:38:41 UTC
  • Revision ID: csa@dside.dyndns.org-20091212013841-feih3qa4i28x75j4
Provide stand-alone library

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#  For more information, please see: http://software.sci.utah.edu
 
3
#
 
4
#  The MIT License
 
5
#
 
6
#  Copyright (c) 2007
 
7
#  Scientific Computing and Imaging Institute, University of Utah
 
8
#
 
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:
 
16
#
 
17
#  The above copyright notice and this permission notice shall be included
 
18
#  in all copies or substantial portions of the Software.
 
19
#
 
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.
 
27
 
 
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.
 
32
 
 
33
file(READ ${input_file} depend_text)
 
34
 
 
35
if (${depend_text} MATCHES ".+")
 
36
 
 
37
  # message("FOUND DEPENDS")
 
38
 
 
39
  # Remember, four backslashes is escaped to one backslash in the string.
 
40
  string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
 
41
 
 
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})
 
45
 
 
46
  foreach(file ${depend_text})
 
47
 
 
48
    string(REGEX REPLACE "^ +" "" file ${file})
 
49
 
 
50
    if(NOT IS_DIRECTORY ${file})
 
51
      set(cuda_nvcc_depend "${cuda_nvcc_depend} \"${file}\"\n")
 
52
    endif(NOT IS_DIRECTORY ${file})
 
53
 
 
54
  endforeach(file)
 
55
 
 
56
else()
 
57
  # message("FOUND NO DEPENDS")
 
58
endif()
 
59
 
 
60
 
 
61
file(WRITE ${output_file} "# Generated by: make2cmake.cmake\nSET(CUDA_NVCC_DEPEND\n ${cuda_nvcc_depend})\n\n")