use lua headers correctly
authorkoda
Tue, 20 Nov 2012 17:50:17 +0100
changeset 8072 c803d89ae74d
parent 8071 7d6aaba59505
child 8073 5a289ef40fdb
use lua headers correctly
cmake_modules/FindLua.cmake
misc/physfs/extras/CMakeLists.txt
--- a/cmake_modules/FindLua.cmake	Tue Nov 20 00:47:35 2012 +0400
+++ b/cmake_modules/FindLua.cmake	Tue Nov 20 17:50:17 2012 +0100
@@ -6,6 +6,7 @@
 #  the bundled one when nothing is found
 
 set(LUA_FOUND false)
+set(LUA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/liblua)
 
 if (ANDROID)
     SET(LUA_DEFAULT "liblua5.1.so")
@@ -19,11 +20,13 @@
             #locate the system's lua library
             FIND_LIBRARY(LUA_DEFAULT NAMES lua51 lua5.1 lua-5.1 lua PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib)
             IF(${LUA_DEFAULT} MATCHES "LUA_DEFAULT-NOTFOUND")
-	        set(LUA_DEFAULT lua)
+                set(LUA_DEFAULT lua)
+                set(LUA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/liblua)
             ELSE()
                 set(LUA_FOUND true)
                 message(STATUS "LibLua 5.1 found at ${LUA_DEFAULT}")
                 #remove the path (fpc doesn't like it - why?)
+                GET_FILENAME_COMPONENT(LUA_INCLUDE_DIR ${LUA_DEFAULT} PATH)
                 GET_FILENAME_COMPONENT(LUA_DEFAULT ${LUA_DEFAULT} NAME)
             ENDIF()
         ENDIF(APPLE)
@@ -32,3 +35,4 @@
 
 SET(LUA_LIBRARY ${LUA_DEFAULT} CACHE STRING "Lua library to link to; file name without path only!")
 
+
--- a/misc/physfs/extras/CMakeLists.txt	Tue Nov 20 00:47:35 2012 +0400
+++ b/misc/physfs/extras/CMakeLists.txt	Tue Nov 20 17:50:17 2012 +0100
@@ -1,9 +1,8 @@
 find_package(SDL REQUIRED)
 
 include_directories(${SDL_INCLUDE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/misc/liblua)
+include_directories(${LUA_INCLUDE_DIR})
 include_directories(${CMAKE_SOURCE_DIR}/misc/physfs/src)
 
 add_library(physfsrwops STATIC physfsrwops.c physfslualoader.c hwpacksmounter.c)
 
-add_dependencies(physfsrwops lua)