Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
trace earlier, simix may start the process before returning the flow control
[simgrid.git] / CMakeLists.txt
index a784b34..ae43da2 100644 (file)
@@ -1,9 +1,17 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.6)
+### Need to set rc ccompiler before enable language
+if(WIN32)
+    SET(CMAKE_RC_COMPILER "windres")
+endif(WIN32)
 project(simgrid CXX C)
 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_CXX_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
 project(simgrid CXX C)
 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_CXX_FLAGS "" CACHE TYPE INTERNAL FORCE)
 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
-set(release_version "3.5")
+### Version 3.5.99, aka 3.6 svn
+set(SIMGRID_VERSION_MAJOR "3")
+set(SIMGRID_VERSION_MINOR "5")
+set(SIMGRID_VERSION_PATCH "99")
+set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
 set(libsimgrid_version "${release_version}")
 set(libgras_version "${release_version}")
 set(libsmpi_version "${release_version}")
 set(libsimgrid_version "${release_version}")
 set(libgras_version "${release_version}")
 set(libsmpi_version "${release_version}")
@@ -43,26 +51,27 @@ endif(VBC)
 
 ### Find programs and paths
 FIND_PROGRAM(GCOV_PATH gcov)
 
 ### Find programs and paths
 FIND_PROGRAM(GCOV_PATH gcov)
-FIND_PROGRAM(VALGRIND_PATH valgrind)
 include(FindPerl)
 if(NOT PERL_EXECUTABLE)
        message(FATAL_ERROR "-- SimGrid cannot be compiled without Perl installed -- sorry. Bailling out.")
 endif(NOT PERL_EXECUTABLE)
 
 include(FindPerl)
 if(NOT PERL_EXECUTABLE)
        message(FATAL_ERROR "-- SimGrid cannot be compiled without Perl installed -- sorry. Bailling out.")
 endif(NOT PERL_EXECUTABLE)
 
