X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/23f4a1521c0658ea2450c97e70616b6d04de97d7..c37bfd055f255fd8b46855f9e2ac0da974f64292:/tools/cmake/Distrib.cmake diff --git a/tools/cmake/Distrib.cmake b/tools/cmake/Distrib.cmake index 095b794e60..334dad9ac1 100644 --- a/tools/cmake/Distrib.cmake +++ b/tools/cmake/Distrib.cmake @@ -13,6 +13,7 @@ if(enable_smpi) ${CMAKE_BINARY_DIR}/bin/smpicc ${CMAKE_BINARY_DIR}/bin/smpicxx ${CMAKE_BINARY_DIR}/bin/smpirun + ${CMAKE_BINARY_DIR}/bin/smpimain DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/) if(SMPI_FORTRAN) install(PROGRAMS @@ -22,6 +23,12 @@ if(enable_smpi) endif() endif() +if(enable_model-checking) + install( + PROGRAMS ${CMAKE_BINARY_DIR}/bin/simgrid-mc + DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/) +endif() + 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/) @@ -54,12 +61,12 @@ if(enable_java) endif() # include files -set(HEADERS ${headers_to_install} ${generated_headers_to_install}) -foreach(file ${HEADERS}) +foreach(file ${headers_to_install} ${generated_headers_to_install}) get_filename_component(location ${file} PATH) string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" location "${location}") + string(REPLACE "src/" "include/simgrid/" location "${location}") # For kernel headers install(FILES ${file} DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${location}) -endforeach(file ${HEADERS}) +endforeach() # example files foreach(file ${examples_to_install}) @@ -114,7 +121,7 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -E echo "uninstall man ok" WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}") -if(HAVE_LUA) +if(SIMGRID_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} @@ -135,9 +142,6 @@ set(source_to_pack ${JEDULE_SRC} ${JMSG_C_SRC} ${JMSG_JAVA_SRC} - ${JSURF_SWIG_SRC} - ${JSURF_SWIG_SRC_EXTRA} - ${JSURF_C_SRC} ${LUA_SRC} ${MC_SRC_BASE} ${MC_SRC} @@ -184,7 +188,10 @@ add_custom_target(dist-dir COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_NAME}-${release_version}.tar.gz COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version} COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/doc/html/ - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/html/ ${PROJECT_NAME}-${release_version}/doc/html/) + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_HOME_DIRECTORY}/doc/html/ ${PROJECT_NAME}-${release_version}/doc/html/ + COMMAND rm -f `grep -rl " Reference" ${PROJECT_NAME}-${release_version}/doc/html/` # Doxygen, go away + COMMAND rm -f `grep -rl "Member List" ${PROJECT_NAME}-${release_version}/doc/html/` # Doxygen, you're getting annoying + ) add_dependencies(dist-dir maintainer_files) set(dirs_in_tarball "") @@ -213,6 +220,37 @@ add_custom_command( TARGET dist-dir COMMAND ${CMAKE_COMMAND} -E echo "${GIT_VERSION}" > ${PROJECT_NAME}-${release_version}/.gitversion) +########################################################## +### Link all sources to the bindir if srcdir != bindir ### +########################################################## +add_custom_target(hardlinks + COMMENT "Making the source files available from the bindir" +) +if (NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + foreach(file ${source_to_pack}) + #message(${file}) + # This damn prefix is still set somewhere (seems to be in subdirs) + string(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" file "${file}") + + # Create the directory on need + get_filename_component(file_location ${file} PATH) + string(REGEX MATCH ";${file_location};" OPERATION "${dirs_in_bindir}") + if(NOT OPERATION) + set(dirs_in_tarball "${dirs_in_bindir};${file_location};") + add_custom_command( + TARGET hardlinks + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${file_location}/) + endif() + + # Actually copy the file + add_custom_command( + TARGET hardlinks + COMMAND if test -f ${CMAKE_HOME_DIRECTORY}/${file} \; then rm -f ${CMAKE_BINARY_DIR}/${file}\; ln ${CMAKE_HOME_DIRECTORY}/${file} ${CMAKE_BINARY_DIR}/${file_location}\; fi + ) + endforeach(file ${source_to_pack}) +endif() + + ###################################### ### Fill in the "make dist" target ### ###################################### @@ -306,9 +344,7 @@ add_custom_target(maintainer-clean COMMAND ${CMAKE_COMMAND} -E remove -f src/ex_unit.c COMMAND ${CMAKE_COMMAND} -E remove -f src/set_unit.c COMMAND ${CMAKE_COMMAND} -E remove -f src/simgrid_units_main.c - COMMAND ${CMAKE_COMMAND} -E remove -f src/swag_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 "${CMAKE_HOME_DIRECTORY}")