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

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


On 07.12.10 14:31:56, John Drescher wrote:
> On Tue, Dec 7, 2010 at 2:14 PM, Paul Dean <aquawicket at hotmail.com> 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?
> >
> 
> I would love to see a working QMake to CMake converter. And I mean one
> that works for complicated QMake projects not just a simple executable
> with a few headers and a few source files.

If I recollect my lessons in computer-theory correctly from university,
then this is not possible for the "general case". The problem is that
QMake's language is very close to a general-purpose programming
language, in particular it supports loops and conditions. This (again
IIRC) makes it impossible for a program to decide wether two qmake
projects or a qmake and a cmake project are semantically equal. It might
be possible to do a "bit-by-bit" conversion of qmake project files to
cmake, but I doubt the resulting cmake project is very useful except for
pure building. Maintaining those cmake-files is not going to be easy or
fun, nor would they match what a cmake developer would write if he set
up stuff "from scratch" for cmake to build the project. And without the
goal of switching from qmake to cmake, I don't see any point in doing a
conversion in the first place - after all qmake can build the project on
all interesting platforms already (else it would've been replaced).

And that doesn't even consider a configure-script which I think most
larger qmake projects have (like Qt itself).

Andreas

-- 
You are as I am with You.


More information about the CMake mailing list