Browse code

Common parts of CMake modules targets were moved to cmake/module.rules.txt. This greatly simplified further work.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1513 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Peter Lemenkov authored on 09/10/2009 14:34:17
Showing 40 changed files
... ...
@@ -2,6 +2,5 @@ set (ann_b2b_SRCS
2 2
 AnnounceB2B.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(ann_b2b SHARED ${ann_b2b_SRCS})
6
-TARGET_LINK_LIBRARIES(ann_b2b ${CMAKE_DL_LIBS})
7
-
5
+SET(sems_module_name ann_b2b)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -2,6 +2,6 @@ set (announce_transfer_SRCS
2 2
 AnnounceTransfer.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(announce_transfer SHARED ${announce_transfer_SRCS})
6
-TARGET_LINK_LIBRARIES(announce_transfer ${CMAKE_DL_LIBS})
5
+SET(sems_module_name announce_transfer)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -2,6 +2,6 @@ set (announcement_SRCS
2 2
 Announcement.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(announcement SHARED ${announcement_SRCS})
6
-TARGET_LINK_LIBRARIES(announcement ${CMAKE_DL_LIBS})
5
+SET(sems_module_name announcement)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -2,6 +2,6 @@ set (annrecorder_SRCS
2 2
 AnnRecorder.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(annrecorder SHARED ${annrecorder_SRCS})
6
-TARGET_LINK_LIBRARIES(annrecorder ${CMAKE_DL_LIBS})
5
+SET(sems_module_name annrecorder)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -2,8 +2,6 @@ set (auth_b2b_SRCS
2 2
 AuthB2B.cpp
3 3
 )
4 4
 
5
-ADD_DEFINITIONS(-DMOD_NAME="auth_b2b")
6
-
7
-ADD_LIBRARY(auth_b2b SHARED ${auth_b2b_SRCS})
8
-TARGET_LINK_LIBRARIES(auth_b2b ${CMAKE_DL_LIBS})
5
+SET(sems_module_name auth_b2b)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
9 7
 
... ...
@@ -2,8 +2,6 @@ set (call_timer_SRCS
2 2
 CallTimer.cpp
3 3
 )
4 4
 
5
-ADD_DEFINITIONS(-DMOD_NAME="call_timer")
6
-
7
-ADD_LIBRARY(call_timer SHARED ${call_timer_SRCS})
8
-TARGET_LINK_LIBRARIES(call_timer ${CMAKE_DL_LIBS})
5
+SET(sems_module_name call_timer)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
9 7
 
... ...
@@ -2,8 +2,6 @@ set (callback_SRCS
2 2
 CallBack.cpp
3 3
 )
4 4
 
5
-ADD_DEFINITIONS(-DMOD_NAME="callback")
6
-
7
-ADD_LIBRARY(callback SHARED ${callback_SRCS})
8
-TARGET_LINK_LIBRARIES(callback ${CMAKE_DL_LIBS})
5
+SET(sems_module_name callback)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
9 7
 
... ...
@@ -2,6 +2,6 @@ set (click2dial_SRCS
2 2
 Click2Dial.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(click2dial SHARED ${click2dial_SRCS})
6
-TARGET_LINK_LIBRARIES(click2dial ${CMAKE_DL_LIBS})
5
+SET(sems_module_name click2dial)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -2,18 +2,18 @@ set (conference_SRCS
2 2
 Conference.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(conference SHARED ${conference_SRCS})
6
-TARGET_LINK_LIBRARIES(conference ${CMAKE_DL_LIBS})
7
-
8 5
 IF(FLITE_FOUND AND ZRTP_FOUND)
9 6
 	INCLUDE_DIRECTORIES(${FLITE_INCLUDE_DIR}/flite)
10 7
 	ADD_DEFINITIONS(-DWITH_SAS_TTS)
11
-	TARGET_LINK_LIBRARIES(conference ${CMAKE_DL_LIBS} flite_cmu_us_kal flite_usenglish flite_cmulex flite)
8
+	SET(sems_module_libs ${sems_module_libs} flite_cmu_us_kal flite_usenglish flite_cmulex flite)
12 9
 ENDIF(FLITE_FOUND AND ZRTP_FOUND)
13 10
 
14 11
 IF(MYSQLPP_FOUND)
15 12
 	INCLUDE_DIRECTORIES(/usr/include/mysql)
16 13
 	INCLUDE_DIRECTORIES(${MYSQLPP_INCLUDE_DIR}/mysql++)
17 14
 	ADD_DEFINITIONS(-DUSE_MYSQL)
18
-	TARGET_LINK_LIBRARIES(conference ${CMAKE_DL_LIBS} mysqlpp)
15
+	SET(sems_module_libs ${sems_module_libs} mysqlpp)
19 16
 ENDIF(MYSQLPP_FOUND)
17
+
18
+SET(sems_module_name conference)
19
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -8,10 +8,12 @@ INCLUDE_DIRECTORIES (lib_dbase)
8 8
 
9 9
 SET_PROPERTY(TARGET libdbase PROPERTY IMPORTED_LOCATION ./lib_dbase/libdbase.a)
10 10
 
11
-ADD_LIBRARY(diameter_client SHARED ${diameter_client_SRCS})
12
-TARGET_LINK_LIBRARIES(diameter_client ${CMAKE_DL_LIBS} libdbase)
11
+SET(sems_module_name diameter_client)
12
+SET(sems_module_libs libdbase)
13 13
 
14 14
 IF(OPENSSL_FOUND)
15 15
 	ADD_DEFINITIONS(-DWITH_OPENSSL)
16
-	TARGET_LINK_LIBRARIES(diameter_client ${CMAKE_DL_LIBS} ssl crypto)
16
+	SET(sems_module_libs ${sems_module_libs} ssl crypto)
17 17
 ENDIF(OPENSSL_FOUND)
18
+
19
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -10,10 +10,10 @@ DSMStateDiagramCollection.cpp
10 10
 DSMStateEngine.cpp
11 11
 )
12 12
 
13
+# needed for DSM sub-modules
13 14
 INCLUDE_DIRECTORIES (.)
14 15
 
15 16
 ADD_SUBDIRECTORY (mods)
16 17
 
17
-ADD_LIBRARY(dsm SHARED ${dsm_SRCS})
18
-TARGET_LINK_LIBRARIES(dsm ${CMAKE_DL_LIBS})
19
-
18
+SET(sems_module_name dsm)
19
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -2,12 +2,12 @@ set (early_announce_SRCS
2 2
 EarlyAnnounce.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(early_announce SHARED ${early_announce_SRCS})
6
-TARGET_LINK_LIBRARIES(early_announce ${CMAKE_DL_LIBS})
7
-
8 5
 IF(MYSQLPP_FOUND)
9 6
 	INCLUDE_DIRECTORIES(/usr/include/mysql)
10 7
 	INCLUDE_DIRECTORIES(${MYSQLPP_INCLUDE_DIR}/mysql++)
11 8
 	ADD_DEFINITIONS(-DUSE_MYSQL)
12
-	TARGET_LINK_LIBRARIES(early_announce ${CMAKE_DL_LIBS} mysqlpp)
9
+	SET(sems_module_libs mysqlpp)
13 10
 ENDIF(MYSQLPP_FOUND)
11
+
12
+SET(sems_module_name early_announce)
13
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -9,6 +9,6 @@ mISDNStack.cpp
9 9
 ADD_DEFINITIONS(-DGW_VERSION="0.1")
10 10
 INCLUDE_DIRECTORIES(${MISDN_INCLUDE_DIR}/mISDNuser)
11 11
 
12
-ADD_LIBRARY(gateway SHARED ${gateway_SRCS})
13
-TARGET_LINK_LIBRARIES(gateway ${CMAKE_DL_LIBS} mISDN isdnnet)
14
-
12
+SET(sems_module_name gateway)
13
+SET(sems_module_libs mISDN isdnnet)
14
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -11,12 +11,11 @@ IvrUAC.cpp
11 11
 
12 12
 INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
13 13
 
14
-ADD_LIBRARY(ivr SHARED ${ivr_SRCS})
15
-TARGET_LINK_LIBRARIES(ivr ${CMAKE_DL_LIBS})
16
-
17 14
 IF(FLITE_FOUND)
18 15
 	INCLUDE_DIRECTORIES(${FLITE_INCLUDE_DIR}/flite)
19 16
 	ADD_DEFINITIONS(-DIVR_WITH_TTS)
20
-	TARGET_LINK_LIBRARIES(ivr ${CMAKE_DL_LIBS} flite_cmu_us_kal flite_usenglish flite_cmulex flite)
17
+	SET(sems_module_libs flite_cmu_us_kal flite_usenglish flite_cmulex flite)
21 18
 ENDIF(FLITE_FOUND)
22 19
 
20
+SET(sems_module_name ivr)
21
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -2,8 +2,6 @@ set (monitoring_SRCS
2 2
 Monitoring.cpp
3 3
 )
4 4
 
5
-ADD_DEFINITIONS(-DMOD_NAME="monitoring")
6
-
7
-ADD_LIBRARY(monitoring SHARED ${monitoring_SRCS})
8
-TARGET_LINK_LIBRARIES(monitoring ${CMAKE_DL_LIBS})
5
+SET(sems_module_name monitoring)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
9 7
 
... ...
@@ -6,6 +6,6 @@ mp3.c
6 6
 #	module_ldflags += -lmpg123
7 7
 #	module_cflags += -DWITH_MPG123DECODER
8 8
 
9
-ADD_LIBRARY(mp3 SHARED ${mp3_SRCS})
10
-TARGET_LINK_LIBRARIES(mp3 ${CMAKE_DL_LIBS} mp3lame)
11
-
9
+SET(sems_module_name mp3)
10
+SET(sems_module_libs mp3lame)
11
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -6,8 +6,6 @@ MsgStorage.cpp
6 6
 #spooldir: 
7 7
 #	mkdir -p $(DESTDIR)/var/spool/voicebox
8 8
 
9
-ADD_DEFINITIONS(-DMOD_NAME="msg_storage")
10
-
11
-ADD_LIBRARY(msg_storage SHARED ${msg_storage_SRCS})
12
-TARGET_LINK_LIBRARIES(msg_storage ${CMAKE_DL_LIBS})
9
+SET(sems_module_name msg_storage)
10
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
13 11
 
... ...
@@ -2,8 +2,5 @@ set (precoded_announce_SRCS
2 2
 PrecodedAnnounce.cpp
3 3
 )
4 4
 
5
-ADD_DEFINITIONS(-DMOD_NAME="precoded_announce")
6
-
7
-ADD_LIBRARY(precoded_announce SHARED ${precoded_announce_SRCS})
8
-TARGET_LINK_LIBRARIES(precoded_announce ${CMAKE_DL_LIBS})
9
-
5
+SET(sems_module_name precoded_announce)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -2,6 +2,6 @@ set (reg_agent_SRCS
2 2
 RegistrationAgent.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(reg_agent SHARED ${reg_agent_SRCS})
6
-TARGET_LINK_LIBRARIES(reg_agent ${CMAKE_DL_LIBS})
5
+SET(sems_module_name reg_agent)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -3,6 +3,5 @@ ContactInfo.cpp
3 3
 SIPRegistrarClient.cpp
4 4
 )
5 5
 
6
-ADD_LIBRARY(registrar_client SHARED ${registrar_client_SRCS})
7
-TARGET_LINK_LIBRARIES(registrar_client ${CMAKE_DL_LIBS})
8
-
6
+SET(sems_module_name registrar_client)
7
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -2,6 +2,5 @@ set (sw_prepaid_sip_SRCS
2 2
 SWPrepaidSIP.cpp
3 3
 )
4 4
 
5
-ADD_LIBRARY(sw_prepaid_sip SHARED ${sw_prepaid_sip_SRCS})
6
-TARGET_LINK_LIBRARIES(sw_prepaid_sip ${CMAKE_DL_LIBS})
7
-
5
+SET(sems_module_name sw_prepaid_sip)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -3,6 +3,6 @@ Voicebox.cpp
3 3
 VoiceboxDialog.cpp
4 4
 )
5 5
 
6
-ADD_LIBRARY(voicebox SHARED ${voicebox_SRCS})
7
-TARGET_LINK_LIBRARIES(voicebox ${CMAKE_DL_LIBS})
6
+SET(sems_module_name voicebox)
7
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
8 8
 
... ...
@@ -5,9 +5,6 @@ AnswerMachine.cpp
5 5
 EmailTemplate.cpp
6 6
 )
7 7
 
8
-ADD_LIBRARY(voicemail SHARED ${voicemail_SRCS})
9
-TARGET_LINK_LIBRARIES(voicemail ${CMAKE_DL_LIBS})
10
-
11 8
 # Currently cannot be build with mysql++
12 9
 #IF(MYSQLPP_FOUND)
13 10
 #	IF(CMAKE_COMPILER_IS_GNUCC)
... ...
@@ -16,5 +13,8 @@ TARGET_LINK_LIBRARIES(voicemail ${CMAKE_DL_LIBS})
16 13
 #	IF(CMAKE_COMPILER_IS_GNUCXX)
17 14
 #		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_MYSQL -I/usr/include/mysql++ -I/usr/include/mysql")
18 15
 #	ENDIF(CMAKE_COMPILER_IS_GNUCXX)
19
-#	TARGET_LINK_LIBRARIES(voicemail ${CMAKE_DL_LIBS} mysqlpp)
16
+#	SET(sems_module_libs mysqlpp)
20 17
 #ENDIF(MYSQLPP_FOUND)
18
+
19
+SET(sems_module_name voicemail)
20
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -5,6 +5,5 @@ WebConference.cpp
5 5
 WebConferenceDialog.cpp
6 6
 )
7 7
 
8
-ADD_LIBRARY(webconference SHARED ${webconference_SRCS})
9
-TARGET_LINK_LIBRARIES(webconference ${CMAKE_DL_LIBS})
10
-
8
+SET(sems_module_name webconference)
9
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -10,10 +10,12 @@ INCLUDE_DIRECTORIES (xmlrpc++/src)
10 10
 
11 11
 SET_PROPERTY(TARGET xmlrpcpp PROPERTY IMPORTED_LOCATION ./xmlrpc++/src/xmlrpcpp.a)
12 12
 
13
-ADD_LIBRARY(xmlrpc2di SHARED ${xmlrpc2di_SRCS})
14
-TARGET_LINK_LIBRARIES(xmlrpc2di ${CMAKE_DL_LIBS} xmlrpcpp)
13
+SET(sems_module_name xmlrpc2di)
14
+SET(sems_module_libs xmlrpcpp)
15 15
 
16 16
 IF(OPENSSL_FOUND)
17 17
 	ADD_DEFINITIONS(-DHAVE_XMLRPCPP_SSL -DXMLRPCPP_SUPPORT_STRUCT_ACCESS)
18
-	TARGET_LINK_LIBRARIES(xmlrpc2di ${CMAKE_DL_LIBS} ssl)
18
+	SET(sems_module_libs ${sems_module_libs} ssl)
19 19
 ENDIF(OPENSSL_FOUND)
20
+
21
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
20 22
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+# A place for common parts of SEMS modules rules
2
+#
3
+# We adding sems_ prefix to the internal name of the library to avoid nasty
4
+# issue then this name is equals to external library, our module links to.
5
+# E.g. the issue, then speex module should be linked to -lspeex
6
+
7
+ADD_LIBRARY(sems_${sems_module_name} SHARED ${${sems_module_name}_SRCS})
8
+
9
+ADD_DEFINITIONS(-DMOD_NAME="${sems_module_name}")
10
+
11
+# all modules should be linked against ${CMAKE_DL_LIBS} at least
12
+# and with additional ${sems_module_libs} if they exists
13
+TARGET_LINK_LIBRARIES(sems_${sems_module_name} ${CMAKE_DL_LIBS} ${sems_module_libs})
14
+
15
+SET_TARGET_PROPERTIES(sems_${sems_module_name} PROPERTIES OUTPUT_NAME ${sems_module_name})
16
+
17
+INSTALL(
18
+	TARGETS sems_${sems_module_name}
19
+	LIBRARY DESTINATION ${SEMS_EXEC_PREFIX}/${SEMS_LIBDIR}/sems/plug-in/
20
+)
... ...
@@ -77,5 +77,5 @@ ENDIF(SEMS_USE_IPV6)
77 77
 ADD_SUBDIRECTORY(plug-in)
78 78
 
79 79
 INSTALL(TARGETS sems
80
-	RUNTIME DESTINATION sbin
80
+	RUNTIME DESTINATION ${SEMS_EXEC_PREFIX}/sbin
81 81
 	)
... ...
@@ -7,6 +7,6 @@ g723_40.c
7 7
 g72x.c
8 8
 )
9 9
 
10
-ADD_LIBRARY(adpcm SHARED ${adpcm_SRCS})
11
-TARGET_LINK_LIBRARIES(adpcm ${CMAKE_DL_LIBS})
10
+SET(sems_module_name adpcm)
11
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
12 12
 
... ...
@@ -10,8 +10,8 @@ INCLUDE_DIRECTORIES (libbinrpc/include)
10 10
 
11 11
 SET_PROPERTY(TARGET libbinrpc PROPERTY IMPORTED_LOCATION ./libbinrpc/src/binrpcctrl.a)
12 12
 
13
-ADD_LIBRARY(binrpcctrl SHARED ${binrpcctrl_SRCS})
14
-TARGET_LINK_LIBRARIES(binrpcctrl ${CMAKE_DL_LIBS} libbinrpc)
15
-
13
+SET(sems_module_name binrpcctrl)
14
+SET(sems_module_libs libbinrpc)
15
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
16 16
 
17 17
 
... ...
@@ -3,6 +3,6 @@ AmAudioEcho.cpp
3 3
 Echo.cpp
4 4
 )
5 5
 
6
-ADD_LIBRARY(echo SHARED ${echo_SRCS})
7
-TARGET_LINK_LIBRARIES(echo ${CMAKE_DL_LIBS})
6
+SET(sems_module_name echo)
7
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
8 8
 
... ...
@@ -3,6 +3,7 @@ g722.c
3 3
 )
