Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix kademlia node sort
[simgrid.git] / CMakeLists.txt
index 05b9c0e..4945197 100644 (file)
@@ -1,9 +1,43 @@
 cmake_minimum_required(VERSION 2.6)
+
+IF(CMAKE_BUILD_TYPE STREQUAL "ModelChecker")
+  SET(enable_coverage ON)
+  SET(enable_model-checking ON)
+  SET(enable_lua ON)
+  SET(enable_compile_optimization OFF)
+ENDIF()
+
 ### Need to set rc ccompiler before enable language
 if(WIN32)
   SET(CMAKE_RC_COMPILER "windres")
 endif()
 project(SimGrid C)
+if (enable_gtnets OR enable_ns3)
+  enable_language(CXX)
+endif()
+if (NOT DEFINED enable_smpi OR enable_smpi) # smpi is enabled by default
+  # Call enable_language(Fortran) in order to load the build rules for
+  # this language, needed by teshsuite/smpi/mpich-test/.  Use
+  # CMAKE_FORCE_Fortran_COMPILER to bypass checks for a working
+  # compiler (smpiff don't exist at configure time).
+  include(CMakeForceCompiler)
+  if(NOT COMMAND CMAKE_FORCE_Fortran_COMPILER)
+    MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
+      SET(CMAKE_Fortran_COMPILER "${compiler}")
+      SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
+      SET(CMAKE_Fortran_COMPILER_ID ${id})
+      SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
+      SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
+
+      # Set old compiler id variables.
+      IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+        SET(CMAKE_COMPILER_IS_GNUG77 1)
+      ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+    ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
+  endif()
+  CMAKE_FORCE_Fortran_COMPILER(smpiff smpiff)
+  enable_language(Fortran OPTIONAL)
+endif()
 
 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_CXX_FLAGS "" CACHE TYPE INTERNAL FORCE)
@@ -30,7 +64,6 @@ else()
   set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}.${SIMGRID_VERSION_PATCH}")
 endif()
 set(libsimgrid_version "${release_version}")
-set(libgras_version "${release_version}")
 set(libsmpi_version "${release_version}")
 set(GCC_NEED_VERSION "4.0")
 set(APPLE_NEED_GCC_VERSION "4.6")