Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[cmake] Fix foreach() loop for default values
[simgrid.git] / CMakeLists.txt
index 73b7e9b..30b2978 100644 (file)
@@ -186,21 +186,26 @@ include_directories(${INCLUDES})
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Option.cmake)
 
 ### Determine the assembly flavor that we need today
+set(HAVE_RAW_CONTEXTS 0)
 include(CMakeDetermineSystem)
 IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   IF(${ARCH_32_BITS})
     message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
     set(PROCESSOR_i686 1)
+    set(PROCESSOR_x86_64 0)
   ELSE()
     message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
+    set(PROCESSOR_i686 0)
     set(PROCESSOR_x86_64 1)
   ENDIF()
   if (WIN32)
-    message(STATUS "Disable fast raw contextes on Windows.")
+    message(STATUS "Disable fast raw contexts on Windows.")
   else()
     set(HAVE_RAW_CONTEXTS 1)
   endif()
-
+ELSE()
+  set(PROCESSOR_i686 0)
+  set(PROCESSOR_x86_64 0)
 ENDIF()
 
 include(CheckFunctionExists)
@@ -270,6 +275,7 @@ CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 CHECK_LIBRARY_EXISTS(pthread pthread_create          "" HAVE_PTHREAD)
 CHECK_LIBRARY_EXISTS(pthread sem_init                "" HAVE_SEM_INIT_LIB)
 CHECK_LIBRARY_EXISTS(pthread sem_open                "" HAVE_SEM_OPEN_LIB)
+set(HAVE_PTHREAD_SETAFFINITY 0)
 CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np  "" HAVE_PTHREAD_SETAFFINITY)
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
@@ -300,13 +306,34 @@ CHECK_FUNCTION_EXISTS(process_vm_readv HAVE_PROCESS_VM_READV)
 CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
 
 CHECK_SYMBOL_EXISTS(vasprintf stdio.h HAVE_VASPRINTF)
-if(MINGW) 
+if(MINGW)
   # The detection of vasprintf fails on MinGW, assumingly because it's
   # defined as an inline function in stdio.h instead of a regular
   # function. So force the result to be 1 despite of the test.
   set(HAVE_VASPRINTF 1)
 endif()
 
+foreach(var
+  HAVE_VALGRIND_H
+  HAVE_UNISTD_H
+  HAVE_EXECINFO_H
+  HAVE_SIGNAL_H
+  HAVE_SYS_PARAM_H
+  HAVE_SYS_SYSCTL_H
+  HAVE_UCONTEXT_H
+  HAVE_FUTEX_H
+  HAVE_GETTIMEOFDAY
+  HAVE_NANOSLEEP
+  HAVE_GETDTABLESIZE
+  HAVE_SYSCONF
+  HAVE_POPEN
+  HAVE_PROCESS_VM_READV
+  HAVE_MMAP
+  HAVE_VASPRINTF)
+  if(NOT DEFINED ${var})
+    set(${var} 0)
+  endif()
+endforeach()
 
 #Check if __thread is defined
 execute_process(
@@ -338,6 +365,8 @@ endif()
 
 if(enable_jedule)
   set(HAVE_JEDULE 1)
+else()
+  set(HAVE_JEDULE 0)
 endif()
 
 if(enable_mallocators)
@@ -371,6 +400,8 @@ if(enable_smpi)
     message (STATUS "Warning:  no support for SMPI automatic privatization on this platform")
     SET(HAVE_PRIVATIZATION 0)
   endif()
+else()
+  SET(HAVE_SMPI 0)
 endif()
 
 #--------------------------------------------------------------------------------------------------