Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tracing -> trace/pingpong
[simgrid.git] / examples / java / CMakeLists.txt
1 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent)
2 set(app_bittorrent_sources    ${srcdir}/Main.java  ${srcdir}/Common.java  ${srcdir}/Connection.java
3                               ${srcdir}/MessageTask.java ${srcdir}/Peer.java  ${srcdir}/Tracker.java
4                               ${srcdir}/TrackerTask.java)
5
6 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/app/centralizedmutex)
7 set(app_centralizedmutex_sources  ${srcdir}/Main.java  ${srcdir}/Coordinator.java  ${srcdir}/GrantTask.java
8                               ${srcdir}/Node.java ${srcdir}/ReleaseTask.java  ${srcdir}/RequestTask.java)
9
10 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker)
11 set(app_masterworker_sources   ${srcdir}/Main.java  ${srcdir}/Master.java ${srcdir}/Worker.java) 
12
13 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/app/pingpong)
14 set(app_pingpong_sources       ${srcdir}/Main.java  ${srcdir}/PingPongTask.java ${srcdir}/Receiver.java 
15                                ${srcdir}/Sender.java) 
16
17 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/masterworker)
18 set(cloud_masterworker_sources ${srcdir}/Main.java  ${srcdir}/Master.java ${srcdir}/Worker.java)
19
20 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration)
21 set(cloud_migration_sources    ${srcdir}/Main.java  ${srcdir}/Daemon.java ${srcdir}/Test.java
22                                ${srcdir}/TestHostOnOff.java ${srcdir}/XVM.java)
23
24 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord)
25 set(dht_chord_sources          ${srcdir}/Main.java  ${srcdir}/ChordTask.java  ${srcdir}/Common.java
26                                ${srcdir}/FindSuccessorAnswerTask.java  ${srcdir}/FindSuccessorTask.java
27                                ${srcdir}/GetPredecessorAnswerTask.java ${srcdir}/GetPredecessorTask.java
28                                ${srcdir}/Node.java  ${srcdir}/NotifyTask.java)
29
30 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia)
31 set(dht_kademlia_sources       ${srcdir}/Main.java  ${srcdir}/Answer.java  ${srcdir}/Bucket.java  ${srcdir}/Common.java
32                                ${srcdir}/Contact.java  ${srcdir}/FindNodeAnswerTask.java  ${srcdir}/FindNodeTask.java
33                                ${srcdir}/KademliaTask.java  ${srcdir}/Node.java  ${srcdir}/PingAnswerTask.java
34                                ${srcdir}/PingTask.java  ${srcdir}/RoutingTable.java)
35
36 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/trace/pingpong)
37 set(trace_pingpong_sources     ${srcdir}/Main.java  ${srcdir}/PingPongTask.java ${srcdir}/Receiver.java 
38                                ${srcdir}/Sender.java) 
39
40 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/consumption)
41 set(energy_consumption_sources ${srcdir}/Main.java  ${srcdir}/EnergyConsumer.java)
42
43 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/vm)
44 set(energy_vm_sources          ${srcdir}/Main.java  ${srcdir}/EnergyVMRunner.java)
45
46 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/file)
47 set(io_file_sources            ${srcdir}/Main.java  ${srcdir}/Node.java)
48
49 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/storage)
50 set(io_storage_sources         ${srcdir}/Main.java  ${srcdir}/Client.java)
51
52 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/kill)
53 set(process_kill_sources       ${srcdir}/Main.java  ${srcdir}/Killer.java  ${srcdir}/Victim.java)
54
55 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/migration)
56 set(process_migration_sources  ${srcdir}/Main.java  ${srcdir}/Emigrant.java  ${srcdir}/Policeman.java)
57
58 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime)
59 set(process_startkilltime_sources ${srcdir}/Main.java ${srcdir}/Sleeper.java)
60
61 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend)
62 set(process_suspend_sources    ${srcdir}/Main.java  ${srcdir}/DreamMaster.java  ${srcdir}/LazyGuy.java)
63
64 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/task/priority)
65 set(task_priority_sources      ${srcdir}/Main.java  ${srcdir}/Test.java)
66
67 foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong cloud_migration cloud_masterworker 
68          dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
69          process_startkilltime process_suspend task_priority trace_pingpong)
70   string (REPLACE "_" "/" example_dir ${example})
71   if(enable_java)
72     add_custom_command(
73       COMMENT "Building java_${example}..."
74       OUTPUT ${example_dir}/java_${example}_compiled
75       DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR}
76       COMMAND ${CMAKE_COMMAND} -E make_directory ${example_dir}
77       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${${example}_sources}
78       COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java_${example}_compiled
79       COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java_${example}_compiled
80     )
81     add_custom_target(${example} ALL DEPENDS ${example_dir}/java_${example}_compiled)
82   endif()
83   set(examples_src  ${examples_src}  ${${example}_sources})
84   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
85 endforeach()
86
87 set(examples_src  ${examples_src}                                                          PARENT_SCOPE)
88 set(tesh_files    ${tesh_files}                                                            PARENT_SCOPE)
89 set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/generate.py  PARENT_SCOPE)
90 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README
91                                    ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration/README                      PARENT_SCOPE)
92 set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bittorrent.xml
93                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/centralizedmutex/centralizedmutex.xml
94                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
95                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
96                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml
97                                    ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml
98                                    ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml                  PARENT_SCOPE)
99
100 if(enable_java)
101   foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong cloud_migration cloud_masterworker 
102            dht_chord dht_kademlia energy_consumption energy_vm io_file io_storage process_kill process_migration
103            process_startkilltime process_suspend task_priority trace_pingpong)
104     string (REPLACE "_" "/" example_dir ${example})
105     ADD_TESH(java-${example}  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
106   endforeach()
107 endif()