Commit Graph

121 Commits

Author SHA1 Message Date
scivision
39881de3f6 FindMatlab:macOS: return full version when found by path guess 2023-09-18 15:50:48 -04:00
scivision
35bcb9116c FindMatlab:lint: set(... CACHE INTERNAL) implies FORCE 2023-09-18 15:23:21 -04:00
scivision
dc9d9589e4 FindMatlab:WIN32: return full Matlab version when found via registry
rework internal XML reading function for better code reuse and
namespace isolation
2023-09-18 15:23:21 -04:00
scivision
abbfdd3b3a FindMatlab: improve version regex
the matlab_versions_mapping always has at least major.minor
2023-09-18 15:23:21 -04:00
scivision
ff20d993f3 FindMatlab: doc: rename osx=>macOS 2023-09-18 15:09:51 -04:00
scivision
d7b73f14c2 FindMatlab: retrieve full major.minor.patch.tweak 2023-09-18 15:09:49 -04:00
scivision
8b8135487f FindMatlab: refactor: remove unneeded syntax 2023-09-18 15:07:53 -04:00
scivision
fff5c1507e FindMatlab: refactor: use registry query instead of execute_process
On Windows,
instead of executing "reg query" it's much simpler and more robust
to use cmake's built in registry query.

Remove unused variables. Significantly reduces amount of code in
function.
2023-09-18 15:07:52 -04:00
scivision
cf7ea12a7e FindMatlab: Add R2023b=23.2
Matlab went to a new version numbering scheme with R2023b.
2023-09-15 09:03:32 -04:00
scivision
8ea398a7af FindMatlab: Prefer to use VersionInfo.xml to get version, fallback to run
Parsing the version file is much faster than running Matlab.
It also improves reliability as Matlab silently quits or hangs
in some misconfigured environments.

For old Matlab, falls back to running Matlab.

