CMakeLists.txt
changeset 7031 d5ea24399a48
parent 7030 09984acadece
child 7050 91199321e916
--- a/CMakeLists.txt	Mon May 07 11:59:09 2012 +0200
+++ b/CMakeLists.txt	Mon May 07 14:53:08 2012 +0200
@@ -120,8 +120,6 @@
 	set(pascal_compiler_flags_cmn "-Ff~/Library/Frameworks" ${pascal_compiler_flags_cmn})
 	#set deployment target
 	set(pascal_compiler_flags_cmn "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_compiler_flags_cmn})
-	#link with liblua.a (which requires readline)
-	set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn})
 	#link with libsdlmain.a (when building an executable)
 	if(NOT BUILD_ENGINE_LIBRARY)
 		set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/libSDLmain.a" ${pascal_compiler_flags_cmn})
@@ -190,7 +188,12 @@
 	set(HAVE_NETSERVER false)
 endif(WITH_SERVER)
 
-add_subdirectory(misc/liblua)
+find_package(Lua)
+if(NOT ${LUA_FOUND})
+	add_subdirectory(misc/liblua)
+	#link with liblua.a (which requires readline)
+	set(pascal_compiler_flags_cmn "-k${CMAKE_BINARY_DIR}/bin/liblua.a" "-k-lreadline" ${pascal_compiler_flags_cmn})
+endif()
 add_subdirectory(hedgewars)
 
 #run cmake -DBUILD_ANDROID_PORT=1 to enable this