Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Filter for test properties.
[simgrid.git] / CMakeLists.txt
index 0cb1bd6..b5bd133 100644 (file)
@@ -1,6 +1,9 @@
 cmake_minimum_required(VERSION 2.6)
 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 +16,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")
@@ -60,10 +60,17 @@ include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDistrib.txt)
 ### Print ARGS
 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakePrintArgs.txt)
 
-set_property(GLOBAL PROPERTY LABELS "${SVN_VERSION}${GIT_VERSION}")
-set_property(GLOBAL PROPERTY PROJECT_LABEL "${SVN_VERSION}${GIT_VERSION}")
-set(PROJECT_LABEL "${SVN_VERSION}${GIT_VERSION}")
-
 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 "^.*Test.*\\:+" test_ok ${test})
+       if(test_ok)
+               string(REGEX REPLACE "^.*Test.*\\:+" " " test ${test})
+               string(STRIP ${test} test)
+               set_tests_properties(${test} PROPERTIES LABELS "rev${SVN_VERSION}")
+       endif(test_ok)
+endforeach(test ${LIST_OF_TEST})