X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/93db403fd2b6666c60754c6169e6211bce974044..7ff79318b09b10352e946822714b333b8e71555c:/buildtools/Cmake/Distrib.cmake diff --git a/buildtools/Cmake/Distrib.cmake b/buildtools/Cmake/Distrib.cmake index 63bf14bff0..c76e61b21a 100644 --- a/buildtools/Cmake/Distrib.cmake +++ b/buildtools/Cmake/Distrib.cmake @@ -3,10 +3,10 @@ ######################################### # 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/" +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 @@ -14,23 +14,29 @@ install(DIRECTORY "${PROJECT_DIRECTORY}/doc/html/" PATTERN "*~" EXCLUDE ) +#### Generate the manpages +if( NOT MANPAGE_DIR ) + set( MANPAGE_DIR $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/man/share/man/man1 ) +endif( NOT MANPAGE_DIR) + +add_custom_target(TARGET install + COMMAND ${CMAKE_COMMAND} -E make_directory ${MANPAGE_DIR} + COMMAND pod2man tools/simgrid_update_xml.pl > ${MANPAGE_DIR}/simgrid_update_xml.1 + COMMENT "Generating manpages" +) + # binaries install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc ${CMAKE_BINARY_DIR}/bin/smpif2c ${CMAKE_BINARY_DIR}/bin/smpiff ${CMAKE_BINARY_DIR}/bin/smpirun 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/ - 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 ${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 ${CMAKE_HOME_DIRECTORY}/tools/MSG_visualization/colorize.pl DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/ @@ -72,34 +78,26 @@ if(enable_lib_static AND NOT WIN32) endif(enable_lib_static AND NOT WIN32) # include files -foreach(file ${install_HEADERS}) +set(HEADERS + ${headers_to_install} + ${generated_headers_to_install} + ) +foreach(file ${HEADERS}) get_filename_component(location ${file} PATH) string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" location "${location}") install(FILES ${file} DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${location}) -endforeach(file ${install_HEADERS}) +endforeach(file ${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}${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 - DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/share/) -endif(HAVE_JAVA) if(HAVE_LUA) file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/lua/5.1") @@ -116,25 +114,6 @@ if(HAVE_LUA) ) endif(HAVE_LUA) -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 - 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.${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}${CMAKE_INSTALL_PREFIX}/lib/ruby/${install_link_ruby}/) - -endif(HAVE_RUBY) - ########################################### ### Fill in the "make uninstall" target ### ########################################### @@ -171,32 +150,14 @@ 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 ${CMAKE_INSTALL_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 ${CMAKE_INSTALL_PREFIX}/lib/lua/5.1/simgrid.${LIB_EXE} - WORKING_DIRECTORY "${PROJECT_DIRECTORY}/" + WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/" ) endif(HAVE_LUA) -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 ${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 "${PROJECT_DIRECTORY}/" - ) -endif(HAVE_RUBY) - ################################################################ ## Build a sain "make dist" target to build a source package ### ## containing only the files that I explicitely state ### @@ -207,28 +168,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/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_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) +add_dependencies(dist-dir maintainer_files) set(dirs_in_tarball "") 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) @@ -244,7 +199,12 @@ foreach(file ${source_to_pack}) # 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}) @@ -343,27 +303,40 @@ 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}" ) ############################################# ### 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}" +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/${release_version}/doc/ || true +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/${release_version}/ +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/${release_version}/ +WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" +) + +#doc/index.php doc/webcruft/robots.txt doc/webcruft/fish.gif +add_custom_target(sync-gforge-website +COMMAND chmod g+rw -R website/html +COMMAND chmod a+rX -R website/html +COMMAND scp -r website/html/* scm.gforge.inria.fr:/home/groups/simgrid/htdocs/ +WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}" ) include(CPack)