Logo AND Algorithmique Numérique Distribuée

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