diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake
index 0057ed4d7f8b1104d4bc08a6ff368c20f33b69dd..938d88629c72f0b5f1c2055fcfb98f10fdbf694c 100644
--- a/cmake/DD4hepBuild.cmake
+++ b/cmake/DD4hepBuild.cmake
@@ -1310,17 +1310,33 @@ MACRO(DD4HEP_SETUP_BOOST_TARGETS)
   INTERFACE_COMPILE_DEFINITIONS BOOST_SPIRIT_USE_PHOENIX_V3
   )
 
-IF(${CMAKE_CXX_STANDARD} EQUAL 14)
-  find_package(Boost 1.49 REQUIRED COMPONENTS filesystem system)
-  SET(FS_LIBRARIES Boost::filesystem Boost::system)
-SET_TARGET_PROPERTIES(Boost::filesystem
-  PROPERTIES
-  INTERFACE_COMPILE_DEFINITIONS USE_BOOST_FILESYSTEM
-  )
+  # Try to compile with filesystem header linking against different FS libraries
+  SET(HAVE_FILESYSTEM False)
+  FOREACH(FS_LIB_NAME stdc++fs c++fs )
+    try_compile(HAVE_FILESYSTEM ${CMAKE_BINARY_DIR}/try ${CMAKE_SOURCE_DIR}/cmake/TryFileSystem.cpp
+      CXX_STANDARD ${CMAKE_CXX_STANDARD}
+      CXX_EXTENSIONS False
+      OUTPUT_VARIABLE HAVE_FS_OUTPUT
+      LINK_LIBRARIES ${FS_LIB_NAME}
+      )
+    dd4hep_print("|++> ${HAVE_FS_OUTPUT}")
+    IF(HAVE_FILESYSTEM)
+      MESSAGE(STATUS "Compiler supports filesystem, linking against ${FS_LIB_NAME}")
+      SET(FS_LIBRARIES ${FS_LIB_NAME})
+      BREAK()
+    ENDIF()
+  ENDFOREACH()
+
+  IF(NOT HAVE_FILESYSTEM)
+    MESSAGE(STATUS "Compiler does not have filesystem support, falling  back to Boost::filesystem")
+    FIND_PACKAGE(Boost 1.49 REQUIRED COMPONENTS filesystem system)
+    SET(FS_LIBRARIES Boost::filesystem Boost::system)
+    SET_TARGET_PROPERTIES(Boost::filesystem
+      PROPERTIES
+      INTERFACE_COMPILE_DEFINITIONS USE_BOOST_FILESYSTEM
+    )
   GET_TARGET_PROPERTY(BOOST_FILESYSTEM_LOC Boost::filesystem IMPORTED_LOCATION)
   GET_FILENAME_COMPONENT(BOOST_DIR ${BOOST_FILESYSTEM_LOC} DIRECTORY)
-ELSE()
-  SET(FS_LIBRARIES stdc++fs)
 ENDIF()
 
 
diff --git a/cmake/TryFileSystem.cpp b/cmake/TryFileSystem.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6ea87a0843894c951bc60c551e9cf381f761d63b
--- /dev/null
+++ b/cmake/TryFileSystem.cpp
@@ -0,0 +1,31 @@
+//==========================================================================
+//  AIDA Detector description implementation
+//--------------------------------------------------------------------------
+// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
+// All rights reserved.
+//
+// For the licensing terms see $DD4hepINSTALL/LICENSE.
+// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
+//
+// Author     : A. Sailer
+//
+//==========================================================================
+
+//Header to check if the current compiler and stdlibrary implementation supports filesystem
+
+#include <filesystem>
+
+#include <iostream>
+namespace fs = std::filesystem;
+
+int main ()
+{
+    fs::space_info devi = fs::space("/dev/null");
+    fs::space_info tmpi = fs::space("/tmp");
+    std::cout << ".        Capacity       Free      Available\n"
+              << "/dev:   " << devi.capacity << "   "
+              << devi.free << "   " << devi.available  << '\n'
+              << "/tmp: " << tmpi.capacity << " "
+              << tmpi.free << " " << tmpi.available  << '\n';
+  return 0;
+}