Closed suhasghorp closed 5 months ago
Answering my own question here if anyone comes across this issue. Set the RANGES_CXX_STD before FecthContent and then include_directories as follows:
set(RANGES_CXX_STD 20)
include(FetchContent)
FetchContent_Declare(
range-v3
GIT_REPOSITORY git@github.com:ericniebler/range-v3.git
GIT_TAG "0.12.0" # https://github.com/ericniebler/range-v3/releases
GIT_SHALLOW TRUE
GIT_PROGRESS ON
SYSTEM
)
FetchContent_MakeAvailable(range-v3)
include_directories(range-v3 INTERFACE "${range-v3_SOURCE_DIR}/include")
I am using FetchContent to download range-v3 in Visual Studio 2022 CMake project. I set CMAKE_CXX_STANDARD to 20 as follows. I am getting an error :
I can debug cmake script in VS and I can see that ranges is using C++17 standard. Do I need to specify RANGES_CXX_STD to 20 ?
Thanks