-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- add_definitions("-D_XOPEN_SOURCE")
-endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ if(enable_smpi)
+ add_dependencies(smpi ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
+ if(enable_lib_static)
+ add_dependencies(smpi_static ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
+ endif(enable_lib_static)
+ endif(enable_smpi)
+endif(enable_supernovae)
+
+# Compute the dependencies of GRAS
+##################################
+set(GRAS_DEP "-lm -lpthread")
+
+if(HAVE_POSIX_GETTIME)
+ SET(GRAS_DEP "${GRAS_DEP} -lrt")
+endif(HAVE_POSIX_GETTIME)
+
+# the following is probably unneed since it kills the previous
+# GRAS_DEP (and is thus probably invalid).
+# My guess is that pthread is never true [Mt]
+# FIXME: KILLME if we get a working windows with that?
+if(pthread AND (with_context MATCHES windows))
+ SET(GRAS_DEP "msg")
+endif(pthread AND (with_context MATCHES windows))
+
+target_link_libraries(gras ${GRAS_DEP})
+
+# Compute the dependencies of SimGrid
+#####################################
+set(SIMGRID_DEP "-lm")
+if(HAVE_PCRE_LIB)
+ SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre")
+endif(HAVE_PCRE_LIB)