vcpkg/ports/lpeg/CMakeLists.txt
Stephen E. Baker 1653cf4363 Add package for lpeg
LPeg (http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html) is an expression
parsing library for lua created by the developer of lua.
2017-06-08 08:11:59 -04:00

29 lines
639 B
CMake

cmake_minimum_required(VERSION 3.0)
project(lpeg)
if(NOT WIN32)
message(FATAL_ERROR "Written for windows only")
endif()
find_path(LUA_INCLUDE_DIR lua.h PATH_SUFFIXES lua)
find_library(LUA_LIBRARY lua)
set(LPEG_INCLUDES ${LUA_INCLUDE_DIR})
set(LPEG_LIBRARIES ${LUA_LIBRARY})
add_library(lpeg
lpvm.c
lptree.c
lpprint.c
lpcap.c
lpcode.c
lpeg.def)
target_include_directories(lpeg PRIVATE ${LPEG_INCLUDES})
target_link_libraries(lpeg PRIVATE ${LPEG_LIBRARIES})
install(TARGETS lpeg
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES re.lua DESTINATION share/lua)