~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to cmake/make2cmake.cmake

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-vr15wtg9b50cuesg
Tags: upstream-1.9.0
ImportĀ upstreamĀ versionĀ 1.9.0

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 (EXISTS ${file})
 
51
          #   MESSAGE("DEPEND = ${file}")    
 
52
    # ELSE (EXISTS ${file})
 
53
          #   MESSAGE("ERROR = ${file}")
 
54
    # ENDIF(EXISTS ${file})
 
55
  
 
56
    SET(cuda_nvcc_depend "${cuda_nvcc_depend} \"${file}\"\n")
 
57
  
 
58
  ENDFOREACH(file) 
 
59
 
 
60
ELSE(${depend_text} MATCHES ".+") 
 
61
  # MESSAGE("FOUND NO DEPENDS")
 
62
ENDIF(${depend_text} MATCHES ".+")
 
63
 
 
64
 
 
65
FILE(WRITE ${output_file} "# Generated by: make2cmake.cmake\nSET(CUDA_NVCC_DEPEND\n ${cuda_nvcc_depend})\n\n")