4 4
 
5 5
 #module_cflags  = -ansi # -DNOFPU
6
-ADD_LIBRARY(g722 SHARED ${g722_SRCS})
7
-TARGET_LINK_LIBRARIES(g722 ${CMAKE_DL_LIBS} spandsp)
8 6
 
7
+SET(sems_module_name g722)
8
+SET(sems_module_libs spandsp)
9
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -4,7 +4,6 @@ set (gsm_SRCS
4 4
 
5 5
 INCLUDE_DIRECTORIES(${GSM_INCLUDE_DIR})
6 6
 
7
-ADD_LIBRARY(libgsm SHARED ${gsm_SRCS})
8
-SET_TARGET_PROPERTIES(libgsm PROPERTIES OUTPUT_NAME "gsm")
9
-TARGET_LINK_LIBRARIES(libgsm ${CMAKE_DL_LIBS} gsm)
10
-
7
+SET(sems_module_name gsm)
8
+SET(sems_module_libs gsm)
9
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -8,6 +8,7 @@ INCLUDE_DIRECTORIES (iLBC_rfc3951)
8 8
 
9 9
 SET_PROPERTY(TARGET libilbc PROPERTY IMPORTED_LOCATION ./iLBC_rfc3951/ilbc.a)
10 10
 
11
-ADD_LIBRARY(ilbc SHARED ${ilbc_SRCS})
12
-TARGET_LINK_LIBRARIES(ilbc ${CMAKE_DL_LIBS} libilbc)
11
+SET(sems_module_name ilbc)
12
+SET(sems_module_libs libilbc)
13
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
13 14
 
... ...
@@ -2,6 +2,6 @@ set (l16_SRCS
2 2
  l16.c
3 3
 )
4 4
 
5
-ADD_LIBRARY(l16 SHARED ${l16_SRCS})
6
-TARGET_LINK_LIBRARIES(l16 ${CMAKE_DL_LIBS})
5
+SET(sems_module_name l16)
6
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
7 7
 
... ...
@@ -3,6 +3,6 @@ SessionTimer.cpp
3 3
 UserTimer.cpp
4 4
 )
