<s> import os <EOL> import os . path as osp <EOL> import textwrap <EOL> import waflib . Utils <EOL> import waflib . Logs as msg <EOL> from waflib . Configure import conf <EOL> _heptooldir = osp . dirname ( osp . abspath ( __file__ ) ) <EOL> def options ( opt ) : <EOL> opt . load ( '<STR_LIT>' , tooldir = _heptooldir ) <EOL> opt . add_option ( <EOL> '<STR_LIT>' , <EOL> default = None , <EOL> help = "<STR_LIT>" ) <EOL> return <EOL> def configure ( conf ) : <EOL> conf . load ( '<STR_LIT>' , tooldir = _heptooldir ) <EOL> return <EOL> @ conf <EOL> def find_cmake ( ctx , ** kwargs ) : <EOL> if not ctx . env . HWAF_FOUND_C_COMPILER : <EOL> ctx . fatal ( '<STR_LIT>' ) <EOL> pass <EOL> if not ctx . env . HWAF_FOUND_CXX_COMPILER : <EOL> ctx . fatal ( '<STR_LIT>' ) <EOL> pass <EOL> path_list = waflib . Utils . to_list ( kwargs . get ( '<STR_LIT>' , [ ] ) ) <EOL> if getattr ( ctx . options , '<STR_LIT>' , None ) : <EOL> topdir = ctx . options . with_cmake <EOL> topdir = ctx . hwaf_subst_vars ( topdir ) <EOL> path_list . append ( osp . join ( topdir , "<STR_LIT>" ) ) <EOL> pass <EOL> kwargs [ '<STR_LIT>' ] = path_list <EOL> ctx . find_program ( <EOL> "<STR_LIT>" , <EOL> var = "<STR_LIT>" , <EOL> ** kwargs ) <EOL> kwargs [ '<STR_LIT>' ] = False <EOL> ctx . find_program ( <EOL> "<STR_LIT>" , <EOL> var = "<STR_LIT>" , <EOL> ** kwargs ) <EOL> ctx . find_program ( <EOL> "<STR_LIT>" , <EOL> var = "<STR_LIT>" , <EOL> ** kwargs ) <EOL> ctx . find_program ( <EOL> "<STR_LIT>" , <EOL> var = "<STR_LIT>" , <EOL> ** kwargs ) <EOL> version = "<STR_LIT>" <EOL> cmd = [ ctx . env . CMAKE , "<STR_LIT>" ] <EOL> lines = ctx . cmd_and_log ( cmd ) . splitlines ( ) <EOL> for l in lines : <EOL> l = l . lower ( ) <EOL> if "<STR_LIT:version>" in l : <EOL> version = l [ l . find ( "<STR_LIT:version>" ) + len ( "<STR_LIT:version>" ) : ] . strip ( ) <EOL> break <EOL> pass <EOL> ctx . start_msg ( "<STR_LIT>" ) <EOL> ctx . end_msg ( version ) <EOL> ctx . hwaf_declare_runtime_env ( '<STR_LIT>' ) <EOL> ctx . env . CMAKE_HOME = osp . dirname ( osp . dirname ( ctx . env . CMAKE ) ) <EOL> ctx . env . CMAKE_VERSION = version <EOL> ctx . env . HWAF_FOUND_CMAKE = <NUM_LIT:1> <EOL> return </s>
