summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2017-10-24 12:59:12 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2017-10-24 12:59:12 +0100
commit57ccd56cacb3c437f706324f330af40a3a715f18 (patch)
tree7a511c41c6a03e2531970b17a36883c1c974b9e6
parent546104f8dfea5691801137c1be99d09e1e999d82 (diff)
downloadregularization-57ccd56cacb3c437f706324f330af40a3a715f18.tar.gz
regularization-57ccd56cacb3c437f706324f330af40a3a715f18.tar.bz2
regularization-57ccd56cacb3c437f706324f330af40a3a715f18.tar.xz
regularization-57ccd56cacb3c437f706324f330af40a3a715f18.zip
added targets and cache variables
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/Python/CMakeLists.txt48
2 files changed, 48 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d05cdd9..4cfad7e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,6 @@ set (CIL_VERSION_MAJOR 0)
set (CIL_VERSION_MINOR 9)
set (CIL_VERSION_PATCH 1)
-set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}')
+set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}' CACHE INTERNAL "Core Imaging Library version" FORCE)
add_subdirectory(src)
diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt
index c5e14ea..1399c71 100644
--- a/src/Python/CMakeLists.txt
+++ b/src/Python/CMakeLists.txt
@@ -64,6 +64,16 @@ message("Python found Minor " ${PYTHON_VERSION_MINOR})
findPythonPackagesPath()
message("PYTHON_PACKAGES_FOUND " ${PYTHON_PACKAGES_PATH})
+## CACHE SOME VARIABLES ##
+set (CONDA_ENVIRONMENT ${CONDA_ENVIRONMENT} CACHE INTERNAL "active conda environment" FORCE)
+set (CONDA_ENVIRONMENT_PATH ${CONDA_ENVIRONMENT_PATH} CACHE INTERNAL "active conda environment" FORCE)
+
+set (PYTHON_VERSION_STRING ${PYTHON_VERSION_STRING} CACHE INTERNAL "conda environment Python version string" FORCE)
+set (PYTHON_VERSION_MAJOR ${PYTHON_VERSION_MAJOR} CACHE INTERNAL "conda environment Python version major" FORCE)
+set (PYTHON_VERSION_MINOR ${PYTHON_VERSION_MINOR} CACHE INTERNAL "conda environment Python version minor" FORCE)
+set (PYTHON_VERSION_PATCH ${PYTHON_VERSION_PATCH} CACHE INTERNAL "conda environment Python version patch" FORCE)
+set (PYTHON_PACKAGES_PATH ${PYTHON_PACKAGES_PATH} CACHE INTERNAL "conda environment Python packages path" FORCE)
+
if (WIN32)
#set (CONDA_ENVIRONMENT_PATH "C:\\Apps\\Miniconda2\\envs\\${CONDA_ENVIRONMENT}" CACHE PATH "Main environment directory")
set (CONDA_ENVIRONMENT_PREFIX "${CONDA_ENVIRONMENT_PATH}\\Library" CACHE PATH "env dir")
@@ -123,7 +133,43 @@ elseif(UNIX)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/compile-fista.sh.in ${CMAKE_CURRENT_BINARY_DIR}/compile-fista.sh)
endif()
-
+############################# TARGETS
+
+########################## REGULARIZER PACKAGE ###############################
+
+# runs cmake on the build tree to update the code from source
+add_custom_target(update_code
+ COMMAND ${CMAKE_COMMAND}
+ ARGS ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+ )
+
+
+add_custom_target(fista
+ COMMAND bash
+ compile-fista.sh
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${update_code}
+ )
+
+add_custom_target(regularizers
+ COMMAND bash
+ compile.sh
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${update_code}
+ )
+
+add_custom_target(install-fista
+ COMMAND conda
+ install --force --use-local ccpi-fista=${CIL_VERSION} -c ccpi -c conda-forge
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${fista})
+
+add_custom_target(install-regularizers
+ COMMAND conda
+ install --force --use-local ccpi-regularizers=${CIL_VERSION} -c ccpi -c conda-forge
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${fista})
### add tests
#add_executable(RegularizersTest )