diff options
-rw-r--r-- | src/Python/CMakeLists.txt | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index 1399c71..66630cb 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -30,26 +30,24 @@ execute_process(COMMAND "conda" "env" "list" foreach(line ${ENV_LIST}) string(REGEX MATCHALL "(.+)[*](.+)" match ${line}) if (NOT ${match} EQUAL "") - string(REPLACE "*" ";" ENV_DIR ${match}) - list (APPEND cc "") - foreach(conda ${ENV_DIR}) - string(STRIP ${conda} stripped) - list(APPEND cc ${stripped}) - endforeach() - list(LENGTH cc Ns) - if (${Ns} EQUAL 2) - list(GET cc 0 CONDA_ENVIRONMENT) - list(GET cc 1 CONDA_ENVIRONMENT_PATH) - endif() + #message("MATCHED " ${CMAKE_MATCH_0}) + #message("MATCHED " ${CMAKE_MATCH_1}) + #message("MATCHED " ${CMAKE_MATCH_2}) + string(STRIP ${CMAKE_MATCH_1} CONDA_ENVIRONMENT) + string(STRIP ${CMAKE_MATCH_2} CONDA_ENVIRONMENT_PATH) endif() endforeach() else() message(FATAL_ERROR "ERROR with conda command " ${_CONDA_ERR}) endif() -message("**********************************************************") -message("Active conda environmnet: " ${CONDA_ENVIRONMENT}) -message("Active conda environmnet path: " ${CONDA_ENVIRONMENT_PATH}) +if (${CONDA_ENVIRONMENT} AND ${CONDA_ENVIRONMENT_PATH}) + message (FATAL_ERROR "CONDA NOT FOUND") +else() + message("**********************************************************") + message("Using current conda environmnet " ${CONDA_ENVIRONMENT}) + message("Using current conda environmnet path " ${CONDA_ENVIRONMENT_PATH}) +endif() message("CIL VERSION " ${CIL_VERSION}) |