Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
compile Java in the binary tree, not the source one
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 30 Mar 2016 23:05:39 +0000 (01:05 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 30 Mar 2016 23:05:43 +0000 (01:05 +0200)
This should fix out of tree builds of the java examples

examples/java/CMakeLists.txt

index 7427c11..d8ed9bf 100644 (file)
@@ -50,7 +50,8 @@ foreach (example app_bittorrent app_masterworker dht_chord dht_kademlia energy_c
       COMMENT "Building java_${example}..."
       OUTPUT ${example_dir}/java_${example}_compiled
       DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR}
-      COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_SOURCE_DIR} ${${example}_sources}
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${example_dir}
+      COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${${example}_sources}
       COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java_${example}_compiled
       COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java_${example}_compiled
     )