[CMake] Creating CMakeLists files from Solutions, Projects and Makefiles

Andreas Pakulat apaku at gmx.de
Tue Dec 7 17:52:10 EST 2010


On 07.12.10 13:14:19, Paul Dean wrote:
> 
> I've been using CMAKE for a few years now and I absolutley LOVE it. 
> It makes my life as a programmer so much easier to be able to generate project files on any platform.
>  
> What hurts is doing the reverse.  I can't count how many hours I've spent converting Solutions, Projects and Makefiles into CmakeLists files.  
>  
> I think if CMAKE could generate CMakeLists files from Solutions, Projects and Makefiles, it would be the ULTIMATE make system.
> Just think. Any time you run into some sorcecode that does not have a CMakeFile, you could generate it from the Makefile or Project.
>  
> I can't imagine any programmer that would not love that ability.  I think it would be something great to add to CMAKE.
> What are everyones thoughts on that?   

See my answer to John, basically I doubt this is actually possible,
except for very static project-files like may VS solutions are. For
Makefile's or other build-tools like qmake its not going to work as they
allow arbitrary commands to be executed at any point. You may be able to
convert the files on a syntactic level, but that doesn't guarantee you
they're semantically equivalent. And I bet in most cases (except very
trivial ones) the generated CMake files will look very un-cmake'ish.

Not to mention configure-scripts written in some shell-language or as
C++ app...

Also whats the point of being able to generate cmake files from "any"
project files? If I just want to build the project then I can just as
well use the existing buildsystem to build. Why bother installing cmake,
if VS is already installed and the project has a solution file?

If you want to port a project to cmake, you'll probably also end up
restructuring some things wrt. the buildsystem, so a human needs to do
the conversion anyway (and automatic conversion will be ugly, see
above).

This is similar to automatic translation of languages. Yes todays tools
that do this are good enough so that you can get the meaning of a text
for many cases. But they're still not good enough to match what a native
speaker would've written or to be able to translate any arbitrary text
(especially 'slang', scientific texts etc. are causing problems for such
tools).

Andreas

-- 
You need more time; and you probably always will.


More information about the CMake mailing list