[CMake] Generating makefile from Visual Studio Project (Migrating to Eclipse)

Jesper Eskilson jesper at eskilson.se
Tue Dec 4 04:05:23 EST 2007


Olumide wrote:
> Hello -
> 
> I'm a CMake newbie and I'd appreciate help creating a makefile *from* a
> Visual Studio .NET 2003 project/solution. I'm trying like to migrate my
> projects to eclipse and I hope CMake will help make that transition.
> 
> Many thanks,
> 
> - Olumide
> 
> 
> PS: I've already tried creating the config file CMakeLists.txt using
> vcproj2cmake.rb ( http://www.eskilson.se/vcproj2cmake.rb ). Below is the
> config file generated from a small project -- commenting out the
> offending add_locate directives(?). I'm not sure how of what I ought to
> do next in order to generate a standard (UNIX) makefile.

I've uploaded a new version of the vcproj2cmake.rb script which does not
emit any add_locale() macros.

> #################################################################
> 
> project( TestTexturePlugin )
> 
> set(SOURCES
>   pluginMain.cpp
> )
> 
> include_directories(
>   C:/Program Files/Alias/Maya6.5/include
> )

You need double quotes around the path, since it contains spaces.

> add_definitions(
>   -DWIN32,_DEBUG,_WINDOWS,_AFXDLL,_MBCS,NT_PLUGIN,REQUIRE_IOSTREAM
> )

No commas between the symbols.

> add_library( TestTexturePlugin SHARED ${SOURCES} )
> 
> #add_locale( TestTexturePlugin ENU <RESFILE> )
> #add_locale( TestTexturePlugin JPN <RESFILE> )
> 
> target_link_libraries( TestTexturePlugin Foundation OpenMaya )
> 
> #################################################################

You should be able to run CMake directly on this file. If you're on
Unix, try

$ cd [your project dir]
$ cmake .

--
/Jesper


More information about the CMake mailing list