question

TerenceDarwen-7654 avatar image
0 Votes"
TerenceDarwen-7654 asked MinxinYu-MSFT commented

Include a CMakeLists.txt project inside a Visual Studio solution?

I have a Visual Studio 2019 solution that currently has eleven different projects in it. These are various C# and C++ projects that run in docker containers.

I currently have an independent project that is a C++ application that runs in a Linux docker container. This project is based on the Microsoft C++ Team blog post here:

https://devblogs.microsoft.com/cppblog/build-c-applications-in-a-linux-docker-container-with-visual-studio/

Instead of a typical Visual Studio project, it uses a CMakeLists.txt file I open in Visual Studio, which then allows me to compile, run and debug my software in the Linux container.

It works great. However, what I'd like to do, is include this project in my aforementioned solution, but I'm not aware of any way to do this.

Unlike a typical Visual Studio project, it seems I can't just add in the CMakeLists.txt, as a project, to my existing solution. Am I missing something???

Maybe there's a different way to create a C++ application that runs in a Linux docker container that uses a typical Visual Studio project file instead of a CMakeLists.txt file??? If so, I'd be fine with doing that, I'm just not aware of any other way to do this even after googling a good bit on the topic.

I'd appreciate any feedback anyone might have on this topic.

Thanks!


[1]: https://devblogs.microsoft.com/cppblog/build-c-applications-in-a-linux-docker-container-with-visual-studio/

c++office-teams-linux-itprodotnet-ad
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MinxinYu-MSFT avatar image
0 Votes"
MinxinYu-MSFT answered MinxinYu-MSFT commented

Hi,

To include a CMakeLists.txt project, you can choose File > Open > Folder to open a folder containing a CMakeLists.txt file or choose File > Open > CMake. Then, navigate to an existing CMakeCache.txt file. For more information,please refer to the article : CMake projects in Visual Studio.

For Linux-related questions, you can ask in other linux forums such as: https://www.linux.org/forums/.

Best regards,

Minxin Yu


If the response is helpful, please click "Accept Answer" and upvote it.


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @TerenceDarwen-7654,

May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·