comparison src/mime/CMakeLists.txt @ 0:4b915342e2a8

LuaSocket 2.0.2 + CMake build description.
author Eric Wing <ewing . public |-at-| gmail . com>
date Tue, 26 Aug 2008 18:40:01 -0700
parents
children cf0892e34f45
comparison
equal deleted inserted replaced
-1:000000000000 0:4b915342e2a8
1 # Ugh. I'm very irritated that the Luasocket people rename the modules to "core". (No prefix, .dll/.so suffix). This makes life difficult because I can't build the libraries directly with the name because there are two libraries (socket, mime) so the names conflict with each other.
2 # Furthermore, CMake doesn't offer good support for renaming TARGETS on install.
3 # The easiest way to work around this problem was create a new subdirectory just for the mime plugin and build directly to the name 'core'.
4
5
6 SET(luasocket_MIME
7 ${LuaSocket_SOURCE_DIR}/src/mime.h
8 ${LuaSocket_SOURCE_DIR}/src/mime.c
9 )
10 SET(luamime_RESOURCE_FILES
11 # ${LuaSocket_SOURCE_DIR}/src/mime.lua
12 )
13
14
15 IF(WANTS_BUILD_SHARED_LIBRARY)
16 ADD_LIBRARY(luamime_library_dynamic MODULE ${luasocket_PUBLIC_HEADERS} ${luasocket_MIME})
17 SET_TARGET_PROPERTIES(luamime_library_dynamic PROPERTIES
18 PREFIX ""
19 OUTPUT_NAME "core"
20 )
21 SET_TARGET_PROPERTIES(luamime_library_dynamic PROPERTIES COMPILE_FLAGS "${LUASOCKET_C_FLAGS}")
22 TARGET_LINK_LIBRARIES(luamime_library_dynamic ${LUA_LIBRARIES} ${LUASOCKET_LINK_FLAGS})
23 ENDIF(WANTS_BUILD_SHARED_LIBRARY)
24 #IF(WANTS_BUILD_STATIC_LIBRARY)
25 ADD_LIBRARY(luamime_library_static STATIC ${luasocket_PUBLIC_HEADERS} ${luasocket_MIME})
26 SET_TARGET_PROPERTIES(luamime_library_static PROPERTIES OUTPUT_NAME "mime")
27 SET_TARGET_PROPERTIES(luamime_library_static PROPERTIES COMPILE_FLAGS "${LUASOCKET_C_FLAGS}")
28 TARGET_LINK_LIBRARIES(luamime_library_static ${LUA_LIBRARIES} ${LUASOCKET_LINK_FLAGS})
29 #ENDIF(WANTS_BUILD_STATIC_LIBRARY)
30
31 INSTALL(TARGETS
32 luamime_library_static
33 RUNTIME DESTINATION bin
34 LIBRARY DESTINATION lib
35 ARCHIVE DESTINATION lib
36 # ARCHIVE DESTINATION lib/static
37 )
38
39 IF(WANTS_BUILD_SHARED_LIBRARY)
40 INSTALL(TARGETS luamime_library_dynamic DESTINATION ${LUAPACKAGE_CDIR}/mime)
41 ENDIF(WANTS_BUILD_SHARED_LIBRARY)
42
43 INSTALL(FILES ${luamime_RESOURCE_FILES} DESTINATION ${LUAPACKAGE_LDIR}/mime)
44
45