I think the answer to this is “no” from my reading of the docs, but I want to be sure. In my project, I have this little chunk of code from @scivision where we auto-gitignore our build dirs and I then use install()
to auto-gitignore install dirs:
# https://www.scivision.dev/cmake-auto-gitignore-build-dir/
# --- auto-ignore build directory
if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore)
file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*")
endif()
# Piggyback that file into install
install(
FILES ${PROJECT_BINARY_DIR}/.gitignore
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
And it seems to work great! The one sort of annoying thing is this:
-- Installing: /path/to/install-Release/.gitignore
I was just wondering if there was a way I could quiet that message for just that install? Just to make my install stage a little more focused on files that matter?
I do know about (and use) CMAKE_INSTALL_MESSAGE
and have:
set (CMAKE_INSTALL_MESSAGE LAZY)
set in my projects and I know I could do NEVER
but that would suppress all my install messages and I do like to see them for the things that matter.