简体   繁体   中英

MS Visual Studio solution combining unmanaged C++ project and C# projects

I am using MS Visual Studio 2017 and want to have a solution which contains all of my subprojects, and can build them and maintain dependency relationships among them.

One of these projects is unmanaged C++, and needs to cross-compile on Linux because it already has python and other bindings, used by customers.

The others are C# libary (the deliverable artifact for the customer) and C# application (where I am testing the library).

I created minimal sample project with the same structure here: https://github.com/pkozelka/csharp-dummy

The problem is that, when I create project for C++ sources, it creates CMakeLists.txt and this cannot be opened (and contained) inside the solution.

Is there a way to create msbuild / visual studio compatible project for it that allows me to put this into a solution?

Except if your project is very large, you can create a project in Visual Studio with all the desired files in it.

Also you can type visual studio open folder c++ or something similar in Google. Here are the first 2 links:

https://blogs.msdn.microsoft.com/vcblog/2016/10/05/bring-your-c-codebase-to-visual-studio-with-open-folder/

https://docs.microsoft.com/en-us/cpp/ide/non-msbuild-projects?view=vs-2017

Finally, if your CMakeLists.txt is complex, you can always write a program that would generate a C++ project. The file is XML file add it should not be hard to figure out how to create one from a template (for ex. an empty project) and a list of files.

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