Skip to content

VSCode: Add vcpkg toolchain for CMake Tools support - #572

Closed
Daniel Marshall (SuperWig) wants to merge 1 commit into
microsoft:masterfrom
SuperWig:vscode-cmake
Closed

Daniel Marshall (SuperWig) wants to merge 1 commit into
microsoft:masterfrom
SuperWig:vscode-cmake

Conversation

@SuperWig

Copy link
Copy Markdown
Contributor

Description

Resolves #571

Checklist

Be sure you've read README.md and understand the scope of this repo.

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    the C++ Working Draft (including any cited standards), other WG21 papers
    (excluding reference implementations outside of proposed standard wording),
    and LWG issues as reference material. If they were derived from a project
    that's already listed in NOTICE.txt, that's fine, but please mention it.
    If they were derived from any other project (including Boost and libc++,
    which are not yet listed in NOTICE.txt), you must mention it here,
    so we can determine whether the license is compatible and what else needs
    to be done.

@SuperWig
Daniel Marshall (SuperWig) requested a review from a team as a code owner February 29, 2020 10:21
@SuperWig

Copy link
Copy Markdown
Contributor Author

Since CMake Tools default build directory is build maybe that could be added to the .gitignore? Alternatively also add something like

 "cmake.buildDirectory": "${workspaceFolder}/out/build/${buildKit}",

To mimic Visual Studio's default build directory. Albeit with less nice naming

out/build/Visual Studio Community 2019 Preview - amd64/

@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the enhancement Something can be improved label Feb 29, 2020
@BillyONeal

Copy link
Copy Markdown
Member

Doesn't this break someone who is using an "installed" vcpkg rather than our submodule?

@barcharcraz

Copy link
Copy Markdown
Contributor

Doesn't this break someone who is using an "installed" vcpkg rather than our submodule?

I think it kinda does, workspace settings override global or user settings, and I happen to set the vcpkg toolchain in my user settings

This also sorta breaks people building using "other" boost libraries (from wherever).

And people who don't use the toolchain (I sometimes just set CMAKE_PREFIX_PATH, or use vcpkg export and then set CMAKE_INSTALL_PREFIX to that).

@BillyONeal

Copy link
Copy Markdown
Member

I see, in that case this change would break me :(

@SuperWig

Copy link
Copy Markdown
Contributor Author

Well bugger. I don't suppose there's a way to change that behaviour? From my quick search there doesn't seem to be :/

@BillyONeal

Copy link
Copy Markdown
Member

If the STL submodule vcpkg is the only one you regularly use you can vcpkg integrate install that one and then VS will find it without other configuration in this repo.

@SuperWig

Daniel Marshall (SuperWig) commented Mar 3, 2020

Copy link
Copy Markdown
Contributor Author

This is for VS Code not VS. With VS the CMake settings JSON isn't tracked by this repo so modifying it doesn't mean git add -u will stage it.

The desire for this was mainly due to that time where the latest Boost wasn't supported so at the time the toolchain file in my settings didn't work so I added this one's to the workspace settings
(also for out the box support for less experienced users that wanted to use VS Code over VS).

(Didn't mean to close and comment just now though will keep it closed due to the issues stated above).

@BillyONeal

Copy link
Copy Markdown
Member

This is for VS Code not VS.

Hmmm it seems like a bug that VS Code doesn't listen to the signal that integrate install sets :(

@SuperWig

Copy link
Copy Markdown
Contributor Author

Huh, could have sworn 2 things before double checking just now

  1. CMakeSettings.json wasn't tracked and I had to manually alter it to add the toolchain file to it.
  2. vcpkg integrate install only worked with MSBuild and not a Visual Studio CMake project.

I'm thinking 1) was me misremembering the time when I altered it due to that Boost issue noted above. 🤷‍♂️
Thanks for opening the vcpkg issue 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VSCode: Add vcpkg toolchain file to settings.json (CMake Tools extension)

4 participants