How to not generate CMake Target View in Visual Studio

Mohammad Mohsin Siddiqui 175 Reputation points
2023-07-04T07:47:10.4133333+00:00

We are using VS as IDE and CMake as build system. As part of cache generation process from CMake via Visual Studio, after generating build files, VS also generate cmake target view.

We have written our own extension to build targets. So basically on click of build of any target from our view, it basically call cmake build system with proper information like below

cmake --build --preset=Windiws-x64-Debug --target=aTarget

When cache generation happens, we get below log in VS output.

1> Working directory: D:/TW/Builds/TWInt/Android_Phone-x64

1> [CMake] -- Configuring done

1> [CMake] -- Generating done

1> [CMake] -- Build files have been written to: D:/TW/Builds/TWInt/Android_Phone-x64

1> Extracted CMake variables.

1> Extracted source files and headers.

1> Extracted code model.

1> Extracted toolchain configurations.

1> Extracted includes paths.

1> CMake generation finished.

Till above bold line, all build files are generated and rest logs all are to setup CMake Target View. Steps post buildsystem generation, it takes some time to setup/generate cmake target view. And since we are not using cmake target view for building, we do not want to pay this extra time.

Is there anyway to disable setup/generation of cmake target view in Visual Studio ?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,439 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,018 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 33,271 Reputation points Microsoft Vendor
    2023-07-04T12:30:03.34+00:00

    Hello @Mohammad Mohsin Siddiqui ,

    Welcome to Microsoft Q&A forum.

    CMake Target View is used to visualize your CMake projects’ source and structure. As far as I know, you can choose to switch to this View but can’t disable it, which means the preparation for showing the CMake Target View will automatically start and run.

    You may submit a suggestion ticket on our Developer Community - Visual Studio.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.