Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't generate doc with windows.
[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 ### Find programs and paths
12 find_path(GCOV_PATH NAMES gcov PATHS NO_DEFAULT_PATHS)
13 find_path(VALGRIND_PATH NAMES valgrind  PATHS NO_DEFAULT_PATHS)
14
15 ### SET THE PROJECT_DIRECTORY
16 SET(PROJECT_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
17
18 ### Set some variables for Cmake
19 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
20 set(INCLUDES "-I${PROJECT_DIRECTORY} -I${PROJECT_DIRECTORY}/include -I${PROJECT_DIRECTORY}/src/include -I${PROJECT_DIRECTORY}/src -I${CMAKE_CURRENT_BINARY_DIR}/src/")
21 set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIRECTORY})
22
23 if(EXISTS /usr/include/)
24         set(INCLUDES "${INCLUDES} -I/usr/include/")
25 endif(EXISTS /usr/include/)
26
27 if(WIN32)
28         set(INCLUDES_MORE $ENV{INCLUDE})
29         string(REPLACE "\\" "/" INCLUDES_MORE "${INCLUDES_MORE}")
30         foreach(include_dir ${INCLUDES_MORE})
31                 set(INCLUDES "${INCLUDES} -I\"${include_dir}\"")
32         endforeach(include_dir ${INCLUDES_MORE})
33         message("       Be sure all those variables are correctely set.")
34     message("           -- C_COMPILER                   $ENV{CC}")
35     message("           -- CXX_COMPILER                 $ENV{CXX}")    
36     message("           -- RC_COMPILER                  $ENV{RC}")
37     message("           -- INCLUDE                      $ENV{INCLUDE}")
38     message("           -- LIB                          $ENV{LIB}")
39     message("           -- MAKE_PROGRAM                 ${CMAKE_MAKE_PROGRAM}")
40     message("           -- CMAKE_BUILD_TOOL             ${CMAKE_BUILD_TOOL}")
41     message("           -- LINKER                       ${CMAKE_LINKER}")
42     message("           -- CMAKE_GENERATOR              ${CMAKE_GENERATOR}")
43     message("           -- INCLUDES                     ${INCLUDES}\n\n")
44     set(__STRICT_ANSI__ 1)
45     set(_MSC_VER 1)
46     set(_WIN32 1)
47 endif(WIN32)
48
49 if(enable_coverage)
50         add_definitions (${INCLUDES} -fprofile-arcs -ftest-coverage)
51 else(enable_coverage)
52         add_definitions (${INCLUDES})
53 endif(enable_coverage)
54
55 ### Setup Options
56 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Option.cmake)
57
58 ### Make the *.h files with *.h.in files
59 include(${PROJECT_DIRECTORY}/buildtools/Cmake/CompleteInFiles.cmake)
60
61 ### Define source packages for Libs 
62 include(${PROJECT_DIRECTORY}/buildtools/Cmake/DefinePackages.cmake)
63
64 include(${PROJECT_DIRECTORY}/buildtools/Cmake/MaintainerMode.cmake)
65
66 ### Setup gcc flags
67 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Flags.cmake)
68
69 ### Make Libs and Exes
70 include(${PROJECT_DIRECTORY}/buildtools/Cmake/MakeExeLib.cmake)
71
72 ### Make Simgrid.jar and Java examples
73 if(HAVE_JAVA)
74         include(${PROJECT_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
75 endif(HAVE_JAVA)
76
77 ### Build the doc
78 if(NOT WIN32)
79 include(${PROJECT_DIRECTORY}/buildtools/Cmake/GenerateDoc.cmake)
80 endif(NOT WIN32)
81
82 ### Make tests
83 include(${PROJECT_DIRECTORY}/buildtools/Cmake/AddTests.cmake)
84 include(${PROJECT_DIRECTORY}/buildtools/Cmake/CTestConfig.cmake)
85
86 ### Setup the distrib
87 include(${PROJECT_DIRECTORY}/buildtools/Cmake/Distrib.cmake)
88
89 ### Print ARGS
90 include(${PROJECT_DIRECTORY}/buildtools/Cmake/PrintArgs.cmake)
91
92 INCLUDE(Dart)