Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
splaySim: a lua implementation of a splay (simulation)scenario with a masterslave...
[simgrid.git] / buildtools / Cmake / Distrib.cmake
index 546d80d..a17eb4d 100644 (file)
@@ -82,6 +82,23 @@ foreach(file ${examples_to_install_in_doc})
           DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/examples/${location})
 endforeach(file ${examples_to_install_in_doc})
 
+# bindings cruft
+
+if(HAVE_LUA)
+       file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/lua/5.1")
+       add_custom_target(simgrid_lua ALL
+               DEPENDS simgrid 
+                               ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
+               )
+       add_custom_command(
+               OUTPUT ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
+               COMMAND ${CMAKE_COMMAND} -E create_symlink ../../libsimgrid.${LIB_EXE} ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
+       )
+       install(FILES ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/lua/5.1
+               )
+endif(HAVE_LUA)
+
 ###########################################
 ### Fill in the "make uninstall" target ###
 ###########################################
@@ -118,6 +135,14 @@ COMMAND ${CMAKE_COMMAND} -E        echo "uninstall include ok"
 WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
 )
 
+if(HAVE_LUA)
+       add_custom_command(TARGET uninstall
+       COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding lua ok"
+       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid.${LIB_EXE}
+       WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/"
+       )
+endif(HAVE_LUA)
+
 ################################################################
 ## Build a sain "make dist" target to build a source package ###
 ##   containing only the files that I explicitely state      ###