include_guard(GLOBAL)
# the apple clang does not have fs
if (CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
    message(FATAL_ERROR "Apple clang compiler is not supported, use `brew install llvm` instead.")
endif()
add_library(cpp_filesystem INTERFACE)
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
   if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
       target_link_libraries(cpp_filesystem INTERFACE c++fs)
   endif()
   # clang >= 9 have c++fs built-in already
else()
   target_link_libraries(cpp_filesystem INTERFACE stdc++fs)
endif()
if (VERBOSE_MESSAGE)
    include(print_properties)
    print_target_properties(cpp_filesystem)
endif()
add_library(tula::filesystem ALIAS cpp_filesystem)
