[CMake] ADD_CUSTOM_COMMAND and unix makefile generator

William A. Hoffman billlist at nycap.rr.com
Wed Feb 8 13:29:43 EST 2006


At 12:19 PM 2/8/2006, Ian.Appru at ubs.com wrote:
>I am trying to get ADD_CUSTOM_COMMAND to execute before a build - ie
>using PRE_BUILD variable - with the unix makefile generator.
>
>This is so that I can get java to compile swig generated java files
>before the cxx generated files are compiled.
> - Its quite a large project with a long build time and errors are
>generally in the java layer. 
>
>However this doesn't seem to work - nothing is added to the makefile.
>I am using a copy of cmake from cvs - about a week old.
>
>I looked at changing the SWIG_ADD_MODULE macro, but I think the change
>is required in cxx.
>
>Are there any work-arounds? 
>Or failing that I'm not averse to putting together a code patch - so
>hints would be apreciated.
>
>Regards
>Ian 

It is not possible to do PRE_BUILD with makefiles.
We have tried there is some discussion on the list:

http://www.cmake.org/pipermail/cmake/2004-April/004983.html

It may be possible to do what you want in a different way.
If you make the cxx library depend on the java target then, it
should build the jave target first.

-Bill



More information about the CMake mailing list