The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=13302 ====================================================================== Reported By: Jean-Christophe Fillion-Robin Assigned To: ====================================================================== Project: CMake Issue ID: 13302 Category: CTest Reproducibility: N/A Severity: feature Priority: normal Status: new ====================================================================== Date Submitted: 2012-06-13 21:05 EDT Last Modified: 2012-06-13 21:05 EDT ====================================================================== Summary: Improve mechanism allowing to pass command line parameter to ctest script Description: When setting up dashboard it is sometimes useful to pass parameter to ctest script.
A possible approach is to pass parameters doing the following: ctest -S /path/to/script.cmake,OPTNAME1##OPTVALUE1^^OPTNAME2##OPTVALUE2 Then, the following code can be used in the called CTest script to "extract" the associated value: if(NOT CTEST_SCRIPT_ARG STREQUAL "") string(REPLACE "^^" "\\;" CTEST_SCRIPT_ARG_AS_LIST "${CTEST_SCRIPT_ARG}") set(CTEST_SCRIPT_ARG_AS_LIST ${CTEST_SCRIPT_ARG_AS_LIST}) foreach(argn_argv ${CTEST_SCRIPT_ARG_AS_LIST}) string(REPLACE "##" "\\;" argn_argv_list ${argn_argv}) set(argn_argv_list ${argn_argv_list}) list(GET argn_argv_list 0 argn) list(GET argn_argv_list 1 argv) set(${argn} ${argv}) endforeach() endif() When more complex value, like URL are passed as parameter, special characters like ":" need also to be "encoded". See issue http://public.kitware.com/Bug/view.php?id=12953 A mechanism similar to what's done with "cmake" executable could probably be implemented. It means parameter could be passed using: -DOPTNAME1:STRING=OPTVALUE1 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2012-06-13 21:05 Jean-Christophe Fillion-RobinNew Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers