You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some parameters (like "${CMAKE_INSTALL_PREFIX}/bin" and "${CMAKE_CURRENT_SOURCE_DIR}") are passed to CMake commands in your build scripts without enclosing them by quotation marks. I see that these places will result in build difficulties if the contents of the used variables will contain special characters like spaces.
Sorry, but can't reproduce the issue. Actually I did start to quote every variable which might contain a path, but soon realized that none of that is necessary. I tried doing build, running tests and installing in path with spaces and it ran flawlessly. I also did some testing:
I assumed this would print three lines (containing /path, with, spaces/file.txt), but it actually behaved correctly and printed just one line containing /path with spaces/file.txt. So I conclude as long as the original variable (prefix) is created as string (quoted) and not as a list of strings (unquoted), all following variable replacements will treat it as whole string and not split it again. And all CMAKE_*_PREFIX and CMAKE_*_DIR are presented to the scripts as string values.
This is actually pretty awesome (unlike in shell, which would go haywire in this case).
Some parameters (like "${CMAKE_INSTALL_PREFIX}/bin" and "${CMAKE_CURRENT_SOURCE_DIR}") are passed to CMake commands in your build scripts without enclosing them by quotation marks. I see that these places will result in build difficulties if the contents of the used variables will contain special characters like spaces.
I would recommend to apply advices from a Wiki article.
The text was updated successfully, but these errors were encountered: