From b0ae11686fe2a7917604dc7136c97607ad34c8b3 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Tue, 17 Oct 2017 16:03:20 +0200 Subject: [PATCH] Require Matlab MX_LIBRARY component (#154) --- CMakeLists.txt | 2 +- octave/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18fe7b2..8fbcf61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -298,7 +298,7 @@ if (NLOPT_OCTAVE) endif () if (NLOPT_MATLAB) - find_package (Matlab) + find_package (Matlab COMPONENTS MX_LIBRARY) endif () if (OCTAVE_FOUND OR Matlab_FOUND) diff --git a/octave/CMakeLists.txt b/octave/CMakeLists.txt index 8586720..192d9b2 100644 --- a/octave/CMakeLists.txt +++ b/octave/CMakeLists.txt @@ -2,7 +2,7 @@ set (MFILES NLOPT_GN_DIRECT.m NLOPT_GN_DIRECT_L.m NLOPT_GN_DIRECT_L_RAND.m NLOPT set (M_DATA ${MFILES} nlopt_minimize.m nlopt_minimize_constrained.m) -if (Matlab_FOUND) +if (Matlab_FOUND AND Matlab_MX_LIBRARY) cmake_minimum_required (VERSION 3.3) # for the matlab_add_mex macro matlab_add_mex (NAME nlopt_optimize-mex SRC nlopt_optimize-mex.c OUTPUT_NAME nlopt_optimize LINK_TO ${nlopt_lib}) -- 2.30.2