question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CMake Tools doesn't recognize CMakeLists.txt on Windows

See original GitHub issue

Brief Issue Summary

On Windows, when configuring cmake through CMake Tools, the “You do not have a CMakeLists.txt” message appears even though the file does exist.

Expected:

The project configures

Apparent Behavior:

CMake Tools doesn’t find the CMakeLists.txt

CMake Tools Log

[cms-client] Configuring using the "Ninja" CMake generator
[cms-client] Configuring using the "Ninja" CMake generator

Developer Tools Log

 INFO no standard startup: panel is active
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.211Z [debug] [rollbar] Updated Rollbar payload {"environment":"production","packageJSON":{"name":"cmake-tools","version":"1.1.1"},"client":{"code_version":"1.1.1"},"platform":"win32"}
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.439Z [debug] [kit] Reading kits file C:\Users\Justin\AppData\Roaming\CMakeTools\cmake-tools.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.440Z [debug] [kit] Not reading non-existent kits file: c:\Users\Justin\Documents\CPP\pitchfork\.vscode\cmake-kits.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.606Z [info] [kit] Successfully loaded 12 kits from C:\Users\Justin\AppData\Roaming\CMakeTools\cmake-tools.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.609Z [debug] [main] Safe constructing new CMakeTools instance
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.611Z [debug] [variant] Constructing VariantManager
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.613Z [debug] [main] Constructing new CMakeTools instance
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.615Z [debug] [main] Starting CMakeTools second-phase init
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.617Z [debug] [rollbar] Checking Rollbar permissions
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.625Z [debug] [rollbar] Rollbar enabled?  true
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.739Z [info] [variant] Loaded new set of variants
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.742Z [debug] [main] CMakeTools instance initialization complete.
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.743Z [debug] [main] Injecting new Kit into CMake driver
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.747Z [debug] [kit] Reading kits file C:\Users\Justin\AppData\Roaming\CMakeTools\cmake-tools.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.767Z [info] [kit] Successfully loaded 12 kits from C:\Users\Justin\AppData\Roaming\CMakeTools\cmake-tools.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.769Z [debug] [kit] Not reading non-existent kits file: c:\Users\Justin\Documents\CPP\pitchfork\.vscode\cmake-kits.json
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.771Z [debug] [rollbar] Updated Rollbar payload {"kit":{"name":"Visual Studio Community 2017 - amd64","visualStudio":"e3c5dd2b","visualStudioArchitecture":"amd64","preferredGenerator":{"name":"Visual Studio 15 2017","platform":"x64"}}}
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:19.771Z [debug] [main] Injecting new Kit into CMake driver
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] activating extension
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.349Z [debug] [extension] Configuring workspace on open  file:///c%3A/Users/Justin/Documents/CPP/pitchfork
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.351Z [debug] [main] Run configure  
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.351Z [debug] [main] Saving open files before configure/build
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.795Z [debug] [main] Starting new CMake driver
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.796Z [debug] [main] Starting CMake driver
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:22.797Z [debug] [driver] CMakeDriver Kit set to Visual Studio Community 2017 - amd64
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:24.148Z [debug] [driver] Run _refreshExpansions
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:24.149Z [debug] [cms-driver] Run doRefreshExpansions
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:24.149Z [debug] [driver] Run _refreshExpansions cb
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:24.159Z [debug] [cms-client] Started new CMake Server instance with PID 6536
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.162Z [debug] [driver] Trying to detect generator supported by system
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.192Z [info] [cms-client] Configuring using the "Ninja" CMake generator
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.196Z [debug] [driver] Setting new variant , Emit debug information without performing optimizations
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.196Z [debug] [driver] Run _refreshExpansions
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.197Z [debug] [cms-driver] Run doRefreshExpansions
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.197Z [debug] [driver] Run _refreshExpansions cb
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:25.265Z [debug] [cms-client] Started new CMake Server instance with PID 3496
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:26.266Z [debug] [driver] Trying to detect generator supported by system
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:26.301Z [info] [cms-client] Configuring using the "Ninja" CMake generator
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:26.398Z [debug] [driver] Start configure  
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:26.398Z [debug] [driver] Runnnig pre-configure checks and steps
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:272 [Extension Host] [CMakeTools] 2018-09-03T04:29:26.399Z [debug] [driver] No configuring: There is no  c:/users/justin/documents/cpp/pitchfork/cmakelists.txt
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2386 You do not have a CMakeLists.txt
t.onDidNotificationChange @ /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2386

Platform and Versions

  • Operating System: Windows
  • CMake Version: 3.12.1
  • VSCode Version: 1.26.1
  • CMake Tools Extension Version: 1.1.1
  • Compiler/Toolchain: Visual C++ 2017

Other Notes/Information

Clicking “Quickstart a new CMake project” fails with the message: “This workspace already contains a CMakeLists.txt!”

I’m guessing this has to do with the fact that Windows uses case insensitive file paths.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Quincunx271commented, Sep 5, 2018

Here’s what happened: I created the directory from the Windows Subsystem for Linux (WSL), even though it is a Windows folder. Windows automatically enables case sensitivity for files created from the WSL, meaning that the paths are actually case sensitive.

I verified it by running fsutil.exe:

C:\...\pitchfork>fsutil.exe file queryCaseSensitiveInfo .
Case sensitive attribute on C:\...\pitchfork is enabled.
1reaction
marc-h38commented, Nov 29, 2018

I have no idea how to fix this but in the meantime a small error message change would really go a long way and save a number of lives. Something like:

  The source directory
    C:\Users\joe\Project\foo\bar\
  does not contain a CMakeLists.txt file. Note Windows supports per-directory case-sensitivity. We're not joking.
Read more comments on GitHub >

github_iconTop Results From Across the Web

CMake projects in Visual Studio | Microsoft Learn
Use the CMakeLists. txt file in each project folder just as you would in any CMake project. You can specify source files, find...
Read more >
Failed to configure preset with Clang/LLVM compilers when ...
Problem Description. First of all, I already installed Clang/LLVM by running the following winget command: winget install LLVM.LLVM.
Read more >
vscode-cmake-tools/support - Gitter
I'm using Clang 10.0.0 to compile, VSCode 1.53.2, CMake 3.19.6 (on the machine that doesn't work) and 3.17.0-rc2 on the one that does....
Read more >
Setting Up CMake | Qt Creator Manual - Qt Documentation
CMake automates the configuration of build systems. It controls the software compilation process by using simple configuration files, called CMakeLists.txt ...
Read more >
How to configure VS Code's CMake Tools Extension for GCC ...
You probably need to select a different build tool. [cmake] CMake Error: CMake was unable to find a build program corresponding to "MSYS ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found