[Cmake] CMakeLists.txt <-> Makefile

Brad King brad.king at kitware.com
Mon Jul 19 08:44:39 EDT 2004


Yang wrote:
> Dear CMake members,
> 
> I have a question regarding CMakeLists.txt and Makefile.
> It is obvious that I can write my own CMakeLists.txt and
> use cmake . to create the Makefile that will be used.
> 
> But if I have a Makefile and want to create(write) the 
> CMakeLists.txt that corresponding to it (i.e. can later
> use cmake . to create this Makefile). Is this possible?

This is not currently possible.  Even if someone were to implement a 
feature like this, it would have to be some kind of verbatim conversion 
of each rule into an ADD_CUSTOM_TARGET or ADD_CUSTOM_COMMAND, so I doubt 
it would be very useful.  The problem is that there are countless ways 
to organize a Makefile to build the same program, so reverse engineering 
it to recover the original organization of the source is very hard.

-Brad


More information about the Cmake mailing list