Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove one layer of calls
[simgrid.git] / examples / java / CMakeLists.txt
1 set(app_bittorrent_files        Main  Common  Connection MessageTask Peer  Tracker TrackerTask)
2 set(app_centralizedmutex_files  Main  Coordinator  GrantTask Node ReleaseTask  RequestTask)
3 set(app_masterworker_files      Main  Master Worker) 
4 set(app_pingpong_files          Main  PingPongTask Receiver Sender) 
5 set(app_tokenring_files         Main RelayRunner)
6 set(async_waitall_files         Main  Receiver Sender)
7 set(async_yield_files           Main  Yielder)
8 set(async_dsend_files           Main  Receiver Sender)
9 set(cloud_masterworker_files    Main  Master Worker)
10 set(cloud_migration_files       Main  Daemon Test TestHostOnOff XVM)
11 set(dht_chord_files             Main  ChordTask  Common FindSuccessorAnswerTask  FindSuccessorTask
12                                       GetPredecessorAnswerTask GetPredecessorTask Node  NotifyTask)
13 set(dht_kademlia_files          Main  Answer  Bucket  Common Contact FindNodeAnswerTask  FindNodeTask
14                                       KademliaTask  Node  PingAnswerTask PingTask  RoutingTable)
15 set(trace_pingpong_files        Main  PingPongTask Receiver Sender) 
16 set(energy_consumption_files    Main  EnergyConsumer)
17 set(energy_pstate_files         Main  PstateRunner)
18 set(energy_vm_files             Main  EnergyVMRunner)
19 set(io_file_files               Main  Node)
20 set(io_storage_files            Main  Client)
21 set(process_kill_files          Main  Killer  Victim)
22 set(process_migration_files     Main  Emigrant  Policeman)
23 set(process_startkilltime_files Main Sleeper)
24 set(process_suspend_files       Main  DreamMaster  LazyGuy)
25 set(task_priority_files         Main  Test)
26
27
28 foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
29          cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
30          process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
31   string (REPLACE "_" "/" example_dir ${example})
32   set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir})
33   foreach (filename ${${example}_files} )
34     set( ${example}_sources "${${example}_sources}" "${srcdir}/${filename}.java")
35   endforeach()
36
37   if(enable_java)
38     add_custom_command(
39       COMMENT "Building java_${example}..."
40       OUTPUT ${example_dir}/java_${example}_compiled
41       DEPENDS ${example_sources} simgrid-java_jar ${SIMGRID_JAR}
42       COMMAND ${CMAKE_COMMAND} -E make_directory ${example_dir}
43       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${${example}_sources}
44       COMMAND ${CMAKE_COMMAND} -E remove ${example_dir}/java_${example}_compiled
45       COMMAND ${CMAKE_COMMAND} -E touch ${example_dir}/java_${example}_compiled
46     )
47     add_custom_target(${example} ALL DEPENDS ${example_dir}/java_${example}_compiled)
48   endif()
49   set(examples_src  ${examples_src}  ${${example}_sources})
50   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${example_dir}/${example}.tesh)
51 endforeach()
52
53 set(examples_src  ${examples_src}                                                                          PARENT_SCOPE)
54 set(tesh_files    ${tesh_files}                                                                            PARENT_SCOPE)
55 set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/generate.py                  PARENT_SCOPE)
56 set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/README
57                                    ${CMAKE_CURRENT_SOURCE_DIR}/cloud/migration/README                      PARENT_SCOPE)
58 set(xml_files     ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/app/bittorrent/bittorrent.xml
59                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/centralizedmutex/centralizedmutex.xml
60                                    ${CMAKE_CURRENT_SOURCE_DIR}/app/masterworker/masterworker.xml
61                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/chord/chord.xml
62                                    ${CMAKE_CURRENT_SOURCE_DIR}/dht/kademlia/kademlia.xml
63                                    ${CMAKE_CURRENT_SOURCE_DIR}/process/startkilltime/startkilltime.xml
64                                    ${CMAKE_CURRENT_SOURCE_DIR}/task/priority/priority.xml                  PARENT_SCOPE)
65
66 if(enable_java)
67   foreach (example app_bittorrent app_centralizedmutex app_masterworker app_pingpong app_tokenring async_yield async_waitall async_dsend
68            cloud_migration cloud_masterworker dht_chord dht_kademlia energy_consumption energy_pstate energy_vm io_file io_storage 
69            process_kill process_migration process_startkilltime process_suspend task_priority trace_pingpong)
70     string (REPLACE "_" "/" example_dir ${example})
71     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/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/java/${example_dir}/${example}.tesh)
72   endforeach()
73 endif()