Logo AND Algorithmique Numérique Distribuée

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