Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a gforge sync for simgrid.dtd
[simgrid.git] / buildtools / Cmake / Distrib.cmake
old mode 100755 (executable)
new mode 100644 (file)
index 06d37d6..e1968f9
-set(CMAKE_INSTALL_PREFIX "${prefix}" CACHE TYPE INTERNAL FORCE)
-
 #########################################
 ### Fill in the "make install" target ###
 #########################################
          
 # doc
-if(NOT EXISTS ${PROJECT_DIRECTORY}/doc/html/)
-       file(MAKE_DIRECTORY ${PROJECT_DIRECTORY}/doc/html/)
-endif(NOT EXISTS ${PROJECT_DIRECTORY}/doc/html/)
-       install(DIRECTORY "${PROJECT_DIRECTORY}/doc/html/"
-         DESTINATION "$ENV{DESTDIR}${prefix}/doc/simgrid/html/"
-         PATTERN ".svn" EXCLUDE 
-         PATTERN ".git" EXCLUDE 
-         PATTERN "*.o" EXCLUDE
-         PATTERN "*~" EXCLUDE
-       )
+if(NOT EXISTS ${CMAKE_HOME_DIRECTORY}/doc/html/)
+       file(MAKE_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/html/)
+endif(NOT EXISTS ${CMAKE_HOME_DIRECTORY}/doc/html/)
+install(DIRECTORY "${CMAKE_HOME_DIRECTORY}/doc/html/"
+  DESTINATION "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/html/"
+  PATTERN ".svn" EXCLUDE 
+  PATTERN ".git" EXCLUDE 
+  PATTERN "*.o" EXCLUDE
+  PATTERN "*~" EXCLUDE
+)
+
 # binaries
 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
+                 ${CMAKE_BINARY_DIR}/bin/smpif2c
+                 ${CMAKE_BINARY_DIR}/bin/smpiff
                  ${CMAKE_BINARY_DIR}/bin/smpirun
-                 ${CMAKE_BINARY_DIR}/bin/tesh
-               DESTINATION $ENV{DESTDIR}${prefix}/bin/)
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
+
+install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/tesh
+DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
+
+install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/graphicator
+DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
        
-install(PROGRAMS tools/MSG_visualization/colorize.pl
-        DESTINATION $ENV{DESTDIR}${prefix}/bin/
+install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/tools/MSG_visualization/colorize.pl
+        DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/
                RENAME simgrid-colorizer)
+               
+add_custom_target(simgrid-colorizer ALL
+COMMENT "Install ${CMAKE_BINARY_DIR}/bin/colorize"
+COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/tools/MSG_visualization/colorize.pl ${CMAKE_BINARY_DIR}/bin/colorize
+)
+                               
+install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/
+               RENAME simgrid_update_xml)
+               
+add_custom_target(simgrid_update_xml ALL
+COMMENT "Install ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml"
+COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/tools/simgrid_update_xml.pl ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
+)
+               
+install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/gras_stub_generator
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
 
 # libraries
 install(TARGETS simgrid gras 
-        DESTINATION $ENV{DESTDIR}${prefix}/lib/)
-       
-install(FILES ${CMAKE_BINARY_DIR}/lib/libsimgrid_static.a 
-        RENAME libsimgrid.a
-        DESTINATION $ENV{DESTDIR}${prefix}/lib/)
+        DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
        
 if(enable_smpi)        
   install(TARGETS smpi
-          DESTINATION $ENV{DESTDIR}${prefix}/lib/)
-endif(enable_smpi)     
+          DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
+endif(enable_smpi)
+
+if(enable_lib_static AND NOT WIN32)
+       install(TARGETS simgrid_static 
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
+       if(enable_smpi) 
+               install(TARGETS smpi_static
+                       DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/)
+       endif(enable_smpi)
+endif(enable_lib_static AND NOT WIN32)
 
 # include files
 foreach(file ${install_HEADERS})
   get_filename_component(location ${file} PATH)
+  string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" location "${location}")
   install(FILES ${file}
-          DESTINATION $ENV{DESTDIR}${prefix}/${location})
+          DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${location})
 endforeach(file ${install_HEADERS})
 
 # example files
 foreach(file ${examples_to_install_in_doc})
