X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/809ffede4e61d5404cb3a17286b5a4fb843a33a3..97822856837d9d28da641163961482ef8814c49e:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ab5b02ab7..00ebaf2ef0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,12 +110,6 @@ else() endif() set(SIMGRID_VERSION_STRING "SimGrid version ${release_version}${SIMGRID_VERSION_EXTRA}") -set(SIMGRID_VERSION_BANNER "SIMGRID_VERSION_STRING\\nCopyright (c) 2004-${SIMGRID_VERSION_DATE}. The Simgrid Team.") -if(release) - set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER}\\nRelease build") -else() - set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER}\\nDevelopment build") -endif() set(libsimgrid_version "${release_version}") set(libsimgrid-java_version "${release_version}") @@ -245,7 +239,8 @@ else() else() message(FATAL_ERROR "Failed to find Boost libraries." "Did you install libboost-dev and libboost-context-dev?" - "(libboost-context-dev is optional)") + "(libboost-context-dev is optional)" + "SimGrid requires Boost >= 1.48.0") endif() endif() @@ -268,6 +263,18 @@ else() set(HAVE_BOOST_CONTEXTS 0) endif() +# Try again to see if we have libboost-context +find_package(Boost 1.42 COMPONENTS context) +set(Boost_FOUND 1) # We don't care of whether this component is missing + +if(Boost_FOUND AND Boost_GRAPH_FOUND) + set(HAVE_BOOST_GRAPH 1) +else() + message (" boost : found.") + message (" boost-graph : missing. Install libboost-graph-dev for this optional feature.") + set(HAVE_BOOST_GRAPH 0) +endif() + # Checks for header libraries functions. CHECK_LIBRARY_EXISTS(execinfo backtrace "" HAVE_BACKTRACE_IN_LIBEXECINFO) CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME) @@ -313,30 +320,6 @@ if(MINGW) set(HAVE_VASPRINTF 1) endif() -foreach(var - HAVE_VALGRIND_H - HAVE_UNISTD_H - HAVE_EXECINFO_H - HAVE_SIGNAL_H - HAVE_SYS_PARAM_H - HAVE_SYS_SYSCTL_H - HAVE_UCONTEXT_H - HAVE_FUTEX_H - HAVE_GETTIMEOFDAY - HAVE_NANOSLEEP - HAVE_GETDTABLESIZE - HAVE_SYSCONF - HAVE_POPEN - HAVE_PROCESS_VM_READV - HAVE_MMAP - HAVE_VASPRINTF) - if(${var}) - set(${var} 1) - else() - set(${var} 0) - endif() -endforeach() - #Check if __thread is defined execute_process( COMMAND "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_thread_storage.c -o testprog" @@ -646,15 +629,27 @@ elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion) FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION) endif() -if(GIT_VERSION) - set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER} at commit ${GIT_VERSION}") -endif() -if(GIT_DATE) - set(SIMGRID_VERSION_BANNER "${SIMGRID_VERSION_BANNER} (${GIT_DATE})") -endif() ### Generate the required headers and scripts ############################################# + +# gcc makes no difference between "#define HAVE_FOOBAR" and "#define HAVE_FOOBAR 0" by default, +# but this too error prone. If you forget to include the config.h, you get weird segfaults. +# If you include it everywhere, everything gets recompiled everytime. +# So we include only where needed, and compile with -Wundef to notice the missing includes. +# But cmake sometimes defines to the empty definition (#define HAVE_VALGRIND_H). +# So we have to make sure that everything got a decent value before generating the files. +foreach(var HAVE_EXECINFO_H HAVE_FUTEX_H HAVE_GETDTABLESIZE HAVE_GETTIMEOFDAY HAVE_MMAP + HAVE_NANOSLEEP HAVE_POPEN HAVE_POSIX_GETTIME HAVE_PROCESS_VM_READV HAVE_SIGNAL_H + HAVE_SYS_PARAM_H HAVE_SYS_SYSCTL_H HAVE_SYSCONF HAVE_UCONTEXT_H HAVE_UNISTD_H + HAVE_VALGRIND_H HAVE_VASPRINTF) + if(${var}) + set(${var} 1) + else() + set(${var} 0) + endif() +endforeach() + # Avoid triggering a (full) rebuild by touching the files if they did not really change configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE) configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated" @ONLY IMMEDIATE) @@ -900,7 +895,7 @@ message("##########################################") message("#### Content of src/internal_config.h ####") message("##########################################") file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output) -LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8) # Pass the file header +LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 10) # Pass the file header foreach(line ${config_output}) message(" ${line}") endforeach()