32 lines
1016 B
CMake
Raw Normal View History

2016-10-30 18:24:19 +01:00
cmake_minimum_required (VERSION 2.8.12)
enable_testing()
project(component_checks)
set(MATLAB_FIND_DEBUG TRUE)
2018-08-09 18:06:22 +02:00
if(NOT "${MCR_ROOT}" STREQUAL "")
set(Matlab_ROOT_DIR "${MCR_ROOT}")
if(NOT EXISTS "${MCR_ROOT}")
message(FATAL_ERROR "MCR does not exist ${MCR_ROOT}")
endif()
endif()
2016-10-30 18:24:19 +01:00
# the success of the following command is dependent on the current configuration:
# - on 32bits builds (cmake is building with 32 bits), it looks for 32 bits Matlab
# - on 64bits builds (cmake is building with 64 bits), it looks for 64 bits Matlab
2019-11-11 23:01:05 +01:00
find_package(Matlab REQUIRED COMPONENTS ENG_LIBRARY MAT_LIBRARY
2018-08-09 18:06:22 +02:00
OPTIONAL_COMPONENTS MAIN_PROGRAM)
2016-10-30 18:24:19 +01:00
message(STATUS "FindMatlab libraries: ${Matlab_LIBRARIES}")
matlab_add_mex(
# target name
NAME cmake_matlab_test_wrapper1
# output name
OUTPUT_NAME cmake_matlab_mex1
SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
LINK_TO ${Matlab_LIBRARIES}
2019-11-11 23:01:05 +01:00
)