diff options
Diffstat (limited to 'tensorflow/contrib/cmake/tf_python.cmake')
-rwxr-xr-x | tensorflow/contrib/cmake/tf_python.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tensorflow/contrib/cmake/tf_python.cmake b/tensorflow/contrib/cmake/tf_python.cmake index b62a031749..8862390d2b 100755 --- a/tensorflow/contrib/cmake/tf_python.cmake +++ b/tensorflow/contrib/cmake/tf_python.cmake @@ -126,7 +126,8 @@ STRING(REGEX REPLACE ";" "\\\\;" python_protos "${python_protos}") STRING(REGEX REPLACE "\n" ";" python_protos "${python_protos}") foreach(python_proto ${python_protos}) - if(NOT python_proto MATCHES "\#") + if(NOT python_proto MATCHES "^\#") + STRING(REGEX REPLACE " *\#.*" "" python_proto "${python_proto}") if(NOT EXISTS "${tensorflow_source_dir}/${python_proto}") message(SEND_ERROR "Python proto directory not found: ${python_proto}") endif() @@ -147,7 +148,8 @@ STRING(REGEX REPLACE ";" "\\\\;" python_protos_cc "${python_protos_cc}") STRING(REGEX REPLACE "\n" ";" python_protos_cc "${python_protos_cc}") foreach(python_proto_cc ${python_protos_cc}) - if(NOT python_proto_cc MATCHES "\#") + if(NOT python_proto_cc MATCHES "^\#") + STRING(REGEX REPLACE " *\#.*" "" python_proto_cc "${python_proto_cc}") if(NOT EXISTS "${tensorflow_source_dir}/${python_proto_cc}") message(SEND_ERROR "Python proto CC directory not found: ${python_proto_cc}") endif() @@ -209,7 +211,8 @@ STRING(REGEX REPLACE ";" "\\\\;" python_modules "${python_modules}") STRING(REGEX REPLACE "\n" ";" python_modules "${python_modules}") foreach(python_module ${python_modules}) - if(NOT python_module MATCHES "\#") + if(NOT python_module MATCHES "^\#") + STRING(REGEX REPLACE " *\#.*" "" python_module "${python_module}") if(NOT EXISTS "${tensorflow_source_dir}/${python_module}") message(SEND_ERROR "Python module not found: ${python_module}") endif() |