Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

visual studio 2010 - C# Projects in CMake-Made VS2010 Solution Must Be Unloaded/Reloaded to Avoid Being Skipped

I'm using CMake to generate a VS2010 solution with both C/C++ projects: native console app, static libs and native DLL; and C# projects: managed console app and managed DLL.
I'm using CMake with the include_external_msproject + CONFIGURE_FILE technique as described e.g. here.

However, the resulting solution keeps skipping the build of the C# projects.
Following this, if I "Unload Project" and then "Reload Project" the projects now build properly.
I must do this every time I re-"Generate" the solution with CMake.

Why is this happening?
Is there a way to avoid this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Had the same problem here.

Our cmake generated solution created configurations for Win32 and x64 platforms while the external C# project had x86 and x64 platforms. After cmake generated the solution, all projects (internal and external) are set to use platform Win32. (Check the solutions Configuration Manager.)

To force cmake to include the external projects as x86, specify the PLATFORM parameter when calling include_external_msproject.

include_external_msproject(TestApp "/TestApp/TestApp.csproj" PLATFORM x86)

(And of course ensure that you just do this for the x86 version...)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...