source: trunk/CMakeLists.txt@ 1743

Last change on this file since 1743 was 1743, checked in by merek, 10 years ago

Merge from UMP r1808

File size: 20.4 KB
Line 
1project (OSCam C)
2
3#----------------------- minimum version of cmake to use ------------
4
5# if you want to switch to 2.6 min, please look at the escaped definitions
6# later in this file (the add_definitions in 2.6 don't need to be escaped),
7# and remove the CMP0005 policy.
8# the CMP0003 could also be removed for cmake 2.6
9cmake_minimum_required (VERSION 2.4)
10if(COMMAND cmake_policy)
11 cmake_policy(SET CMP0005 OLD)
12 cmake_policy(SET CMP0003 NEW)
13endif(COMMAND cmake_policy)
14
15#----------------------- detect system ------------------------------
16
17if (CMAKE_CROSSCOMPILING)
18 if (OSCAM_SYSTEM_NAME MATCHES "Tuxbox")
19 set (OSCamOperatingSystem "Tuxbox")
20 set (CS_OS_HW "tuxbox")
21 set (CS_OS_SYS "linux")
22 elseif (OSCAM_SYSTEM_NAME MATCHES "TripleDragon")
23 set (OSCamOperatingSystem "TripleDragon")
24 set (CS_OS_HW "tuxbox")
25 set (CS_OS_SYS "linux")
26 elseif (OSCAM_SYSTEM_NAME MATCHES "Coolstream")
27 set (OSCamOperatingSystem "NeutrinoHD")
28 set (CS_OS_HW "coolstream")
29 set (CS_OS_SYS "linux")
30 elseif (OSCAM_SYSTEM_NAME MATCHES "NSLU2")
31 set (OSCamOperatingSystem "SlugOS")
32 set (CS_OS_HW "nslu2")
33 set (CS_OS_SYS "linux")
34 elseif (OSCAM_SYSTEM_NAME MATCHES "Fonera2")
35 set (OSCamOperatingSystem "Fonera2")
36 set (CS_OS_HW "fonera2")
37 set (CS_OS_SYS "linux")
38 elseif (OSCAM_SYSTEM_NAME MATCHES "agv2+w")
39 set (OSCamOperatingSystem "agv2+w")
40 set (CS_OS_HW "agv2+w")
41 set (CS_OS_SYS "linux")
42 elseif (OSCAM_SYSTEM_NAME MATCHES "WRT54G")
43 set (OSCamOperatingSystem "WRT54G")
44 set (CS_OS_HW "wrt54g")
45 set (CS_OS_SYS "linux")
46 elseif (OSCAM_SYSTEM_NAME MATCHES "Amino")
47 set (OSCamOperatingSystem "Amino")
48 set (CS_OS_HW "amino")
49 set (CS_OS_SYS "linux")
50 else (OSCAM_SYSTEM_NAME MATCHES "Tuxbox")
51 message (STATUS "Unknown cross system name: <${CMAKE_SYSTEM_NAME}>")
52 set (OSCamOperatingSystem "Unknown")
53 set (CS_OS_HW "unknown")
54 set (CS_OS_SYS "unknown")
55 endif (OSCAM_SYSTEM_NAME MATCHES "Tuxbox")
56else (CMAKE_CROSSCOMPILING)
57 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
58 set (OSCamOperatingSystem "Linux")
59 set (CS_OS_HW "pc")
60 set (CS_OS_SYS "linux")
61 elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
62 set (OSCamOperatingSystem "Mac OS X")
63 set (CS_OS_HW "mac")
64 set (CS_OS_SYS "macosx")
65 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
66 SET( CMAKE_CFLAGS "${CMAKE_CFLAGS} -m32" )
67 elseif (${CYGWIN})
68 set (OSCamOperatingSystem "Windows/Cygwin")
69 set (CS_OS_HW "pc")
70 set (CS_OS_SYS "cygwin")
71 set (CMAKE_SYSTEM_PROCESSOR "i386")
72 else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
73 message (STATUS "Unknown system name: <${CMAKE_SYSTEM_NAME}>")
74 set (OSCamOperatingSystem "Unknown")
75 set (CS_OS_HW "unknown")
76 set (CS_OS_SYS "unknown")
77 endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
78endif (CMAKE_CROSSCOMPILING)
79
80#----------------------- some paths ------------------------------
81
82set (OPTIONAL_LINK_DIR "" CACHE STRING "Some optional link directories")
83set (OPTIONAL_INCLUDE_DIR "" CACHE STRING "Some optional include directories")
84
85include_directories (
86 ${CMAKE_CURRENT_SOURCE_DIR}/csctapi
87 ${CMAKE_CURRENT_SOURCE_DIR}/cscrypt
88 ${OPTIONAL_INCLUDE_DIR}
89 )
90link_directories (${OPTIONAL_LINK_DIR})
91
92#----------------------- global options ------------------------------
93
94if (OSCamOperatingSystem MATCHES "Linux")
95 add_definitions ("-DOS_LINUX")
96 set (DEFAULT_CS_CONFDIR "/usr/local/etc")
97elseif (OSCamOperatingSystem MATCHES "Mac OS X")
98 add_definitions ("-DOS_MACOSX -DHAVE_PCSC -DNEED_DAEMON -DCS_NOSHM")
99 set (DEFAULT_CS_CONFDIR "/usr/local/etc")
100elseif (OSCamOperatingSystem MATCHES "Tuxbox")
101 set (DEFAULT_CS_CONFDIR "/var/tuxbox/config")
102 if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
103 add_definitions ("-DOS_LINUX -DTUXBOX -DMIPSEL")
104 else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
105 add_definitions ("-DOS_LINUX -DTUXBOX -DPPC")
106 endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips")
107elseif (OSCamOperatingSystem MATCHES "TripleDragon")
108 add_definitions ("-DOS_LINUX -DTRIPLEDRAGON -DSTB04SCI -DTUXBOX -DPPC")
109 set (DEFAULT_CS_CONFDIR "/var/tuxbox/config")
110elseif (OSCamOperatingSystem MATCHES "NeutrinoHD")
111 add_definitions ("-DOS_LINUX -DTUXBOX -DCOOL")
112 set (DEFAULT_CS_CONFDIR "/var/tuxbox/config")
113elseif (OSCamOperatingSystem MATCHES "SlugOS")
114 add_definitions ("-DOS_LINUX -DARM")
115 set (DEFAULT_CS_CONFDIR "/var/etc")
116elseif (OSCamOperatingSystem MATCHES "Fonera2")
117 add_definitions ("-DOS_LINUX -DMIPSEL -DUCLIBC")
118 set (DEFAULT_CS_CONFDIR "/var/etc")
119elseif (OSCamOperatingSystem MATCHES "agv2+w")
120 add_definitions ("-DOS_LINUX -DUCLIBC")
121 set (DEFAULT_CS_CONFDIR "/etc")
122elseif (OSCamOperatingSystem MATCHES "WRT54G")
123 add_definitions ("-DOS_LINUX -DMIPSEL -DUCLIBC -DUSE_GPIO")
124 set (DEFAULT_CS_CONFDIR "/jffs/etc/config/oscam")
125elseif (OSCamOperatingSystem MATCHES "Amino")
126 add_definitions ("-DOS_LINUX -DSH4 -DTUXBOX")
127 set (DEFAULT_CS_CONFDIR "/usr/local/etc")
128elseif (OSCamOperatingSystem MATCHES "Windows/Cygwin")
129 add_definitions ("-DOS_CYGWIN32 -static")
130 set (DEFAULT_CS_CONFDIR ".")
131endif (OSCamOperatingSystem MATCHES "Linux")
132
133set (CS_CONFDIR ${DEFAULT_CS_CONFDIR} CACHE STRING "Default path for the config files")
134add_definitions ("-DCS_CONFDIR=\\\"${CS_CONFDIR}\\\"")
135
136set (CS_OS_CPU ${CMAKE_SYSTEM_PROCESSOR})
137set (CS_OSTYPE ${CS_OS_CPU}-${CS_OS_HW}-${CS_OS_SYS})
138
139add_definitions ("-DUSE_CMAKE")
140add_definitions ("-DCS_OSTYPE=\\\"${CS_OSTYPE}\\\"")
141add_definitions ("-DCS_OS_CPU=\\\"${CS_OS_CPU}\\\"")
142add_definitions ("-DCS_OS_HW=\\\"${CS_OS_HW}\\\"")
143add_definitions ("-DCS_OS_SYS=\\\"${CS_OS_SYS}\\\"")
144
145#----------------------- subdirectories ------------------------------
146
147include (CheckIncludeFile)
148if(CS_ANTICASC)
149 add_definitions ("-DCS_ANTICASC")
150endif(CS_ANTICASC)
151
152if(CS_LOGHISTORY)
153 add_definitions ("-DCS_LOGHISTORY")
154endif(CS_LOGHISTORY)
155
156if(CS_WITH_GBOX)
157 add_definitions ("-DCS_WITH_GBOX")
158endif(CS_WITH_GBOX)
159
160if (WEBIF)
161 add_definitions ("-DWEBIF")
162endif (WEBIF)
163
164if(IRDETO_GUESSING)
165 add_definitions ("-DIRDETO_GUESSING")
166endif (IRDETO_GUESSING)
167
168check_include_file ("pthread.h" HAVE_PTHREAD)
169if (HAVE_PTHREAD)
170 message(STATUS " pthread found. Adding pthread support ")
171 add_definitions ("-DHAVE_PTHREAD_H")
172elseif (HAVE_PTHREAD)
173 message(STATUS " no pthread found. No smartreader ")
174endif (HAVE_PTHREAD)
175
176check_include_file ("openssl/aes.h" HAVE_AES)
177if (HAVE_AES)
178 add_definitions ("-DHAVE_AES")
179endif (HAVE_AES)
180
181check_include_file ("openssl/sha.h" HAVE_SHA)
182if (HAVE_SHA)
183 add_definitions ("-DHAVE_SHA")
184endif (HAVE_SHA)
185
186
187if (NOT OSCamOperatingSystem MATCHES "Mac OS X")
188 if (LIBRTDIR)
189 check_include_file ("${LIBRTDIR}/include/time.h" HAVE_LIBRT_STATIC)
190 if (HAVE_LIBRT_STATIC)
191 if (EXISTS ${LIBRTDIR}/lib/librt.a)
192 message(STATUS " static librt found : ${LIBRTDIR}/lib/librt.a (needed by libusb).")
193 add_definitions ("-I${LIBRTDIR}/include/")
194 add_library(imp_librt STATIC IMPORTED)
195 set_property(TARGET imp_librt PROPERTY IMPORTED_LOCATION ${LIBRTDIR}/lib/librt.a)
196 else (EXISTS ${LIBRTDIR}/lib/librt.a)
197 message(STATUS " ${LIBRTDIR}/lib/librt.a not found (needed by libusb). No smartreader support)")
198 unset (HAVE_LIBRT_STATIC)
199 endif (EXISTS ${LIBRTDIR}/lib/librt.a)
200 else (HAVE_LIBRT_STATIC)
201 message(STATUS " no librt found (needed by libusb). No smartreader support")
202 endif (HAVE_LIBRT_STATIC)
203 else (LIBRTDIR)
204 check_include_file ("time.h" HAVE_LIBRT)
205 if (HAVE_LIBRT)
206 message(STATUS " librt found (needed by libusb).")
207 else (HAVE_LIBRT)
208 message(STATUS " no librt found (needed by libusb. No smartreader support")
209 endif (HAVE_LIBRT)
210 endif (LIBRTDIR)
211else (NOT OSCamOperatingSystem MATCHES "Mac OS X")
212 set (HAVE_LIBRT True)
213endif (NOT OSCamOperatingSystem MATCHES "Mac OS X")
214
215
216if( HAVE_LIBRT OR HAVE_LIBRT_STATIC)
217 if (LIBUSBDIR)
218 check_include_file ("${LIBUSBDIR}/include/libusb-1.0/libusb.h" HAVE_LIBUSB)
219 if (HAVE_LIBUSB AND HAVE_PTHREAD)
220 if (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a)
221 message(STATUS " static libusb 1.0 found (${LIBUSBDIR}/lib/libusb-1.0.a). Adding smartreader support ")
222 add_definitions ("-DLIBUSB")
223 add_definitions ("-I${LIBUSBDIR}/include/")
224 add_library(imp_libusb STATIC IMPORTED)
225 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION ${LIBUSBDIR}/lib/libusb-1.0.a)
226 else (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a)
227 message(STATUS " static libusb 1.0 not found (${LIBUSBDIR}/lib/libusb-1.0.a). No smartreader support ")
228 unset(HAVE_LIBUSB)
229 unset(HAVE_LIBRT)
230 unset(HAVE_LIBRT_STATIC)
231 endif (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a)
232 else (HAVE_LIBUSB AND HAVE_PTHREAD)
233 message(STATUS " no libusb 1.0 found. No smartreader support")
234 endif (HAVE_LIBUSB AND HAVE_PTHREAD)
235 else (LIBUSBDIR)
236 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB)
237 if (HAVE_LIBUSB AND HAVE_PTHREAD)
238 if (EXISTS /usr/local/lib/libusb-1.0.a)
239 message(STATUS " static libusb 1.0 found : /usr/local/lib/libusb-1.0.a . Adding smartreader support ")
240 add_definitions ("-DLIBUSB")
241 add_definitions ("-I/usr/local/include")
242 add_library(imp_libusb STATIC IMPORTED)
243 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION /usr/local/lib/libusb-1.0.a)
244 elseif (EXISTS /usr/lib/libusb-1.0.a)
245 message(STATUS " static libusb 1.0 found : /usr/lib/libusb-1.0.a . Adding smartreader support ")
246 add_definitions ("-DLIBUSB")
247 add_library(imp_libusb STATIC IMPORTED)
248 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION /usr/lib/libusb-1.0.a)
249 else (EXISTS /usr/local/lib/libusb-1.0.a)
250 message(STATUS " static libusb 1.0 not found (not in /usr/local/lib/ or /usr/lib/) . No smartreader support ")
251 unset(HAVE_LIBUSB)
252 unset(HAVE_LIBRT)
253 unset(HAVE_LIBRT_STATIC)
254 endif (EXISTS /usr/local/lib/libusb-1.0.a)
255 else (HAVE_LIBUSB AND HAVE_PTHREAD)
256 message(STATUS " no libusb 1.0 found. No smartreader support")
257 endif (HAVE_LIBUSB AND HAVE_PTHREAD)
258 endif (LIBUSBDIR)
259endif( HAVE_LIBRT OR HAVE_LIBRT_STATIC)
260
261
262check_include_file ("PCSC/wintypes.h" HAVE_PCSC)
263if (HAVE_PCSC)
264 add_definitions ("-DHAVE_PCSC")
265if (OSCamOperatingSystem MATCHES "Linux")
266 add_definitions ("-I/usr/include/PCSC")
267endif (OSCamOperatingSystem MATCHES "Linux")
268endif (HAVE_PCSC)
269
270#----------------------- subdirectories ------------------------------
271
272add_subdirectory (csctapi)
273add_subdirectory (cscrypt)
274
275if( HAVE_LIBRT OR HAVE_LIBRT_STATIC)
276 if (HAVE_LIBUSB)
277 add_subdirectory (utils)
278 endif (HAVE_LIBUSB)
279endif( HAVE_LIBRT OR HAVE_LIBRT_STATIC)
280
281#----------------------- file groups ------------------------------
282
283file (GLOB csmodules_srcs "module-*.c")
284file (GLOB csmodules_hdrs "module-*.h")
285file (GLOB csreaders_srcs "reader-*.c")
286file (GLOB csreaders_hdrs "reader-*.h")
287file (GLOB csoscam_srcs "oscam-*.c")
288file (GLOB csoscam_hdrs "oscam-*.h")
289file (GLOB exe_srcs "oscam.c")
290file (GLOB exe_hdrs "globals.h")
291file (GLOB all_srcs ${csmodules_srcs} ${csreaders_srcs} ${csoscam_srcs} ${exe_srcs})
292
293#----------------------- modules ------------------------------
294
295set (csmodules "csmodules")
296add_library (${csmodules} STATIC ${csmodules_srcs} ${csmodules_hdrs})
297
298#----------------------- readers ------------------------------
299
300set (csreaders "csreaders")
301add_library (${csreaders} STATIC ${csreaders_srcs} ${csreaders_hdrs})
302
303#----------------------- other oscam files ------------------------------
304
305set (csoscam "csoscam")
306add_library (${csoscam} STATIC ${csoscam_srcs} ${csoscam_hdrs})
307
308#----------------------- the executable ------------------------------
309
310set (exe_name "oscam")
311add_executable (${exe_name} ${exe_srcs} ${exe_hdrs})
312target_link_libraries (${exe_name} ${csoscam} ${csmodules} ${csreaders} csctapi cscrypt)
313if(HAVE_LIBRT AND HAVE_LIBUSB)
314 target_link_libraries (${exe_name} imp_libusb)
315 if (NOT OSCamOperatingSystem MATCHES "Mac OS X")
316 target_link_libraries (${exe_name} rt)
317 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X")
318endif(HAVE_LIBRT AND HAVE_LIBUSB)
319
320if (HAVE_LIBRT_STATIC AND HAVE_LIBUSB)
321 target_link_libraries (${exe_name} imp_libusb)
322 if (NOT OSCamOperatingSystem MATCHES "Mac OS X")
323 target_link_libraries (${exe_name} imp_librt)
324 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X")
325endif (HAVE_LIBRT_STATIC AND HAVE_LIBUSB)
326
327if (HAVE_PTHREAD)
328 target_link_libraries (${exe_name} pthread)
329endif (HAVE_PTHREAD)
330
331if (HAVE_AES)
332 target_link_libraries (${exe_name} crypto)
333endif (HAVE_AES)
334if (HAVE_PCSC)
335if (NOT OSCamOperatingSystem MATCHES "Mac OS X")
336 target_link_libraries (${exe_name} pcsclite)
337endif (NOT OSCamOperatingSystem MATCHES "Mac OS X")
338endif (HAVE_PCSC)
339
340
341add_dependencies (${exe_name} ${csoscam} ${csreaders} ${csmodules})
342
343#----------------------- specific options ------------------------------
344
345if (OSCamOperatingSystem MATCHES "Linux")
346elseif (OSCamOperatingSystem MATCHES "Mac OS X")
347 FIND_LIBRARY (PCSC_LIBRARY PCSC)
348 message (STATUS "OS X system PCSC : ${PCSC_LIBRARY}")
349 target_link_libraries ( ${exe_name} ${PCSC_LIBRARY})
350 set (HAVE_PCSC "1")
351 FIND_LIBRARY (IOKit_LIBRARY IOKit)
352 target_link_libraries ( ${exe_name} ${IOKit_LIBRARY})
353 FIND_LIBRARY (CoreFoundation_LIBRARY CoreFoundation)
354 target_link_libraries ( ${exe_name} ${CoreFoundation_LIBRARY})
355elseif (OSCamOperatingSystem MATCHES "Tuxbox")
356 target_link_libraries ( ${exe_name} dl)
357elseif (OSCamOperatingSystem MATCHES "TripleDragon")
358 target_link_libraries ( ${exe_name} dl)
359elseif (OSCamOperatingSystem MATCHES "SlugOS")
360elseif (OSCamOperatingSystem MATCHES "Fonera2")
361elseif (OSCamOperatingSystem MATCHES "agv2+w")
362elseif (OSCamOperatingSystem MATCHES "WRT54G")
363elseif (OSCamOperatingSystem MATCHES "Amino")
364elseif (OSCamOperatingSystem MATCHES "Windows/cygwin")
365elseif (OSCamOperatingSystem MATCHES "NeutrinoHD")
366 target_link_libraries ( ${exe_name} rt nxp )
367endif (OSCamOperatingSystem MATCHES "Linux")
368
369#----------------------- put svnversion in the build ------------------------------
370# at every target rebuild, we re-build the oscam.c compilation...
371
372# add the needed dependency
373add_dependencies (${exe_name} svnversion)
374add_dependencies (${csoscam} svnversion-log)
375
376# how to re-build the files which printout the version
377add_custom_target (
378 svnversion
379 ALL
380 touch ${CMAKE_CURRENT_SOURCE_DIR}/oscam.c
381)
382add_custom_target (
383 svnversion-log
384 ALL
385 touch ${CMAKE_CURRENT_SOURCE_DIR}/oscam-log.c
386)
387
388#if the svnversion program is absent, this will leave the SVN_REVISION string empty,
389#but won't stop CMake.
390execute_process (COMMAND "svnversion" "-n" "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE OSCAM_SVN_REVISION)
391
392if (OSCAM_SVN_REVISION)
393 string (REGEX REPLACE "[0-9]+:" "" OSCAM_SVN_REVISION "${OSCAM_SVN_REVISION}")
394 string (REPLACE "M" "" OSCAM_SVN_REVISION "${OSCAM_SVN_REVISION}")
395 string (REPLACE "exported" "0" OSCAM_SVN_REVISION "${OSCAM_SVN_REVISION}")
396else (OSCAM_SVN_REVISION)
397 set (OSCAM_SVN_REVISION "0")
398endif (OSCAM_SVN_REVISION)
399
400# pass the version to the compilations as a define
401add_definitions ("-D'CS_SVN_VERSION=\"${OSCAM_SVN_REVISION}\"'")
402
403#----------------------- global compile and link options ------------------------------
404
405# some optimisations
406if (OSCamOperatingSystem MATCHES "Mac OS X")
407 add_definitions ("-O2 -Winline -Wall -Wextra -finline-functions -fomit-frame-pointer -m32")
408elseif (OSCAM_SYSTEM_NAME MATCHES "NSLU2")
409 add_definitions ("-O2 -Winline -Wall -finline-functions -fomit-frame-pointer")
410else (OSCamOperatingSystem MATCHES "Mac OS X")
411 add_definitions ("-O2 -Winline -Wall -Wextra -finline-functions -fomit-frame-pointer")
412endif (OSCamOperatingSystem MATCHES "Mac OS X")
413
414# we don't want the '-rdynamic' in the link command
415set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
416
417# we want to strip
418if (OSCamOperatingSystem MATCHES "Mac OS X")
419set (CMAKE_EXE_LINKER_FLAGS "-s -m32")
420else (OSCamOperatingSystem MATCHES "Mac OS X")
421set (CMAKE_EXE_LINKER_FLAGS "-s")
422endif (OSCamOperatingSystem MATCHES "Mac OS X")
423#----------------------- installation -----------------------------
424
425file (GLOB config_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/oscam.*")
426file (GLOB doc_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/txt/*.txt")
427file (GLOB man1_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/man/*.1")
428file (GLOB man5_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/man/*.5")
429file (GLOB example_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.ac"
430 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.cert"
431 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.conf"
432 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.guess"
433 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.ird"
434 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.server"
435 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.services"
436 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.srvid"
437 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/doc/example/oscam.user")
438file (GLOB monitor_files "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/monitor/mpcs*.sh"
439 "${CMAKE_CURRENT_SOURCE_DIR}/Distribution/monitor/mpcs*.tar")
440
441install (PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${exe_name}${CMAKE_EXECUTABLE_SUFFIX} DESTINATION bin COMPONENT bin)
442install (FILES ${config_files} DESTINATION etc COMPONENT config)
443install (FILES ${doc_files} DESTINATION share/doc/oscam COMPONENT doc)
444install (FILES ${man1_files} DESTINATION share/man/man1 COMPONENT doc)
445install (FILES ${man5_files} DESTINATION share/man/man5 COMPONENT doc)
446install (FILES ${example_files} DESTINATION share/doc/oscam/example COMPONENT doc)
447install (FILES ${monitor_files} DESTINATION share/doc/oscam/monitor COMPONENT doc)
448
449#----------------------- we can use CPack to build pacakges --------------------------
450
451# get version from source file
452execute_process (COMMAND grep CS_VERSION ${CMAKE_CURRENT_SOURCE_DIR}/globals.h
453 OUTPUT_VARIABLE CS_VERSION)
454string (REGEX REPLACE ".*\"\(.*\)\".*" "\\1" CS_VERSION ${CS_VERSION})
455string (REGEX REPLACE "\(.*\)\\..*\\..*" "\\1" CPACK_PACKAGE_VERSION_MAJOR ${CS_VERSION})
456string (REGEX REPLACE ".*\\.\(.*\)\\..*" "\\1" CPACK_PACKAGE_VERSION_MINOR ${CS_VERSION})
457string (REGEX REPLACE ".*\\..*\\.\(.*\)" "\\1" CPACK_PACKAGE_VERSION_PATCH ${CS_VERSION})
458set (CPACK_PACKAGE_VERSION
459 "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
460
461# compute my filename
462set (CPACK_PACKAGE_FILE_NAME
463 "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CS_OSTYPE}")
464
465# wich archive we want to generate
466set (CPACK_GENERATOR "TGZ")
467
468# what to put in the archive
469set (CPACK_STRIP_FILES TRUE)
470set (CPACK_COMPONENTS_ALL bin)# config doc)
471
472# ok, we can now use CPack
473include (CPack)
474
475#----------------------- printout resume -----------------------------
476
477message (STATUS "")
478message (STATUS " operating system: ${OSCamOperatingSystem}")
479message (STATUS " system type: ${CS_OSTYPE}")
480message (STATUS " system: ${CS_OS_SYS}")
481message (STATUS " cpu: ${CS_OS_CPU}")
482message (STATUS " hw: ${CS_OS_HW}")
483if (HAVE_AES)
484 message (STATUS " use system aes functions")
485else (HAVE_AES)
486 message (STATUS " use built-in aes functions")
487endif (HAVE_AES)
488if (HAVE_SHA)
489 message (STATUS " use system sha functions")
490else (HAVE_SHA)
491 message (STATUS " use built-in sha functions")
492endif (HAVE_SHA)
493if (HAVE_PCSC)
494 message (STATUS " use system pcsc functions")
495endif (HAVE_PCSC)
496if (HAVE_PTHREAD)
497 message (STATUS " use system pthread functions")
498endif (HAVE_PTHREAD)
499if (HAVE_LIBUSB)
500 message (STATUS " use system libusb functions")
501endif (HAVE_LIBUSB)
502if (WEBIF)
503 message (STATUS " web interface enabled")
504endif (WEBIF)
505if (IRDETO_GUESSING)
506 message (STATUS " irdeto guessing enabled")
507endif (IRDETO_GUESSING)
508message (STATUS "")
Note: See TracBrowser for help on using the repository browser.