페이지

2010년 11월 25일 목요일

converting vcproj to CMakeLists.txt

In official CMake wiki, there was several ruby script converters.
 
But the functionality I want is absent:
- Not supporting project configuration; converting 'debug|win32' configuration or 'release|win32' ?
- Not supporting exclude from build for each File configuration.
 
Since I have 150+ projects to convert , I write my own script using Powershell. It worked well for me. You don't need to install Powershell if you are using Windows7. it's already installed!
 
Note that this script supports only VS2005 project file only.
How to use:
  • Save powershell script in some directory(let's say c:tools)
  • Change your current directory to c:tools
  • Invoke following command.
  • CMakeLists.txt will be created in directory where vcproj located.

powershell .vcproj2cmake.ps1 c:xxx.vcproj -conf  'Debug'