Skip to content

Commit

Permalink
Merge pull request #1 from phaustin/miniconda
Browse files Browse the repository at this point in the history
allow for miniconda installation
  • Loading branch information
jkhoogland authored Apr 17, 2017
2 parents 6a03905 + cfbedb4 commit 4153da0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions FindPythonAnaconda.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# tested on OSX Yosemite and Ubuntu 14.04 LTS
# handle anaconda dependencies
cmake_minimum_required(VERSION 3.7)

option(ANACONDA_PYTHON_VERBOSE "Anaconda dependency info" OFF)

Expand All @@ -24,15 +25,16 @@ if(NOT CMAKE_FIND_ANACONDA_PYTHON_INCLUDED)
message("_e = ${_e}")
endif()

string (REGEX MATCH "anaconda" ANACONDA_PYTHON_FOUND "${_o}")
IF(IS_DIRECTORY ${_o})
set(ANACONDA_PYTHON_FOUND True)
endif()

if(ANACONDA_PYTHON_FOUND)
set( ANACONDA_PYTHON_DIR ${_o} )
message( "Found anaconda root directory ${ANACONDA_PYTHON_DIR}" )

# find python version
#
# bloody cmake puts it in error variable ???
set(_cmd python --version)
execute_process(
COMMAND ${_cmd}
Expand All @@ -50,7 +52,7 @@ if(NOT CMAKE_FIND_ANACONDA_PYTHON_INCLUDED)
message("_e = ${_e}")
endif()

string (REGEX MATCH "Python ([0-9]+)[.]([0-9]+)[.]([0-9]+)" _py_version_found "${_e}")
string (REGEX MATCH "Python ([0-9]+)[.]([0-9]+)[.]([0-9]+)" _py_version_found "${_o}")
#message("_py_version_found = ${_py_version_found}")
#message("CMAKE_MATCH_0 = ${CMAKE_MATCH_0}")
set( _py_version_major ${CMAKE_MATCH_1} )
Expand All @@ -69,8 +71,8 @@ if(NOT CMAKE_FIND_ANACONDA_PYTHON_INCLUDED)

if( NOT DEFINED ENV{CONDA_DEFAULT_ENV} )
set( env_CONDA_DEFAULT_ENV "root" )
else()
message( WARNING "Could not find anaconda environment setting; using default root" )
else()
set( env_CONDA_DEFAULT_ENV $ENV{CONDA_DEFAULT_ENV} )
endif()

Expand Down

0 comments on commit 4153da0

Please sign in to comment.