For my a test suite I want to test a Python script,
I have the arguments in a variable like
SET(MATVIZ_ARGS „—res 2 —type bulk2d’")
and call it similar to
EXECUTE_PROCESS(
COMMAND "${MATVIZ_PY}" "${MATVIZ_ARGS}"
WORKING_DIRECTORY "${CCSD}"
ERROR_VARIABLE MATVIZ_ERROR
RESULT_VARIABLE MATVIZ_RETVAL
)
print sys.args in the python script then tells me that there is one argument
with spaces
[‚…py‘, ‚—res 2 --type bulk2d']
separate_arguments(MATVIZ_ARGS_LIST UNIX_COMMAND „${MATVIZ_ARGS}“)
COMMAND "${MATVIZ_PY}" "${MATVIZ_ARGS_LIST}"
does also not work, it delivers
[‚.…py‘, '--res;2;--type;bulk2d']
Trying various ways did not help.
I do not know in advance how many arguments my MATVIZ_ARGS will hold.
Is there a way to achieve it? The only idea I have at the moment is to have a
small python script
that gets all arguments in one argument and does a system call via python but I
would prefer a
clean cmake solution.
Thank you very much for any suggestion,
Fabian
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake