From 8f27e53ed4e14ed643cd21d4e7b1c080642f2461 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 24 Apr 2024 20:00:01 +0100 Subject: [PATCH] Start: Allow system Microsoft GSL to be used --- src/Mod/Start/App/AppStart.cpp | 2 +- src/Mod/Start/CMakeLists.txt | 9 ++++++++- src/Mod/Start/Gui/AppStartGui.cpp | 2 +- src/Mod/Start/Gui/FileCardDelegate.cpp | 2 +- src/Mod/Start/Gui/Manipulator.cpp | 2 +- src/Mod/Start/Gui/StartView.cpp | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Mod/Start/App/AppStart.cpp b/src/Mod/Start/App/AppStart.cpp index 95011f1a9a..3bed957bde 100644 --- a/src/Mod/Start/App/AppStart.cpp +++ b/src/Mod/Start/App/AppStart.cpp @@ -29,7 +29,7 @@ #include -#include <3rdParty/GSL/include/gsl/pointers> +#include namespace Start { diff --git a/src/Mod/Start/CMakeLists.txt b/src/Mod/Start/CMakeLists.txt index 8583e280a4..4991bc3a98 100644 --- a/src/Mod/Start/CMakeLists.txt +++ b/src/Mod/Start/CMakeLists.txt @@ -21,8 +21,15 @@ # * * # ***************************************************************************/ -if( NOT EXISTS "${CMAKE_SOURCE_DIR}/src/3rdParty/GSL" ) +if ( EXISTS "${CMAKE_SOURCE_DIR}/src/3rdParty/GSL/include" ) + include_directories( ${CMAKE_SOURCE_DIR}/src/3rdParty/GSL/include ) +else() + find_package(Microsoft.GSL) + if( Microsoft.GSL_FOUND ) + message( STATUS "Found Microsoft.GSL: version ${Microsoft.GSL_VERSION}" ) + else() message( SEND_ERROR "The C++ Guidelines Support Library (GSL) submodule is not available. Please run git submodule update --init" ) + endif() endif() add_subdirectory(App) diff --git a/src/Mod/Start/Gui/AppStartGui.cpp b/src/Mod/Start/Gui/AppStartGui.cpp index c33b3dc64f..ad2898e9dc 100644 --- a/src/Mod/Start/Gui/AppStartGui.cpp +++ b/src/Mod/Start/Gui/AppStartGui.cpp @@ -35,7 +35,7 @@ #include -#include <3rdParty/GSL/include/gsl/pointers> +#include #include "Manipulator.h" #include "StartView.h" diff --git a/src/Mod/Start/Gui/FileCardDelegate.cpp b/src/Mod/Start/Gui/FileCardDelegate.cpp index d8122dbf9b..4255980dd6 100644 --- a/src/Mod/Start/Gui/FileCardDelegate.cpp +++ b/src/Mod/Start/Gui/FileCardDelegate.cpp @@ -39,7 +39,7 @@ #include "../App/DisplayedFilesModel.h" #include "App/Application.h" #include -#include <3rdParty/GSL/include/gsl/pointers> +#include using namespace Start; diff --git a/src/Mod/Start/Gui/Manipulator.cpp b/src/Mod/Start/Gui/Manipulator.cpp index ebf0e525a5..1682bb9cda 100644 --- a/src/Mod/Start/Gui/Manipulator.cpp +++ b/src/Mod/Start/Gui/Manipulator.cpp @@ -36,7 +36,7 @@ #include #include -#include <3rdParty/GSL/include/gsl/pointers> +#include DEF_STD_CMD(CmdStart) diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index a655d11476..ed2d0f48b1 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -45,7 +45,7 @@ #include #include #include -#include <3rdParty/GSL/include/gsl/pointers> +#include using namespace StartGui;