-  string(REPLACE "${PROJECT_DIRECTORY}/examples/" "" file ${file})
+  string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/examples/" "" file ${file})
   get_filename_component(location ${file} PATH)
   install(FILES "examples/${file}"
-          DESTINATION $ENV{DESTDIR}${prefix}/doc/simgrid/examples/${location})
+          DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/examples/${location})
 endforeach(file ${examples_to_install_in_doc})
 
 # bindings cruft
-if(HAVE_JAVA)
-  install(FILES ${CMAKE_BINARY_DIR}/simgrid.jar
-          DESTINATION $ENV{DESTDIR}${prefix}/share/)
-endif(HAVE_JAVA)
 
 if(HAVE_LUA)
        file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/lua/5.1")
-       add_custom_target(lua_simgrid ALL
-               COMMAND ${CMAKE_COMMAND} -E create_symlink ../../libsimgrid.so ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.so
-               DEPENDS simgrid
+       add_custom_target(simgrid_lua ALL
+               DEPENDS simgrid 
+                               ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.${LIB_EXE}
                )
-       install(FILES ${CMAKE_BINARY_DIR}/lib/lua/5.1/simgrid.so
-               DESTINATION $ENV{DESTDIR}${prefix}/lib/lua/5.1
+       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)
 
@@ -74,14 +103,18 @@ if(HAVE_RUBY)
        string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
        file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}")
        add_custom_target(ruby_simgrid ALL
-       COMMAND ${CMAKE_COMMAND} -E create_symlink ../../../libsimgrid.so ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.so
-       DEPENDS simgrid
+               DEPENDS simgrid
+                               ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE}
+       )
+       add_custom_command(
+               OUTPUT ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE}
+               COMMAND ${CMAKE_COMMAND} -E create_symlink ../../../libsimgrid.${LIB_EXE} ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE}
        )
-       install(FILES ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.so
-               DESTINATION $ENV{DESTDIR}${prefix}/lib/ruby/${install_link_ruby}/
+       install(FILES ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE}
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/ruby/${install_link_ruby}/
        )
-       install(FILES ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb
-               DESTINATION $ENV{DESTDIR}${prefix}/lib/ruby/${install_link_ruby}/)
+       install(FILES ${CMAKE_HOME_DIRECTORY}/src/bindings/ruby/simgrid.rb
+               DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib/ruby/${install_link_ruby}/)
 
 endif(HAVE_RUBY)
 
@@ -90,46 +123,42 @@ endif(HAVE_RUBY)
 ###########################################
 
 add_custom_target(uninstall
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/doc/simgrid
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/doc/simgrid
 COMMAND ${CMAKE_COMMAND} -E    echo "uninstall doc ok"
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/lib/libgras*
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/lib/libsimgrid*
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/lib/libsmpi*
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/lib/libgras*
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsimgrid*
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/lib/libsmpi*
 COMMAND ${CMAKE_COMMAND} -E    echo "uninstall lib ok"
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/bin/smpicc
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/bin/smpirun
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/bin/tesh
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/bin/simgrid-colorizer
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpicc
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpif2c
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpiff
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/smpirun
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/tesh
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid-colorizer
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/simgrid_update_xml
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/bin/gras_stub_generator
 COMMAND ${CMAKE_COMMAND} -E    echo "uninstall bin ok"
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/amok
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/gras
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/instr
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/msg 
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/simdag
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/smpi
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/surf
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/xbt
-COMMAND ${CMAKE_COMMAND} -E    remove_directory ${prefix}/include/mc
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/include/simgrid_config.h
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/include/gras.h 
-COMMAND ${CMAKE_COMMAND} -E    remove -f ${prefix}/include/xbt.h
-COMMAND ${CMAKE_COMMAND} -E    echo "uninstal include ok"
-WORKING_DIRECTORY "${prefix}"
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/amok
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/gras
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/instr
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/msg 
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/simdag
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/smpi
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/surf
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/xbt
+COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/mc
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/include/simgrid_config.h
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/include/gras.h 
+COMMAND ${CMAKE_COMMAND} -E    remove -f ${CMAKE_INSTALL_PREFIX}/include/xbt.h
+COMMAND ${CMAKE_COMMAND} -E    echo "uninstall include ok"
+WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}"
 )
 
