From 4ac0a64dbad48509391a638fc916542d0b4a8062 Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Wed, 23 Dec 2015 17:37:07 -0500 Subject: [PATCH] Fix lua dll build --- CMakeModules/build_lua.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeModules/build_lua.cmake b/CMakeModules/build_lua.cmake index 5e8be7c..8a82109 100644 --- a/CMakeModules/build_lua.cmake +++ b/CMakeModules/build_lua.cmake @@ -1,6 +1,7 @@ INCLUDE(ExternalProject) SET(prefix ${CMAKE_BINARY_DIR}/third_party/lua) +SET(lua_lib_prefix "${prefix}/lib") SET(lua_location "${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}lua${CMAKE_SHARED_LIBRARY_SUFFIX}") IF(CMAKE_VERSION VERSION_LESS 3.2) @@ -44,9 +45,15 @@ ExternalProject_Add( ${byproducts} ) +ExternalProject_Get_Property(lua-ext binary_dir) ExternalProject_Get_Property(lua-ext install_dir) + ADD_LIBRARY(lua IMPORTED SHARED) SET_TARGET_PROPERTIES(lua PROPERTIES IMPORTED_LOCATION ${lua_location}) +IF(WIN32) + SET_TARGET_PROPERTIES(lua PROPERTIES IMPORTED_IMPLIB ${lua_lib_prefix}/lua.lib) +ENDIF(WIN32) + ADD_DEPENDENCIES(lua lua-ext) SET(LUA_INCLUDE_DIR ${install_dir}/include) SET(LUA_LIBRARIES lua)