### Make Libs
+# On Mac OSX, specify that rpath is useful to look for the dependencies
+# See https://cmake.org/Wiki/CMake_RPATH_handling and Java.cmake
+set(MACOSX_RPATH ON)
+if(APPLE)
+ # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib
+ # (useful when unpacking the native libraries from the jarfile)
+ set(CMAKE_INSTALL_RPATH "@loader_path/.")
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+endif()
+
###############################
# Declare the library content #
###############################
# Compute the dependencies of SMPI
##################################
+
+if(enable_smpi)
+ set(SIMGRID_DEP "${SIMGRID_DEP} ${DL_LIBRARY}") # for privatization
+ add_executable(smpimain src/smpi/smpi_main.c)
+ target_link_libraries(smpimain simgrid)
+ set_target_properties(smpimain
+ PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+endif()
+
if(enable_smpi AND APPLE)
set(SIMGRID_DEP "${SIMGRID_DEP} -Wl,-U -Wl,_smpi_simulated_main")
endif()