Skip to content

Commit

Permalink
Satisfy cmake-lint for out-of-source build checker
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Jul 10, 2023
1 parent 1c14987 commit b76480f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions experimental/cmake/PreventInSourceBuilds.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# From cpp-best-practices/cpp_starter_project This code is in the public domain
# This function will prevent in-source builds
function(AssureOutOfSourceBuilds)
# ~~~
# cmake-lint: disable=C0301
# From https://github.com/cpp-best-practices/cmake_template/blob/e2a8aef3997405a452c438f0181d91ff03c1e78d/cmake/PreventInSourceBuilds.cmake#L4.
# This code is in the public domain. This function will prevent in-source builds.
# ~~~
function(assure_out_of_source_builds)
# make sure the user doesn't play dirty with symlinks
get_filename_component(srcdir "${SST_TOP_SRC_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
Expand All @@ -22,4 +25,4 @@ function(AssureOutOfSourceBuilds)
endif()
endfunction()

assureoutofsourcebuilds()
assure_out_of_source_builds()

0 comments on commit b76480f

Please sign in to comment.