#!/usr/bin/env python3 import sys import os def ctest_sets(conffile, confsteps): conffile.write('###################################################################\n') for confs in confsteps: k = confs v = confsteps[k] conffile.write('set({} {})\n'.format(k,v)) conffile.write('###################################################################\n') def ctest_options(conffile, confsteps, HAVE_FORTRAN, HAVE_CXX, HAVE_JAVA): conffile.write('###################################################################\n') for confs in confsteps: o = confs t = confsteps[o] for opt in t: k = opt v = t[k] if 'FORTRAN' in o: if HAVE_FORTRAN == 'ON': conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,v)) else: conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,HAVE_FORTRAN)) elif 'CPP' in o: if HAVE_CXX == 'ON': conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,v)) else: conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,HAVE_CXX)) elif 'JAVA' in o: if HAVE_JAVA == 'ON': conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,v)) else: conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,HAVE_JAVA)) else: conffile.write('set(ADD_BUILD_OPTIONS "${{ADD_BUILD_OPTIONS}} -D{}:{}={}")\n'.format(o,k,v)) conffile.write('###################################################################\n')