Skip to content

Commit 3a729a9

Browse files
aminyaalandefreitas
authored andcommitted
fix: fix build on MacOS when FindFileSystem fails
1 parent 1545230 commit 3a729a9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cmake/FindFilesystem.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,5 +248,5 @@ cmake_pop_check_state()
248248
set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE)
249249

250250
if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND)
251-
message(FATAL_ERROR "Cannot run a simple program using std::filesystem\nYou need to update your C++ compiler to use this library")
251+
message(STATUS "Could not run a simple program using std::filesystem\nYou might need to update your C++ compiler to use this library")
252252
endif()

source/matplot/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ target_include_directories(matplot
102102
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
103103

104104
# Dependencies
105-
if(NOT MINGW)
105+
if(TARGET std::filesystem AND NOT MINGW)
106106
target_link_libraries_system(matplot
107107
PRIVATE cimg nodesoup std::filesystem)
108108
else()

test/generate_examples/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
if(NOT MINGW)
2-
find_package(Filesystem REQUIRED)
2+
find_package(Filesystem REQUIRED)
33
endif()
44
add_executable(generate_examples main.cpp)
5-
if(NOT MINGW)
6-
target_link_libraries(generate_examples std::filesystem)
5+
if(TARGET std::filesystem)
6+
target_link_libraries(generate_examples std::filesystem)
77
endif()
8-
target_compile_features(generate_examples PRIVATE cxx_std_17)
8+
target_compile_features(generate_examples PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)