<commit_before>#  minimum required cmake version: 3.1.0
cmake_minimum_required(VERSION 3.1.0)

project(RealsenseMatlabWrappers)

# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# View the makefile commands during build
#set(CMAKE_VERBOSE_MAKEFILE on)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

find_package(Matlab COMPONENTS MX_LIBRARY MAT_LIBRARY REQUIRED)
set(DEPENDENCIES realsense2 ${Matlab_MAT_LIBRARY})

set(MATLAB_CPP librealsense_mex.cpp Factory.cpp)
set(MATLAB_H Factory.h MatlabParamParser.h rs2_type_traits.h types.h)
set(MATLAB_M align.m camera_info.m colorizer.m config.m context.m
             decimation_filter.m depth_frame.m depth_sensor.m
             depth_stereo_sensor.m device.m device_hub.m disparity_frame.m
             disparity_transform.m depth_example.m format.m frame.m frameset.m
             frame_metadata_value.m frame_queue.m hole_filling_filter.m
             motion_frame.m motion_stream_profile.m option.m options.m pipeline.m
             pipeline_profile.m playback.m playback_status.m pointcloud.m points.m
             pose_frame.m processing_block.m recorder.m roi_sensor.m
             rosbag_example.m sensor.m spatial_filter.m stream.m stream_profile.m
             syncer.m temporal_filter.m timestamp_domain.m video_frame.m video_stream_profile.m
   )

matlab_add_mex(NAME librealsense_mex
               SRC ${MATLAB_CPP} ${MATLAB_H}
               LINK_TO ${DEPENDENCIES})

#TODO: additionally, the compiled mex file and all the .m files need to be copied into a folder called `+realsense` at the install site<commit_msg>Add Matlab project to Wrappers folder<commit_after>#  minimum required cmake version: 3.1.0
cmake_minimum_required(VERSION 3.1.0)

project(RealsenseMatlabWrappers)

# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# View the makefile commands during build
#set(CMAKE_VERBOSE_MAKEFILE on)

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

find_package(Matlab COMPONENTS MX_LIBRARY MAT_LIBRARY REQUIRED)
set(DEPENDENCIES realsense2 ${Matlab_MAT_LIBRARY})

set(MATLAB_CPP librealsense_mex.cpp Factory.cpp)
set(MATLAB_H Factory.h MatlabParamParser.h rs2_type_traits.h types.h)
set(MATLAB_M align.m camera_info.m colorizer.m config.m context.m
             decimation_filter.m depth_frame.m depth_sensor.m
             depth_stereo_sensor.m device.m device_hub.m disparity_frame.m
             disparity_transform.m depth_example.m format.m frame.m frameset.m
             frame_metadata_value.m frame_queue.m hole_filling_filter.m
             motion_frame.m motion_stream_profile.m option.m options.m pipeline.m
             pipeline_profile.m playback.m playback_status.m pointcloud.m points.m
             pose_frame.m processing_block.m recorder.m roi_sensor.m
             rosbag_example.m sensor.m spatial_filter.m stream.m stream_profile.m
             syncer.m temporal_filter.m timestamp_domain.m video_frame.m video_stream_profile.m
   )

matlab_add_mex(NAME librealsense_mex
               SRC ${MATLAB_CPP} ${MATLAB_H}
               LINK_TO ${DEPENDENCIES})
set_target_properties(librealsense_mex PROPERTIES FOLDER Wrappers)

#TODO: additionally, the compiled mex file and all the .m files need to be copied into a folder called `+realsense` at the install site
{'fraction_non_alphanumeric': 0.07751552795031055, 'fraction_numerical': 0.010434782608695653, 'mean_word_length': 4.368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3689146', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1412, 'n_words': 284}