From 0ece30dc7c0e34b4c5911969b8fa99c33c6d023c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 30 Nov 2022 17:48:47 +0300 Subject: Telegram: update for TDLIB --- .../Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake (limited to 'protocols/Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake') diff --git a/protocols/Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake b/protocols/Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake new file mode 100644 index 0000000000..1815e82a25 --- /dev/null +++ b/protocols/Telegram/tdlib/td/CMake/PreventInSourceBuild.cmake @@ -0,0 +1,14 @@ +function(prevent_in_source_build) + get_filename_component(REAL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH) + get_filename_component(REAL_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" REALPATH) + + if (REAL_BINARY_DIR STREQUAL REAL_SOURCE_DIR) + message(" Out-of-source build must be used. Remove the files already") + message(" created by CMake and rerun CMake from a new directory:") + message(" rm -rf CMakeFiles CMakeCache.txt") + message(" mkdir build") + message(" cd build") + message(" cmake ..") + message(FATAL_ERROR "In-source build failed.") + endif() +endfunction() -- cgit v1.2.3