summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xWrappers/Matlab/CMakeLists.txt24
-rw-r--r--Wrappers/Python/CMakeLists.txt11
2 files changed, 28 insertions, 7 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})
diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt
index b4d334f..01b5208 100644
--- a/Wrappers/Python/CMakeLists.txt
+++ b/Wrappers/Python/CMakeLists.txt
@@ -16,7 +16,16 @@ find_package(PythonInterp REQUIRED)
if (PYTHONINTERP_FOUND)
message ("Current Python " ${PYTHON_VERSION_STRING} " found " ${PYTHON_EXECUTABLE})
endif()
-
+if (CONDA_BUILD)
+else()
+set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Matlab wrappers")
+ if (PYTHON_DEST_DIR)
+ set(PYTHON_DEST "${PYTHON_DEST_DIR}")
+ else()
+ set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python")
+ endif()
+ message(STATUS "Python wrappers will be installed in " ${PYTHON_DEST})
+endif()
## Build the regularisers package as a library
message("Creating Regularisers as shared library")