X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f371a2501c4503399f53c987a2bb24d1de5dfba2..f91296008c859d2d7b57a02bf1ccfa993a8e3af3:/examples/java/bittorrent/CMakeLists.txt diff --git a/examples/java/bittorrent/CMakeLists.txt b/examples/java/bittorrent/CMakeLists.txt index c2f2803e07..ef9e1ab1b2 100644 --- a/examples/java/bittorrent/CMakeLists.txt +++ b/examples/java/bittorrent/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 2.6) +set(example java_bittorrent) set(sources ${CMAKE_CURRENT_SOURCE_DIR}/Bittorrent.java ${CMAKE_CURRENT_SOURCE_DIR}/Common.java @@ -11,11 +12,16 @@ set(sources ) if(enable_java) - add_custom_target(java_bittorrent ALL - COMMENT "Building java_bittorrent..." - COMMAND ${JAVA_COMPILE} -cp ${CMAKE_BINARY_DIR}/simgrid.jar - -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources}) - add_dependencies(java_bittorrent SG_java_jar) + add_custom_command( + COMMENT "Building ${example}..." + OUTPUT ${example}_compiled + DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} + COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} + -d ${CMAKE_CURRENT_BINARY_DIR}/.. ${sources} + COMMAND ${CMAKE_COMMAND} -E remove ${example}_compiled + COMMAND ${CMAKE_COMMAND} -E touch ${example}_compiled + ) + add_custom_target(${example} ALL DEPENDS ${example}_compiled) endif() set(tesh_files