[CMake] java -classpath

Richard Fuchs fuchsrich at se-core.net
Fri Aug 4 13:54:16 EDT 2006


I'm running into an issue with these two .jar files that I'm creating.

I've got files in src/foo/*.java and src/bar/*.java.  The files in /bar 
depend on the files in /foo

CMakeLists.txt in foo
INCLUDE_DIRECTORIES(foo/CMakeFiles/foo.dir) -- Have to do this because 
.class files are not put in current dir
ADD_LIBRARY(foo ${FOO_SRCS})

CMakeLists.txt in bar
INCLUDE_DIRECTORIES(foo/CMakeFiles/foo.dir bar/CMakeFiles/bar.dir) -- 
Have to do this to get .class files from bar and to get to foo.jar
ADD_LIBRARY(bar ${BAR_SRCS})
ADD_DEPENDENCIES(bar foo)

After hacking the build.make files in foo/CMakeFiles/foo.dir and 
bar/CMakeFiles/bar.dir to include the absolute path for the -d 
directory, foo compiles fine, and bar begins to compile until it reaches 
a point where it needs stuff defined in foo.jar and then it dies.  Turns 
out that the flag.make file that is created for bar only includes 
bar/CMakeFiles.dir and not foo/CMakeFiles/foo.dir. 

Anyone know how to keep INCLUDE_DIRECTORIES from helping me by removing 
duplicate dirs?

Thanks
Richard


More information about the CMake mailing list