also refactor file(STRINGS => file(READ as whole file was read anyway

Fixes: #25209
2023-09-09 22:23:05 -04:00
scivision
7d7fe9981c FindMatlab: use if(IS_DIRECTORY) for directories instead of EXISTS 2023-08-27 18:27:39 -04:00
scivision
cf554750dd FindMatlab: no if(NOT EXIST) guard needed for file(MAKE_DIRECTORY) 2023-08-27 18:25:55 -04:00
Brad King
04b0d5c862 codespell: Fix typos 2023-05-22 16:51:15 -04:00
Brad King
6aa58ebaba Merge topic 'FindMatlab-R2023a'
58ab34d88a FindMatlab: add version/release map for R2023a

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8334
2023-03-17 07:46:54 -04:00
scivision
58ab34d88a FindMatlab: add version/release map for R2023a 2023-03-16 11:08:05 -04:00
scivision
1932ae0284 FindMatlab: refactor: use string(APPEND 2023-03-07 15:34:36 -05:00
scivision
c4cacdc7eb FindMatlab: use modern foreach()
remove unused superseded commented code
2023-03-07 15:34:35 -05:00
scivision
af05544c49 FindMatlab: document function input/output 2023-03-07 15:34:35 -05:00
scivision
257a3e870e FindMatlab: add Matlab_VERSION and document.
fixes #24569
2023-03-07 15:32:56 -05:00
Brad King
be4dcdf100 Merge topic 'FindMatlab-macos-rosetta'
1bc9b0f256 FindMatlab: accommodate Matlab running under Rosetta
8dcd14bb87 FindMatlab: simplify mexext find logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8063
2023-01-13 08:57:43 -05:00
scivision
1bc9b0f256 FindMatlab: accommodate Matlab running under Rosetta
fixes #24312
2023-01-12 09:47:09 -05:00
scivision
8dcd14bb87 FindMatlab: simplify mexext find logic
This eliminates an explicit for() loop
2023-01-12 08:41:13 -05:00
Jorrit Olthuis
6683c20f22 FindMatlab: Add SYSTEM include flag for matlab_add_mex
Add the `SYSTEM` flag for include directories provided by MATLAB, as the
the pragmas used are not compatible with GCC and generate a warning.

Fixes: #24166
2023-01-11 15:26:19 -05:00
Brad King
689eb0c306 Merge topic 'matlab-r2022b'
edbdfba3f5 FindMatlab: add R2022b 9.13 version map

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7683
2022-09-19 10:19:12 -04:00
Michael Hirsch
edbdfba3f5 FindMatlab: add R2022b 9.13 version map 2022-09-16 10:29:19 -04:00
Brad King
671509ff27 Merge topic 'FindMatlab-macos-arm64'
f0edac914a FindMatlab: Add MEX binary file suffix for Apple Silicon native Matlab

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7673
2022-09-15 09:05:53 -04:00
Michael Hirsch
f0edac914a FindMatlab: Add MEX binary file suffix for Apple Silicon native Matlab
The Matlab MEX binary file suffix is distinct for Apple Silicon.
2022-09-14 14:05:35 -04:00
Michael Hirsch
72dd680609 FindMatlab: follow CMP0074 <PackageName>_ROOT search behavior 2022-09-01 10:48:13 -04:00
Michael Hirsch
ba74c58ca4 FindMatlab: add'l check that Matlab test version file exists
this last resort check is for some HPC with "module load matlab"
not enacted that fail to catch in earlier checks. That would
error CMake configure even if find_package(Matlab) is not REQUIRED
2022-09-01 10:35:41 -04:00
Silvio
178cf34bdc FindMatlab: Add NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES option to matlab_add_mex 2022-04-05 08:27:09 -04:00
Silvio Traversaro
8468dfb35f FindMatlab: Use -batch option in matlab_add_unit_test if possible 2022-03-21 14:58:24 -04:00
Silvio
ebb0685824 FindMatlab: Add fallback to use -batch option in version extraction
Fixes: #22646
2022-03-18 15:36:04 +01:00
Michael Hirsch
6032213456 FindMatlab: Add R2022a => 9.12 version 2022-03-18 07:22:42 -04:00
Michael Hirsch
bb2c7b7dc0 FindMatlab: Fix logic error when minimum version is not found
Fix logic added by commit 7fdd5128b1 (FindMatlab: Fix version selection
if a version is given, 2021-07-02, v3.22.0-rc1~66^2).  Ensure that
`_list_index` is always initialized to -1, akin to `list(FIND)` not
finding a match.

Issue: #22377
2022-03-07 10:12:43 -05:00
Tom M
b8d885ed0d FindMatlab: Fix version detection for MCR >= 9.10
Recent MCR versions have the following `VersionInfo.xml`:

    <version>9.11.0.1837725</version>

Fix parsing of multiple digits in the version components
so that we do not mistake this for version `9.1`.
2022-02-14 10:23:33 -05:00
Alexander Neumann
7fdd5128b1 FindMatlab: Fix version selection if a version is given
Fixes: #22377
2021-09-29 14:33:36 -04:00
Brad King
1f8b4afbce Merge topic 'FindMatlab-r2021b'
a013404f43 FindMatlab: Add R2021b => 9.11 version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6556
2021-09-24 09:14:20 -04:00
Michael Hirsch
a013404f43 FindMatlab: Add R2021b => 9.11 version
R2021b released 09/22/2021.
2021-09-23 10:41:20 -04:00
Vincent Newsum
2f43ba5073 FindMatlab: Sort available Matlab versions using natural comparison.
On Windows, when FindMatlab.cmake searches the registry for installed Matlab versions, it sorts these versions alphabetically.
Since Matlab 2021a (version 9.10) came out this became a problem as now version 9.10 is placed after 9.1 instead of after a higher version less than 9.10.
The result is that FindMatlab doesn't return the highest version by default.
This fix uses the natural sort comparison which was introduced in CMake 3.18.
2021-09-22 09:43:56 +02:00
Silvio Traversaro
161990b921 FindMatlab: Add imported targets 2021-09-13 12:12:05 -04:00
Josef Angstenberger
87f8843d8b FindMatlab: Fix spelling in warning and documentation 2021-05-07 17:00:16 +02:00
Josef Angstenberger
dad5b9d845 Modules: Fix typos and spelling in comments 2021-05-07 17:00:15 +02:00
Michael Hirsch
427f5f2fa9 FindMatlab: R2021a version map 2021-03-15 09:10:07 -04:00
Silvio Traversaro
5ba1f4b6ee FindMatlab: Fix Matlab_LIBRARIES for MCR
In commit bda5e2ac8f (FindMatlab: Only include engine and dataarray
libraries if they are found, 2020-12-11, v3.20.0-rc1~297^2~1) we fixed
the imported target to contain optional libraries only if they are
found.  Do the same for `Matlab_LIBRARIES`.
2021-03-09 12:56:08 -05:00
Nikolaj Fogh
9c360b9eea FindMatlab: Fix search for MCR
Fixes: #21068, #21582
2020-12-11 11:30:59 -05:00
Nikolaj Fogh
bda5e2ac8f FindMatlab: Only include engine and dataarray libraries if they are found 2020-12-11 11:27:35 -05:00
Nikita Nemkin
8fea95319b Help: Add .. versionadded directives to module docs
Issue: #19715
2020-12-02 21:00:30 +05:00
Brad King
bdd0e28782 Merge topic 'FindMatlab-r2020b'
4d292aecb6 FindMatlab: add R2020b => 9.9

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5233
2020-09-18 08:41:08 -04:00
Michael Hirsch
4d292aecb6 FindMatlab: add R2020b => 9.9 2020-09-17 08:58:21 -04:00
Alexey Kreschuk
a3c389cb17 FindMatlab: set MATLAB_DEFAULT_RELEASE for unknown version
An "unknown" version does not always mean an old version.  Setting this
macro by mistake does not result in a compilation error, but not setting
it does.  I had this error when compiling from a user that does not have
a matlab license.
2020-07-08 08:56:10 -04:00