简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM