Skip to content

Commit

Permalink
Escape special characters (#1862)
Browse files Browse the repository at this point in the history
* Escape special characters for problematic Windows paths when calling nrnivmodl
  • Loading branch information
jorblancoa authored and alexsavulescu committed Jul 1, 2022
1 parent 50688ad commit 285d7f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/NeuronTestHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ function(nrn_add_test_group)
# Add a rule to build the modfiles for this test group. Multiple groups may ask for exactly the
# same thing (testcorenrn), so it's worth deduplicating.
set(hash_components ${NRN_ADD_TEST_GROUP_NRNIVMODL_ARGS})
# Escape special characters (problematic with Windows paths when calling nrnivmodl)
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" NRN_RUN_FROM_BUILD_DIR_ENV
"${NRN_RUN_FROM_BUILD_DIR_ENV}")
set(nrnivmodl_command cmake -E env ${NRN_RUN_FROM_BUILD_DIR_ENV}
${CMAKE_BINARY_DIR}/bin/nrnivmodl ${NRN_ADD_TEST_GROUP_NRNIVMODL_ARGS})
# The user decides whether or not this test group should have its MOD files compiled for
Expand Down

0 comments on commit 285d7f4

Please sign in to comment.