mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-11-13 22:06:55 +00:00
19 lines
712 B
CMake
19 lines
712 B
CMake
#
|
|
# 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)
|
|
|
|
# disallow in-source builds
|
|
if("${srcdir}" STREQUAL "${bindir}")
|
|
message("######################################################")
|
|
message("Warning: in-source builds are disabled")
|
|
message("Please create a separate build directory and run cmake from there")
|
|
message("######################################################")
|
|
message(FATAL_ERROR "Quitting configuration")
|
|
endif()
|
|
endfunction()
|
|
|
|
assureoutofsourcebuilds()
|