Variable isn't substituted using `set` and `configure_file` inside `install("CODE ...")`
Not sure if this is expected behavior or if I am not referencing ${VAR} properly, but I would have expect this to work:
install(CODE "
set(VAR value)
configure_file(
${SOURCE_DIR}/X.h.in
${VAR}/X.h
@ONLY)
")
where ${SOURCE_DIR}/X.h.in
contains:
@VAR@
The file X.h
shows the substitution ok: value
But the resulting file path of X.h
is not correct, and ${VAR}
there is empty.