Commit 8d322feb authored by Marco Clemencic's avatar Marco Clemencic
Browse files

replaced merge_files.py with something simpler in CMake builds

parent c2d751db
#!/usr/bin/env python
import sys
import os
from optparse import OptionParser
parser = OptionParser(#desc='simple script to merge files',
usage="%prog [options] input1 input2 ... output")
parser.add_option('--ignore-missing', action='store_true',
help='do not fail if an input file is missing, '
'just ignore it')
if __name__ == '__main__':
opts, args = parser.parse_args()
if len(args) < 1:
parser.print_usage()
sys.exit(0)
import logging
logging.basicConfig()
output = args.pop()
inputs = args
missing = [i for i in inputs if not os.path.isfile(i)]
if missing:
if opts.ignore_missing:
inputs = [i for i in inputs if i not in missing]
for i in missing:
logging.warning('file %s not found', i)
else:
for i in missing:
logging.error('file %s not found', i)
sys.exit(1)
try:
with open(output, 'wb') as out:
for input in inputs:
out.writelines(open(input, 'rb'))
except:
os.remove(output)
raise
......@@ -331,8 +331,8 @@ macro(gaudi_project project version)
find_program(env_cmd xenv HINTS ${binary_paths})
set(env_cmd ${PYTHON_EXECUTABLE} ${env_cmd})
find_program(default_merge_cmd merge_files.py HINTS ${binary_paths})
set(default_merge_cmd ${PYTHON_EXECUTABLE} ${default_merge_cmd} --no-stamp)
find_program(default_merge_cmd quick-merge HINTS ${binary_paths})
set(default_merge_cmd ${PYTHON_EXECUTABLE} ${default_merge_cmd})
find_program(versheader_cmd createProjVersHeader.py HINTS ${binary_paths})
if(versheader_cmd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment