#NEWLINE# def need_configure( self ) : #NEWLINE# #INDENT# previous_args = self . read_cmake_args ( ) #NEWLINE# if ( not previous_args ) : #NEWLINE# #INDENT# ui . debug ( 'Could not read previous CMake args, re-running CMake' ) #NEWLINE# return True #NEWLINE# #UNINDENT# if ( previous_args != self . cmake_args ) : #NEWLINE# #INDENT# if previous_args : #NEWLINE# #INDENT# ui . info ( 'CMake arguments changed, re-running CMake' ) #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# if ( not os . path . exists ( self . cmake_cache ) ) : #NEWLINE# #INDENT# ui . debug ( 'CMakeCache.txt does not exist, re-running CMake' ) #NEWLINE# return True #NEWLINE# #UNINDENT# def cmake_filter( filename = None , dirname = None ) : #NEWLINE# #INDENT# ' Return True if cmake should re-run when\n            the file has changed\n\n            ' #NEWLINE# if dirname : #NEWLINE# #INDENT# if dirname . startswith ( '.' ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if dirname . startswith ( 'build-' ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# if filename : #NEWLINE# #INDENT# basename = os . path . basename ( filename ) #NEWLINE# if ( basename in [ 'CMakeLists.txt' , 'qiproject.xml' ] ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if basename . endswith ( '.cmake' ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# cmake_cache_time = os . path . getmtime ( self . cmake_cache ) #NEWLINE# filenames = qisys . sh . ls_r ( self . path , filter_fun = cmake_filter ) #NEWLINE# for filename in filenames : #NEWLINE# #INDENT# full_path = os . path . join ( self . path , filename ) #NEWLINE# if ( os . path . getmtime ( full_path ) > cmake_cache_time ) : #NEWLINE# #INDENT# rel_path = os . path . relpath ( full_path , self . path ) #NEWLINE# ui . info ( ( 'Re-running CMake because %s has changed' % cmake_filter ) ) #NEWLINE# return True