[CMake] how to add jar that depends on other built jar?

Matthew Woehlke matthew.woehlke at kitware.com
Wed Mar 13 17:09:55 EDT 2013


I have a project that builds a bunch of jar's with add_jar from 
UseJava.cmake. Let's say we have myjar1 and myjar2. How do I write the 
build rules for myjar2 such that it depends on myjar1?

It looks like add_jar is intended to accept names of jar's as source 
arguments, but this doesn't work (they are appended to 
CMAKE_JAVA_INCLUDE_PATH which is not pushed back to parent scope and is 
not used after the point where the append happens). Also, there does not 
seem to be *any* way to enforce that myjar1 is built before myjar2.

Do I miss something, or is this not supported?

-- 
Matthew



More information about the CMake mailing list