diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2017-10-19 17:07:48 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2017-10-19 17:07:48 +0100 |
commit | b6c314b371ef3081828fa007cd3fcaf1dc820477 (patch) | |
tree | afad1650c27d2f7293f5caa78c2f009c73001339 /src/Python | |
parent | fe4e60b66c1aeccb373b013bfd8396ce413d9d3e (diff) | |
download | regularization-b6c314b371ef3081828fa007cd3fcaf1dc820477.tar.gz regularization-b6c314b371ef3081828fa007cd3fcaf1dc820477.tar.bz2 regularization-b6c314b371ef3081828fa007cd3fcaf1dc820477.tar.xz regularization-b6c314b371ef3081828fa007cd3fcaf1dc820477.zip |
First commit of CMakeLists.txt
attempting to locate conda python environment
Diffstat (limited to 'src/Python')
-rw-r--r-- | src/Python/CMakeLists.txt | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt new file mode 100644 index 0000000..a75c062 --- /dev/null +++ b/src/Python/CMakeLists.txt @@ -0,0 +1,79 @@ +cmake_minimum_required (VERSION 3.0) + +project(FISTA) + +# The version number. +set (FISTA_VERSION_MAJOR 1) +set (FISTA_VERSION_MINOR 0) + +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}') + +message("CIL VERSION " ${CIL_VERSION}) + +# variables we need to run the conda build +#PREFIX=C:\Apps\Miniconda2\envs\cil\Library +#LIBRARY_INC=C:\\Apps\\Miniconda2\\envs\\cil\\Library\\include + +set (NUMPY_VERSION 1.12) +#set (PYTHON_VERSION 3.5) + +#https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/R9gWjl09UFs +set (CONDA_ENVIRONMENT "C:\\Apps\\Miniconda2\\envs\\cil27" CACHE PATH "env dir") + +function (findPythonForAnacondaEnvironment env) + + file(TO_CMAKE_PATH ${env}/python.exe PYTHON_EXECUTABLE) + + message("Found " ${PYTHON_EXECUTABLE}) + execute_process(COMMAND ${PYTHON_EXECUTABLE} pythonversion.py major + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE major + ERROR_QUIET) + execute_process(COMMAND ${PYTHON_EXECUTABLE} pythonversion.py minor + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE minor + ERROR_QUIET) + execute_process(COMMAND ${PYTHON_EXECUTABLE} pythonversion.py patch + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE patch + ERROR_QUIET) + execute_process(COMMAND ${PYTHON_EXECUTABLE} pythonversion.py + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE version + ERROR_QUIET) + + + set (PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} PARENT_SCOPE) + set (PYTHONINTERP_FOUND "ON" PARENT_SCOPE) + set (PYTHON_VERSION_STRING ${version}) + message("My version found " ${PYTHON_VERSION_STRING}) + +endfunction() + +findPythonForAnacondaEnvironment(${CONDA_ENVIRONMENT}) + +set(Python_ADDITIONAL_VERSIONS 3) + +find_package(PythonInterp) +if (PYTHONINTERP_FOUND) + + message("Found interpret " ${PYTHON_EXECUTABLE}) + + foreach(pv ${PYTHON_VERSION_STRING}) + message("Found interpret " ${pv}) + endforeach() +endif() + +find_package(PythonLibs) +if (PYTHONLIB_FOUND) + message("Found PythonLibs PYTHON_LIBRARIES " ${PYTHON_LIBRARIES}) + message("Found PythonLibs PYTHON_INCLUDE_PATH " ${PYTHON_INCLUDE_PATH}) + message("Found PythonLibs PYTHON_INCLUDE_DIRS " ${PYTHON_INCLUDE_DIRS}) + message("Found PythonLibs PYTHONLIBS_VERSION_STRING " ${PYTHONLIBS_VERSION_STRING} ) + +endif() + |