X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6aba5042bde05bc44e4bdd6c8bde3ac536ef40b3..86e1845718a0de274c945daec5f823b614e83ba8:/examples/deprecated/java/CMakeLists.txt diff --git a/examples/deprecated/java/CMakeLists.txt b/examples/deprecated/java/CMakeLists.txt index 676d85d5fc..afcdd5237c 100644 --- a/examples/deprecated/java/CMakeLists.txt +++ b/examples/deprecated/java/CMakeLists.txt @@ -11,13 +11,11 @@ set(cloud-migration_files Main Daemon Test XVM) set(dht-chord_files Main ChordTask Common FindSuccessorAnswerTask FindSuccessorTask GetPredecessorAnswerTask GetPredecessorTask Node NotifyTask) set(dht-kademlia_files Main Answer Bucket Common Contact FindNodeAnswerTask FindNodeTask - KademliaTask Node PingAnswerTask PingTask RoutingTable) + KademliaTask Node RoutingTable) set(trace-pingpong_files Main PingPongTask Receiver Sender) set(energy-consumption_files Main EnergyConsumer) set(energy-pstate_files Main PstateRunner) set(energy-vm_files Main EnergyVMRunner) -set(io-file_files Main Node) -set(io-storage_files Main Client) set(process-kill_files Main Killer Victim) set(process-migration_files Main Emigrant Policeman) set(process-startkilltime_files Main Sleeper) @@ -28,10 +26,11 @@ set(hostload_files Main LoadRunner) if(enable_java) add_custom_target(java-all COMMENT "Building all Java examples...") add_dependencies(tests java-all) + add_dependencies(java-all simgrid-java) # useful when the libs are not included in the jar endif() foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend - cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload io-file io-storage + cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong) string (REPLACE "-" "/" example_dir ${example}) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}) @@ -40,17 +39,14 @@ foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpo endforeach() if(enable_java) - add_custom_command( - COMMENT "Building java-${example}..." - OUTPUT ${example_dir}/java-${example}_compiled - DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR} - 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 - ) - add_custom_target(java-${example} ALL DEPENDS ${example_dir}/java-${example}_compiled) + add_jar(java-${example} SOURCES ${${example}_sources} + INCLUDE_JARS simgrid-java_jar + OUTPUT_NAME ${example} + OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/${example_dir}) add_dependencies(java-all java-${example}) + + string (REPLACE "-" "/" example_dir ${example}) + ADD_TESH(java-${example} --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/java --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath="${TESH_CLASSPATH}:${example}.jar" --cd ${CMAKE_BINARY_DIR}/examples/deprecated/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/deprecated/java/${example_dir}/${example}.tesh) endif() set(examples_src ${examples_src} ${${example}_sources}) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh) @@ -68,12 +64,3 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bi ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml PARENT_SCOPE) - -if(enable_java) - foreach (example app-bittorrent app-centralizedmutex app-masterworker app-pingpong app-tokenring async-yield async-waitall async-dsend - cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload io-file io-storage - process-kill process-migration process-startkilltime process-suspend task-priority trace-pingpong) - string (REPLACE "-" "/" example_dir ${example}) - ADD_TESH(java-${example} --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/java --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/deprecated/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/deprecated/java/${example_dir}/${example}.tesh) - endforeach() -endif()