summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2017-10-25 10:48:48 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2017-10-25 10:48:48 +0100
commit31097954f87d0f30f667b29a12f7098710c284ab (patch)
tree8ab3793cdc6916110e94cba2fe4738546ec1408d
parent99b106a2ced10136a2a71b42440d8c1ffa4f8d2c (diff)
downloadregularization-31097954f87d0f30f667b29a12f7098710c284ab.tar.gz
regularization-31097954f87d0f30f667b29a12f7098710c284ab.tar.bz2
regularization-31097954f87d0f30f667b29a12f7098710c284ab.tar.xz
regularization-31097954f87d0f30f667b29a12f7098710c284ab.zip
Use MATCH and CMAKE_MATCH_<n>
-rw-r--r--src/Python/CMakeLists.txt18
1 files 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()