-foreach(example SemaphoreGC SleepHostOff)
- set(sources ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.java)
- set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.tesh PARENT_SCOPE)
+set(semaphoregc_files SemaphoreGC)
+set(sleephostoff_files SleepHostOff)
+
+foreach(example semaphoregc sleephostoff)
+ foreach (filename ${${example}_files} )
+ set(sources "${${example}_sources}" "${CMAKE_CURRENT_SOURCE_DIR}/${example}/${filename}.java")
+ endforeach()
+
+ set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)