Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / java / CMakeLists.txt
1 set(semaphoregc_files  SemaphoreGC)
2 set(sleephostoff_files SleepHostOff)
3
4 foreach(example semaphoregc sleephostoff)
5   foreach (filename ${${example}_files} )
6     set(sources "${${example}_sources}" "${CMAKE_CURRENT_SOURCE_DIR}/${example}/${filename}.java")
7   endforeach()
8
9   set(tesh_files   ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)
10
11   if(enable_java)
12     add_custom_command(
13       COMMENT "Building ${example}..."
14       OUTPUT  java-${example}_compiled
15       DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR}
16       COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${sources}
17       COMMAND ${CMAKE_COMMAND} -E remove ${example}/java-${example}_compiled
18       COMMAND ${CMAKE_COMMAND} -E touch ${example}/java-${example}_compiled
19     )
20     add_custom_target(java-${example} ALL DEPENDS java-${example}_compiled)
21     set_target_properties(java-${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
22   endif()
23   set(examples_src ${examples_src} ${sources})
24 endforeach()
25
26 set(examples_src ${examples_src} ${sources}                                                    PARENT_SCOPE)
27 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
28
29 if(enable_java)
30   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)
31   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)
32 endif()