def METHOD_NAME(oilDir,oilFile):
    result = TestState.FAIL
    stop = False
    #compile CMake based project.
    buildDir = join(oilDir,'build')
    #1 - build dir (may be already generated)
    try:
        os.mkdir(buildDir)
    except FileExistsError:
        #There is a build dir, remove the cache (if any)
        CMakeCache = join(buildDir,'CMakeCache.txt')
        if isfile(CMakeCache):
            os.remove(CMakeCache)
    #2 - run cmake
    oilGeneratedDir = join(oilDir,oilFile[:-4])
    oilCMakeCompiler = join(oilGeneratedDir,'compiler.cmake')
    cmd = 'cmake -D CMAKE_TOOLCHAIN_FILE='+oilCMakeCompiler+' '+oilDir
    process = None
    try:
        process = run(cmd.split(),cwd=buildDir,stdout=DEVNULL)
    except OSError:
        print('the command "'+cmd+ '" failed.')
    except KeyboardInterrupt:
        stop = True
    #3 - run make
    if process and process.returncode == 0:
        cmd = 'make'
        process = None
        try:
            process = run(cmd.split(),cwd=buildDir,stdout=DEVNULL)
        except OSError:
            print('the command "'+cmd+ '" failed.')
        except KeyboardInterrupt:
            stop = True
        if process and process.returncode == 0:
            result = TestState.OK
    return result,stop