4

I would like to generate visual studio project files on linux using cmake.

Unfortunately, the visual studio project file generator is not enabled by default on linux.

The cmake build instructions don't mention how to enable this feature on linux. It seems like the generators are enabled based on the host platform cmake is being build. Has anybody a patched cmake to enable the Visual Studio Project Generator on linux ?

We have tools that work on linux and windows for analyzing projects by parsing .sln/.vcxproj files. However generating .sln/.vcxproj files on windows is quite inconvenient as our main development is done on linux/osx.

10
  • Even if you were successful CMake generated projects are not that useful outside the machine that built them. They still require CMake and the paths that CMake added to the project would be wrong / nonsense. Commented Sep 1, 2017 at 15:50
  • 1
    I would concentrate on automating the Visual Studio build process on your windows test box. This should be easy to make it with little to no user intervention. I assume you have your source code in git or svn. Commented Sep 1, 2017 at 15:52
  • The paths are useful to us regardless of the machine they are generated as our main focus is dependency analysis. We have a preprocessing step that fixes up the paths. Commented Sep 1, 2017 at 16:17
  • CMake source code is available. You can build it using CMake to generate a Makefile. I am not sure how easy it is to get it to build Visual Studio support for a linux build. I have not built CMake in a few years. Commented Sep 1, 2017 at 16:19
  • CMakes sourcecode has a bunch of #ifndef(_WIN32), looks like there is nothing inherent that would make building the vs generator on linux not possible. Someone just needs to remove the ifndefs ... Commented Sep 1, 2017 at 16:33

1 Answer 1

3

You cannot generate Visual Studio Solutions under Linux. Nowadays you can generate Visual Studio solutions via ssh to a Windows docker container.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.