[CMake] makefile to CMakeLists.txt, possible?

Chiheng Xu chiheng.xu at gmail.com
Fri Sep 3 04:35:58 EDT 2010


On Fri, Sep 3, 2010 at 12:47 AM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
>
> Generated makefiles can't be portable e.g. because they contain include paths
> and paths to libraries which will be linked which can differ on each system.
> Also, the generated makefiles contain calls to cmake e.g. for the progress
> report.
> Also, it is quite common to use cmake -E for cross platform commands e.g. in
> add_custom_command() or add_custom_target(), which results in rules in the
> makefiles which call cmake to do something,  e.-g. copy a file or something.
>
>> It is true that while developing software, using CMake requires an
>> extra step.  For example, when you add a C++ source file, you'll need
>> to run cmake and then make.
>
> If cmake has already generated makefiles for you, you don't need to invoke it
> manually again after editing CMakeLists.txt, the generated makefiles include
> this dependency and rerun cmake automatically for you.
>
>
> Nevertheless, some way to make something in cmake parallel would be nice :-)
> But at least for me it's not obvious how to do that.
>


Why CMake can't run as make ?

CMake parse CMakeLists.txt, generate Makefile.  Then, make parse the
Makefile,  and execute(serially or parallelly) shells,  shells run
comands(compiler, etc) to build.

Perhaps, CMake can parse CMakeLists.txt, and directly run
comands(compiler, etc) to build,  without gererating Makefile,
invoking make, invoking shells.




-- 
Chiheng Xu
Wuhan,China


More information about the CMake mailing list