Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
definitely fix doc generation, and inclusion of documentation in dist archives
[simgrid.git] / buildtools / Cmake / Distrib.cmake
index ee5e289..83af4c7 100644 (file)
@@ -24,17 +24,33 @@ install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
                DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
 if(WIN32)
        install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl
-       DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
+       DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/
+       RENAME tesh)
+       add_custom_target(tesh
+       COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl ${CMAKE_BINARY_DIR}/bin/tesh
+       )
 else(WIN32)
        install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/tesh
        DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/)
 endif(WIN32)  
        
-install(PROGRAMS tools/MSG_visualization/colorize.pl
+install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/tools/MSG_visualization/colorize.pl
         DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/
                RENAME simgrid-colorizer)
                
-install(PROGRAMS tools/simgrid_update_xml.pl
+add_custom_target(simgrid-colorizer ALL
+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
+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
@@ -71,6 +87,14 @@ foreach(file ${examples_to_install_in_doc})
           DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/examples/${location})
 endforeach(file ${examples_to_install_in_doc})
 
+# example README
+foreach(file ${README_examples_files})
+  string(REPLACE "${PROJECT_DIRECTORY}/examples/" "" file ${file})
+  get_filename_component(location ${file} PATH)
+  install(FILES "examples/${file}"
+          DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/doc/simgrid/examples/${location})
+endforeach(file ${README_examples_files})
+
 # bindings cruft
 if(HAVE_JAVA)
   install(FILES ${CMAKE_BINARY_DIR}/simgrid.jar
@@ -128,6 +152,8 @@ 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 ${CMAKE_INSTALL_PREFIX}/include/amok
 COMMAND ${CMAKE_COMMAND} -E    remove_directory ${CMAKE_INSTALL_PREFIX}/include/gras
@@ -181,13 +207,22 @@ endif(HAVE_RUBY)
 ### Fill in the "make dist-dir" target ###
 ##########################################
 
+if(enable_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 make_directory simgrid-${release_version}
   COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/doc/html/
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_DIRECTORY}/doc/html/ simgrid-${release_version}/doc/html/
 )
+add_dependencies(dist-dir simgrid_documentation)
+else(enable_doc)
+add_custom_target(dist-dir
+       COMMAND ${CMAKE_COMMAND} -E echo "Please enable the doc to generate the doc"
+       COMMAND I_said_PLEASE_ENABLE_THE_DOC_GENERATION_BEFORE_BUILDING_AN_ARCHIVE
+)
+endif(enable_doc)
 
 set(dirs_in_tarball "")
 foreach(file ${source_to_pack})
@@ -222,6 +257,7 @@ add_custom_target(dist
 )
 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}/