Fix "unknown CMake command "check_library_exists" (#4517)
authorEric Mountain <eric.stephen.mountain@gmail.com>
Wed, 14 Sep 2016 03:05:21 +0000 (05:05 +0200)
committerkwolekr <kwolekr@minetest.net>
Wed, 14 Sep 2016 03:05:21 +0000 (23:05 -0400)
Adds CMakeLists.txt include to fix this issue:

$ cmake . -DBUILD_SERVER=TRUE -DBUILD_CLIENT=FALSE \
   -DCMAKE_BUILD_TYPE=Release -DENABLE_CURL=TRUE -DENABLE_CURSES=FALSE \
   -DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=FALSE \
   -DENABLE_POSTGRESQL=FALSE -DENABLE_SOUND=FALSE -DENABLE_LUAJIT=TRUE \
   -DIRRLICHT_SOURCE_DIR=$HOME/irrlicht-1.8.4 -LH
...
CMake Error at src/CMakeLists.txt:339 (check_library_exists):
  Unknown CMake command "check_library_exists".
...

src/CMakeLists.txt

index bcd7a5984bfe9995132669ccc0a4a3664543a441..608437f3a51f0848dd42015d5dbda7a3aaf14632 100644 (file)
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.6)
 project(minetest)
 
 INCLUDE(CheckIncludeFiles)
+INCLUDE(CheckLibraryExists)
 
 # Add custom SemiDebug build mode
 set(CMAKE_CXX_FLAGS_SEMIDEBUG "-O1 -g -Wall -Wabi" CACHE STRING