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.
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.