[CMake] Don't know how to handle this...

David Cole david.cole at kitware.com
Mon Sep 19 07:57:43 EDT 2005


You can use the CMake expression:
FILE(GLOB sources "${BABEL_OUT_DIR}/*.cc")
to collect a list of the *.cc files in the babel output directory after 
babel has run.

Then you can use ${sources} as input to the ADD_LIBRARY command.

The key question is: where does the SIDL file come from? If it's 
static/known in advance, you can make this part of your regular 
CMakeLists processing in the configure step. If it's dynamic/generated 
as part of your build, you'll need to run CMake itself as a custom 
command after the SIDL file exists and after babel has been run to 
generate all the *.cc files.

Does this make sense? Ask more questions if something's unclear...

Hope this helps,
David


Christophe Dupre wrote:

>I'm not sure how to handle a specific case, and I hope that the
>collective wisdom will provide a few pointers...
>
>We have a library for which we use CMake to control the building
>process. The last step we currently manually do, but which we'd like to
>automate, is this:
>
>We use Babel (http://www.llnl.gov/CASC/components/babel.html) to provide
>binding for several programming languages. The way babel works is as
>follows:
>- an SIDL file describes the API in a language-independant way
>- the 'babel' program is used to generate .h and .cc files based on the
>SIDL file.
>- the .cc are compiled and made into a shared library, which can be
>called by client programs.
>
>The thing here is that the actual name and number of generated .cc files
>is not known in advance (depends on the SIDL file and the version of
>babel used). All that we now for sure is that all the .cc files in a
>given directory need to be compiled and linked together. To help the
>process, babel generates a babel.make file that defines 'make' variables
>with all the files - not a big help for CMake, though.
>
>This seems to be a case of 'one program generates multiple files'
>described in the CMake book, except that here the program generates all
>the files at once with unpredictable names, so the example of VTK doing
>the TCL wrapping cannot be used as-is.
>
>Thanks in advance for any help provided.
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>  
>



More information about the CMake mailing list