Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Set definitions with Darwin.
[simgrid.git] / buildtools / CPACK / src / CMakeMakeExeLib.txt
index eac42f1..69f83bf 100644 (file)
@@ -2,16 +2,28 @@
 
 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(simgrid SHARED ${simgrid_sources})
+       add_library(gras SHARED ${gras_sources})
+       add_library(smpi STATIC ${SMPI_SRC})
+endif(supernovae)
 
 set(GRAS_DEP "pthread")
 set(SIMGRID_DEP "")
+set(SMPI_DEP "")
+
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+       set(GRAS_DEP "pthread -D_OPEN_SOURCE")
+       set(SIMGRID_DEP "-D_OPEN_SOURCE")
+       set(SMPI_DEP "-D_OPEN_SOURCE")
+endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+
 
 if(pthread)
        if(with_context MATCHES pthread)
-               SET(SIMGRID_DEP pthread)
+               SET(SIMGRID_DEP ${SIMGRID_DEP}pthread)
                SET(ESPACE " ")
        endif(with_context MATCHES pthread)
        
@@ -28,15 +40,14 @@ if(HAVE_GTNETS)
        SET(SIMGRID_DEP_GTNETS "gtnets ")
 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  ${SIMGRID_DEP} ${SIMGRID_DEP_GTNETS}-fprofile-arcs)
+target_link_libraries(gras     ${GRAS_DEP} -fprofile-arcs)
+target_link_libraries(smpi     ${SMPI_DEP} -fprofile-arcs)
 
 ### Make EXEs
 
@@ -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}")