aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-10-15 13:13:34 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-10-15 13:13:38 +0200
commit303628bb0579f13d3ceac915b3caaf4d7fc9b2db (patch)
tree40aed476e8ec8ed5e5e49aab330bbae79213140d
parent89e45a61b33ed7ae73aa9903149530462fd760b6 (diff)
downloadPrismLauncher-303628bb0579f13d3ceac915b3caaf4d7fc9b2db.tar.gz
PrismLauncher-303628bb0579f13d3ceac915b3caaf4d7fc9b2db.tar.bz2
PrismLauncher-303628bb0579f13d3ceac915b3caaf4d7fc9b2db.zip
refactor: support system ghc-filesystem
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--CMakeLists.txt17
-rw-r--r--launcher/CMakeLists.txt2
2 files changed, 13 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45dd691d..310cec59 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,13 +189,13 @@ if (Qt5_POSITION_INDEPENDENT_CODE)
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
-# Find toml++
if(NOT Launcher_FORCE_BUNDLED_LIBS)
+ # Find toml++
find_package(tomlplusplus 3.2.0 QUIET)
-endif()
-# Workaround ghc::filesystem bug
-set(GHC_FILESYSTEM_WITH_INSTALL OFF)
+ # Find ghc_filesystem
+ find_package(ghc_filesystem QUIET)
+endif()
####################################### Program Info #######################################
@@ -326,7 +326,14 @@ endif()
add_subdirectory(libraries/katabasis) # An OAuth2 library that tried to do too much
add_subdirectory(libraries/gamemode)
add_subdirectory(libraries/murmur2) # Hash for usage with the CurseForge API
-add_subdirectory(libraries/filesystem) # Implementation of std::filesystem for old C++, for usage in old macOS
+if (NOT ghc_filesystem_FOUND)
+ message(STATUS "Using bundled ghc_filesystem")
+ set(GHC_FILESYSTEM_WITH_INSTALL OFF) # Workaround ghc::filesystem bug
+ add_subdirectory(libraries/filesystem) # Implementation of std::filesystem for old C++, for usage in old macOS
+ add_library(ghcFilesystem::ghc_filesystem ALIAS ghc_filesystem)
+else()
+ message(STATUS "Using system ghc_filesystem")
+endif()
############################### Built Artifacts ###############################
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index d04f3e4d..c7d0d68c 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -976,7 +976,7 @@ target_link_libraries(Launcher_logic
BuildConfig
Katabasis
Qt${QT_VERSION_MAJOR}::Widgets
- ghc_filesystem
+ ghcFilesystem::ghc_filesystem
)
if (UNIX AND NOT CYGWIN AND NOT APPLE)