Skip to content

Commit 651c556

Browse files
committed
[matplotplusplus] fix: fix build on MacOS when FindFileSystem fails
1 parent bda28c8 commit 651c556

File tree

4 files changed

+60
-3
lines changed

4 files changed

+60
-3
lines changed

ports/matplotplusplus/fix-pass-filesystem-s-required-flags-for-osx-failure.patch renamed to ports/matplotplusplus/0001-fix-pass-filesystem-s-required-flags-for-osx-failure.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From f8f8b7dc7929b18600c667ed92482e0ac7ec948d Mon Sep 17 00:00:00 2001
22
From: Amin Yahyaabadi <[email protected]>
33
Date: Thu, 11 May 2023 12:14:34 -0700
4-
Subject: [PATCH] fix: pass filesystem's required flags for osx failures
4+
Subject: [PATCH 1/2] fix: pass filesystem's required flags for osx failures
55

66
---
77
cmake/FindFilesystem.cmake | 5 ++++-
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From cefe59f72f055a06cfd47578b7753e8f4b91e115 Mon Sep 17 00:00:00 2001
2+
From: Amin Yahyaabadi <[email protected]>
3+
Date: Tue, 6 Jun 2023 13:47:35 -0700
4+
Subject: [PATCH 2/2] fix: fix build on MacOS when FindFileSystem fails
5+
6+
---
7+
cmake/FindFilesystem.cmake | 2 +-
8+
source/matplot/CMakeLists.txt | 2 +-
9+
test/generate_examples/CMakeLists.txt | 8 ++++----
10+
3 files changed, 6 insertions(+), 6 deletions(-)
11+
12+
diff --git a/cmake/FindFilesystem.cmake b/cmake/FindFilesystem.cmake
13+
index ccdb3de..25d905b 100644
14+
--- a/cmake/FindFilesystem.cmake
15+
+++ b/cmake/FindFilesystem.cmake
16+
@@ -248,5 +248,5 @@ cmake_pop_check_state()
17+
set(Filesystem_FOUND ${_found} CACHE BOOL "TRUE if we can run a program using std::filesystem" FORCE)
18+
19+
if(Filesystem_FIND_REQUIRED AND NOT Filesystem_FOUND)
20+
- message(FATAL_ERROR "Cannot run a simple program using std::filesystem\nYou need to update your C++ compiler to use this library")
21+
+ message(STATUS "Could not run a simple program using std::filesystem\nYou might need to update your C++ compiler to use this library")
22+
endif()
23+
diff --git a/source/matplot/CMakeLists.txt b/source/matplot/CMakeLists.txt
24+
index fe9ad53..b059aa1 100644
25+
--- a/source/matplot/CMakeLists.txt
26+
+++ b/source/matplot/CMakeLists.txt
27+
@@ -102,7 +102,7 @@ target_include_directories(matplot
28+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
29+
30+
# Dependencies
31+
-if(NOT MINGW)
32+
+if(TARGET std::filesystem AND NOT MINGW)
33+
target_link_libraries_system(matplot
34+
PRIVATE cimg nodesoup std::filesystem)
35+
else()
36+
diff --git a/test/generate_examples/CMakeLists.txt b/test/generate_examples/CMakeLists.txt
37+
index 32d0145..c9f7d09 100644
38+
--- a/test/generate_examples/CMakeLists.txt
39+
+++ b/test/generate_examples/CMakeLists.txt
40+
@@ -1,8 +1,8 @@
41+
if(NOT MINGW)
42+
-find_package(Filesystem REQUIRED)
43+
+ find_package(Filesystem REQUIRED)
44+
endif()
45+
add_executable(generate_examples main.cpp)
46+
-if(NOT MINGW)
47+
-target_link_libraries(generate_examples std::filesystem)
48+
+if(TARGET std::filesystem)
49+
+ target_link_libraries(generate_examples std::filesystem)
50+
endif()
51+
-target_compile_features(generate_examples PRIVATE cxx_std_17)
52+
\ No newline at end of file
53+
+target_compile_features(generate_examples PRIVATE cxx_std_17)
54+
--
55+
2.34.1
56+

ports/matplotplusplus/portfile.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ vcpkg_from_github(
1515
PATCHES
1616
install-3rd-libraries.patch # Remove this patch when nodesoup is added in vcpkg
1717
fix-dependencies.patch
18-
fix-pass-filesystem-s-required-flags-for-osx-failure.patch
18+
0001-fix-pass-filesystem-s-required-flags-for-osx-failure.patch
19+
0002-fix-fix-build-on-MacOS-when-FindFileSystem-fails.patch
1920
)
2021

2122
vcpkg_check_features(

versions/m-/matplotplusplus.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"versions": [
33
{
4-
"git-tree": "a498eed3b86401455af7bb16831f6db360e7c92f",
4+
"git-tree": "3b947996af5b3f8c96f678496c46966170a6ca53",
55
"version": "1.2.0",
66
"port-version": 0
77
},

0 commit comments

Comments
 (0)