mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-01 13:37:55 +08:00
[lua] Reduce post-install work needed in portfile by adding them to CMakeLists.txt
This commit is contained in:
parent
057069e87b
commit
d3a453e638
@ -6,9 +6,6 @@ ENDIF()
|
|||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||||
|
|
||||||
# remove warnings
|
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS )
|
|
||||||
|
|
||||||
SET (HDR_LIBLUA
|
SET (HDR_LIBLUA
|
||||||
src/lapi.h src/lauxlib.h src/lcode.h src/lctype.h src/ldebug.h src/ldo.h src/lfunc.h
|
src/lapi.h src/lauxlib.h src/lcode.h src/lctype.h src/ldebug.h src/ldo.h src/lfunc.h
|
||||||
src/lgc.h src/llex.h src/llimits.h src/lmem.h src/lobject.h src/lopcodes.h src/lparser.h
|
src/lgc.h src/llex.h src/llimits.h src/lmem.h src/lobject.h src/lopcodes.h src/lparser.h
|
||||||
@ -16,9 +13,6 @@ src/lstate.h src/lstring.h src/ltable.h src/ltm.h src/lua.h src/luaconf.h src/lu
|
|||||||
src/lundump.h src/lvm.h src/lzio.h
|
src/lundump.h src/lvm.h src/lzio.h
|
||||||
)
|
)
|
||||||
|
|
||||||
#SET_SOURCE_FILES_PROPERTIES(${HDR_LIBLUA} PROPERTIES HEADER_FILE_ONLY TRUE)
|
|
||||||
#include_directories(src)
|
|
||||||
|
|
||||||
# Build Libraries
|
# Build Libraries
|
||||||
SET (SRC_LIBLUA
|
SET (SRC_LIBLUA
|
||||||
src/lapi.c src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcode.c src/lcorolib.c
|
src/lapi.c src/lauxlib.c src/lbaselib.c src/lbitlib.c src/lcode.c src/lcorolib.c
|
||||||
@ -28,16 +22,33 @@ src/lopcodes.c src/loslib.c src/lparser.c src/lstate.c src/lstring.c src/lstrlib
|
|||||||
src/ltable.c src/ltablib.c src/ltm.c src/lundump.c src/lutf8lib.c src/lvm.c src/lzio.c
|
src/ltable.c src/ltablib.c src/ltm.c src/lundump.c src/lutf8lib.c src/lvm.c src/lzio.c
|
||||||
)
|
)
|
||||||
|
|
||||||
SET ( SRC_LUA src/lua.c )
|
|
||||||
|
|
||||||
# append headers to sources to make them show up in MSVC GUI
|
# append headers to sources to make them show up in MSVC GUI
|
||||||
LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA})
|
LIST(APPEND SRC_LIBLUA ${HDR_LIBLUA})
|
||||||
|
|
||||||
#DLL
|
IF (BUILD_SHARED_LIBS)
|
||||||
ADD_LIBRARY ( lua53 SHARED ${SRC_LIBLUA} ${SRC_LUA} )
|
ADD_DEFINITIONS ( -DLUA_BUILD_AS_DLL )
|
||||||
SET_TARGET_PROPERTIES (lua53 PROPERTIES DEFINE_SYMBOL "LUA_BUILD_AS_DLL" )
|
ENDIF ()
|
||||||
|
|
||||||
INSTALL ( TARGETS lua53 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
|
# remove warnings
|
||||||
INSTALL(DIRECTORY src/ DESTINATION include
|
ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS )
|
||||||
FILES_MATCHING PATTERN lualib.h PATTERN luaconf.h
|
|
||||||
PATTERN lua.hpp PATTERN lua.h PATTERN lauxlib.h)
|
#DLL
|
||||||
|
ADD_LIBRARY ( lua ${SRC_LIBLUA} )
|
||||||
|
|
||||||
|
INSTALL ( TARGETS lua
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (NOT DEFINED SKIP_INSTALL_HEADERS)
|
||||||
|
INSTALL(
|
||||||
|
FILES
|
||||||
|
src/lualib.h
|
||||||
|
src/lua.h
|
||||||
|
src/luaconf.h
|
||||||
|
src/lua.hpp
|
||||||
|
src/lauxlib.h
|
||||||
|
DESTINATION include
|
||||||
|
)
|
||||||
|
ENDIF ()
|
@ -20,16 +20,12 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_configure_cmake(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
OPTIONS_DEBUG
|
||||||
|
-DSKIP_INSTALL_HEADERS=ON
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_install_cmake()
|
vcpkg_install_cmake()
|
||||||
|
|
||||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
||||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
||||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/lua53.dll ${CURRENT_PACKAGES_DIR}/debug/bin/lua53.dll)
|
|
||||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/lua53.dll ${CURRENT_PACKAGES_DIR}/bin/lua53.dll)
|
|
||||||
|
|
||||||
# Handle copyright
|
# Handle copyright
|
||||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lua)
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lua)
|
||||||
vcpkg_copy_pdbs()
|
vcpkg_copy_pdbs()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user