diff --git a/source/matplot/CMakeLists.txt b/source/matplot/CMakeLists.txt index 391bc948..e0962216 100644 --- a/source/matplot/CMakeLists.txt +++ b/source/matplot/CMakeLists.txt @@ -1,4 +1,6 @@ +if(NOT MINGW) find_package(Filesystem REQUIRED COMPONENTS Experimental Final) +endif() ####################################################### ### Library ### @@ -97,8 +99,13 @@ target_include_directories(matplot $) # Dependencies +if(NOT MINGW) target_link_libraries_system(matplot PRIVATE cimg nodesoup std::filesystem) +else() +target_link_libraries_system(matplot + PRIVATE cimg nodesoup) +endif() # Required compiler features required # https://cmake.org/cmake/help/v3.14/manual/cmake-compile-features.7.html#requiring-language-standards @@ -122,10 +129,11 @@ maybe_target_pedantic_warnings(matplot) ### Definitions ### ####################################################### # Use experimental filesystem if std::filesystem is not available yet -if (CXX_FILESYSTEM_IS_EXPERIMENTAL) - target_compile_definitions(matplot PRIVATE CXX_FILESYSTEM_IS_EXPERIMENTAL) +if(NOT MINGW) + if (CXX_FILESYSTEM_IS_EXPERIMENTAL) + target_compile_definitions(matplot PRIVATE CXX_FILESYSTEM_IS_EXPERIMENTAL) + endif() endif() - # Some hack to not depend on FILE* internals # /~https://github.com/alandefreitas/matplotplusplus/issues/4 include(CheckSymbolExists) diff --git a/test/generate_examples/CMakeLists.txt b/test/generate_examples/CMakeLists.txt index 60ee072d..32d0145b 100644 --- a/test/generate_examples/CMakeLists.txt +++ b/test/generate_examples/CMakeLists.txt @@ -1,4 +1,8 @@ +if(NOT MINGW) find_package(Filesystem REQUIRED) +endif() add_executable(generate_examples main.cpp) +if(NOT MINGW) target_link_libraries(generate_examples std::filesystem) +endif() target_compile_features(generate_examples PRIVATE cxx_std_17) \ No newline at end of file