misc/liblua/CMakeLists.txt
branchhedgeroid
changeset 15515 7030706266df
parent 11664 71bdf987e41f
equal deleted inserted replaced
7861:bc7b6aa5d67a 15515:7030706266df
     2 
     2 
     3 file(GLOB lua_src *.c *.h)
     3 file(GLOB lua_src *.c *.h)
     4 
     4 
     5 if(WIN32)
     5 if(WIN32)
     6     add_definitions(-DLUA_BUILD_AS_DLL)
     6     add_definitions(-DLUA_BUILD_AS_DLL)
     7     add_library(lua SHARED ${lua_src})
       
     8 
       
     9     set(LUA_LIBRARY lua.dll)
       
    10 
       
    11     set_target_properties(lua PROPERTIES PREFIX "")
       
    12     install(TARGETS lua RUNTIME DESTINATION ${target_dir})
       
    13 else(WIN32)
     7 else(WIN32)
    14     add_definitions(-DLUA_USE_LINUX)
     8     add_definitions(-DLUA_USE_LINUX)
    15     add_library(lua STATIC ${lua_src})
     9     add_definitions(-fvisibility=default) #TODO: fixme
    16     set(LUA_LIBRARY lua)
       
    17 endif(WIN32)
    10 endif(WIN32)
    18 
    11 
       
    12 add_library(lua ${lua_src})
    19 
    13 
       
    14 set_target_properties(lua PROPERTIES
       
    15                           VERSION "5.1.4"
       
    16                           SOVERSION 1
       
    17                           OUTPUT_NAME ${lua_output_name})
       
    18 install(TARGETS lua RUNTIME DESTINATION ${target_binary_install_dir}
       
    19                     LIBRARY DESTINATION ${target_library_install_dir}
       
    20                     ARCHIVE DESTINATION ${target_library_install_dir})
       
    21 get_target_property(lua_fullpath lua LOCATION)
    20 
    22 
       
    23 set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Lua include dir" FORCE)
       
    24 set(LUA_LIBRARY ${lua_fullpath} CACHE STRING "Lua library" FORCE)
       
    25 
       
    26 #emscripten does not expose headers but has an internal binary copy
       
    27 if(BUILD_ENGINE_JS)
       
    28     set(LUA_LIBRARY "lua_emscripten_internal" CACHE STRING "Lua library" FORCE)
       
    29 endif()
       
    30