Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Test if valgrind is found for enable memcheck.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 25 May 2010 12:13:23 +0000 (12:13 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 25 May 2010 12:13:23 +0000 (12:13 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7792 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/AddTests.cmake
buildtools/Cmake/PrintArgs.cmake

index 792c96a..70c5336 100644 (file)
@@ -4,6 +4,22 @@ if(enable_smpi)
        exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/src/smpi/smpicc" OUTPUT_VARIABLE "OKITOKI")
        exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/src/smpi/smpirun" OUTPUT_VARIABLE "OKITOKI")
 endif(enable_smpi)
        exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/src/smpi/smpicc" OUTPUT_VARIABLE "OKITOKI")
        exec_program("chmod a=rwx ${PROJECT_DIRECTORY}/src/smpi/smpirun" OUTPUT_VARIABLE "OKITOKI")
 endif(enable_smpi)
+
+if(enable_memcheck)
+       exec_program("valgrind --version " OUTPUT_VARIABLE "VALGRIND_VERSION")
+       if(VALGRIND_VERSION)
+               string(REGEX MATCH "[0-9].[0-9].[0-9]" NEW_VALGRIND_VERSION "${VALGRIND_VERSION}")
+               if(NEW_VALGRIND_VERSION)
+               else(NEW_VALGRIND_VERSION)
+                       set(enable_memcheck false)
+                       message("Command valgrind not found --> enable_memcheck autoset to false.")
+               endif(NEW_VALGRIND_VERSION)
+       else(VALGRIND_VERSION)
+               set(enable_memcheck false)
+               message("Command valgrind not found --> enable_memcheck autoset to false.")
+       endif(VALGRIND_VERSION)
+endif(enable_memcheck)
+
 ### For code coverage
 ### Set some variables
 SET(UPDATE_TYPE "svn")
 ### For code coverage
 ### Set some variables
 SET(UPDATE_TYPE "svn")
index 761c863..f875b23 100644 (file)
@@ -92,6 +92,10 @@ if(enable_print_message)
        message("LAUXLIB.H:                     ${HAVE_LUA5_1_LAUXLIB_H}")
        message("LUA_VERSION :                  ${LUA_MAJOR_VERSION}.${LUA_MINOR_VERSION}.${LUA_PATCH_VERSION}")
        endif(enable_lua)
        message("LAUXLIB.H:                     ${HAVE_LUA5_1_LAUXLIB_H}")
        message("LUA_VERSION :                  ${LUA_MAJOR_VERSION}.${LUA_MINOR_VERSION}.${LUA_PATCH_VERSION}")
        endif(enable_lua)
+       if(enable_memcheck)
+       message("")
+       message("VALGRIND :                     ${NEW_VALGRIND_VERSION}")
+       endif(enable_memcheck)
        message("________________________________________________________________________________")
        message("________________________________________________________________________________ DEBUG END")
        message("")
        message("________________________________________________________________________________")
        message("________________________________________________________________________________ DEBUG END")
        message("")