X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/25565db4e0e123731ccc3a7bba4af66c92fb21dc..a21b6634a89ef18ffdbde0607b410f8e59d169c3:/buildtools/Cmake/Distrib.cmake diff --git a/buildtools/Cmake/Distrib.cmake b/buildtools/Cmake/Distrib.cmake old mode 100755 new mode 100644 index ac7c2048d3..fdafa18853 --- a/buildtools/Cmake/Distrib.cmake +++ b/buildtools/Cmake/Distrib.cmake @@ -1,4 +1,4 @@ -set(CMAKE_INSTALL_PREFIX ${prefix} CACHE TYPE INTERNAL FORCE) +set(CMAKE_INSTALL_PREFIX "${prefix}" CACHE TYPE INTERNAL FORCE) ######################################### ### Fill in the "make install" target ### @@ -18,8 +18,14 @@ endif(NOT EXISTS ${PROJECT_DIRECTORY}/doc/html/) # binaries install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc ${CMAKE_BINARY_DIR}/bin/smpirun - ${CMAKE_BINARY_DIR}/bin/tesh DESTINATION $ENV{DESTDIR}${prefix}/bin/) +if(WIN32) + install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/tesh.pl + DESTINATION $ENV{DESTDIR}${prefix}/bin/) +else(WIN32) + install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/tesh + DESTINATION $ENV{DESTDIR}${prefix}/bin/) +endif(WIN32) install(PROGRAMS tools/MSG_visualization/colorize.pl DESTINATION $ENV{DESTDIR}${prefix}/bin/ @@ -29,10 +35,6 @@ install(PROGRAMS tools/MSG_visualization/colorize.pl 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/) - if(enable_smpi) install(TARGETS smpi DESTINATION $ENV{DESTDIR}${prefix}/lib/) @@ -41,6 +43,7 @@ endif(enable_smpi) # 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}) endforeach(file ${install_HEADERS}) @@ -61,10 +64,15 @@ 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 + 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 + 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}${prefix}/lib/lua/5.1 ) endif(HAVE_LUA) @@ -73,9 +81,14 @@ 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 + ${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 + install(FILES ${CMAKE_BINARY_DIR}/lib/ruby/${install_link_ruby}/libsimgrid.${LIB_EXE} DESTINATION $ENV{DESTDIR}${prefix}/lib/ruby/${install_link_ruby}/ ) install(FILES ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb @@ -126,7 +139,7 @@ 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 + COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/lua/5.1/simgrid.${LIB_EXE} WORKING_DIRECTORY "${PROJECT_DIRECTORY}/" ) endif(HAVE_LUA) @@ -135,7 +148,7 @@ 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}/libsimgrid.${LIB_EXE} COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/ruby/${install_link_ruby}/simgrid.rb WORKING_DIRECTORY "${PROJECT_DIRECTORY}/" ) @@ -146,7 +159,7 @@ endif(HAVE_RUBY) ###################################### add_custom_target(html -COMMAND ${CMAKE_COMMAND} -E echo "Make the html doc" +DEPENDS ${PROJECT_DIRECTORY}/doc/all_bib.html 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 @@ -156,6 +169,33 @@ COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/doc/ WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/doc" ) +add_custom_command( +OUTPUT ${PROJECT_DIRECTORY}/doc/all_bib.html + ${PROJECT_DIRECTORY}/doc/all_bib.latin1.html + ${PROJECT_DIRECTORY}/doc/all_bib.latin1.html.tmp + ${PROJECT_DIRECTORY}/doc/logcategories.sh + ${PROJECT_DIRECTORY}/doc/publis_core.bib + ${PROJECT_DIRECTORY}/doc/publis_core_bib.html + ${PROJECT_DIRECTORY}/doc/publis_core_bib.latin1.html + ${PROJECT_DIRECTORY}/doc/publis_core_bib.latin1.html.tmp + ${PROJECT_DIRECTORY}/doc/publis_count.html + ${PROJECT_DIRECTORY}/doc/publis_extern.bib + ${PROJECT_DIRECTORY}/doc/publis_extern_bib.html + ${PROJECT_DIRECTORY}/doc/publis_extern_bib.latin1.html + ${PROJECT_DIRECTORY}/doc/publis_extern_bib.latin1.html.tmp + ${PROJECT_DIRECTORY}/doc/publis_intra.bib + ${PROJECT_DIRECTORY}/doc/publis_intra_bib.html + ${PROJECT_DIRECTORY}/doc/publis_intra_bib.latin1.html + ${PROJECT_DIRECTORY}/doc/publis_intra_bib.latin1.html.tmp + ${PROJECT_DIRECTORY}/doc/tmp.realtoc + ${PROJECT_DIRECTORY}/doc/using_bib.html + ${PROJECT_DIRECTORY}/doc/using_bib.latin1.html + ${PROJECT_DIRECTORY}/doc/using_bib.latin1.html.tmp + ${PROJECT_DIRECTORY}/doc/realtoc.sh + ${PROJECT_DIRECTORY}/doc/html +COMMAND ${CMAKE_COMMAND} -E echo "Make the html doc" +) + ################################################################ ## Build a sain "make dist" target to build a source package ### ## containing only the files that I explicitely state ### @@ -170,12 +210,14 @@ add_custom_target(dist-dir 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/ ) set(dirs_in_tarball "") -foreach(file ${source_to_pack} ${txt_files}) +foreach(file ${source_to_pack}) # This damn prefix is still set somewhere (seems to be in subdirs) - string(REPLACE "${PROJECT_DIRECTORY}/" "" file ${file}) + string(REPLACE "${PROJECT_DIRECTORY}/" "" file "${file}") # Create the directory on need get_filename_component(file_location ${file} PATH) @@ -200,9 +242,13 @@ 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 + 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) @@ -212,9 +258,11 @@ add_dependencies(dist dist-dir) # Allow to test the "make dist" add_custom_target(distcheck + COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}.cpy + COMMAND ${CMAKE_COMMAND} -E copy_directory simgrid-${release_version}/ simgrid-${release_version}.cpy 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 make_directory simgrid-${release_version}/CMakeFiles @@ -225,10 +273,18 @@ add_custom_target(distcheck COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ${CMAKE_COMMAND} build .. -Dprefix=../_inst # 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 chdir simgrid-${release_version}/_build ctest -j5 --output-on-failure + COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make + + # 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 echo "XXX Check that cleaning works" COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make clean -# COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/ + COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/_build + COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/_inst + 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}/ ) add_dependencies(distcheck dist-dir) @@ -236,13 +292,18 @@ add_dependencies(distcheck dist-dir) ### Fill in the "make check" target ### ####################################### -add_custom_target(check -COMMAND make test -#WORKING_DIRECTORY "${PROJECT_DIRECTORY}" -) +if(enable_memcheck) + add_custom_target(check + COMMAND ctest -D ExperimentalMemCheck + ) +else(enable_memcheck) + add_custom_target(check + COMMAND make test + ) +endif(enable_memcheck) ####################################### -### Fill in the "make all-clean" target ### +### Fill in the "make xxx-clean" target ### ####################################### add_custom_target(maintainer-clean @@ -268,66 +329,6 @@ COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c WORKING_DIRECTORY "${PROJECT_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 ### #############################################