diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-08-06 21:38:06 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2018-08-06 21:38:06 +0100 |
commit | 4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b (patch) | |
tree | 2bcc0ec14d5773be16faa7f6bffda37b76120bed /Wrappers/Matlab | |
parent | 89d9b706aa5f6dfe3724e6bdb628f5c95e7425f6 (diff) | |
download | regularization-4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b.tar.gz regularization-4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b.tar.bz2 regularization-4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b.tar.xz regularization-4fa0c5bcd9e362cbdf2211edc85f30ec1dafee3b.zip |
add destination for wrapper
Diffstat (limited to 'Wrappers/Matlab')
-rwxr-xr-x | Wrappers/Matlab/CMakeLists.txt | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Wrappers/Matlab/CMakeLists.txt b/Wrappers/Matlab/CMakeLists.txt index e9cc6a8..9cbade9 100755 --- a/Wrappers/Matlab/CMakeLists.txt +++ b/Wrappers/Matlab/CMakeLists.txt @@ -2,6 +2,13 @@ project(regulariserMatlab) find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY )
+set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers")
+if (MATLAB_DEST_DIR)
+set(MATLAB_DEST "${MATLAB_DEST_DIR}")
+else()
+set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab")
+endif()
+message(STATUS "Matlab wrappers will be installed in " ${MATLAB_DEST})
#C:\Users\ofn77899\Documents\Projects\CCPi\GitHub\CCPi-FISTA_Reconstruction\Core\regularisers_CPU
@@ -38,7 +45,6 @@ find_package(Matlab REQUIRED COMPONENTS MAIN_PROGRAM MX_LIBRARY ENG_LIBRARY ) #list(APPEND MEX_TARGETS "CPU_TNV")
#list(APPEND MEX_TARGETS "CPU_ROF")
-set (CPU_TARGETS "CPU_TNV;CPU_ROF")
file(GLOB CPU_MEX_FILES
"${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/regularisers_CPU/*.c"
"${CMAKE_SOURCE_DIR}/Wrappers/Matlab/mex_compile/inpainters_CPU/*.c"
@@ -53,13 +59,17 @@ MATH(EXPR num "${num}-1") foreach(tgt RANGE ${num})
message("number " ${tgt})
#list(GET CPU_TARGETS ${tgt} current_target)
- list(GET CPU_MEX_FILES ${tgt} current_file)
- get_filename_component(current_target ${current_file} NAME)
- message("matlab_add_mex " ${current_target})
+ list(GET CPU_MEX_FILES ${tgt} current_file_name)
+ get_filename_component(current_file ${current_file_name} NAME)
+ string(REGEX MATCH "(.+).c" match ${current_file})
+ if (NOT ${match} EQUAL "" )
+ set (current_target ${CMAKE_MATCH_1})
+ endif()
+ message("matlab_add_mex target " ${current_file} " and " ${current_target})
matlab_add_mex(
NAME ${current_target}
SRC
- ${current_file}
+ ${current_file_name}
LINK_TO cilreg ${Matlab_LIBRARIES}
)
@@ -71,6 +81,7 @@ target_include_directories(${current_target} ${MATLAB_INCLUDE_DIR})
list(APPEND CPU_MEX_TARGETS ${current_target})
+ INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}")
endforeach()
add_custom_target(MatlabWrapper DEPENDS ${CPU_MEX_TARGETS})
@@ -108,7 +119,8 @@ if (BUILD_CUDA) ${CMAKE_SOURCE_DIR}/Core/
${MATLAB_INCLUDE_DIR})
- list(APPEND CPU_MEX_TARGETS ${current_target})
+ list(APPEND GPU_MEX_TARGETS ${current_target})
+ INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}")
endforeach()
add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS})
|