diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -291,6 +291,16 @@ endif() endif() +# std::filesystem support for older compilers +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) + link_libraries(c++fs) + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + link_libraries(stdc++fs) + endif() +endif() # Make sure that all the global compiler and linker flags are set BEFORE # including the libraries so they apply as needed.