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
1 ### Make Libs
2
3 if(supernovae)
4         include(${PROJECT_DIRECTORY}/CPACK/src/CMakeSupernovae.txt)
5 else(supernovae)
6         add_library(msg STATIC ${MSG_SRC_bis})
7         add_library(simgrid STATIC ${simgrid_sources})
8         add_library(gras SHARED ${gras_sources})
9         add_library(smpi STATIC ${SMPI_SRC})
10 endif(supernovae)
11
12 set(GRAS_DEP "pthread")
13 set(SIMGRID_DEP "ruby1.8")
14 set(SMPI_DEP "")
15 set(MSG_DEP "pthread -lrt -ldl -lcrypt -lm -lc")
16
17 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
18         add_definitions("-D_XOPEN_SOURCE")
19 endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
20
21
22 if(pthread)
23         if(with_context MATCHES pthread)
24                 SET(SIMGRID_DEP "${SIMGRID_DEP} -lpthread")
25         endif(with_context MATCHES pthread)
26         
27         if(with_context MATCHES windows)
28                 SET(GRAS_DEP "msg")
29         endif(with_context MATCHES windows)
30 endif(pthread)
31
32 if(HAVE_LUA)
33         SET(SIMGRID_DEP "${SIMGRID_DEP} -ldl -llua5.1")
34 endif(HAVE_LUA)
35
36 if(HAVE_GTNETS)
37         SET(SIMGRID_DEP "${SIMGRID_DEP} -lgtnets")
38 endif(HAVE_GTNETS)
39
40 ### Add definitions for compile
41 #set(CMAKE_CXX_FLAGS "-fprofile-arcs -ftest-coverage")
42 #set(CMAKE_C_FLAGS "-fprofile-arcs -ftest-coverage")
43
44 #add_definitions (-fprofile-arcs -ftest-coverage)
45 target_link_libraries(simgrid   msg ${SIMGRID_DEP} -fprofile-arcs)
46 target_link_libraries(gras      msg ${GRAS_DEP} -fprofile-arcs)
47 target_link_libraries(smpi      simgrid ${SMPI_DEP} -fprofile-arcs)
48 target_link_libraries(msg       ${MSG_DEP} -fprofile-arcs)
49 ### Make EXEs
50
51 #tools
52 #tools/tesh
53 add_subdirectory(${PROJECT_DIRECTORY}/tools/tesh)
54
55 #tools/gras
56 add_subdirectory(${PROJECT_DIRECTORY}/tools/gras)
57
58 if(NOT init)
59         #testsuite/xbt
60         add_subdirectory(${PROJECT_DIRECTORY}/testsuite/xbt)
61
62         #testsuite/surf
63         add_subdirectory(${PROJECT_DIRECTORY}/testsuite/surf)
64
65         #testsuite/simdag
66         add_subdirectory(${PROJECT_DIRECTORY}/testsuite/simdag)
67
68         #teshsuite
69         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/xbt)
70         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/datadesc)
71         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/msg_handle)
72         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/empty_main)
73         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/gras/small_sleep)
74         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag)
75         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/network)
76         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/network/p2p)
77         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/network/mxn)
78         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/partask)
79         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/simdag/platforms)
80         add_subdirectory(${PROJECT_DIRECTORY}/teshsuite/msg)
81
82         #examples
83         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/ping)
84         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/rpc)
85         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/spawn)
86         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/timer)
87         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/chrono)
88         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/mutual_exclusion/simple_token)
89         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/mmrpc)
90         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/all2all)
91         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/pmm)
92         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/synchro)
93         add_subdirectory(${PROJECT_DIRECTORY}/examples/gras/properties)
94
95         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/properties)
96         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/actions)
97         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/migration)
98         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/sendrecv)
99         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/suspend)
100         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/parallel_task)
101         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/priority)
102         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/masterslave)
103         add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/trace)
104         if(HAVE_GTNETS)
105                 add_definitions("-lgtnets -L${gtnets_path}/lib -I${gtnets_path}/include/gtnets")
106                 add_subdirectory(${PROJECT_DIRECTORY}/examples/msg/gtnets)
107         endif(HAVE_GTNETS)
108
109         add_subdirectory(${PROJECT_DIRECTORY}/examples/amok/bandwidth)
110         add_subdirectory(${PROJECT_DIRECTORY}/examples/amok/saturate)
111
112         add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag)
113         add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/dax)
114         add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/metaxml)
115         add_subdirectory(${PROJECT_DIRECTORY}/examples/simdag/properties)
116         add_subdirectory(${PROJECT_DIRECTORY}/examples/smpi)
117
118         if(HAVE_JAVA)
119                 message("Make : src/simgrid.jar with : ${JAVA_COMPILE}")
120                 exec_program("rm -rf ${PROJECT_DIRECTORY}/src/.classes" OUTPUT_VARIABLE "SIM_JAR_OK")
121                 exec_program("mkdir ${PROJECT_DIRECTORY}/src/.classes" OUTPUT_VARIABLE "SIM_JAR_OK")
122                 exec_program("${JAVA_COMPILE}" ARGS "-d ${PROJECT_DIRECTORY}/src/.classes -cp ${PROJECT_DIRECTORY}/src/.classes ${PROJECT_DIRECTORY}/src/java/simgrid/msg/*.java" OUTPUT_VARIABLE "SIM_JAR_OK")
123                 exec_program("mkdir ${PROJECT_DIRECTORY}/src/.classes/surf" OUTPUT_VARIABLE "SIM_JAR_OK")
124                 exec_program("cp ${PROJECT_DIRECTORY}/src/surf/simgrid.dtd ${PROJECT_DIRECTORY}/src/.classes/surf/simgrid.dtd" OUTPUT_VARIABLE "SIM_JAR_OK")
125                 exec_program("${JAVA_ARCHIVE}" ARGS "cvf ./src/simgrid.jar -C ${PROJECT_DIRECTORY}/src/.classes ." OUTPUT_VARIABLE "SIM_JAR_OK")
126
127                 message("Make examples/java with : ${JAVA_COMPILE}")
128                 exec_program("rm ${PROJECT_DIRECTORY}/examples/java/basic/*.class" OUTPUT_VARIABLE "SIM_JAR_OK")
129                 exec_program("${JAVA_COMPILE}" ARGS "-d ${PROJECT_DIRECTORY}/examples/java/basic -cp ${PROJECT_DIRECTORY}/src/.classes ${PROJECT_DIRECTORY}/examples/java/basic/*.java"  OUTPUT_VARIABLE "SIM_JAR_OK")
130                 exec_program("rm ${PROJECT_DIRECTORY}/examples/java/ping_pong/*.class" OUTPUT_VARIABLE "SIM_JAR_OK")
131                 exec_program("${JAVA_COMPILE}" ARGS "-d ${PROJECT_DIRECTORY}/examples/java/ping_pong -cp ${PROJECT_DIRECTORY}/src/.classes ${PROJECT_DIRECTORY}/examples/java/ping_pong/*.java"  OUTPUT_VARIABLE "SIM_JAR_OK")
132                 exec_program("rm ${PROJECT_DIRECTORY}/examples/java/comm_time/*.class" OUTPUT_VARIABLE "SIM_JAR_OK")
133                 exec_program("${JAVA_COMPILE}" ARGS "-d ${PROJECT_DIRECTORY}/examples/java/comm_time -cp ${PROJECT_DIRECTORY}/src/.classes ${PROJECT_DIRECTORY}/examples/java/comm_time/*.java"  OUTPUT_VARIABLE "SIM_JAR_OK")
134                 exec_program("rm ${PROJECT_DIRECTORY}/examples/java/suspend/*.class" OUTPUT_VARIABLE "SIM_JAR_OK")
135                 exec_program("${JAVA_COMPILE}" ARGS "-d ${PROJECT_DIRECTORY}/examples/java/suspend -cp ${PROJECT_DIRECTORY}/src/.classes ${PROJECT_DIRECTORY}/examples/java/suspend/*.java"  OUTPUT_VARIABLE "SIM_JAR_OK")
136
137         endif(HAVE_JAVA)
138
139 endif(NOT init)