Skip to content

Fix newline issue in execute_process command

Example:

execute_process( COMMAND node -e "require('nan')"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE NODE_ADDON_API_DIR)

When using execute_process to query for information, the returned directory in ${NODE_ADDON_API_DIR} contains a newline. This causes the Makefile generated to insert the ending quote in a new line, causing the Makefile to fail to compile.

Edited by Craig Scott

Merge request reports