Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more than 100 codacy treats, not bad
[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  ${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}/${example}_compiled
18       COMMAND ${CMAKE_COMMAND} -E touch ${example}/${example}_compiled
19     )
20     add_custom_target(${example} ALL DEPENDS ${example}_compiled)
21     set_target_properties(${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()