Closed certik closed 1 year ago
this creates file ${CMAKE_CURRENT_BINARY_DIR}/.gitignore. It doesn't affect the repository source .gitignore. It implicitly is in the build directory
Oh I see, if one is using in-source build then it would overwrite--this logic fixes that.
if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# Git auto-ignore out-of-source build directory
file(GENERATE OUTPUT .gitignore CONTENT "*")
endif()
Ok, now it should work.
Oops I made a silly mistake. I put the correct logic in #28 .
if(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
Can you send a PR with just this change? I have to test carefully every change to the build system.
I sent a PR with this fix here: https://github.com/certik/fastGPT/pull/35
That way we do not have uncommitted git changes just by running cmake.