Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add notes to cdash.
[simgrid.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 project(simgrid CXX C)
3 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
4 set(CMAKE_CXX_FLAGS "" CACHE TYPE INTERNAL FORCE)
5 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
6 set(release_version "3.5")
7 set(libsimgrid_version "${release_version}")
8 set(libgras_version "${release_version}")
9 set(libsmpi_version "${release_version}")
10
11 if(WIN32)
12         message("       Be sure all those variables are correctely set.")
13     message("           -- C_COMPILER                   $ENV{CC}")
14     message("           -- CXX_COMPILER                 $ENV{CXX}")    
15     message("           -- RC_COMPILER                  $ENV{RC}")
16     message("           -- INCLUDE                      $ENV{INCLUDE}")
17     message("           -- LIB                          $ENV{LIB}")
18     message("           -- MAKE_PROGRAM                 ${CMAKE_MAKE_PROGRAM}")
19     message("           -- CMAKE_BUILD_TOOL                     ${CMAKE_BUILD_TOOL}")
20     message("           -- LINKER                               ${CMAKE_LINKER}")
21     message("           -- CMAKE_GENERATOR                      ${CMAKE_GENERATOR}\n\n")
22 endif(WIN32)
23
24 ### Find programs and paths
25 find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
26 find_path(VALGRIND_PATH NAMES valgrind  PATHS NO_DEFAULT_PATHS)
27
28 ### SET THE PROJECT_DIRECTORY
29 SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
30
31 ### Set some variables for Cmake
32 #SET(PROJECT_SOURCE_DIRECTORY "${PROJECT_DIRECTORY}/src") #this one is evil since it speaks to CPack instead
33 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
34 set(INCLUDES "-I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include -I${PROJECT_DIRECTORY}/src -I${CMAKE_CURRENT_BINARY_DIR}/src/")
35 set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY})
36
37 if(EXISTS /usr/include/)
38         set(INCLUDES "${INCLUDES} -I/usr/include/")
39 endif(EXISTS /usr/include/)
40
41 if(WIN32)
42         set(INCLUDES "${INCLUDES} -I$ENV{INCLUDE}")
43 endif(WIN32)
44
45 if(enable_coverage)
46         add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
47 else(enable_coverage)
48         add_definitions (${INCLUDES})
49 endif(enable_coverage)
50
51 ### Setup Options
52 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Option.cmake)
53
54 ### Make the *.h files with *.h.in files
55 include(${PROJECT_DIRECTORY}/buildtools/Cmake/CompleteInFiles.cmake)
56
57 ### Define source packages for Libs 
58 include(${PROJECT_DIRECTORY}/buildtools/Cmake/DefinePackages.cmake)
59
60 include(${PROJECT_DIRECTORY}/buildtools/Cmake/MaintainerMode.cmake)
61
62 ### Setup gcc flags
63 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Flags.cmake)
64
65 ### Make Libs and Exes
66 include(${PROJECT_DIRECTORY}/buildtools/Cmake/MakeExeLib.cmake)
67
68 ### Make Simgrid.jar and Java examples
69 if(HAVE_JAVA)
70         include(${PROJECT_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
71 endif(HAVE_JAVA)
72
73 ### Make tests
74 include(${PROJECT_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
75 include(${PROJECT_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
76
77 ### Setup the distrib
78 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Distrib.cmake)
79
80 ### Print ARGS
81 include(${PROJECT_DIRECTORY}/buildtools/Cmake/PrintArgs.cmake)
82
83 INCLUDE(Dart)