Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / CMakeLists.txt
index 38839a6..29e9a43 100644 (file)
@@ -12,6 +12,10 @@ set(libsmpi_version "${release_version}")
 FIND_PROGRAM(GCOV_PATH gcov)
 FIND_PROGRAM(VALGRIND_PATH valgrind)
 include(FindPerl)
+if(NOT PERL_EXECUTABLE)
+       message(FATAL_ERROR "-- SimGrid cannot be compiled without Perl installed -- sorry. Bailling out.")
+endif(NOT PERL_EXECUTABLE)
+
 
 ### SET THE LIBRARY EXTENSION
 if(APPLE)
@@ -21,8 +25,27 @@ else(APPLE)
 endif(APPLE)
 
 ### Set some variables for Cmake
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
-set(INCLUDES ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_BINARY_DIR}/src/include ${PROJECT_BINARY_DIR}/src)
+SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
+
+if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+       set(INCLUDES
+       ${CMAKE_HOME_DIRECTORY}
+       ${CMAKE_HOME_DIRECTORY}/include
+       ${CMAKE_HOME_DIRECTORY}/src
+       ${CMAKE_HOME_DIRECTORY}/src/include
+       )
+else("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+       set(INCLUDES
+       ${CMAKE_HOME_DIRECTORY}
+       ${CMAKE_HOME_DIRECTORY}/include
+       ${CMAKE_HOME_DIRECTORY}/src
+       ${CMAKE_HOME_DIRECTORY}/src/include
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_BINARY_DIR}/include
+       ${CMAKE_BINARY_DIR}/src
+       )
+endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}")
+
 set(INCLUDES ${INCLUDES} ${CMAKE_HOME_DIRECTORY} ${CMAKE_HOME_DIRECTORY}/include ${CMAKE_HOME_DIRECTORY}/src/include ${CMAKE_HOME_DIRECTORY}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
 if(WIN32)
     set(INCLUDES ${INCLUDES} ${CMAKE_HOME_DIRECTORY}/include/xbt ${CMAKE_HOME_DIRECTORY}/src/xbt) #for win32_ucontext.[ch]
@@ -120,6 +143,11 @@ endif(WIN32)
 
 include_directories(${INCLUDES})
 
+
+### Determine the assembly flavor that we need today
+include(CMakeDetermineSystem)
+set(PROCESSOR_${CMAKE_SYSTEM_PROCESSOR} 1)
+
 ### Setup Options
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Option.cmake)
 
@@ -143,11 +171,6 @@ else(WIN32)
     include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeExeLib.cmake)
 endif(WIN32)
 
-### Build the doc
-if(enable_doc)
-       include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/GenerateDoc.cmake)
-endif(enable_doc)
-
 ### Make Simgrid.jar and Java examples
 if(HAVE_JAVA)
        include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/MakeJava.cmake)
@@ -168,6 +191,9 @@ include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Distrib.cmake)
 ### Pipol compilation
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/Pipol.cmake)
 
+### Build the doc
+include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/GenerateDoc.cmake)
+
 ### Print ARGS
 include(${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/PrintArgs.cmake)