Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
checking if a unsigned int is >0 is a bad idea
[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}/app/tokenring)
18 set(app_tokenring_sources      ${srcdir}/Main.java ${srcdir}/RelayRunner.java)
19
20 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/async/waitall)
21 set(async_waitall_sources      ${srcdir}/Main.java  ${srcdir}/Receiver.java ${srcdir}/Sender.java)
22
23 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/async/yield)
24 set(async_yield_sources      ${srcdir}/Main.java  ${srcdir}/Yielder.java)
25
26 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/async/dsend)
27 set(async_dsend_sources        ${srcdir}/Main.java  ${srcdir}/Receiver.java ${srcdir}/Sender.java)
28
29 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/masterworker)
30 set(cloud_masterworker_sources ${srcdir}/Main.java  ${srcdir}/Master.java ${srcdir}/Worker.java)
31
32 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration)
33 set(cloud_migration_sources    ${srcdir}/Main.java  ${srcdir}/Daemon.java ${srcdir}/Test.java
34                                ${srcdir}/TestHostOnOff.java ${srcdir}/XVM.java)
35
36 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord)
37 set(dht_chord_sources          ${srcdir}/Main.java  ${srcdir}/ChordTask.java  ${srcdir}/Common.java
38                                ${srcdir}/FindSuccessorAnswerTask.java  ${srcdir}/FindSuccessorTask.java
39                                ${srcdir}/GetPredecessorAnswerTask.java ${srcdir}/GetPredecessorTask.java
40                                ${srcdir}/Node.java  ${srcdir}/NotifyTask.java)
41
42 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia)
43 set(dht_kademlia_sources       ${srcdir}/Main.java  ${srcdir}/Answer.java  ${srcdir}/Bucket.java  ${srcdir}/Common.java
44                                ${srcdir}/Contact.java  ${srcdir}/FindNodeAnswerTask.java  ${srcdir}/FindNodeTask.java
45                                ${srcdir}/KademliaTask.java  ${srcdir}/Node.java  ${srcdir}/PingAnswerTask.java
46                                ${srcdir}/PingTask.java  ${srcdir}/RoutingTable.java)
47
48 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/trace/pingpong)
49 set(trace_pingpong_sources     ${srcdir}/Main.java  ${srcdir}/PingPongTask.java ${srcdir}/Receiver.java 
50                                ${srcdir}/Sender.java) 
51
52 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/consumption)
53 set(energy_consumption_sources ${srcdir}/Main.java  ${srcdir}/EnergyConsumer.java)
54
55 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/pstate)
56 set(energy_pstate_sources      ${srcdir}/Main.java  ${srcdir}/PstateRunner.java)
57
58 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/energy/vm)
59 set(energy_vm_sources          ${srcdir}/Main.java  ${srcdir}/EnergyVMRunner.java)
60
61 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/file)
62 set(io_file_sources            ${srcdir}/Main.java  ${srcdir}/Node.java)
63
64 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/io/storage)
65 set(io_storage_sources         ${srcdir}/Main.java  ${srcdir}/Client.java)
66
67 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/kill)
68 set(process_kill_sources       ${srcdir}/Main.java  ${srcdir}/Killer.java  ${srcdir}/Victim.java)
69
70 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/migration)
71 set(process_migration_sources  ${srcdir}/Main.java  ${srcdir}/Emigrant.java  ${srcdir}/Policeman.java)
72
73 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime)
74 set(process_startkilltime_sources ${srcdir}/Main.java ${srcdir}/Sleeper.java)
75
76 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/process/suspend)
77 set(process_suspend_sources    ${srcdir}/Main.java  ${srcdir}/DreamMaster.java  ${srcdir}/LazyGuy.java)
78
79 set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/task/priority)
80 set(task_priority_sources      ${srcdir}/Main.java  ${srcdir}/Test.java)
81
82 foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
83          cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
84          process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
85   string (REPLACE "_" "/" example_dir ${example})
86   if(enable_java)
87     add_custom_command(
88       COMMENT "Building java_${example}..."
89       OUTPUT ${example_dir}/java_${example}_compiled
90       DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR}
91       COMMAND ${CMAKE_COMMAND} -E make_directory ${example_dir}
92       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${${example}_sources}
93       COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java_${example}_compiled
94       COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java_${example}_compiled
95     )
96     add_custom_target(${example} ALL DEPENDS ${example_dir}/java_${example}_compiled)
97   endif()
98   set(examples_src  ${examples_src}  ${${example}_sources})
99   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
100 endforeach()
101
102 set(examples_src  ${examples_src}                                                                          PARENT_SCOPE)
103 set(tesh_files    ${tesh_files}                                                                            PARENT_SCOPE)
104 set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/generate.py                  PARENT_SCOPE)
105 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README
106                                    ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration/README                      PARENT_SCOPE)
107 set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bittorrent.xml
108                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/centralizedmutex/centralizedmutex.xml
109                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
110                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
111                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml
112                                    ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml
113                                    ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml                  PARENT_SCOPE)
114
115 if(enable_java)
116   foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
117            cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
118            process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
119     string (REPLACE "_" "/" example_dir ${example})
120     ADD_TESH(java-${example}  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/java --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/java ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
121   endforeach()
122 endif()