X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3fa08f69b66a84472bc1805a9e1ac86741b00780..afb3f25be9fd652ab66cf7740691b3e8e6ba17d3:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 92cb5e3127..51940649e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,19 @@ cmake_minimum_required(VERSION 2.6) -### Need to set rc ccompiler before enable language -if(WIN32) - SET(CMAKE_RC_COMPILER "windres") -endif() -project(SimGrid C) +project(SimGrid C CXX) #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Check for the compiler # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +### Need to set rc ccompiler before enable language +if(WIN32) + SET(CMAKE_RC_COMPILER "windres") +endif() + ## ## Check the C/C++ standard that we need ## See also tools/cmake/Flags.cmake that sets our paranoid warning flags - -enable_language(CXX) - INCLUDE(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER) @@ -30,11 +28,6 @@ if (CMAKE_COMPILER_IS_GNUCC) "SimGrid needs at least g++ version 4.7 to compile " "(c++11 support of previous versions is too limited).") endif() - - if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8") - set (CMAKE_AR gcc-ar) - set (CMAKE_RANLIB gcc-ranlib) - endif() endif() ## We need a decent support of the c++11 standard @@ -59,6 +52,12 @@ else() "Please use a decent C compiler " "(note that c++11 support of ${CMAKE_CXX_COMPILER} seems ok).") endif() +if(APPLE AND ("4.6" GREATER COMPILER_C_VERSION_MAJOR_MINOR)) + ### gcc 4.[1-5] cannot compile ucontext on OSX + message(STATUS "Ucontext can't be used with this version of gcc (must be greater than 4.5)") + set(HAVE_UCONTEXT_H 0) +endif() + ### SMPI vs. Fortran if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by default @@ -85,23 +84,17 @@ if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by enable_language(Fortran OPTIONAL) endif() +if (CMAKE_COMPILER_IS_GNUCC) + if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8") + set (CMAKE_AR gcc-ar) + set (CMAKE_RANLIB gcc-ranlib) + endif() +endif() + #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Build the version number # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# -## Mapping version number -> version name -# 3.5.99 -> alpha1 (oops) -# 3.5.9{1,2} -> beta{1,2} -# 3.5.9{3,4,5} -> rc{1,2,3} -# 3.6.{0,1,2} -> release 3.6, 3.6.1, 3.6.2 -# 3.7.{0,1} -> release 3.7, 3.7.1 -# 3.8.{0,1} -> release 3.8, 3.8.1 -# 3.9.0 -> release 3.9 -# 3.9.90 -> release 3.10pre1 -# 3.10.0 -> release 3.10 -# 3.11.0 -> release 3.11 -# 3.12.0 -> release 3.12 - set(SIMGRID_VERSION_MAJOR "3") set(SIMGRID_VERSION_MINOR "12") set(SIMGRID_VERSION_PATCH "0") @@ -121,7 +114,6 @@ set(SIMGRID_VERSION_BANNER set(libsimgrid_version "${release_version}") set(libsimgrid-java_version "${release_version}") -set(APPLE_NEED_GCC_VERSION "4.6") ### SET THE LIBRARY EXTENSION if(APPLE) #MAC @@ -222,12 +214,6 @@ if(WIN32) message("You REALLY should use MinGW to compile SimGrid on Windows!") endif() - if(ARCH_32_BITS) ### Arch 32bits - set(_WIN32 1) - else() ### Arch 64bits - set(_WIN64 1) - endif() - set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITEW6432}) if(NSIS_WIN_VERSION MATCHES "") set(NSIS_WIN_VERSION $ENV{PROCESSOR_ARCHITECTURE})