Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add an icon to installer.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
1 set(CMAKE_MODULE_PATH 
2 ${CMAKE_MODULE_PATH}
3 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Modules
4 )
5
6 IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #Intel processor 64 bits
7    message(STATUS "System processor: amd64")
8    set(HAVE_RAWCTX 1)
9    
10 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86") #Intel processor 32 bits
11    message(STATUS "System processor: x86")
12    set(PROCESSOR_i686 1)
13    set(HAVE_RAWCTX 1)
14    
15 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
16     IF(${ARCH_32_BITS})
17         set(PROCESSOR_i686 1)
18         message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")
19     ELSE(${ARCH_32_BITS})
20         message(STATUS "System processor: amd64")
21         set(PROCESSOR_x86_64 1)
22         set(PROCESSOR_i686 0)
23     ENDIF(${ARCH_32_BITS})          
24     set(HAVE_RAWCTX 1)
25     
26 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha")
27     message(STATUS "System processor: alpha")
28     
29 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
30     # Subdir is "arm" for both big-endian (arm) and little-endian (armel).
31     message(STATUS "System processor: arm")
32     
33 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
34     # mips* machines are bi-endian mostly so processor does not tell
35     # endianess of the underlying system.
36     message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb")
37     
38 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64")
39     message(STATUS "System processor: ppc64")
40     
41 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
42     message(STATUS "System processor: ppc")
43     
44 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
45     # Both flavours can run on the same processor
46     message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9")
47     
48 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)")
49     message(STATUS "System processor: parisc" "parisc64")
50     
51 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
52     # s390 binaries can run on s390x machines
53     message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x")
54     
55 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh")
56     message(STATUS "System processor: sh")
57     
58 ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") #PROCESSOR NOT fIND
59     message(STATUS "PROCESSOR NOT FOUND: ${CMAKE_SYSTEM_PROCESSOR}")
60     
61 ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
62
63 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}")
64
65 include(CheckFunctionExists)
66 include(CheckTypeSize)
67 include(CheckIncludeFile)
68 include(CheckIncludeFiles)
69 include(CheckLibraryExists)
70 include(TestBigEndian)
71 TEST_BIG_ENDIAN(BIGENDIAN)
72
73 include(FindGraphviz)
74
75 string(TOUPPER ${enable_pcre} enable_pcre)
76 if(enable_pcre STREQUAL "AUTO" OR enable_pcre STREQUAL "ON")
77 include(FindPCRE)
78 endif(enable_pcre STREQUAL "AUTO" OR enable_pcre STREQUAL "ON")
79 set(HAVE_GTNETS 0)
80 if(enable_gtnets)       
81         include(FindGTnets)
82 endif(enable_gtnets)
83 if(enable_smpi)
84         include(FindF2c)
85 endif(enable_smpi)
86 if(enable_lua)
87         include(FindLua51Simgrid)
88 endif(enable_lua)
89 set(HAVE_NS3 0)
90 if(enable_ns3)
91         include(FindNS3)
92 endif(enable_ns3)
93
94 # Checks for header libraries functions.
95 CHECK_LIBRARY_EXISTS(pthread    pthread_create                  "" pthread)
96 CHECK_LIBRARY_EXISTS(pthread    sem_init                                "" HAVE_SEM_INIT_LIB)
97 CHECK_LIBRARY_EXISTS(pthread    sem_open                                "" HAVE_SEM_OPEN_LIB)
98 CHECK_LIBRARY_EXISTS(pthread    sem_timedwait                   "" HAVE_SEM_TIMEDWAIT_LIB)
99 CHECK_LIBRARY_EXISTS(pthread    pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
100 CHECK_LIBRARY_EXISTS(rt                 clock_gettime                   "" HAVE_POSIX_GETTIME)
101
102 CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME)
103 CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
104 CHECK_INCLUDE_FILE("pthread.h" HAVE_PTHREAD_H)
105 CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_VALGRIND_H)
106 CHECK_INCLUDE_FILE("socket.h" HAVE_SOCKET_H)
107 CHECK_INCLUDE_FILE("sys/socket.h" HAVE_SYS_SOCKET_H)
108 CHECK_INCLUDE_FILE("stat.h" HAVE_STAT_H)
109 CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
110 CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
111 CHECK_INCLUDE_FILE("winsock.h" HAVE_WINSOCK_H)
112 CHECK_INCLUDE_FILE("winsock2.h" HAVE_WINSOCK2_H)
113 CHECK_INCLUDE_FILE("WinDef.h" HAVE_WINDEF_H)
114 CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
115 CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
116 CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
117 CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H)
118 CHECK_INCLUDE_FILE("sys/time.h" HAVE_SYS_TIME_H)
119 CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
120 CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
121 CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
122 CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
123 CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
124 CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
125 CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
126 CHECK_INCLUDE_FILE("ucontext.h" HAVE_UCONTEXT_H)
127 CHECK_INCLUDE_FILE("stdio.h" HAVE_STDIO_H)
128 CHECK_INCLUDE_FILE("linux/futex.h" HAVE_FUTEX_H)
129
130 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
131 CHECK_FUNCTION_EXISTS(usleep HAVE_USLEEP)
132 CHECK_FUNCTION_EXISTS(getdtablesize HAVE_GETDTABLESIZE)
133 CHECK_FUNCTION_EXISTS(sysconf HAVE_SYSCONF)
134 CHECK_FUNCTION_EXISTS(readv HAVE_READV)
135 CHECK_FUNCTION_EXISTS(popen HAVE_POPEN)
136 CHECK_FUNCTION_EXISTS(signal HAVE_SIGNAL)
137 CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
138 CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
139 CHECK_FUNCTION_EXISTS(asprintf HAVE_ASPRINTF)
140 CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
141 CHECK_FUNCTION_EXISTS(makecontext HAVE_MAKECONTEXT)
142 CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
143 CHECK_FUNCTION_EXISTS(mergesort HAVE_MERGESORT)
144
145 #Check if __thread is defined
146 exec_program("${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_thread_storage.c" 
147                         OUTPUT_VARIABLE HAVE_thread_storage_run)
148 if(HAVE_thread_storage_run)
149         set(HAVE_THREAD_LOCAL_STORAGE 0)
150 else(HAVE_thread_storage_run)
151         set(HAVE_THREAD_LOCAL_STORAGE 1)
152 endif(HAVE_thread_storage_run)
153
154 # Our usage of mmap is Linux-specific (flag MAP_ANONYMOUS), but kFreeBSD uses a GNU libc
155 IF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU")
156   SET(HAVE_MMAP 0)
157   message(STATUS "Warning: MMAP is thought as non functional on this architecture (${CMAKE_SYSTEM})")
158 ENDIF(NOT "${CMAKE_SYSTEM}" MATCHES "Linux" AND NOT "${CMAKE_SYSTEM}" MATCHES "kFreeBSD" AND NOT "${CMAKE_SYSTEM}" MATCHES "GNU")
159
160 if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD...
161     set(HAVE_UCONTEXT_H 1)
162     set(HAVE_MAKECONTEXT 1)
163     set(HAVE_SNPRINTF 1)
164     set(HAVE_VSNPRINTF 1)
165 endif(WIN32)
166
167 set(CONTEXT_UCONTEXT 0)
168 SET(CONTEXT_THREADS 0)
169 SET(HAVE_TRACING 0)
170
171 if(enable_tracing)
172         SET(HAVE_TRACING 1)
173 endif(enable_tracing)
174
175 if(enable_jedule)
176         SET(HAVE_JEDULE 1)
177 endif(enable_jedule)
178
179 if(enable_latency_bound_tracking)
180         SET(HAVE_LATENCY_BOUND_TRACKING 1)
181 else(enable_latency_bound_tracking)
182   if(enable_gtnets)
183     message(STATUS "Warning : Turning latency_bound_tracking to ON because GTNeTs is ON")
184     SET(enable_latency_bound_tracking ON)
185     SET(HAVE_LATENCY_BOUND_TRACKING 1)
186   else(enable_gtnets)
187     SET(HAVE_LATENCY_BOUND_TRACKING 0)
188   endif(enable_gtnets)
189 endif(enable_latency_bound_tracking)
190
191 if(enable_model-checking AND HAVE_MMAP)
192         SET(HAVE_MC 1)
193         SET(MMALLOC_WANT_OVERIDE_LEGACY 1)
194 else(enable_model-checking AND HAVE_MMAP)
195         SET(HAVE_MC 0)
196         SET(MMALLOC_WANT_OVERIDE_LEGACY 0)
197 endif(enable_model-checking AND HAVE_MMAP)
198
199 #--------------------------------------------------------------------------------------------------
200 ### Check for some architecture dependent values
201 CHECK_TYPE_SIZE(int SIZEOF_INT)
202 CHECK_TYPE_SIZE(void* SIZEOF_VOIDP)
203
204
205 #--------------------------------------------------------------------------------------------------
206 ### Initialize of CONTEXT THREADS
207
208 if(pthread)
209         set(pthread 1)
210 elseif(pthread)
211         set(pthread 0)
212 endif(pthread)
213
214 if(pthread)
215         ### Test that we have a way to create semaphores
216         
217         if(HAVE_SEM_OPEN_LIB)
218                 exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_open.c -o testprog"
219                              OUTPUT_VARIABLE HAVE_SEM_OPEN_run)
220                 if(HAVE_SEM_OPEN_run)
221                         set(HAVE_SEM_OPEN 0)
222                 else(HAVE_SEM_OPEN_run)
223                         exec_program("./testprog" RETURN_VALUE HAVE_SEM_OPEN_run2 OUTPUT_VARIABLE var_compil)
224                         if(HAVE_SEM_OPEN_run2)
225                                 set(HAVE_SEM_OPEN 0)
226                         else(HAVE_SEM_OPEN_run2)
227                                 set(HAVE_SEM_OPEN 1)
228                         endif(HAVE_SEM_OPEN_run2)       
229                 endif(HAVE_SEM_OPEN_run)
230         else(HAVE_SEM_OPEN_LIB)
231                 set(HAVE_SEM_OPEN 0)
232         endif(HAVE_SEM_OPEN_LIB)
233
234         if(HAVE_SEM_INIT_LIB)
235                 exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_init.c -o testprog" 
236                              OUTPUT_VARIABLE HAVE_SEM_INIT_run)
237                 if(HAVE_SEM_INIT_run)
238                         set(HAVE_SEM_INIT 0)
239                 else(HAVE_SEM_INIT_run)
240                         exec_program("./testprog" RETURN_VALUE HAVE_SEM_INIT_run OUTPUT_VARIABLE var_compil)
241                         if(HAVE_SEM_INIT_run)
242                                 set(HAVE_SEM_INIT 0)
243                         else(HAVE_SEM_INIT_run)
244                                 set(HAVE_SEM_INIT 1)
245                         endif(HAVE_SEM_INIT_run)
246                 endif(HAVE_SEM_INIT_run)
247         else(HAVE_SEM_INIT_LIB)
248                 set(HAVE_SEM_INIT 0)
249         endif(HAVE_SEM_INIT_LIB)
250
251         if(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
252                 message(FATAL_ERROR "Semaphores are not usable, but they are mandatory to threads (you may need to mount /dev).")
253         endif(NOT HAVE_SEM_OPEN AND NOT HAVE_SEM_INIT)
254
255         ### Test that we have a way to timewait for semaphores
256
257         if(HAVE_SEM_TIMEDWAIT_LIB)
258                 exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_sem_timedwait.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
259                 if(HAVE_SEM_TIMEDWAIT_run)
260                         set(HAVE_SEM_TIMEDWAIT 0)
261                 else(HAVE_SEM_TIMEDWAIT_run)
262                         set(HAVE_SEM_TIMEDWAIT 1)
263                 endif(HAVE_SEM_TIMEDWAIT_run)
264         endif(HAVE_SEM_TIMEDWAIT_LIB)
265
266         ### HAVE_MUTEX_TIMEDLOCK
267
268         if(HAVE_MUTEX_TIMEDLOCK_LIB)
269                 exec_program("${CMAKE_C_COMPILER} -lpthread ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_mutex_timedlock.c" OUTPUT_VARIABLE HAVE_SEM_TIMEDWAIT_run)
270                 if(HAVE_MUTEX_TIMEDLOCK_run)
271                         set(HAVE_MUTEX_TIMEDLOCK 0)
272                 else(HAVE_MUTEX_TIMEDLOCK_run)
273                         set(HAVE_MUTEX_TIMEDLOCK 1)
274                 endif(HAVE_MUTEX_TIMEDLOCK_run)
275         endif(HAVE_MUTEX_TIMEDLOCK_LIB)
276 endif(pthread)
277
278 # AC_CHECK_MCSC(mcsc=yes, mcsc=no) 
279 set(mcsc_flags "")
280 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
281         set(mcsc_flags "-D_XOPEN_SOURCE")
282 endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
283
284 if(WIN32)
285     if(__VISUALC__)
286         set(mcsc_flags "/D_XBT_WIN32 /I${CMAKE_HOME_DIRECTORY}/include/xbt /I${CMAKE_HOME_DIRECTORY}/src/xbt")
287         endif(__VISUALC__)
288         if(__GNUC__)
289                 set(mcsc_flags "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
290         endif(__GNUC__)
291 endif(WIN32)
292
293 IF(CMAKE_CROSSCOMPILING)
294         IF(WIN32)
295                 set(windows_context "yes")
296                 set(IS_WINDOWS 1)       
297         ENDIF(WIN32)
298 ELSE(CMAKE_CROSSCOMPILING)
299         try_run(RUN_mcsc_VAR COMPILE_mcsc_VAR
300                 ${simgrid_BINARY_DIR}
301                 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
302                 COMPILE_DEFINITIONS "${mcsc_flags}"
303                 OUTPUT_VARIABLE var_compil
304                 )
305                 
306                 if(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
307                         file(READ "${simgrid_BINARY_DIR}/conftestval" mcsc)
308                         STRING(REPLACE "\n" "" mcsc "${mcsc}")
309                         if(mcsc)
310                                 set(mcsc "yes")
311                                 set(HAVE_UCONTEXT_H 1)
312                         else(mcsc)
313                                 set(mcsc "no")
314                         endif(mcsc)
315             else(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
316                         set(mcsc "no")
317                 endif(EXISTS "${simgrid_BINARY_DIR}/conftestval" AND COMPILE_mcsc_VAR)
318 ENDIF(CMAKE_CROSSCOMPILING)
319
320 if(mcsc MATCHES "no" AND pthread)
321         if(HAVE_WINDOWS_H)
322                 set(windows_context "yes")
323                 set(IS_WINDOWS 1)
324         elseif(HAVE_WINDOWS_H)
325                 message(FATAL_ERROR "no appropriate backend found")
326         endif(HAVE_WINDOWS_H)
327 endif(mcsc MATCHES "no" AND pthread)
328
329 #Only windows
330
331 if(WIN32)
332         if(NOT HAVE_WINDOWS_H)
333                 message(FATAL_ERROR "no appropriate backend found windows")
334         endif(NOT HAVE_WINDOWS_H)
335 endif(WIN32)
336
337 if(windows_context MATCHES "yes")
338         message(STATUS "Context change to windows")
339 endif(windows_context MATCHES "yes")
340
341 #If can have both context
342
343 if(mcsc)
344         set(CONTEXT_UCONTEXT 1)
345 endif(mcsc)
346
347 if(pthread)
348         set(CONTEXT_THREADS 1)
349 endif(pthread)
350
351
352 ###############
353 ## SVN version check
354 ##
355 exec_program("git remote" OUTPUT_VARIABLE remote RETURN_VALUE ret)
356 exec_program("git config --get remote.${remote}.url" OUTPUT_VARIABLE url RETURN_VALUE ret)
357
358 if(url)
359         exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log --oneline -1" OUTPUT_VARIABLE "GIT_VERSION")
360         message(STATUS "Git version: ${GIT_VERSION}")
361         exec_program("git --git-dir=${CMAKE_HOME_DIRECTORY}/.git log -n 1 --format=%ai ." OUTPUT_VARIABLE "GIT_DATE")
362         message(STATUS "Git date: ${GIT_DATE}")
363         string(REGEX REPLACE " .*" "" GIT_VERSION "${GIT_VERSION}")
364         STRING(REPLACE " +0000" "" GIT_DATE ${GIT_DATE})
365         STRING(REPLACE " " "~" GIT_DATE ${GIT_DATE})
366         STRING(REPLACE ":" "-" GIT_DATE ${GIT_DATE})
367 endif(url)
368
369
370 ###################################
371 ## SimGrid and GRAS specific checks
372 ##
373
374 IF(NOT CMAKE_CROSSCOMPILING)
375 # Check architecture signature begin
376 try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
377         ${simgrid_BINARY_DIR}
378         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_GRAS_ARCH.c
379         RUN_OUTPUT_VARIABLE var1
380         )
381 if(BIGENDIAN)
382   set(val_big "B${var1}")
383   set(GRAS_BIGENDIAN 1)
384 else(BIGENDIAN)
385   set(val_big "l${var1}")
386   set(GRAS_BIGENDIAN 0)
387 endif(BIGENDIAN)
388
389 SET(GRAS_THISARCH "none")
390
391 if(val_big MATCHES "l_C:1/1:_I:2/1:4/1:4/1:8/1:_P:4/1:4/1:_D:4/1:8/1:")
392         #gras_arch=0; gras_size=32; gras_arch_name=little32_1;
393         SET(GRAS_ARCH_32_BITS 1)
394         SET(GRAS_THISARCH 0)
395 endif(val_big MATCHES "l_C:1/1:_I:2/1:4/1:4/1:8/1:_P:4/1:4/1:_D:4/1:8/1:")
396 if(val_big MATCHES "l_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:")
397         #gras_arch=1; gras_size=32; gras_arch_name=little32_2;
398         SET(GRAS_ARCH_32_BITS 1)
399         SET(GRAS_THISARCH 1)
400 endif(val_big MATCHES "l_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:")
401 if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:") 
402         #gras_arch=2; gras_size=32; gras_arch_name=little32_4;
403         SET(GRAS_ARCH_32_BITS 1)
404         SET(GRAS_THISARCH 2)
405 endif(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:")
406 if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:") 
407         #gras_arch=3; gras_size=32; gras_arch_name=little32_8;
408         SET(GRAS_ARCH_32_BITS 1)
409         SET(GRAS_THISARCH 3)
410 endif(val_big MATCHES "l_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:") 
411 if(val_big MATCHES "l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:") 
412         #gras_arch=4; gras_size=64; gras_arch_name=little64;
413         SET(GRAS_ARCH_32_BITS 0)
414         SET(GRAS_THISARCH 4)
415 endif(val_big MATCHES "l_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
416
417 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:") 
418         #gras_arch=5; gras_size=32; gras_arch_name=big32;
419         SET(GRAS_ARCH_32_BITS 1)
420         SET(GRAS_THISARCH 5)
421 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/8:")
422 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:") 
423         #gras_arch=6; gras_size=32; gras_arch_name=big32_8_4;
424         SET(GRAS_ARCH_32_BITS 1)
425         SET(GRAS_THISARCH 6)
426 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/8:_P:4/4:4/4:_D:4/4:8/4:")
427 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:") 
428         #gras_arch=7; gras_size=32; gras_arch_name=big32_4;
429         SET(GRAS_ARCH_32_BITS 1)
430         SET(GRAS_THISARCH 7)
431 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:4/4:8/4:_P:4/4:4/4:_D:4/4:8/4:")
432 if(val_big MATCHES "B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:") 
433         #gras_arch=8; gras_size=32; gras_arch_name=big32_2;
434         SET(GRAS_ARCH_32_BITS 1)
435         SET(GRAS_THISARCH 8)
436 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/2:4/2:8/2:_P:4/2:4/2:_D:4/2:8/2:") 
437 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:") 
438         #gras_arch=9; gras_size=64; gras_arch_name=big64;
439         SET(GRAS_ARCH_32_BITS 0)
440         SET(GRAS_THISARCH 9)
441 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/8:")
442 if(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4:") 
443         #gras_arch=10;gras_size=64; gras_arch_name=big64_8_4;
444         SET(GRAS_ARCH_32_BITS 0)
445         SET(GRAS_THISARCH 10)
446 endif(val_big MATCHES "B_C:1/1:_I:2/2:4/4:8/8:8/8:_P:8/8:8/8:_D:4/4:8/4:") 
447
448 if(GRAS_THISARCH MATCHES "none")
449     message(STATUS "architecture: ${val_big}")
450     message(FATAL_ERROR "GRAS_THISARCH is empty: '${GRAS_THISARCH}'")  
451 endif(GRAS_THISARCH MATCHES "none")
452
453 # Check architecture signature end
454 try_run(RUN_GRAS_VAR COMPILE_GRAS_VAR
455         ${simgrid_BINARY_DIR}
456         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_GRAS_CHECK_STRUCT_COMPACTION.c
457         RUN_OUTPUT_VARIABLE var2
458         )
459 separate_arguments(var2)
460 foreach(var_tmp ${var2})
461         set(${var_tmp} 1)
462 endforeach(var_tmp ${var2})
463
464 # Check for [SIZEOF_MAX]
465 try_run(RUN_SM_VAR COMPILE_SM_VAR
466         ${simgrid_BINARY_DIR}
467         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_max_size.c
468         RUN_OUTPUT_VARIABLE var3
469         )
470 SET(SIZEOF_MAX ${var3})
471 ENDIF(NOT CMAKE_CROSSCOMPILING)
472
473 #--------------------------------------------------------------------------------------------------
474
475 set(makecontext_CPPFLAGS_2 "")
476 if(HAVE_MAKECONTEXT OR WIN32)
477         set(makecontext_CPPFLAGS "-DTEST_makecontext")
478         if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
479                 set(makecontext_CPPFLAGS_2 "-D_XOPEN_SOURCE")
480         endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
481         
482     if(WIN32 AND __VISUALC__)
483         set(makecontext_CPPFLAGS "/DTEST_makecontext")
484             set(makecontext_CPPFLAGS_2 "/D_XBT_WIN32 /I${CMAKE_HOME_DIRECTORY}/include/xbt /I${CMAKE_HOME_DIRECTORY}/src/xbt")
485         endif(WIN32 AND __VISUALC__)
486         if(WIN32 AND __GNUC__)
487             set(makecontext_CPPFLAGS "-DTEST_makecontext")
488             set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
489         endif(WIN32 AND __GNUC__)
490         
491         try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
492                 ${simgrid_BINARY_DIR}
493                 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_stacksetup.c
494                 COMPILE_DEFINITIONS "${makecontext_CPPFLAGS} ${makecontext_CPPFLAGS_2}"
495                 )
496         file(READ ${simgrid_BINARY_DIR}/conftestval MAKECONTEXT_ADDR_SIZE)
497         string(REPLACE "\n" "" MAKECONTEXT_ADDR_SIZE "${MAKECONTEXT_ADDR_SIZE}")
498         string(REGEX MATCH ;^.*,;MAKECONTEXT_ADDR "${MAKECONTEXT_ADDR_SIZE}")
499         string(REGEX MATCH ;,.*$; MAKECONTEXT_SIZE "${MAKECONTEXT_ADDR_SIZE}")
500         string(REPLACE "," "" makecontext_addr "${MAKECONTEXT_ADDR}")
501         string(REPLACE "," "" makecontext_size "${MAKECONTEXT_SIZE}")   
502         set(pth_skaddr_makecontext "#define pth_skaddr_makecontext(skaddr,sksize) (${makecontext_addr})")
503         set(pth_sksize_makecontext "#define pth_sksize_makecontext(skaddr,sksize) (${makecontext_size})")
504         
505 endif(HAVE_MAKECONTEXT OR WIN32)
506
507 #--------------------------------------------------------------------------------------------------
508
509 ### check for stackgrowth
510 if (NOT CMAKE_CROSSCOMPILING)
511         try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
512                 ${simgrid_BINARY_DIR}
513                 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_stackgrowth.c
514                 )
515 file(READ "${simgrid_BINARY_DIR}/conftestval" stack)
516 if(stack MATCHES "down")
517         set(PTH_STACKGROWTH "-1")
518 endif(stack MATCHES "down")
519 if(stack MATCHES "up")
520         set(PTH_STACKGROWTH "1")
521 endif(stack MATCHES "up")
522
523 endif(NOT CMAKE_CROSSCOMPILING)
524 ###############
525 ## System checks
526 ##
527
528 #SG_CONFIGURE_PART([System checks...])
529 #AC_PROG_CC(xlC gcc cc) -auto
530 #AM_SANITY_CHECK -auto
531
532 #AC_PROG_MAKE_SET
533
534
535 #AC_PRINTF_NULL
536 try_run(RUN_PRINTF_NULL_VAR COMPILE_PRINTF_NULL_VAR
537         ${simgrid_BINARY_DIR}
538         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_printf_null.c
539         )
540
541 if(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
542 SET(PRINTF_NULL_WORKING "0")
543 else(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
544 SET(PRINTF_NULL_WORKING "1")
545 endif(RUN_PRINTF_NULL_VAR MATCHES "FAILED_TO_RUN")
546
547 #AC_CHECK_VA_COPY
548
549 set(diff_va "va_copy((d),(s))"
550 "VA_COPY((d),(s))"
551 "__va_copy((d),(s))"
552 "__builtin_va_copy((d),(s))"
553 "do { (d) = (s)\; } while (0)"
554 "do { *(d) = *(s)\; } while (0)"
555 "memcpy((void *)&(d), (void *)&(s), sizeof(s))"
556 "memcpy((void *)(d), (void *)(s), sizeof(*(s)))"
557 )
558
559 foreach(fct ${diff_va})
560         write_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c" "#include <stdlib.h>
561         #include <stdarg.h>
562         #include <string.h>
563         #define DO_VA_COPY(d,s) ${fct}
564         void test(char *str, ...)
565         {
566             va_list ap, ap2;
567             int i;
568             va_start(ap, str);
569             DO_VA_COPY(ap2, ap);
570             for (i = 1; i <= 9; i++) {
571                 int k = (int)va_arg(ap, int);
572                 if (k != i)
573                     abort();
574             }
575             DO_VA_COPY(ap, ap2);
576             for (i = 1; i <= 9; i++) {
577                 int k = (int)va_arg(ap, int);
578                 if (k != i)
579                     abort();
580             }
581             va_end(ap);
582         }
583         int main(void)
584         {
585             test(\"test\", 1, 2, 3, 4, 5, 6, 7, 8, 9);
586             exit(0);
587         }"
588         )
589         try_compile(COMPILE_VA_NULL_VAR
590         ${simgrid_BINARY_DIR}
591         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_va_copy.c
592         )
593         if(COMPILE_VA_NULL_VAR)
594                 string(REGEX REPLACE "\;" "" fctbis ${fct})
595                 if(${fctbis} STREQUAL "va_copy((d),(s))")
596                         set(HAVE_VA_COPY 1)
597                         set(ac_cv_va_copy "C99")
598                         set(__VA_COPY_USE_C99 "va_copy((d),(s))")       
599                 endif(${fctbis} STREQUAL "va_copy((d),(s))")
600
601                 if(${fctbis} STREQUAL "VA_COPY((d),(s))")
602                         set(ac_cv_va_copy "GCM")
603                         set(__VA_COPY_USE_GCM "VA_COPY((d),(s))")
604                 endif(${fctbis} STREQUAL "VA_COPY((d),(s))")
605
606                 if(${fctbis} STREQUAL "__va_copy((d),(s))")
607                         set(ac_cv_va_copy "GCH")
608                         set(__VA_COPY_USE_GCH "__va_copy((d),(s))")
609                 endif(${fctbis} STREQUAL "__va_copy((d),(s))")
610
611                 if(${fctbis} STREQUAL "__builtin_va_copy((d),(s))")
612                         set(ac_cv_va_copy "GCB")
613                         set(__VA_COPY_USE_GCB "__builtin_va_copy((d),(s))")
614                 endif(${fctbis} STREQUAL "__builtin_va_copy((d),(s))")
615
616                 if(${fctbis} STREQUAL "do { (d) = (s) } while (0)")
617                         set(ac_cv_va_copy "ASS")
618                         set(__VA_COPY_USE_ASS "do { (d) = (s); } while (0)")
619                 endif(${fctbis} STREQUAL "do { (d) = (s) } while (0)")
620
621                 if(${fctbis} STREQUAL "do { *(d) = *(s) } while (0)")
622                         set(ac_cv_va_copy "ASP")
623                         set(__VA_COPY_USE_ASP "do { *(d) = *(s); } while (0)")
624                 endif(${fctbis} STREQUAL "do { *(d) = *(s) } while (0)")
625
626                 if(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s), sizeof(s))")
627                         set(ac_cv_va_copy "CPS")
628                         set(__VA_COPY_USE_CPS "memcpy((void *)&(d), (void *)&(s), sizeof(s))")
629                 endif(${fctbis} STREQUAL "memcpy((void *)&(d), (void *)&(s), sizeof(s))")
630
631                 if(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s), sizeof(*(s)))")
632                         set(ac_cv_va_copy "CPP")
633                         set(__VA_COPY_USE_CPP "memcpy((void *)(d), (void *)(s), sizeof(*(s)))")
634                 endif(${fctbis} STREQUAL "memcpy((void *)(d), (void *)(s), sizeof(*(s)))")
635                                 
636                 if(NOT STATUS_OK)
637                 set(__VA_COPY_USE "__VA_COPY_USE_${ac_cv_va_copy}(d, s)")
638                 endif(NOT STATUS_OK)
639                 set(STATUS_OK "1")
640                 
641         endif(COMPILE_VA_NULL_VAR)
642         
643 endforeach(fct ${diff_va})
644
645 #--------------------------------------------------------------------------------------------------
646 ### check for getline
647 try_compile(COMPILE_RESULT_VAR
648         ${simgrid_BINARY_DIR}
649         ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_getline.c
650         )
651
652 if(NOT COMPILE_RESULT_VAR)
653 SET(need_getline "#define SIMGRID_NEED_GETLINE 1")
654 SET(SIMGRID_NEED_GETLINE 1)
655 else(NOT COMPILE_RESULT_VAR)
656 SET(need_getline "")
657 SET(SIMGRID_NEED_GETLINE 0)
658 endif(NOT COMPILE_RESULT_VAR)
659
660 ### check for a working snprintf
661 if(HAVE_SNPRINTF AND HAVE_VSNPRINTF OR WIN32)
662     if(WIN32)
663         #set(HAVE_SNPRINTF 1)
664         #set(HAVE_VSNPRINTF 1)
665     endif(WIN32)
666     
667         if(CMAKE_CROSSCOMPILING)
668                 set(RUN_SNPRINTF_FUNC "cross")
669                 #set(PREFER_PORTABLE_SNPRINTF 1)
670         else(CMAKE_CROSSCOMPILING)
671             try_run(RUN_SNPRINTF_FUNC_VAR COMPILE_SNPRINTF_FUNC_VAR
672                 ${simgrid_BINARY_DIR}
673                 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_snprintf.c
674             )   
675         endif(CMAKE_CROSSCOMPILING)
676
677         if(CMAKE_CROSSCOMPILING)
678                 set(RUN_VSNPRINTF_FUNC "cross")
679                 set(PREFER_PORTABLE_VSNPRINTF 1)
680         else(CMAKE_CROSSCOMPILING)
681            try_run(RUN_VSNPRINTF_FUNC_VAR COMPILE_VSNPRINTF_FUNC_VAR
682                 ${simgrid_BINARY_DIR}
683                 ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_vsnprintf.c
684            )
685         endif(CMAKE_CROSSCOMPILING)
686         
687         set(PREFER_PORTABLE_SNPRINTF 0)
688         if(RUN_VSNPRINTF_FUNC_VAR MATCHES "FAILED_TO_RUN")
689                 set(PREFER_PORTABLE_SNPRINTF 1)
690         endif(RUN_VSNPRINTF_FUNC_VAR MATCHES "FAILED_TO_RUN")
691         if(RUN_SNPRINTF_FUNC_VAR MATCHES "FAILED_TO_RUN")
692                 set(PREFER_PORTABLE_SNPRINTF 1)
693         endif(RUN_SNPRINTF_FUNC_VAR MATCHES "FAILED_TO_RUN")
694 endif(HAVE_SNPRINTF AND HAVE_VSNPRINTF OR WIN32)
695
696 ### check for asprintf function familly
697 if(HAVE_ASPRINTF)
698         SET(simgrid_need_asprintf "")
699         SET(NEED_ASPRINTF 0)
700 else(HAVE_ASPRINTF)
701         SET(simgrid_need_asprintf "#define SIMGRID_NEED_ASPRINTF 1")
702         SET(NEED_ASPRINTF 1)
703 endif(HAVE_ASPRINTF)
704
705 if(HAVE_VASPRINTF)
706         SET(simgrid_need_vasprintf "")
707         SET(NEED_VASPRINTF 0)
708 else(HAVE_VASPRINTF)
709         SET(simgrid_need_vasprintf "#define SIMGRID_NEED_VASPRINTF 1")
710         SET(NEED_VASPRINTF 1)
711 endif(HAVE_VASPRINTF)
712
713 ### check for addr2line
714
715 find_path(ADDR2LINE NAMES addr2line     PATHS NO_DEFAULT_PATHS  )
716 if(ADDR2LINE)
717 set(ADDR2LINE "${ADDR2LINE}/addr2line")
718 endif(ADDR2LINE)
719
720
721
722 ### Check if OSX can compile with ucontext (with gcc 4.[1-5] it is broken)
723 if(APPLE)
724     if(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
725         message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)")
726         set(HAVE_UCONTEXT_H 0)
727     endif(APPLE_NEED_GCC_VERSION GREATER COMPILER_C_VERSION_MAJOR_MINOR)
728 endif(APPLE)
729
730 ### File to create
731
732 configure_file("${CMAKE_HOME_DIRECTORY}/src/context_sysv_config.h.in"                   "${CMAKE_BINARY_DIR}/src/context_sysv_config.h" @ONLY IMMEDIATE)
733
734 SET( CMAKEDEFINE "#cmakedefine" )
735 configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/gras_config.h.in"      "${CMAKE_BINARY_DIR}/src/gras_config.h" @ONLY IMMEDIATE)
736 configure_file("${CMAKE_BINARY_DIR}/src/gras_config.h"                  "${CMAKE_BINARY_DIR}/src/gras_config.h" @ONLY IMMEDIATE)
737 configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in"            "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE)
738
739 set(top_srcdir "${CMAKE_HOME_DIRECTORY}")
740 set(srcdir "${CMAKE_HOME_DIRECTORY}/src")
741
742 set(exec_prefix ${CMAKE_INSTALL_PREFIX})
743 set(includedir ${CMAKE_INSTALL_PREFIX}/include)
744 set(top_builddir ${CMAKE_HOME_DIRECTORY})
745 set(libdir ${exec_prefix}/lib)
746 set(CMAKE_LINKARGS "${CMAKE_BINARY_DIR}/lib")
747 set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:${GTNETS_LIB_PATH}:${HAVE_NS3_LIB}:$LD_LIBRARY_PATH")
748
749 configure_file(${CMAKE_HOME_DIRECTORY}/include/smpi/smpif.h.in ${CMAKE_BINARY_DIR}/include/smpi/smpif.h @ONLY)
750 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpicc.in ${CMAKE_BINARY_DIR}/bin/smpicc @ONLY)
751 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpif2c.in ${CMAKE_BINARY_DIR}/bin/smpif2c @ONLY)
752 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpiff.in ${CMAKE_BINARY_DIR}/bin/smpiff @ONLY)
753 configure_file(${CMAKE_HOME_DIRECTORY}/src/smpi/smpirun.in ${CMAKE_BINARY_DIR}/bin/smpirun @ONLY)
754
755 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc" OUTPUT_VARIABLE OKITOKI)
756 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c" OUTPUT_VARIABLE OKITOKI)
757 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff" OUTPUT_VARIABLE OKITOKI)
758 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE OKITOKI)
759
760 set(generated_headers_to_install
761         ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
762         ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
763 )
764
765 set(generated_headers
766     ${CMAKE_CURRENT_BINARY_DIR}/src/context_sysv_config.h
767     ${CMAKE_CURRENT_BINARY_DIR}/src/gras_config.h
768 )
769
770 set(generated_files_to_clean
771 ${generated_headers}
772 ${generated_headers_to_install}
773 ${CMAKE_BINARY_DIR}/bin/smpicc
774 ${CMAKE_BINARY_DIR}/bin/smpif2c
775 ${CMAKE_BINARY_DIR}/bin/smpiff
776 ${CMAKE_BINARY_DIR}/bin/smpirun
777 ${CMAKE_BINARY_DIR}/bin/colorize
778 ${CMAKE_BINARY_DIR}/bin/simgrid_update_xml
779 ${CMAKE_BINARY_DIR}/examples/smpi/smpi_traced.trace
780 ${CMAKE_BINARY_DIR}/src/supernovae_sg.c
781 ${CMAKE_BINARY_DIR}/src/supernovae_gras.c
782 ${CMAKE_BINARY_DIR}/src/supernovae_smpi.c
783 )
784
785 if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
786 else("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
787         configure_file(${CMAKE_HOME_DIRECTORY}/examples/smpi/hostfile ${CMAKE_BINARY_DIR}/examples/smpi/hostfile COPYONLY)
788         configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml COPYONLY)
789         configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/small_platform_with_routers.xml ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml COPYONLY)
790         configure_file(${CMAKE_HOME_DIRECTORY}/examples/msg/tracing/platform.xml ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml COPYONLY)
791         
792         set(generated_files_to_clean
793                 ${generated_files_to_clean}
794                 ${CMAKE_BINARY_DIR}/examples/smpi/hostfile
795                 ${CMAKE_BINARY_DIR}/examples/msg/small_platform.xml
796                 ${CMAKE_BINARY_DIR}/examples/msg/small_platform_with_routers.xml
797                 ${CMAKE_BINARY_DIR}/examples/msg/tracing/platform.xml
798                 )
799 endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
800
801 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
802 "${generated_files_to_clean}")
803
804
805 IF(${ARCH_32_BITS})
806   set(WIN_ARCH "32")
807 ELSE(${ARCH_32_BITS})
808     set(WIN_ARCH "64")
809 ENDIF(${ARCH_32_BITS})
810 configure_file("${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/simgrid.nsi.in"        "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)