Use current source / binary dir when assuring out of source builds (#1527)

Co-authored-by: Jordan Bayles <bayles.jordan@gmail.com>
This commit is contained in:
Lars Müller 2024-09-10 04:56:37 +02:00 committed by GitHub
parent fdb529bd06
commit 2072e2b4e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,8 +2,8 @@
# This function will prevent in-source builds
function(AssureOutOfSourceBuilds)
# make sure the user doesn't play dirty with symlinks
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
get_filename_component(srcdir "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH)
get_filename_component(bindir "${CMAKE_CURRENT_BINARY_DIR}" REALPATH)
# disallow in-source builds
if("${srcdir}" STREQUAL "${bindir}")