Use current source / binary dir when assuring out of source builds

This commit is contained in:
Lars Müller 2024-01-19 13:03:01 +01:00 committed by GitHub
parent 69098a18b9
commit 37dab289d9
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}")