CMake: generate a .gitignore file for the build directory

As soon as a configuration step is successful, a .gitignore file
is created inside an out-of-source build directory. Hence,
there is no need to put its name into the root .gitignore file.
This commit is contained in:
Yegor Yefremov
2025-02-25 11:35:02 +01:00
parent 26ca0bd146
commit 6ea6778f2b
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@@ -1,5 +1,4 @@
**/CMakeCache.txt
**/CMakeFiles
build
checker
abi-checker

View File

@@ -27,6 +27,11 @@ project(FreeRDP LANGUAGES C)
add_custom_target(fuzzers COMMENT "Build fuzzers")
if(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# Git auto-ignore out-of-source build directory
file(GENERATE OUTPUT .gitignore CONTENT "*")
endif()
if(NOT DEFINED VENDOR)
set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor")
endif()