When attempting to use an install line of the following form with the NSIS package generator:
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/outfile
COMMAND gen_file ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/outfile
DEPENDS gen_file
)
install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/outfile DESTINATION data)
I’m getting the following error and I’m not sure how to interpret it:
CMake Error at C:/project/build/cmake_install.cmake:65 (file):
file INSTALL cannot find
"C:/project/build/$(Configuration)/outfile":
File exists.
The configuration is Release, and if I look in the release directory the file is indeed present - what is this error referring to? (The same build, by the way, does work with Release configuration of the Ninja Multi-Config generator on Linux…)