-if(HAVE_JAVA)
-       add_custom_command(TARGET uninstall
-       COMMAND ${CMAKE_COMMAND} -E     remove -f ${prefix}/share/simgrid.jar
-       COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding java ok"
-       WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
-       )       
-endif(HAVE_JAVA)
-
 if(HAVE_LUA)
        add_custom_command(TARGET uninstall
        COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding lua ok"
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/lua/5.1/simgrid.so  
-       WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
+       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid.${LIB_EXE}
+       WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/"
        )
 endif(HAVE_LUA)
 
@@ -137,27 +166,12 @@ if(HAVE_RUBY)
        string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
        add_custom_command(TARGET uninstall
        COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding ruby ok"
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/ruby/${install_link_ruby}/libsimgrid.so
-       COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/ruby/${install_link_ruby}/simgrid.rb
-       WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
+       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE}
+       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_INSTALL_PREFIX}/lib/ruby/${install_link_ruby}/simgrid.rb
+       WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/"
        )
 endif(HAVE_RUBY)
 
-######################################
-### Fill in the "make html" target ###
-######################################
-
-add_custom_target(html
-COMMAND ${CMAKE_COMMAND} -E echo "Make the html doc"
-COMMAND ${CMAKE_COMMAND} -E echo "cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./"
-COMMAND ${CMAKE_COMMAND} -DBIBTEX2HTML=${BIBTEX2HTML} ./
-COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_DIRECTORY}/buildtools/Cmake/doc/CMakeFiles
-COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/doc/CMakeCache.txt
-COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/doc/cmake_install.cmake
-COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/doc/Makefile
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/doc"
-)
-
 ################################################################
 ## Build a sain "make dist" target to build a source package ###
 ##   containing only the files that I explicitely state      ###
@@ -169,15 +183,20 @@ WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/doc"
 ##########################################
 
 add_custom_target(dist-dir
+  COMMENT "Generating the distribution directory"
   COMMAND test -e simgrid-${release_version}/ && chmod -R a+w simgrid-${release_version}/ || true
-  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
+  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/
   COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}
+  COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/doc/html/
+  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/html/ simgrid-${release_version}/doc/html/
 )
+add_dependencies(dist-dir simgrid_documentation)
 
 set(dirs_in_tarball "")
-foreach(file ${source_to_pack} ${txt_files})
+foreach(file ${source_to_pack})
+  #message(${file})
   # This damn prefix is still set somewhere (seems to be in subdirs)
-  string(REPLACE "${PROJECT_DIRECTORY}/" "" file ${file})
+  string(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" file "${file}")
   
   # Create the directory on need
   get_filename_component(file_location ${file} PATH)
@@ -193,7 +212,12 @@ foreach(file ${source_to_pack} ${txt_files})
    # Actually copy the file
    add_custom_command(
      TARGET dist-dir
-     COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/${file} simgrid-${release_version}/${file_location}/
+     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/${file} simgrid-${release_version}/${file_location}/
+   )
+   
+   add_custom_command(
+     TARGET dist-dir
+     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Makefile.default simgrid-${release_version}/Makefile
    )
 endforeach(file ${source_to_pack})
 
@@ -202,9 +226,14 @@ endforeach(file ${source_to_pack})
 ######################################
 
 add_custom_target(dist
-  COMMAND ${CMAKE_COMMAND} -E tar cf simgrid-${release_version}.tar simgrid-${release_version}/
-  COMMAND gzip -9v simgrid-${release_version}.tar
-  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
+  DEPENDS ${CMAKE_BINARY_DIR}/simgrid-${release_version}.tar.gz
+)
+add_custom_command(
+       OUTPUT ${CMAKE_BINARY_DIR}/simgrid-${release_version}.tar.gz    
+       COMMENT "Compressing the archive from the distribution directory"
+       COMMAND ${CMAKE_COMMAND} -E tar cf simgrid-${release_version}.tar simgrid-${release_version}/
+       COMMAND gzip -9v simgrid-${release_version}.tar
+       COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/
 )
 add_dependencies(dist dist-dir)
 
@@ -214,33 +243,45 @@ add_dependencies(dist dist-dir)
 
 # Allow to test the "make dist"
 add_custom_target(distcheck
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX remove old copy"
   COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}.cpy 
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX copy again the source tree"
   COMMAND ${CMAKE_COMMAND} -E copy_directory simgrid-${release_version}/ simgrid-${release_version}.cpy 
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX create build and install subtrees"
   COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_build
   COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_inst
  
   # This stupid cmake creates a directory in source, killing the purpose of the chmod
   # (tricking around)
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX change the modes of directories"
   COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/CMakeFiles 
-#  COMMAND chmod -R a-w simgrid-${release_version}/ # FIXME: we should pass without commenting that line
+  COMMAND chmod -R a-w simgrid-${release_version}/ # FIXME: we should pass without commenting that line
   COMMAND chmod -R a+w simgrid-${release_version}/_build
   COMMAND chmod -R a+w simgrid-${release_version}/_inst
   COMMAND chmod -R a+w simgrid-${release_version}/CMakeFiles
   
-  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ${CMAKE_COMMAND} build ..  -Dprefix=../_inst
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Configure"
+  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ${CMAKE_COMMAND} build ..  -DCMAKE_INSTALL_PREFIX=../_inst -Wno-dev -Denable_doc=OFF
 #  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make dist-dir
-  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Build"
+  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make VERBOSE=1
   
   # This fails, unfortunately, because GRAS is broken for now
-#  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ctest -j5 --output-on-failure
+  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ctest -j5 --output-on-failure
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Check that cleaning works"
   COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make clean
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Display what is remaining after make clean"
+  COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ls -lR
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Remove _build and _inst directories"
+  COMMAND chmod a+w simgrid-${release_version}/
   COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/_build
   COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/_inst
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX The output of the diff follows"
   COMMAND diff -ruN simgrid-${release_version}.cpy simgrid-${release_version}
-#  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}.cpy 
-#  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX end of the diff, random cleanups now"
+  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}.cpy 
+  COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
 )
 add_dependencies(distcheck dist-dir)
 
