INCLUDE(PolycodeIncludes)

INCLUDE_DIRECTORIES(
    ${LUA_INCLUDE_DIR}
    ${Polycode_SOURCE_DIR}/Modules/Contents/UI/Include
    Include
    ../../Contents/UI/Include
)

SET(polycodeUI_SRCS
    ${CMAKE_CURRENT_SOURCE_DIR}/Source/UILUA.cpp
)

SET(polycodeUI_HDRS
    ${CMAKE_CURRENT_SOURCE_DIR}/Include/UILUA.h
    ${CMAKE_CURRENT_SOURCE_DIR}/Include/UILUAWrappers.h
)

SET(CMAKE_DEBUG_POSTFIX "_d")

ADD_LIBRARY(UILua ${polycodeUI_SRCS} ${polycodeUI_HDRS})

SET_SOURCE_FILES_PROPERTIES(Source/UILUA.cpp PROPERTIES GENERATED 1)
SET_SOURCE_FILES_PROPERTIES(Include/UILUAWrappers.h PROPERTIES GENERATED 1)
SET_SOURCE_FILES_PROPERTIES(Include/UILUA.h PROPERTIES GENERATED 1)
ADD_DEPENDENCIES(UILua PolycodeLuaGenerate)

SET_TARGET_PROPERTIES(UILua PROPERTIES PREFIX "")


IF(POLYCODE_INSTALL_FRAMEWORK)
    
    # install headers
    INSTALL(FILES ${polycodeUI_HDRS} DESTINATION Bindings/Lua/Modules/UI/include)

IF(NOT APPLE)
    INSTALL(FILES API/UI.pak DESTINATION Player)
ENDIF(NOT APPLE)

    INSTALL(DIRECTORY API DESTINATION Bindings/Lua/Modules/UI)
    INSTALL(TARGETS UILua DESTINATION Bindings/Lua/Modules/UI/lib)
    
ENDIF(POLYCODE_INSTALL_FRAMEWORK)