5 5
 
6
-ADD_LIBRARY(session_timer SHARED ${session_timer_SRCS})
7
-TARGET_LINK_LIBRARIES(session_timer ${CMAKE_DL_LIBS})
6
+SET(sems_module_name session_timer)
7
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
8 8
 
... ...
@@ -20,10 +20,9 @@ set (sipctrl_SRCS
20 20
   wheeltimer.cpp
21 21
 )
22 22
 
23
-ADD_LIBRARY(sipctrl SHARED ${sipctrl_SRCS})
24
-TARGET_LINK_LIBRARIES(sipctrl ${CMAKE_DL_LIBS})
25
-
26 23
 IF(SEMS_USE_IPV6)
27 24
 	ADD_DEFINITIONS(-DSUPPORT_IPV6)
28 25
 ENDIF(SEMS_USE_IPV6)
29 26
 
27
+SET(sems_module_name sipctrl)
28
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -5,7 +5,7 @@ set (speex_SRCS
5 5
 INCLUDE_DIRECTORIES(${SPEEX_INCLUDE_DIR})
6 6
 
7 7
 # module_cflags  = -ansi # -DNOFPU
8
-ADD_LIBRARY(libspeex SHARED ${speex_SRCS})
9
-SET_TARGET_PROPERTIES(libspeex PROPERTIES OUTPUT_NAME "speex")
10
-TARGET_LINK_LIBRARIES(libspeex ${CMAKE_DL_LIBS} speex)
11 8
 
9
+SET(sems_module_name speex)
10
+SET(sems_module_libs speex)
11
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
... ...
@@ -1,7 +1,4 @@
1
-set (stats_SRCS
2
-Statistics.cpp
3
-StatsUDPServer.cpp
4
-)
1
+# executable
5 2
 
6 3
 set (sems_stats_SRCS
7 4
 query_stats.cxx
... ...
@@ -10,9 +7,16 @@ query_stats.cxx
10 7
 ADD_EXECUTABLE (sems-stats ${sems_stats_SRCS})
11 8
 TARGET_LINK_LIBRARIES(sems-stats ${CMAKE_DL_LIBS} stdc++)
12 9
 
13
-ADD_LIBRARY(stats SHARED ${stats_SRCS})
14
-TARGET_LINK_LIBRARIES(stats ${CMAKE_DL_LIBS})
15
-
16 10
 INSTALL(TARGETS sems-stats
17
-	RUNTIME DESTINATION sbin
11
+	RUNTIME DESTINATION ${SEMS_EXEC_PREFIX}/sbin
18 12
 	)
13
+
14
+# library
15
+set (stats_SRCS
16
+Statistics.cpp
17
+StatsUDPServer.cpp
18
+)
19
+
20
+SET(sems_module_name stats)
21
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
22
+
... ...
@@ -3,6 +3,6 @@ md5.c
3 3
 UACAuth.cpp
4 4
 )
5 5
 
6
-ADD_LIBRARY(uac_auth SHARED ${uac_auth_SRCS})
7
-TARGET_LINK_LIBRARIES(uac_auth ${CMAKE_DL_LIBS})
6
+SET(sems_module_name uac_auth)
7
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
8 8
 
... ...
@@ -4,6 +4,6 @@ set (wav_SRCS
4 4
  wav_hdr.c
5 5
 )
6 6
 
7
-ADD_LIBRARY(wav SHARED ${wav_SRCS})
8
-TARGET_LINK_LIBRARIES(wav ${CMAKE_DL_LIBS})
7
+SET(sems_module_name wav)
8
+INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt)
9 9