Skip to content

Commit

Permalink
Merge pull request #72 from GEOS-ESM/feature/mathomp4/clever-build-in…
Browse files Browse the repository at this point in the history
…stall-ignore-adas

Use CMake to ignore build and install directories
  • Loading branch information
mathomp4 committed Apr 19, 2021
2 parents 818b38d + 75f59d3 commit 4594711
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
/@cmake/
/@modules/
/@env/
/BUILD/
/build*/
/install*/
/.mepo/
parallel_build.o*
log.*
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,14 @@ include_directories(${MPI_Fortran_INCLUDE_PATH})
add_subdirectory (@env)
add_subdirectory (src)

# 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}
)

0 comments on commit 4594711

Please sign in to comment.