Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
6f5381a13abee1950fca9d0db48463ff9e2a9248
[simgrid.git] / teshsuite / java / CMakeLists.txt
1 foreach(example SemaphoreGC SleepHostOff)
2   set(sources ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.java)
3   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)
4
5   if(enable_java)
6     add_custom_command(
7       COMMENT "Building ${example}..."
8       OUTPUT  ${example}_compiled
9       DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
10       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${sources}
11       COMMAND ${CMAKE_COMMAND} -E remove ${example}/${example}_compiled
12       COMMAND ${CMAKE_COMMAND} -E touch ${example}/${example}_compiled
13     )
14     add_custom_target(${example} ALL DEPENDS ${example}_compiled)
15     set_target_properties(${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
16   endif()
17   set(examples_src ${examples_src} ${sources})
18 endforeach()
19
20 set(examples_src ${examples_src} ${sources}                                                    PARENT_SCOPE)
21 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
22
23 if(enable_java)
24   ADD_TESH(tesh-java-SemaphoreGC  --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/SemaphoreGC  ${CMAKE_HOME_DIRECTORY}/teshsuite/java/SemaphoreGC/SemaphoreGC.tesh)
25   ADD_TESH(tesh-java-SleepHostOff --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/SleepHostOff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/SleepHostOff/SleepHostOff.tesh)
26 endif()