wrong character in the GSM 03.38 table (ç for Ç)
[gammu.git] / libgammu / CMakeLists.txt
bloba284a600dae3b654687b4e423c5291f18fed0cae
1 # cmake <http://www.cmake.org> build file for Gammu
2 # Copyright © 2007 - 2009 Michal Čihař
3 # vim: expandtab sw=4 ts=4 sts=4:
5 project (libGammu C)
7 include(GammuTuneCompiler)
9 set (LIBRARY_SRC
10     gsmcomon.c
11     gsmphones.c
12     gsmstate.c
13     api.c
14     debug.c
15     misc/misc.c
16     misc/cfg.c
17     misc/coding/coding.c
18     service/sms/gsmsms.c
19     service/sms/gsmems.c
20     service/sms/gsmmulti.c
21     service/gsmcal.c
22     service/gsmdata.c
23     service/gsmpbk.c
24     service/gsmring.c
25     service/gsmlogo.c
26     service/gsmmisc.c
27     service/gsmnet.c
28     service/backup/gsmback.c
29     service/backup/backldif.c
30     service/backup/backlmb.c
31     service/backup/backtext.c
32     service/backup/backvcs.c
33     service/backup/backvcf.c
34     service/backup/backics.c
35     service/backup/backvnt.c
36     device/bluetoth/bluetoth.c
37     device/irda/irda.c
38     device/usb/usb.c
39     device/devfunc.c
40     protocol/at/at.c
41     protocol/alcatel/alcabus.c
42     protocol/nokia/mbus2.c
43     protocol/nokia/fbus2.c
44     protocol/nokia/phonet.c
45     protocol/obex/obex.c
46     protocol/symbian/gnapbus.c
47     protocol/s60/s60.c
48     phone/pfunc.c
49     phone/at/atgen.c
50     phone/at/at-sms.c
51     phone/at/siemens.c
52     phone/at/samsung.c
53     phone/at/motorola.c
54     phone/at/sonyericsson.c
55     phone/alcatel/alcatel.c
56     phone/atobex/atobex.c
57     phone/nokia/dct3/n0650.c
58     phone/nokia/dct3/n6110.c
59     phone/nokia/dct3/n7110.c
60     phone/nokia/dct3/n9210.c
61     phone/nokia/dct3/dct3func.c
62     phone/nokia/dct4s40/n3320.c
63     phone/nokia/dct4s40/dct4func.c
64     phone/nokia/dct4s40/6510/n6510.c
65     phone/nokia/dct4s40/6510/6510cal.c
66     phone/nokia/dct4s40/6510/6510file.c
67     phone/nokia/wd2/n3650.c
68     phone/nokia/nauto.c
69     phone/nokia/nfunc.c
70     phone/nokia/nfuncold.c
71     phone/obex/obexgen.c
72     phone/obex/mobex.c
73     phone/symbian/gnapgen.c
74     phone/s60/s60phone.c)
76 # Own or glib based MD5 implementation
77 if (GLIB_FOUND)
78     list (APPEND LIBRARY_SRC misc/coding/md5-glib.c)
79 else (GLIB_FOUND)
80     list (APPEND LIBRARY_SRC misc/coding/md5.c)
81 endif (GLIB_FOUND)
83 if (WITH_BACKUP)
84     list (APPEND LIBRARY_SRC phone/dummy/dummy.c)
85 endif (WITH_BACKUP)
86 if (BLUEZ_FOUND)
87     list (APPEND LIBRARY_SRC device/bluetoth/bluez.c)
88 endif (BLUEZ_FOUND)
89 if (BSD_BLUE_FOUND)
90     list (APPEND LIBRARY_SRC device/bluetoth/blue_bsd.c)
91 endif (BSD_BLUE_FOUND)
92 if (OSX_BLUE_FOUND)
93     list (APPEND LIBRARY_SRC device/bluetoth/blue_osx.c)
94 endif (OSX_BLUE_FOUND)
95 if (WIN32 AND NOT CYGWIN)
96     list (APPEND LIBRARY_SRC device/bluetoth/blue_w32.c)
97 endif (WIN32 AND NOT CYGWIN)
99 if (CYGWIN OR NOT WIN32 AND NOT DJGPP)
100     list (APPEND LIBRARY_SRC device/serial/ser_unx.c)
101 endif (CYGWIN OR NOT WIN32 AND NOT DJGPP)
102 if (DJGPP)
103     list (APPEND LIBRARY_SRC device/serial/ser_djg.c)
104 endif (DJGPP)
105 if (WIN32 AND NOT CYGWIN)
106     list (APPEND LIBRARY_SRC device/serial/ser_w32.c)
107 endif (WIN32 AND NOT CYGWIN)
109 # Library
110 add_library (libGammu ${LIBRARY_SRC})
111 set_target_properties (libGammu PROPERTIES
112     VERSION ${GAMMU_SOVERSION}.${GAMMU_VERSION}
113     SOVERSION ${GAMMU_SOVERSION}
114     OUTPUT_NAME Gammu)
115 if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
116     set_target_properties (libGammu PROPERTIES COMPILE_FLAGS -fPIC)
117 endif (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
118 if(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)
119     SET_TARGET_PROPERTIES(libGammu PROPERTIES LINK_FLAGS
120         "-Wl,--output-def,${CMAKE_CURRENT_BINARY_DIR}/libGammu.def")
121     INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libGammu.def
122             DESTINATION "${INSTALL_LIB_DIR}"
123             COMPONENT library)
124 endif(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)
127 target_link_libraries (libGammu string)
129 if (GLIB_FOUND)
130     target_link_libraries (libGammu ${GLIB_LIBRARIES} ${GOBJECT_LIBRARIES})
131     include_directories(${GLIB_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS})
132 endif (GLIB_FOUND)
134 if (BLUEZ_FOUND)
135     target_link_libraries (libGammu ${BLUEZ_LIBRARIES})
136     include_directories (${BLUEZ_INCLUDE_DIR})
137 endif (BLUEZ_FOUND)
139 if (LIBUSB_FOUND)
140     target_link_libraries (libGammu ${LIBUSB_LIBRARIES})
141     include_directories (${LIBUSB_INCLUDE_DIR})
142 endif (LIBUSB_FOUND)
144 if (BSD_BLUE_FOUND)
145     target_link_libraries (libGammu ${BSD_BLUE_LIBRARIES})
146     include_directories (${BSD_BLUE_INCLUDE_DIR})
147 endif (BSD_BLUE_FOUND)
149 if (OSX_BLUE_FOUND)
150     target_link_libraries (libGammu ${OSX_BLUE_LIBS})
151     include_directories (${OSX_BLUE_INCLUDE_DIR})
152 endif (OSX_BLUE_FOUND)
154 if (ICONV_FOUND)
155     target_link_libraries (libGammu ${ICONV_LIBRARIES})
156     include_directories (${ICONV_INCLUDE_DIR})
157 endif (ICONV_FOUND)
159 if (UNIX)
160     target_link_libraries (libGammu ${MATH_LIBRARIES})
161 endif (UNIX)
163 if (LIBINTL_LIB_FOUND AND LIBINTL_LIBRARIES)
164     target_link_libraries (libGammu ${LIBINTL_LIBRARIES})
165     include_directories (${LIBINTL_INCLUDE_DIR})
166 endif (LIBINTL_LIB_FOUND AND LIBINTL_LIBRARIES)
168 # dirent emulation layer
169 if(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
170     target_link_libraries (libGammu win32dirent)
171 endif(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
173 # Include search path
174 include_directories ("${CMAKE_CURRENT_BINARY_DIR}/../include")
175 include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../common")
177 # Add libraries needed for windows build
178 if (WIN32 AND NOT CYGWIN)
179     # Magic needed for SHGetFolderPathA
180     target_link_libraries (libGammu shfolder shell32)
181     # Win sock
182     target_link_libraries (libGammu ws2_32)
183     # These libraries are needed for serial driver
184     target_link_libraries (libGammu setupapi advapi32)
185 endif (WIN32 AND NOT CYGWIN)
187 # Install instructions
188 install (TARGETS libGammu
189         RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
190         COMPONENT library
191         LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
192         COMPONENT library
193         ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
194         COMPONENT library
195         )