Giter Site home page Giter Site logo

Comments (3)

v-frankwang avatar v-frankwang commented on July 20, 2024

@tengai650 I think the problem is because you set the hidden attribute in the config to true, when I set this attribute to false, I don't have the problem you mentioned.

from vscode-cmake-tools.

v-frankwang avatar v-frankwang commented on July 20, 2024

@gcampbell-msft I am reproducing the problem stated by the user with a simple project, I think the user's problem is caused by setting the hidden attribute to true, here are my steps to reproduce it:

ENV:
VS Code: 1.90.0
CMake tools: 1.18.42
C/C++:1.20.5

  1. Create a folder named test and open it with vscode.
  2. Add the CMakeLists.txt file with the following code:
cmake_minimum_required(VERSION 3.5)
project(test)
add_executable(test main.cpp)
  1. Add the main.cpp file with the following code:
#include"iostream"

int main()
{
    std::cout << "Hello world\n" << std::endl;
}
  1. Add CMakePresets.json file with the following code:
{
    "version": 6,
    "configurePresets": [
        {
            "name": "debug_x64",
            "hidden":true,
            "generator": "Visual Studio 17 2022",
            "binaryDir": "${workspaceFolder}/build",
            "description": "Default build.",
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Debug",
                "CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
                "BOOST_ROOT": "G:/dev/boost/boost_1_85_0"
            }
        },
        {
            "name": "release_x64",
            "hidden": true,
            "generator": "Visual Studio 17 2022",
            "binaryDir": "${workspaceFolder}/build",
            "description": "Release build.",
            "cacheVariables": {
                "CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
                "BOOST_ROOT": "G:/dev/boost/boost_1_85_0"
            }
        }
    ],
    "buildPresets": [
        {
            "name": "Release",
            "description": "",
            "displayName": "",
            "configurePreset": "release_x64"
        },
        {
            "name": "Debug",
            "description": "",
            "displayName": "",
            "configurePreset": "debug_x64"
        }
    ]
}
  1. Run the command:"CMake:configure"

The result of setting the hidden attribute value to true:
image

The result of setting the hidden attribute value to false:
image

from vscode-cmake-tools.

gcampbell-msft avatar gcampbell-msft commented on July 20, 2024

@tengai650 @v-frankwang While this is not exactly matching the behavior of cmake.exe, you should have at least one configure preset visible.

The cmake.exe does allow you to list the build presets even if they use hidden configure Presets, you are not able to build with the command-line with the build presets that use a hidden configure preset. Therefore, the current behavior makes sense.

Closing for now, since you should be using non-hidden configure presets. Thanks! Let me know if there are any other questions.

from vscode-cmake-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.