[ale] [OT] Any Eclipse and C users on the list

Ryan Curtin ryan at igglybob.com
Wed Jan 23 22:22:34 EST 2013


On Tue, Jan 22, 2013 at 05:37:28PM -0500, Michael Potter wrote:
> You are correct.
> My ./configure is a hand written bash script.  It generates three things:
> 1) A config.h that has #defines in it that define the operating system
> specific and user preferences.
> 
> 2) A config.sh that has variable defined.  I use ". config.sh" in the
> bash scripts that are part of the package.
> 
> 3) A ton of make files that are included in the hand coded makefiles.
> 
> The makefile generator scans the .c files for "#include" then adds the
> included file to the list of dependencies.
> 
> It is a home grown system that works well, but it is not mainstream.
> I want to move to a mainstream scheme.

So, CMake should support what you are trying to do.  Or, at least, it
will support (1) and (3), though I would recommend having the hand-coded
makefiles generated automatically.  Keeping a build system simple and
mainstream is good for long-term maintainability.

(1) can be done with #cmakedefine and similar commands [1].  (2) should
probably be adapted to use option() and then the user, when calling
CMake, specifies which options they do and do not want enabled.  I can't
provide advice for (3) because I am not entirely sure what the Makefiles
are doing.  If they are just building source files, then it would be
better to let CMake autogenerate those files.

In addition, CMake does not only output Makefiles but will generate
projects for Eclipse too [2].  Which is what you are looking for. :)

I hope this is helpful information to at least survey what is out there.
Let me know if I can help further.

[1] http://www.cmake.org/Wiki/CMake:How_To_Write_Platform_Checks (an example)
[2] http://www.cmake.org/Wiki/CMake_Generator_Specific_Information

-- 
Ryan Curtin       | "Don't fight it son. Confess quickly! If you hold out too
ryan at igglybob.com | long you could jeopardize your credit rating."  - Guard


More information about the Ale mailing list