Visual-Studio-2010 – Add files to the CMAKE project in Visual Studio 2010

I have been using cmake in Linux for a while, but I need to move to Visual Studio to work for two reasons…

I generate With the cmake project, I can load the solution in Visual Studio, but when I try to add the file, it will be added to the location of the build file instead of added to the source directory. Is there any way to solve this problem, or must Add them through the explorer, then regenerate the cmake build file, and then reopen the solution? This seems a bit clunky, I hope there is an easier way.

To add new File, you can select the “Add -> New Project” option. In the result window, there should be a “location” text input box. This has a default specified build directory, but you can easily change the path to a certain one in the source tree Location.

I have been using cmake in Linux for a while, but I need to move to Visual Studio to work for two reasons…

I generated the cmake project and I can load the solution in Visual Studio, but when I try to add the file, it will be added to the location of the build file instead of added to the source directory. Is there any way to solve this problem, Or do I have to add them through the explorer, then regenerate the cmake build file, and then reopen the solution? This seems a bit clunky, I hope there is an easier way.

To add a new file through Visual Studio, you can select the “Add -> New Project” option . In the result window, there should be a “location” text input box. This has the build directory specified by default, but you can easily change the path to a location in the source tree.

Leave a Comment

Your email address will not be published.