How can I create a VisualStudio2015 solution from a given directory structure?

48 Views Asked by At

Suppose I have isolated some header and source files from a huge CMake C++ project.

C:\USERS\PC\SOURCE\REPOS\my_app_src
├───apps {a.hh, b.cc, c.hh, d.cc}
│   └───biosimulations {main1.hh, main1.cc, x.hh, y.cc}
└───core {w.cc, x.hh, y.hh, z.cc}
    └───algorithms {p.hh, p.cc, q.hh, r.cc, s.hh, s.cc}
        └───trees {r.hh, r.cc, main2.hh, main2.cc}

What is the most convenient way to convert the above into a VisualStudio (C++) 2015 project and solution? Is it possible to do that without manually creating each directory and then adding source files?

1

There are 1 best solutions below

0
On

You could use cmake to create the Visual Studio Solution. It will be better to copy the files to an include folder.

include_directories (apps apps/biosimulations .....)


aux_source_directory (apps SRC_LIST)
aux_source_directory (apps/biosimulations SRC_LIST1)
....

add_executable (${PROJECT_NAME}  ${SRC_LIST} ${SRC_LIST1}......)