cmake changes
This commit is contained in:
parent
5c61d9a765
commit
358225eb8d
1 changed files with 8 additions and 9 deletions
|
@ -5,8 +5,10 @@ cmake_minimum_required(VERSION 2.8)
|
|||
aux_source_directory(./src socket_src)
|
||||
list(REMOVE_ITEM socket_src ./src/mime.c)
|
||||
if(WIN32)
|
||||
list(REMOVE_ITEM socket_src ./src/serial.c ./src/unix.c ./src/usocket.c)
|
||||
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
list(REMOVE_ITEM socket_src ./src/serial.c ./src/unix.c ./src/usocket.c ./src/unixdgram.c ./src/unixstream.c)
|
||||
add_definitions(-D_WIN32_WINNT=0x0600) ##should be this or the next two for working on XP
|
||||
#add_definitions(-D_WIN32_WINNT=0x0501)
|
||||
#add_definitions(-DLUASOCKET_INET_PTON)
|
||||
add_definitions("-DLUASOCKET_API=__declspec(dllexport)")
|
||||
add_definitions("-DMIME_API=__declspec(dllexport)")
|
||||
set(POSTN dll)
|
||||
|
@ -15,9 +17,7 @@ else()
|
|||
add_definitions("-DMIME_API=__attribute__((visibility(default)))")
|
||||
set(POSTN so)
|
||||
endif(WIN32)
|
||||
if(WIN32)#MINGW) and msvc
|
||||
add_definitions(-DLUASOCKET_INET_PTON)
|
||||
endif()
|
||||
|
||||
|
||||
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
|
||||
|
||||
|
@ -26,12 +26,12 @@ add_definitions(-DLUA_BUILD_AS_DLL -DLUA_LIB -DLUASOCKET_EXPORTS)
|
|||
|
||||
add_library(socket SHARED ${socket_src})
|
||||
ADD_LIBRARY(mime SHARED ./src/mime.c ./src/compat.c)
|
||||
#set_target_properties(socket PROPERTIES PREFIX "" OUTPUT_NAME core)
|
||||
#set_target_properties(mime PROPERTIES PREFIX "" OUTPUT_NAME core)
|
||||
|
||||
if(MSVC)
|
||||
set_target_properties(socket PROPERTIES PREFIX "lib")
|
||||
set_target_properties(mime PROPERTIES PREFIX "lib")
|
||||
endif()
|
||||
|
||||
TARGET_LINK_LIBRARIES(socket ${LUA_LIBRARY} wsock32 ws2_32 )
|
||||
TARGET_LINK_LIBRARIES(mime ${LUA_LIBRARY})
|
||||
|
||||
|
@ -47,8 +47,7 @@ endif()
|
|||
##cant use set_target_properties to rename because one overwrites the other so:
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libsocket.${POSTN} DESTINATION ${CDIR}/socket RENAME core.${POSTN})
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libmime.${POSTN} DESTINATION ${CDIR}/mime RENAME core.${POSTN})
|
||||
#INSTALL(TARGETS socket RUNTIME DESTINATION ${CDIR}/socket)
|
||||
#INSTALL(TARGETS mime RUNTIME DESTINATION ${CDIR}/mime)
|
||||
|
||||
install(DIRECTORY src/ DESTINATION ${LDIR}/socket
|
||||
FILES_MATCHING PATTERN "*.lua"
|
||||
PATTERN ltn12.lua EXCLUDE
|
||||
|
|
Loading…
Add table
Reference in a new issue