I am compiling a library using ROOT as a dependancy. My problem is that some users are using a C++11 version of ROOT, and some other a C++14 version of ROOT. if they are using a C++14 ROOT version, when compiling my library, they obtain the error:
**/Users/dudouet/Softs/ROOT/install/v6-26-02/include/ROOT/RConfig.hxx:50:5:** **error:** **"Pass -std=c++14 as compiler argument."**
It works then if I add in my CMakeList the line :
set(CMAKE_CXX_STANDARD 14)
But then it does not work anymore for the users using a C++11 version of ROOT. My question is : Is there a way, in my library’s CMakeList, to automatically define the CXX version that has been used for ROOT compilation ?