@@ -259,7 +300,7 @@ else(enable_memcheck)
 endif(enable_memcheck)
 
 #######################################
-### Fill in the "make all-clean" target ###
+### Fill in the "make xxx-clean" target ###
 #######################################
 
 add_custom_target(maintainer-clean
@@ -275,87 +316,32 @@ COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_sha_unit.c
 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_str_unit.c
 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_strbuff_unit.c
 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_synchro_unit.c
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
+WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 )
 
 add_custom_target(supernovae-clean
 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_gras.c
 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_sg.c
 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
+WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 )
 
-add_custom_target(doc-clean
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.latin1.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.latin1.html.tmp
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/logcategories.sh
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core.bib
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.latin1.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.latin1.html.tmp
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_count.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern.bib
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.latin1.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.latin1.html.tmp
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra.bib
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.latin1.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.latin1.html.tmp
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/tmp.realtoc
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.latin1.html
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.latin1.html.tmp
-COMMAND ${CMAKE_COMMAND} -E remove -f doc/realtoc.sh
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
-)
-
-add_custom_target(java-clean
-COMMAND ${CMAKE_COMMAND} -E remove -f src/simgrid.jar
-COMMAND ${CMAKE_COMMAND} -E remove_directory src/.classes
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/BasicTest.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/FinalizeTask.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Forwarder.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Master.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Slave.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/CommTimeTest.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/FinalizeTask.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/Master.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/Slave.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/PingPongTask.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/PingPongTest.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/Receiver.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/Sender.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/DreamMaster.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/LazyGuy.class
-COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/SuspendTest.class
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
-)
-
-add_custom_target(all-clean
-COMMAND make clean
-COMMAND make java-clean
-COMMAND make doc-clean
-COMMAND make supernovae-clean
-)
-if(enable_maintainer_mode)
-       add_custom_command(TARGET all-clean
-       COMMAND make maintainer-clean
-       )
-endif(enable_maintainer_mode)
-
 #############################################
 ### Fill in the "make sync-gforge" target ###
 #############################################
 
-add_custom_target(sync-gforge
+add_custom_target(sync-gforge-doc
 COMMAND chmod g+rw -R doc/
 COMMAND chmod a+rX -R doc/
 COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/doc/ || true
 COMMAND scp doc/index.php doc/webcruft/robots.txt scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
 COMMAND scp doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo.png doc/webcruft/simgrid_logo_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
-WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
+WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
 )
+add_custom_target(sync-gforge-dtd
+COMMAND scp src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
+WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
+)
+
 
 include(CPack)