[CMake] UseJava.cmake overwrites CMAKE_JAVA_CLASS_OUTPUT_PATH

Pol lluna.nova+tools at gmail.com
Wed Mar 20 10:28:51 EDT 2013


Hi,

I could find a way to retrieve the variables set by UseJava.cmake. Also, it
does not check if CMAKE_JAVA_CLASS_OUTPUT_PATH is already defined, so I
couldn't find a way to retrieve into which directory the .class files will
be stored.

My guess is that

set(CMAKE_JAVA_CLASS_OUTPUT_PATH
"${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")

should be replaced by

if (NOT DEFINED CMAKE_JAVA_CLASS_OUTPUT_PATH
   set(CMAKE_JAVA_CLASS_OUTPUT_PATH
"${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
endif()

Also, how can CLASS_DIR be retrieved?

get_property(class_output_dir TARGET Foo PROPERTY CLASS_DIR

doesn't seem to work.

Pol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130320/6c2334b6/attachment.htm>


More information about the CMake mailing list