X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9d85ead7a4eb80631f931e45d894a446c7e73bb6..8f7873c57495707ccbdad488eab21356bf5496d7:/buildtools/Cmake/MakeExeLib.cmake diff --git a/buildtools/Cmake/MakeExeLib.cmake b/buildtools/Cmake/MakeExeLib.cmake index 0c08e0ebf6..38c5134c58 100644 --- a/buildtools/Cmake/MakeExeLib.cmake +++ b/buildtools/Cmake/MakeExeLib.cmake @@ -1,21 +1,21 @@ ### Make Libs -foreach(file ${simgrid_sources}) - set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT") -endforeach(file ${simgrid_sources}) -foreach(file ${gras_sources}) - set_source_files_properties(${file} PROPERTIES COMPILE_FLAGS "/D DLL_EXPORT") -endforeach(file ${gras_sources}) - -if(enable_supernovae AND NOT WIN32) +include(FindSupernovae) + +if(enable_supernovae AND HAVE_SUPERNOVAE_TOOLS) include(${PROJECT_DIRECTORY}/buildtools/Cmake/Supernovae.cmake) -else(enable_supernovae AND NOT WIN32) +else(enable_supernovae AND HAVE_SUPERNOVAE_TOOLS) add_library(simgrid SHARED ${simgrid_sources}) - add_library(simgrid_static STATIC ${simgrid_sources}) add_library(gras SHARED ${gras_sources}) + if(enable_lib_static) + add_library(simgrid_static STATIC ${simgrid_sources}) + endif(enable_lib_static) if(enable_smpi) add_library(smpi SHARED ${SMPI_SRC}) + if(enable_lib_static) + add_library(smpi_static STATIC ${SMPI_SRC}) + endif(enable_lib_static) endif(enable_smpi) -endif(enable_supernovae AND NOT WIN32) +endif(enable_supernovae AND HAVE_SUPERNOVAE_TOOLS) set_target_properties(simgrid PROPERTIES VERSION ${libsimgrid_version}) set_target_properties(gras PROPERTIES VERSION ${libgras_version}) @@ -23,33 +23,33 @@ if(enable_smpi) set_target_properties(smpi PROPERTIES VERSION ${libsmpi_version}) endif(enable_smpi) -if(WIN32) - set(GRAS_DEP "wsock32") - set(SIMGRID_DEP "wsock32") -else(WIN32) - set(GRAS_DEP "-lm -lpthread") - set(SIMGRID_DEP "-lm") - set(SMPI_DEP "") -endif(WIN32) +set(GRAS_DEP "-lm -lpthread") +set(SIMGRID_DEP "-lm") +set(SMPI_DEP "") +if(APPLE) + set(SMPI_DEP "-Wl,-U -Wl,_smpi_simulated_main") +endif(APPLE) + +if(HAVE_PCRE_LIB) + SET(SIMGRID_DEP "${SIMGRID_DEP} -lpcre") +endif(HAVE_PCRE_LIB) if(HAVE_RUBY) set(SIMGRID_DEP "${SIMGRID_DEP} -l${RUBY_LIBRARY_NAME} -module") - exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.so" - "${PROJECT_DIRECTORY}" - OUTPUT_VARIABLE IGNORED) - - # Make sure this extra link will get cleaned - get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) - set_directory_properties( - PROPERTIES - ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.so") + ADD_CUSTOM_TARGET(link_simgrid_ruby ALL + DEPENDS simgrid ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} + ) + add_custom_command( + OUTPUT ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} + COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/src/bindings/ruby/libsimgrid.${LIB_EXE} + ) endif(HAVE_RUBY) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") add_definitions("-D_XOPEN_SOURCE") endif(CMAKE_SYSTEM_NAME MATCHES "Darwin") - if(pthread) if(with_context MATCHES pthread) SET(SIMGRID_DEP "${SIMGRID_DEP} -lpthread") @@ -61,18 +61,41 @@ if(pthread) endif(pthread) if(HAVE_LUA) - SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -l${liblua}") - exec_program("${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.so ${PROJECT_DIRECTORY}/examples/lua/simgrid.so" - "${PROJECT_DIRECTORY}" - OUTPUT_VARIABLE IGNORED) - - # Make sure this extra link will get cleaned - get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) - set_directory_properties( - PROPERTIES - ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${PROJECT_DIRECTORY}/examples/lua/simgrid.so") + SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -l${LIB_LUA_NAME}") + + ADD_CUSTOM_TARGET(link_simgrid_lua ALL + DEPENDS simgrid + ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} + ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} + ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} + ) + add_custom_command( + OUTPUT ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} + ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} + ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} + COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/lua/simgrid.${LIB_EXE} #for test + + COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/msg/masterslave/simgrid.${LIB_EXE} #for test + + COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} # if it exists, creating the link fails. So cleanup before hand + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/libsimgrid.${LIB_EXE} ${PROJECT_DIRECTORY}/examples/simdag/simgrid.${LIB_EXE} #for test + ) endif(HAVE_LUA) +if(HAVE_GRAPHVIZ) + + if(HAVE_CGRAPH_LIB) + SET(SIMGRID_DEP "${SIMGRID_DEP} -lcgraph") + else(HAVE_CGRAPH_LIB) + if(HAVE_AGRAPH_LIB) + SET(SIMGRID_DEP "${SIMGRID_DEP} -lagraph -lcdt") + endif(HAVE_AGRAPH_LIB) + endif(HAVE_CGRAPH_LIB) + +endif(HAVE_GRAPHVIZ) + if(HAVE_GTNETS) SET(SIMGRID_DEP "${SIMGRID_DEP} -lgtnets") endif(HAVE_GTNETS) @@ -83,12 +106,22 @@ if(HAVE_POSIX_GETTIME) endif(HAVE_POSIX_GETTIME) target_link_libraries(simgrid ${SIMGRID_DEP}) -target_link_libraries(simgrid_static ${SIMGRID_DEP}) target_link_libraries(gras ${GRAS_DEP}) +add_dependencies(gras maintainer_files) +add_dependencies(simgrid maintainer_files) if(enable_smpi) target_link_libraries(smpi simgrid ${SMPI_DEP}) endif(enable_smpi) +if(enable_lib_static) + target_link_libraries(simgrid_static ${SIMGRID_DEP}) + add_dependencies(simgrid_static maintainer_files) + set_target_properties(simgrid_static PROPERTIES OUTPUT_NAME simgrid) + if(enable_smpi) + target_link_libraries(smpi_static simgrid ${SMPI_DEP}) + set_target_properties(smpi_static PROPERTIES OUTPUT_NAME smpi) + endif(enable_smpi) +endif(enable_lib_static) ### Make EXEs @@ -136,6 +169,7 @@ add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/all2all) add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/pmm) add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/synchro) add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/properties) +add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/console) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/properties) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/actions) @@ -147,6 +181,7 @@ add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/priority) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/masterslave) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/trace) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/tracing) +add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/icomms) if(HAVE_MC) add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/mc) @@ -162,8 +197,12 @@ add_subdirectory(${PROJECT_DIRECTORY}/examples/amok/saturate) add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag) add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/dax) +if(HAVE_GRAPHVIZ) + add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/dot) +endif(HAVE_GRAPHVIZ) add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/metaxml) add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/properties) +add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/scheduling) if(enable_smpi) add_subdirectory(${PROJECT_DIRECTORY}/examples/smpi) -endif(enable_smpi) \ No newline at end of file +endif(enable_smpi)