Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Corection of the gtnets-ruby bug with node.h and begining of the doc edition.
[simgrid.git] / buildtools / CPACK / src / CMakeMakeExeLib.txt
index eac42f1..e59cb2a 100644 (file)
@@ -1,43 +1,51 @@
 ### Make Libs
 
-include(${PROJECT_DIRECTORY}/CPACK/src/CMakeFLEXml.txt)
-
-add_library(simgrid SHARED ${simgrid_sources})
-add_library(gras SHARED ${gras_sources})
-add_library(smpi SHARED ${SMPI_SRC})
+if(supernovae)
+       include(${PROJECT_DIRECTORY}/CPACK/src/CMakeSupernovae.txt)
+else(supernovae)
+       add_library(msg STATIC ${MSG_SRC_bis})
+       add_library(simgrid STATIC ${simgrid_sources})
+       add_library(gras SHARED ${gras_sources})
+       add_library(smpi STATIC ${SMPI_SRC})
+endif(supernovae)
 
 set(GRAS_DEP "pthread")
-set(SIMGRID_DEP "")
+set(SIMGRID_DEP "ruby1.8")
+set(SMPI_DEP "")
+set(MSG_DEP "pthread -lrt -ldl -lcrypt -lm -lc")
+
+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 pthread)
-               SET(ESPACE " ")
+               SET(SIMGRID_DEP "${SIMGRID_DEP} -lpthread")
        endif(with_context MATCHES pthread)
        
        if(with_context MATCHES windows)
-               SET(GRAS_DEP "")
+               SET(GRAS_DEP "msg")
        endif(with_context MATCHES windows)
 endif(pthread)
 
 if(HAVE_LUA)
-       SET(SIMGRID_DEP "${SIMGRID_DEP}${ESPACE}-ldl -llua5.1")
+       SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -llua5.1")
 endif(HAVE_LUA)
 
 if(HAVE_GTNETS)
-       SET(SIMGRID_DEP_GTNETS "gtnets ")
+       SET(SIMGRID_DEP "${SIMGRID_DEP} -lgtnets")
 endif(HAVE_GTNETS)
 
-message("SIMGRID_DEP \"${SIMGRID_DEP}\"")
-message("GRAS_DEP \"${GRAS_DEP}\"")
-
 ### Add definitions for compile
-set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
-add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
-target_link_libraries(simgrid ${SIMGRID_DEP} ${SIMGRID_DEP_GTNETS}-fprofile-arcs)
-target_link_libraries(gras ${GRAS_DEP} -fprofile-arcs)
-target_link_libraries(smpi -fprofile-arcs)
-
+#set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
+#set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage")
+
+#add_definitions (-fprofile-arcs -ftest-coverage)
+target_link_libraries(simgrid  msg ${SIMGRID_DEP} -fprofile-arcs)
+target_link_libraries(gras     msg ${GRAS_DEP} -fprofile-arcs)
+target_link_libraries(smpi     simgrid ${SMPI_DEP} -fprofile-arcs)
+target_link_libraries(msg      ${MSG_DEP} -fprofile-arcs)
 ### Make EXEs
 
 #tools
@@ -61,6 +69,8 @@ if(NOT init)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/xbt)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/datadesc)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/msg_handle)
+       add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/empty_main)
+       add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/small_sleep)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/network)
        add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/network/p2p)
@@ -92,6 +102,7 @@ if(NOT init)
        add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/masterslave)
        add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/trace)
        if(HAVE_GTNETS)
+               add_definitions("-lgtnets -L${gtnets_path}/lib -I${gtnets_path}/include/gtnets")
                add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/gtnets)
        endif(HAVE_GTNETS)
 
@@ -102,7 +113,7 @@ if(NOT init)
        add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/dax)
        add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/metaxml)
        add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/properties)
-       #add_subdirectory(${PROJECT_DIRECTORY}/examples/smpi)
+       add_subdirectory(${PROJECT_DIRECTORY}/examples/smpi)
 
        if(HAVE_JAVA)
                message("Make : src/simgrid.jar with : ${JAVA_COMPILE}")