Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the detection of Boost.Context
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 18 Jun 2015 09:44:33 +0000 (11:44 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 18 Jun 2015 09:44:33 +0000 (11:44 +0200)
It seems I forgot this in the commit :/

buildtools/Cmake/CompleteInFiles.cmake

index f9d702c..ce11861 100644 (file)
@@ -109,7 +109,7 @@ endif()
 # intrusive 1.35.0
 # lambda 1.28.0
 # signals2 1.39.0
-find_package(Boost 1.42 REQUIRED)
+find_package(Boost 1.42 REQUIRED COMPONENTS context)
 if(Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
 else()
@@ -120,6 +120,19 @@ else()
   endif()
 endif()
 
+if(Boost_FOUND AND Boost_CONTEXT_FOUND)
+  # We should use feature detection for this instead:
+  if (Boost_VERSION LESS 105600)
+    message("Found suitable Boost.Context")
+    set(HAVE_BOOST_CONTEXT 1)
+  else()
+    message("Found unsuitable version of Boost.Context (${Boost_VERSION}, up to 1.55 is currenly implemented)")
+    set(HAVE_BOOST_CONTEXT 0)
+  endif()
+else()
+  set(HAVE_BOOST_CONTEXT 0)
+endif()
+
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(dl      dlopen                  "" HAVE_DLOPEN_IN_LIBDL)
 CHECK_LIBRARY_EXISTS(execinfo backtrace              "" HAVE_BACKTRACE_IN_LIBEXECINFO)