X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a92d7b716f51a53dea7f59db8524d4add713b910..b1f5b9489d84e72cc1c4a0b51fe3940526de890c:/teshsuite/java/CMakeLists.txt diff --git a/teshsuite/java/CMakeLists.txt b/teshsuite/java/CMakeLists.txt index 2d9d5dfb7b..76c248efc9 100644 --- a/teshsuite/java/CMakeLists.txt +++ b/teshsuite/java/CMakeLists.txt @@ -1,7 +1,7 @@ -set(semaphoreGC_files SemaphoreGC) -set(sleepHostOff_files SleepHostOff) +set(semaphoregc_files SemaphoreGC) +set(sleephostoff_files SleepHostOff) -foreach(example semaphoreGC sleepHostOff) +foreach(example semaphoregc sleephostoff) foreach (filename ${${example}_files} ) set(sources "${${example}_sources}" "${CMAKE_CURRENT_SOURCE_DIR}/${example}/${filename}.java") endforeach() @@ -11,14 +11,15 @@ foreach(example semaphoreGC sleepHostOff) if(enable_java) add_custom_command( COMMENT "Building ${example}..." - OUTPUT ${example}_compiled + OUTPUT java-${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 + COMMAND ${CMAKE_COMMAND} -E remove ${example}/java-${example}_compiled + COMMAND ${CMAKE_COMMAND} -E touch ${example}/java-${example}_compiled ) - add_custom_target(${example} ALL DEPENDS ${example}_compiled) - set_target_properties(${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example}) + add_custom_target(java-${example} ALL DEPENDS java-${example}_compiled) + add_dependencies(java-all java-${example}) + set_target_properties(java-${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example}) endif() set(examples_src ${examples_src} ${sources}) endforeach() @@ -27,6 +28,6 @@ set(examples_src ${examples_src} ${sources} set(tesh_files ${tesh_files} PARENT_SCOPE) if(enable_java) - 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) - 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) + ADD_TESH(tesh-java-semaphoregc --setenv javacmd=${Java_JAVA_EXECUTABLE} --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) + ADD_TESH(tesh-java-sleephostoff --setenv javacmd=${Java_JAVA_EXECUTABLE} --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) endif()