Mercurial > luasocket
annotate 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 |
rev | line source |
---|---|
0
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
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. |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
2 # Furthermore, CMake doesn't offer good support for renaming TARGETS on install. |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
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'. |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
4 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
5 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
6 SET(luasocket_MIME |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
7 ${LuaSocket_SOURCE_DIR}/src/mime.h |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
8 ${LuaSocket_SOURCE_DIR}/src/mime.c |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
9 ) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
10 SET(luamime_RESOURCE_FILES |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
11 # ${LuaSocket_SOURCE_DIR}/src/mime.lua |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
12 ) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
13 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
14 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
15 IF(WANTS_BUILD_SHARED_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
16 ADD_LIBRARY(luamime_library_dynamic MODULE ${luasocket_PUBLIC_HEADERS} ${luasocket_MIME}) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
17 SET_TARGET_PROPERTIES(luamime_library_dynamic PROPERTIES |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
18 PREFIX "" |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
19 OUTPUT_NAME "core" |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
20 ) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
21 SET_TARGET_PROPERTIES(luamime_library_dynamic PROPERTIES COMPILE_FLAGS "${LUASOCKET_C_FLAGS}") |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
22 TARGET_LINK_LIBRARIES(luamime_library_dynamic ${LUA_LIBRARIES} ${LUASOCKET_LINK_FLAGS}) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
23 ENDIF(WANTS_BUILD_SHARED_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
24 #IF(WANTS_BUILD_STATIC_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
25 ADD_LIBRARY(luamime_library_static STATIC ${luasocket_PUBLIC_HEADERS} ${luasocket_MIME}) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
26 SET_TARGET_PROPERTIES(luamime_library_static PROPERTIES OUTPUT_NAME "mime") |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
27 SET_TARGET_PROPERTIES(luamime_library_static PROPERTIES COMPILE_FLAGS "${LUASOCKET_C_FLAGS}") |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
28 TARGET_LINK_LIBRARIES(luamime_library_static ${LUA_LIBRARIES} ${LUASOCKET_LINK_FLAGS}) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
29 #ENDIF(WANTS_BUILD_STATIC_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
30 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
31 INSTALL(TARGETS |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
32 luamime_library_static |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
33 RUNTIME DESTINATION bin |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
34 LIBRARY DESTINATION lib |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
35 ARCHIVE DESTINATION lib |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
36 # ARCHIVE DESTINATION lib/static |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
37 ) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
38 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
39 IF(WANTS_BUILD_SHARED_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
40 INSTALL(TARGETS luamime_library_dynamic DESTINATION ${LUAPACKAGE_CDIR}/mime) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
41 ENDIF(WANTS_BUILD_SHARED_LIBRARY) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
42 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
43 INSTALL(FILES ${luamime_RESOURCE_FILES} DESTINATION ${LUAPACKAGE_LDIR}/mime) |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
44 |
4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
diff
changeset
|
45 |