Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix indentation to please gcc 6
[simgrid.git] / CMakeLists.txt
index 045a76d..be8918f 100644 (file)
@@ -182,15 +182,6 @@ if(WIN32)
   set(INCLUDES ${INCLUDES} ${CMAKE_INCLUDE_WIN})
   unset(CMAKE_INCLUDE_WIN)
 
-  find_program(NSIS_PROGRAM NAMES makensi)
-  set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITEW6432})
-  if(NSIS_WIN_VERSION MATCHES "")
-    set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITECTURE})
-  endif()
-  if(${NSIS_WIN_VERSION})
-    string(TOLOWER ${NSIS_WIN_VERSION} NSIS_WIN_VERSION)
-  endif()
-
   set(_XBT_WIN32 1)
 
   message(STATUS "C_COMPILER                    ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_VERSION}")
@@ -223,7 +214,7 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   if (MSVC)
     message(STATUS "Disable fast raw contextes on Microsoft Visual.")
   else()
-    set(HAVE_RAWCTX 1)
+    set(HAVE_RAW_CONTEXTS 1)
   endif()
 
 ENDIF()
@@ -268,41 +259,38 @@ else()
   endif()
 endif()
 
-# Try again to see if we have libboost-context, 
-# but only if the lib is not embeeded in the jar file to reduce the dependencies from the Java point of view
-if(enable_lib_in_jar)
-  message("   (do not check for boost-context as you are building a full jarfile)")
-  set(HAVE_BOOST_CONTEXT 0)
-else()
-  find_package(Boost 1.42 COMPONENTS context)
-  set(Boost_FOUND 1) # We don't care of whether this component is missing
-
-  if(Boost_FOUND AND Boost_CONTEXT_FOUND)
-    # We should use feature detection for this instead:
-    if (Boost_VERSION LESS 105600)
-      message("Found Boost.Context API v1")
-      set(HAVE_BOOST_CONTEXT 1)
-    else()
-      message("Found Boost.Context API v2")
-      set(HAVE_BOOST_CONTEXT 2)
-    endif()
+# Try again to see if we have libboost-context
+find_package(Boost 1.42 COMPONENTS context)
+set(Boost_FOUND 1) # We don't care of whether this component is missing
+
+if(Boost_FOUND AND Boost_CONTEXT_FOUND)
+  # We should use feature detection for this instead:
+  if (Boost_VERSION LESS 105600)
+    message("Found Boost.Context API v1")
+    set(HAVE_BOOST_CONTEXTS 1)
   else()
-    message ("   boost        : found.")
-    message ("   boost-context: missing. Install libboost-context-dev for this optional feature.")
-    set(HAVE_BOOST_CONTEXT 0)
+    message("Found Boost.Context API v2")
+    set(HAVE_BOOST_CONTEXTS 2)
   endif()
+else()
+  message ("   boost        : found.")
+  message ("   boost-context: missing. Install libboost-context-dev for this optional feature.")
+  set(HAVE_BOOST_CONTEXTS 0)
 endif()
 
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(dl      dlopen                  "" HAVE_DLOPEN_IN_LIBDL)
 CHECK_LIBRARY_EXISTS(execinfo backtrace              "" HAVE_BACKTRACE_IN_LIBEXECINFO)
-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)
-CHECK_LIBRARY_EXISTS(pthread sem_timedwait           "" HAVE_SEM_TIMEDWAIT_LIB)
-CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
 
+if(NOT WIN32) # We don't want to have winpthread-1.dll in the jarfile
+  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)
+  CHECK_LIBRARY_EXISTS(pthread sem_timedwait           "" HAVE_SEM_TIMEDWAIT_LIB)
+  CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB)
+endif()
+
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
 elseif(MINGW)
@@ -395,8 +383,8 @@ if(WIN32) # Those files are not detected despite being present
   set(HAVE_MAKECONTEXT 1)
 endif()
 
-set(CONTEXT_UCONTEXT 0)
-set(CONTEXT_THREADS 0)
+set(HAVE_UCONTEXT_CONTEXTS 0)
+set(HAVE_THREAD_CONTEXTS 0)
 
 if(enable_jedule)
   set(HAVE_JEDULE 1)
@@ -437,6 +425,9 @@ if(enable_smpi)
   elseif("${CMAKE_SYSTEM}" MATCHES "^FreeBSD")
     SET(USE_LIBUTIL 0)
     SET(HAVE_PRIVATIZATION 0)
+  else()
+    message (STATUS "Warning:  no support for SMPI automatic privatization on this platform")
+    SET(HAVE_PRIVATIZATION 0)
   endif()
 endif()
 
@@ -635,12 +626,12 @@ endif()
 #If can have both context
 
 if(HAVE_UCONTEXT)
-  set(CONTEXT_UCONTEXT 1)
+  set(HAVE_UCONTEXT_CONTEXTS 1)
   message("-- Support for ucontext factory")
 endif()
 
 if(HAVE_PTHREAD)
-  set(CONTEXT_THREADS 1)
+  set(HAVE_THREAD_CONTEXTS 1)
   message("-- Support for thread context factory")
 endif()
 
@@ -1137,8 +1128,6 @@ endif()
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
   "${generated_files_to_clean}")
 
-configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/simgrid.nsi.in" "${CMAKE_BINARY_DIR}/simgrid.nsi" @ONLY IMMEDIATE)
-
 ### Define source packages for Libs
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/DefinePackages.cmake)
 
@@ -1186,7 +1175,7 @@ else()
   find_program(WGET_PROGRAM  NAMES wget)
   message(STATUS "wget: ${WGET_PROGRAM}")
   if(WGET_PROGRAM)
-    ADD_CUSTOM_TARGET(simgrid_documentation
+    ADD_CUSTOM_TARGET(documentation
       COMMENT "Downloading the SimGrid documentation..."
       COMMAND ${WGET_PROGRAM} -r -np -nH -nd http://simgrid.gforge.inria.fr/simgrid/${release_version}/doc/
       WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc/html