Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Re: [CMake] Generating makefile from Visual Studio Project (Migrating to Eclipse)

Olumide wrote:
Jesper Eskilson wrote:
Also would you please tell me how I can output a makefile (is that what I need?) with which I can migrate my visual studio project to eclipse? I've run "cmake CMakeLists.txt" (CMakeLists.txt is the output of your script) but I cannot find a makefile in any of the files or directories generated as a result :( .

Try

$ cmake [path-to-src-dir]

i.e., the argument to cmake is the directory containing the CMakeLists.txt, not the file itself.

Thanks. (BTW, the result is pretty much the same as running CMake CMakeLists.txt). As before, my directory contains several files such as, TestTexturePlugin.vcproj.cmake, ALL_BUILD.vcproj.cmake. I'm not sure what I ought to do with these files. I was expecting to find traditional/UNIX style makefiles.

When experimenting like this, use a build directory different from your source tree, like this:

$ cd c:/build
$ cmake c:/my-source-tree -G "NMake Makefiles"

That way CMake won't touch your source tree, and you can easily wipe c:/build if you want to start over.

CMake defaults to generating studio project files on Windows, not makefiles. In order to generate makefiles, do

cmake . -G "NMake Makefiles"

Make sure that you have your Studio environment setup properly. Use the Visual Studio command prompt if you're unsure.

If you try to use MinGW Makefiles you must explicitly tell CMake to use "cl" instead of "gcc". I think setting the CC and CXX environment variables will do the trick.

--
/Jesper




Back to the top