[CMake] Technique for generating projects that depend on generated sources

Steve Huston shuston at riverace.com
Thu Feb 26 19:55:47 EST 2009


I'm working on a project that involves generating a large chunk of the
sources from separate definitions. The set of generated source files
is not known before it is generated.

The approach I've tried so far (and I'm very new to cmake) is to
define a custom_command that does the source generation, then run
cmake over again to regenerate the project files.

I tried this out with Microsoft Visual Studio... When I tried a build
from inside Visual Studio the command to generate the sources happened
like I want, but when it tried to re-run cmake to regenerate the
project with the now-known set of generated sources, an error was
thrown because cmake couldn't update VS macros while VS is running.

So close, yet so far... ;-)

Is there a common pattern for how to address this type of situation?

Thanks,
-Steve

--
Steve Huston, Riverace Corporation
Check out my networked programming blog at
http://stevehuston.wordpress.com/



More information about the CMake mailing list