Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
third try should be the right one
[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
17     ADD_TESH(tesh-java-${example} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/java --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java ${CMAKE_HOME_DIRECTORY}/teshsuite/java/${example}/${example}.tesh)
18   endif()
19   set(examples_src ${examples_src} ${sources})
20 endforeach()
21
22 set(examples_src ${examples_src} ${sources}                                                    PARENT_SCOPE)
23 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
24 set(xml_files    ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/SleepHostOff/sleep_host_off_d.xml PARENT_SCOPE)