diff --git a/src/rotare.m b/src/rotare.m index 0823eb6265189da8b2be626efc4fd6784103e08e..3ffb09cf7d7ba36a0bd1480d216246e20a964524 100644 --- a/src/rotare.m +++ b/src/rotare.m @@ -57,7 +57,7 @@ function [Results] = rotare(configFile) addpath(genpath('.')); rmpath(genpath('./airfoil_data/')); addpath('./airfoil_data/'); - if license('test', 'Aerospace_Toolbox') + if istoolboxinstalled('Aerospace Toolbox') rmpath('./libs/octave-atmosisa/'); end diff --git a/src/utils/istoolboxinstalled.m b/src/utils/istoolboxinstalled.m new file mode 100644 index 0000000000000000000000000000000000000000..3f35d71be1c3e9bc0311406ba16a30552239d934 --- /dev/null +++ b/src/utils/istoolboxinstalled.m @@ -0,0 +1,31 @@ +function result = istoolboxinstalled(toolbox) + % ISTOOLBOXINSTALLED Check if a toolbox is installed and available + % ----- + % + % Syntax: + % result = isToolboxInstalled(toolbox) returns true if the toolbox is intalled. + % + % Inputs: + % toolbox: Name of a toolbox, as displayed in `ver` command + % + % Outputs: + % result : boolean that indicates if toolbox is installed + % + % See also: ver. + % + % <a href="https://gitlab.uliege.be/rotare/documentation">Complete documentation (online)</a> + + % ---------------------------------------------------------------------------------------------- + % (c) Copyright 2022-2024 University of Liege + % Author: Thomas Lambert <t.lambert@uliege.be> + % ULiege - Aeroelasticity and Experimental Aerodynamics + % MIT License + % Repo: https://gitlab.uliege.be/rotare/rotare + % Docs: https://gitlab.uliege.be/rotare/documentation + % Issues: https://gitlab.uliege.be/rotare/rotare/-/issues + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + v = ver; + result = any(strcmp(toolbox, {v.Name})); + +end