Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove old command.
[simgrid.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 SET(CMAKE_LANGUAGE "Cxx")
3 SET(PROJECT_NAME "Simgrid")
4 SET(PROJECT_LABEL "Simgrid")
5 set(simgrid_version "3.4")
6 set(USE_RPATH false)
7
8 ### Find programs and paths
9 find_program(SH_EXE NAMES sh)
10 find_program(SED_EXE NAMES sed)
11 find_program(PWD_EXE NAMES pwd)
12 find_program(UNAME NAMES uname)
13 find_program(HOSTNAME_CMD NAMES hostname)
14 find_program(CAT NAMES cat)
15 find_path(GCC_PATH NAMES gcc PATHS NO_DEFAULT_PATHS)
16 find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
17 find_path(VALGRIND_PATH NAMES valgrind  PATHS NO_DEFAULT_PATHS)
18
19 ### SET THE PROJECT_DIRECTORY
20 SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
21
22 ### Set some variables for Cmake
23 SET(PROJECT_SOURCE_DIRECTORY "${PROJECT_DIRECTORY}/src")
24 set(EXECUTABLE_OUTPUT_PATH "${PROJECT_DIRECTORY}/bin")
25 set(LIBRARY_OUTPUT_PATH "${PROJECT_DIRECTORY}/src/.libs")
26 set(INCLUDES "-I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include -I${PROJECT_DIRECTORY}/src -I/usr/include/ -L${gtnets_path}/lib")
27 set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY})
28
29
30 if(enable_coverage)
31         add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
32 else(enable_coverage)
33         add_definitions (${INCLUDES})
34 endif(enable_coverage)
35
36 ### Setup Options
37 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeOption.txt)
38
39 ### Make the *.h files with *.h.in files
40 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeCompleteInFiles.txt)
41
42 ### Define source packages for Libs 
43 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDefinePackages.txt)
44
45 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeMaintainerMode.txt)
46
47 ### Setup gcc flags
48 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeFlags.txt)
49
50 ### Make Libs and Exes
51 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeMakeExeLib.txt)
52
53 ### Make tests
54 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeTest.txt)
55 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CTestConfig.cmake)
56
57 ### Setup the distrib
58 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakeDistrib.txt)
59
60 ### Print ARGS
61 include(${PROJECT_DIRECTORY}/buildtools/Cmake/src/CMakePrintArgs.txt)
62
63 INCLUDE(Dart)
64
65 exec_program("ctest -N" OUTPUT_VARIABLE LIST_OF_TEST)
66 string(REPLACE "\n" ";" LIST_OF_TEST ${LIST_OF_TEST})
67 foreach(test ${LIST_OF_TEST})
68         string(REGEX REPLACE "^.*Test.*project.*" " " test ${test})
69         string(REGEX REPLACE "^.*Total.*Tests:.*" " " test ${test})
70         string(REGEX REPLACE "^.*Test.*\\:+" " " test ${test})
71         string(STRIP ${test} test)
72         if(test)
73                 set_tests_properties(${test} PROPERTIES LABELS "rev${SVN_VERSION}")
74         endif(test)
75 endforeach(test ${LIST_OF_TEST})