Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update ignore list after file move.
[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     add_dependencies(java-all java-${example})
22     set_target_properties(java-${example}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
23   endif()
24   set(examples_src ${examples_src} ${sources})
25 endforeach()
26
27 set(examples_src ${examples_src}                                                               PARENT_SCOPE)
28 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
29
30 if(enable_java)
31   ADD_TESH(tesh-java-semaphoregc  --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/semaphoregc  ${CMAKE_HOME_DIRECTORY}/teshsuite/java/semaphoregc/semaphoregc.tesh)
32   ADD_TESH(tesh-java-sleephostoff --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/sleephostoff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/sleephostoff/sleephostoff.tesh)
33 endif()