diff --git a/cmake/Configuration.cmake b/cmake/Configuration.cmake index ed47af6..a97e0a1 100644 --- a/cmake/Configuration.cmake +++ b/cmake/Configuration.cmake @@ -2,11 +2,20 @@ include(CheckCXXStandardSupport) include(CheckCXX_TypeExists) include(CheckCXX_InitializerListExists) -CheckCXXStandardSupport(11 SS_COMPILER_SUPPORT_STD_11) -CheckCXXStandardSupport(14 SS_COMPILER_SUPPORT_STD_14) -CheckCXXStandardSupport(17 SS_COMPILER_SUPPORT_STD_17) -CheckCXXStandardSupport(20 SS_COMPILER_SUPPORT_STD_20) -CheckCXXStandardSupport(23 SS_COMPILER_SUPPORT_STD_23) +if ("${CMAKE_CXX_STANDARD}" STREQUAL "") + CheckCXXStandardSupport(11 SS_COMPILER_SUPPORT_STD_11) + CheckCXXStandardSupport(14 SS_COMPILER_SUPPORT_STD_14) + CheckCXXStandardSupport(17 SS_COMPILER_SUPPORT_STD_17) + CheckCXXStandardSupport(20 SS_COMPILER_SUPPORT_STD_20) + CheckCXXStandardSupport(23 SS_COMPILER_SUPPORT_STD_23) +else() + set(SS_COMPILER_SUPPORT_STD_11 0) + set(SS_COMPILER_SUPPORT_STD_14 0) + set(SS_COMPILER_SUPPORT_STD_17 0) + set(SS_COMPILER_SUPPORT_STD_20 0) + set(SS_COMPILER_SUPPORT_STD_23 0) + set(SS_COMPILER_SUPPORT_STD_${CMAKE_CXX_STANDARD} 1) +endif () if(SS_COMPILER_SUPPORT_STD_23) set(SS_COMPILER_SUPPORT_STD 23)