Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test that the node is well installed before trying to run
[simgrid.git] / CMakeLists.txt
index 92cb5e3..6e628d3 100644 (file)
@@ -1,21 +1,20 @@
 cmake_minimum_required(VERSION 2.6)
+# Java requires 2.8.6
 
-### Need to set rc ccompiler before enable language
-if(WIN32)
-  SET(CMAKE_RC_COMPILER "windres")
-endif()
-project(SimGrid C)
+project(SimGrid C CXX)
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 #     Check for the compiler        #
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 
+### Need to set rc ccompiler before enable language
+if(WIN32)
+  SET(CMAKE_RC_COMPILER "windres")
+endif()
+
 ## 
 ## Check the C/C++ standard that we need
 ##   See also tools/cmake/Flags.cmake that sets our paranoid warning flags
-
-enable_language(CXX)
-
 INCLUDE(CheckCCompilerFlag)
 CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER)
 
@@ -30,11 +29,6 @@ if (CMAKE_COMPILER_IS_GNUCC)
             "SimGrid needs at least g++ version 4.7 to compile "
            "(c++11 support of previous versions is too limited).")
   endif()
-
-  if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8")
-    set (CMAKE_AR gcc-ar)
-    set (CMAKE_RANLIB gcc-ranlib)
-  endif()
 endif()
 
 ## We need a decent support of the c++11 standard
@@ -59,6 +53,12 @@ else()
           "Please use a decent C compiler "
           "(note that c++11 support of ${CMAKE_CXX_COMPILER} seems ok).")
 endif()
+if(APPLE AND ("4.6" GREATER COMPILER_C_VERSION_MAJOR_MINOR))
+    ### gcc 4.[1-5] cannot compile ucontext on OSX
+    message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)")
+    set(HAVE_UCONTEXT_H 0)
+endif()
+
 
 ### SMPI vs. Fortran
 if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by default
@@ -89,19 +89,6 @@ endif()
 #     Build the version number      #
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 
-## Mapping version number -> version name
-# 3.5.99 -> alpha1 (oops)
-# 3.5.9{1,2} -> beta{1,2}
-# 3.5.9{3,4,5} -> rc{1,2,3}
-# 3.6.{0,1,2} -> release 3.6, 3.6.1, 3.6.2
-# 3.7.{0,1} -> release 3.7, 3.7.1
-# 3.8.{0,1} -> release 3.8, 3.8.1
-# 3.9.0 -> release 3.9
-# 3.9.90 -> release 3.10pre1
-# 3.10.0 -> release 3.10
-# 3.11.0 -> release 3.11
-# 3.12.0 -> release 3.12
-
 set(SIMGRID_VERSION_MAJOR "3")
 set(SIMGRID_VERSION_MINOR "12")
 set(SIMGRID_VERSION_PATCH "0")
@@ -121,7 +108,6 @@ set(SIMGRID_VERSION_BANNER
 
 set(libsimgrid_version "${release_version}")
 set(libsimgrid-java_version "${release_version}")
-set(APPLE_NEED_GCC_VERSION "4.6")
 
 ### SET THE LIBRARY EXTENSION 
 if(APPLE) #MAC
@@ -222,12 +208,6 @@ if(WIN32)
     message("You REALLY should use MinGW to compile SimGrid on Windows!")
   endif()
 
-  if(ARCH_32_BITS)      ### Arch 32bits
-    set(_WIN32 1)
-  else()        ### Arch 64bits
-    set(_WIN64 1)
-  endif()
-
   set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITEW6432})
   if(NSIS_WIN_VERSION MATCHES "")
     set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITECTURE})
@@ -276,6 +256,10 @@ else()
   include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLibWin.cmake)
 endif()
 
+if(enable_java)
+  include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeJava.cmake)
+endif()
+
 ### Make Exes
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeExe.cmake)