-get_filename_component(TRUE_CMAKE_HOME_DIRECTORY "${CMAKE_HOME_DIRECTORY}" REALPATH)
-get_filename_component(TRUE_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH)
-if(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
-else(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
-       message(STATUS "Change link path '${CMAKE_HOME_DIRECTORY}' to true path '${TRUE_CMAKE_HOME_DIRECTORY}'")
-       set(CMAKE_HOME_DIRECTORY "${TRUE_CMAKE_HOME_DIRECTORY}" CACHE TYPE INTERNAL FORCE)
-       set(CMAKE_SOURCE_DIR "${TRUE_CMAKE_HOME_DIRECTORY}" CACHE TYPE INTERNAL FORCE)
-endif(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
-
-if(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
-else(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
-       message(STATUS "Change link path '${CMAKE_BINARY_DIR}' to true path '${TRUE_CMAKE_BINARY_DIR}'")
-       set(CMAKE_BINARY_DIR "${TRUE_CMAKE_BINARY_DIR}" CACHE TYPE INTERNAL FORCE)
-endif(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})   
+if(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7") #need cmake version 2.8
+       get_filename_component(TRUE_CMAKE_HOME_DIRECTORY "${CMAKE_HOME_DIRECTORY}" REALPATH)
+       get_filename_component(TRUE_CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}" REALPATH)
+       if(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
+       else(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
+               message(STATUS "Change link path '${CMAKE_HOME_DIRECTORY}' to true path '${TRUE_CMAKE_HOME_DIRECTORY}'")
+               set(CMAKE_HOME_DIRECTORY "${TRUE_CMAKE_HOME_DIRECTORY}" CACHE TYPE INTERNAL FORCE)
+               set(CMAKE_SOURCE_DIR "${TRUE_CMAKE_HOME_DIRECTORY}" CACHE TYPE INTERNAL FORCE)
+       endif(${TRUE_CMAKE_HOME_DIRECTORY} STREQUAL ${CMAKE_HOME_DIRECTORY})
+       
+       if(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+       else(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+               message(STATUS "Change link path '${CMAKE_BINARY_DIR}' to true path '${TRUE_CMAKE_BINARY_DIR}'")
+               set(CMAKE_BINARY_DIR "${TRUE_CMAKE_BINARY_DIR}" CACHE TYPE INTERNAL FORCE)
+       endif(${TRUE_CMAKE_BINARY_DIR} STREQUAL ${CMAKE_BINARY_DIR})    
+endif(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7")
 
 ### Set some variables for Cmake
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
 
 ### Set some variables for Cmake
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
@@ -107,22 +116,13 @@ ENDIF(SIZEOF_LONG EQUAL 4)
 
 if(WIN32)
 
 
 if(WIN32)
 
-       set(INCLUDES_MORE $ENV{INCLUDE})
-       string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
-       foreach(include_dir ${INCLUDES_MORE})
-           if(IS_DIRECTORY ${include_dir})
-               string(REGEX MATCH ".*[ ].*" testoki "${include_dir}")
-               if(testoki)
-                       string(REPLACE " " "\\ " include_dir "${include_dir}")
-                   set(INCLUDES ${INCLUDES} \"${include_dir}\")
-               else(testoki)
-                   set(INCLUDES ${INCLUDES} ${include_dir})
-               endif(testoki)
-           else(IS_DIRECTORY ${include_dir})
-               message(FATAL_ERROR "${include_dir} not find")
-           endif(IS_DIRECTORY ${include_dir})
-       endforeach(include_dir ${INCLUDES_MORE})
-
+    #Need env INCLUDE 
+    set(CMAKE_INCLUDE_WIN "${CMAKE_C_COMPILER}")
+    set(CMAKE_LIB_WIN "${CMAKE_C_COMPILER}")
+    string(REGEX REPLACE "/bin/gcc.*" "/include"  CMAKE_INCLUDE_WIN "${CMAKE_INCLUDE_WIN}")
+    string(REGEX REPLACE "/bin/gcc.*" "/lib"  CMAKE_LIB_WIN "${CMAKE_LIB_WIN}")
+    set(INCLUDES ${INCLUDES} ${CMAKE_INCLUDE_WIN})
+    
     if(BORLAND)                        ### BORLAND COMPILER
            set(__BORLANDC__ 1)
            set(CMAKE_COMPILER_IS_GNUCC 0)
     if(BORLAND)                        ### BORLAND COMPILER
            set(__BORLANDC__ 1)
            set(CMAKE_COMPILER_IS_GNUCC 0)
@@ -165,10 +165,11 @@ if(WIN32)
     
     set(_XBT_WIN32 1)
     
     
     set(_XBT_WIN32 1)
     
-    message(STATUS "C_COMPILER                 $ENV{CC}")
-    message(STATUS "CXX_COMPILER                       $ENV{CXX}")    
-    message(STATUS "INCLUDE                    $ENV{INCLUDE}")
-    message(STATUS "LIB                                $ENV{LIB}")
+    message(STATUS "C_COMPILER                 ${CMAKE_C_COMPILER} ${COMPILER_C_VERSION}")
+    message(STATUS "CXX_COMPILER                       ${CMAKE_CXX_COMPILER} ${COMPILER_CXX_VERSION}")
+    message(STATUS "CMAKE_RC_COMPILER          ${CMAKE_RC_COMPILER}")     
+    message(STATUS "INCLUDE                    ${CMAKE_INCLUDE_WIN}")
+    message(STATUS "LIB                                ${CMAKE_LIB_WIN}")
     message(STATUS "MAKE_PROGRAM                       ${CMAKE_MAKE_PROGRAM}")
     message(STATUS "CMAKE_BUILD_TOOL           ${CMAKE_BUILD_TOOL}")
     message(STATUS "LINKER                     ${CMAKE_LINKER}")
     message(STATUS "MAKE_PROGRAM                       ${CMAKE_MAKE_PROGRAM}")
     message(STATUS "CMAKE_BUILD_TOOL           ${CMAKE_BUILD_TOOL}")
     message(STATUS "LINKER                     ${CMAKE_LINKER}")
@@ -213,18 +214,8 @@ endif(NOT WIN32)
 ### Make Exes
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeExe.cmake)
 
 ### Make Exes
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeExe.cmake)
 
-### Make Simgrid.jar and Java examples
-if(HAVE_JAVA)
-       include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
-endif(HAVE_JAVA)
-
 ### Make tests
 ### Make tests
-if(NOT WIN32)
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
-else(NOT WIN32)
-
-endif(NOT WIN32)
-
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
 
 ### Setup the distrib
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
 
 ### Setup the distrib