Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new tracing mask TRACE_VOLUME to trace the msg tasks communication size and group...
[simgrid.git] / CMakeLists.txt
index d3272c1..7fddeef 100644 (file)
@@ -1,6 +1,10 @@
 cmake_minimum_required(VERSION 2.6)
+exec_program("rm ${Project_BINARY_DIR}/CTestTestfile.cmake" OUTPUT_VARIABLE rmok)
 SET(CMAKE_LANGUAGE "Cxx")
 SET(PROJECT_NAME "Simgrid")
+SET(PROJECT_LABEL "Simgrid")
+set(simgrid_version "3.4")
+set(USE_RPATH false)
 
 ### Find programs and paths
 find_program(SH_EXE NAMES sh)
@@ -13,11 +17,8 @@ find_path(GCC_PATH NAMES gcc PATHS NO_DEFAULT_PATHS)
 find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
 find_path(VALGRIND_PATH        NAMES valgrind  PATHS NO_DEFAULT_PATHS)
 
-### AUTO DETECT THE PROJECT_DIRECTORY
-exec_program("${PWD_EXE}" ARGS "| ${SED_EXE} 's/\\/Cmake//g'" OUTPUT_VARIABLE PROJECT_DIRECTORY)
-
 ### SET THE PROJECT_DIRECTORY
-#SET(PROJECT_DIRECTORY "/home/navarrop/Bureau/simgrid-trunk")
+SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
 
 ### Set some variables for Cmake
 SET(PROJECT_SOURCE_DIRECTORY "${PROJECT_DIRECTORY}/src")
@@ -26,9 +27,11 @@ set(LIBRARY_OUTPUT_PATH "${PROJECT_DIRECTORY}/src/.libs")
 set(INCLUDES "-I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include -I${PROJECT_DIRECTORY}/src -I/usr/include/ -L${gtnets_path}/lib")
 set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY})
 
-add_definitions (${INCLUDES})
+
 if(enable_coverage)
-       add_definitions (-fprofile-arcs -ftest-coverage)
+       add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
+else(enable_coverage)
+       add_definitions (${INCLUDES})
 endif(enable_coverage)
 
 ### Setup Options
@@ -40,7 +43,7 @@ include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeCompleteInFiles.txt)
 ### Define source packages for Libs 
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDefinePackages.txt)
 
-include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeFLEXml.txt)
+include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeMaintainerMode.txt)
 
 ### Setup gcc flags
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeFlags.txt)
@@ -50,9 +53,6 @@ include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeMakeExeLib.txt)
 
 ### Make tests
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeTest.txt)
-if(enable_memcheck)
-       include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/memcheck_tests.txt)
-endif(enable_memcheck)
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CTestConfig.cmake)
 
 ### Setup the distrib
@@ -61,9 +61,19 @@ include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDistrib.txt)
 ### Print ARGS
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakePrintArgs.txt)
 
-### Make Docs
-if(enable_maintainer_mode)
-       #include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDocs.txt)
-endif(enable_maintainer_mode)
-
 INCLUDE(Dart)
+
+exec_program("ctest -N" OUTPUT_VARIABLE LIST_OF_TEST)
+string(REPLACE "\n" ";" LIST_OF_TEST ${LIST_OF_TEST})
+foreach(test ${LIST_OF_TEST})
+       string(REGEX REPLACE "^.*Test.*project.*" " " test ${test})
+       string(REGEX REPLACE "^.*Total.*Tests:.*" " " test ${test})
+       string(REGEX MATCH "^.*Testing.*" test_ok_1 ${test}) #for ctest version 2.6 (xxx/xxx Testing)
+       string(REGEX MATCH "^.*Test.*\\:+" test_ok_2 ${test}) #for ctest version 2.8 (Test #xxx)
+       if(test_ok_1 OR test_ok_2)
+               string(REGEX REPLACE "^.*Testing" " " test ${test}) #for ctest version 2.6
+               string(REGEX REPLACE "^.*Test.*\\:+" " " test ${test}) #for ctest version 2.8
+               string(STRIP ${test} test)
+               set_tests_properties(${test} PROPERTIES LABELS "rev${SVN_VERSION}")
+       endif(test_ok_1 OR test_ok_2)
+endforeach(test ${LIST_OF_TEST})