On Wed, Feb 09, 2011 at 05:24:28PM +0100, Verweij, Arjen wrote:
> Currently there is a python script that does preprocessing of all
> source, stores information in override.cmake files using
> set_source_file_properties(). This works fine, but makes maintaining
> source more error prone than it was. For instance a developer might
> use the code for an FE element, use it as the basis for a collapsed
> version and inherit specific optimizations which are now ignored.
> 
> I have looked at a way to chain this step using add_custom_command(),
> but I see no possibility to tell the generator about some variable an
> external program will fill in during the build phase.

You can't use add_custom_command() to drive this because the results of
any custom commands will only be available at build time. You need stuff
to happen at CMake configure time.

Hence, I would use execute_process() to run your python script at
configure time. It would deposit its results into a file, which you
could then include() (or file(READ ...)).

hth,
tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to