X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a89d5cc048eff839141ea5178e9156f1e135a03d..be3bfb2b50bfd21ad12b5f6e4094dedf83f9da62:/teshsuite/java/CMakeLists.txt diff --git a/teshsuite/java/CMakeLists.txt b/teshsuite/java/CMakeLists.txt index 50284bc907..47722850a7 100644 --- a/teshsuite/java/CMakeLists.txt +++ b/teshsuite/java/CMakeLists.txt @@ -1,12 +1,26 @@ -cmake_minimum_required(VERSION 2.6) +foreach(example SemaphoreGC SleepHostOff) + set(sources ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.java) + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh) -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") + if(enable_java) + add_custom_command( + COMMENT "Building ${example}..." + OUTPUT ${example}_compiled + DEPENDS ${sources} simgrid-java_jar ${SIMGRID_JAR} + COMMAND ${JAVA_COMPILE} -classpath ${SIMGRID_JAR} -d ${CMAKE_CURRENT_BINARY_DIR} ${sources} + COMMAND ${CMAKE_COMMAND} -E remove ${example}/${example}_compiled + COMMAND ${CMAKE_COMMAND} -E touch ${example}/${example}_compiled + ) + add_custom_target(${example} ALL DEPENDS ${example}_compiled) + set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example}) + endif() + set(examples_src ${examples_src} ${sources}) +endforeach() -set(xml_files - ${xml_files} - PARENT_SCOPE - ) -set(txt_files - ${txt_files} - PARENT_SCOPE - ) +set(examples_src ${examples_src} ${sources} PARENT_SCOPE) +set(tesh_files ${tesh_files} PARENT_SCOPE) + +if(enable_java) + ADD_TESH(tesh-java-SemaphoreGC --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/SemaphoreGC ${CMAKE_HOME_DIRECTORY}/teshsuite/java/SemaphoreGC/SemaphoreGC.tesh) + ADD_TESH(tesh-java-SleepHostOff --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/SleepHostOff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/SleepHostOff/SleepHostOff.tesh) +endif()