build CHANGE force out-of-source build
Avoid possibility to mix generated (config) files with source files
and force user to always build libyang out of its source codes.
cmake_minimum_required(VERSION 2.8.12)
+
+# force out-of-source build
+if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+ message(FATAL_ERROR "In-source build is not allowed. Please make a standalone build directory and run CMake from there. You may need to remove CMakeCache.txt.")
+endif()
+
project(libyang C)
include(GNUInstallDirs)
