jandrewrfarrell / RUFUS

RUFUS k-mer based genomic variant detection
51 stars 13 forks source link

Make compatible with older versions of GCC #8

Open dantaki opened 5 years ago

dantaki commented 5 years ago

cc1plus: error: unrecognized command line option "-std=c++11"

I cannot update gcc on my server. Do you mind amending your code so I and others with older gcc versions will be able to compile your tool please?

This might be a solution

if(CMAKE_COMPILER_IS_GNUCXX)
   SET(ENABLE_CXX11 "-std=c++11")

   EXECUTE_PROCESS(COMMAND "${CMAKE_CXX_COMPILER} -dumpversion" OUTPUT_VARIABLE GCC_VERSION)
   if (GCC_VERSION VERSION_LESS 4.7)
      SET(ENABLE_CXX11 "-std=c++0x")
   endif()

   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ENABLE_CXX11}")
endif()

https://stackoverflow.com/questions/12715005/add-c0x-support-in-cmake