1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 11:05:18 +00:00
conky/cmake/ToLua.cmake
2009-12-17 19:46:26 -08:00

25 lines
698 B
CMake

function(wrap_tolua VAR)
if(NOT ARGN)
message(SEND_ERROR "Error: wrap_tolua called without any files")
return()
endif(NOT ARGN)
SET(INCL)
SET(${VAR})
FOREACH(FIL ${ARGN})
GET_FILENAME_COMPONENT(ABS_FIL ${FIL} ABSOLUTE)
GET_FILENAME_COMPONENT(FIL_WE ${FIL} NAME_WE)
LIST(APPEND ${VAR} "${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c")
ADD_CUSTOM_COMMAND( OUTPUT ${${VAR}} ${INCL} COMMAND ${APP_TOLUA} -n
${FIL_WE} -o ${CMAKE_CURRENT_BINARY_DIR}/lib${FIL_WE}.c ${ABS_FIL} DEPENDS
${ABS_FIL} COMMENT "Running tolua++ on ${FIL}"
VERBATIM )
SET_SOURCE_FILES_PROPERTIES(${${VAR}} ${INCL} PROPERTIES GENERATED TRUE)
ENDFOREACH(FIL)
SET(${VAR} ${${VAR}} PARENT_SCOPE)
endfunction(wrap_tolua)