From 31097954f87d0f30f667b29a12f7098710c284ab Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 25 Oct 2017 10:48:48 +0100 Subject: Use MATCH and CMAKE_MATCH_ --- src/Python/CMakeLists.txt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index e539eda..b464059 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -36,17 +36,11 @@ 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() @@ -58,7 +52,7 @@ if (${CONDA_ENVIRONMENT} AND ${CONDA_ENVIRONMENT_PATH}) else() message("**********************************************************") message("Using current conda environmnet " ${CONDA_ENVIRONMENT}) - message("Using current conda environmnet path" ${CONDA_ENVIRONMENT_PATH}) + message("Using current conda environmnet path " ${CONDA_ENVIRONMENT_PATH}) endif() -- cgit v1.2.3