From 88bef282e441b0bf13b0efcd3c4896cccf53477e Mon Sep 17 00:00:00 2001 From: "Bob Brown (DEVDIV)" Date: Wed, 22 Jan 2020 11:20:43 -0800 Subject: [PATCH] Don't fail if CMakeLists.txt was appended to sourceDirectory --- src/drivers/driver.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/driver.ts b/src/drivers/driver.ts index 5e1fe9749..28256f983 100644 --- a/src/drivers/driver.ts +++ b/src/drivers/driver.ts @@ -394,6 +394,10 @@ export abstract class CMakeDriver implements vscode.Disposable { log.debug('Run _refreshExpansions cb'); const opts = this.expansionOptions; this._sourceDirectory = util.lightNormalizePath(await expand.expandString(this.config.sourceDirectory, opts)); + if (path.basename(this._sourceDirectory).toLocaleLowerCase() === "cmakelists.txt") { + // Don't fail if CMakeLists.txt was accidentally appended to the sourceDirectory. + this._sourceDirectory = path.dirname(this._sourceDirectory); + } this._binaryDir = util.lightNormalizePath(await expand.expandString(this.config.buildDirectory, opts)); const installPrefix = this.config.installPrefix;