celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Zelzer <s.zel...@dkfz-heidelberg.de>
Subject Re: Project structure
Date Mon, 04 Jun 2012 10:40:51 GMT
Hi,

It would be great if Celix would support a more configurable build system!

I have a couple of years of experience with CMake and I would simply 
have thought that the following would do:

- Create a build option for each "sub-project" (bundle, example, etc) 
using the "option(...)" command (e.g. BUILD_{Project} )
- From the top-level CMakeLists.txt file, call "add_subdirectory" for 
the sub-projects in correct dependency order
- Each CMakeLists.txt file for sub-projects configures a 
{Project}Config.cmake file and sets a cache variable {Project}_DIR to 
the directory containing the {Project}Config.cmake file
- A sub-project depending on other projects could either check the 
BUILD_{dependent_project} variables and set them to on, or do a 
find_package({dependent_project}) which will fail if it cannot find 
{dependent_project}Config.cmake or succeed because of the previously set 
{dependent_project}_DIR variable

This makes each sub-project essential self-contained and requires no 
additional cmake calls. The library dependencies are automatically 
handled by the generated project files. This works very nicely if all 
dependencies are contained in the same soure tree, but works also by 
setting {Project}_DIR to the correct (external) value.

Or did I miss something which wouldn't allow this kind of structure for 
Celix?

Best,
Sascha

On 06/04/2012 12:17 PM, Alexander Broekhuis wrote:
> Hi all,
>
> Currently Celix uses a rather fixed project structure for the core
> (framework) and other bundles. To be able to build anything, all
> dependencies for everything need to be available. This now results in a
> long list including GTK etc. This doesn't make much sense when only the
> framework needs to be build.
>
> To this end I've been working on some ideas for a more separated
> project/build structure, and I'd like to propose it here:
>
> Each subproject will be a separate CMake project, if a project can be a
> dependency to another project it has to provide/generate a {Project}Config
> file like discussed on [1].
> Projects having dependencies will use find_package({Project})
>
> This solution requires that project at least have run the cmake configure.
> To be able to automate this two possible solutions come to mind:
> The first one is a cmake command which takes care of
> downloading/building/installing projects [2]
> The second one is more simpler and calls the cmake executable on the
> dependent project. In this case the {Project}Config takes care of building
> the project.
>
> At this moment the second solution makes more sense for Celix, the trunk
> contains all projects, and everything is downloaded at once.
> I have created a simple example for this, if anyone is interested in it I
> can upload it somewhere.
>
> Anyone have any other ideas/suggestions regarding this problem?
>
> [1]:
> http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
> [2]:
> http://www.kitware.com/products/html/BuildingExternalProjectsWithCMake2.8.html


Mime
View raw message