Skip to content
This repository
tree: ddc535e2e7
Fetching contributors…

Cannot retrieve contributors at this time

file 195 lines (174 sloc) 5.917 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
# cmake <http://www.cmake.org> build file for Gammu
# Copyright © 2007 - 2009 Michal Čihař
# vim: expandtab sw=4 ts=4 sts=4:

project (libGammu C)

include(GammuTuneCompiler)

set (LIBRARY_SRC
    gsmcomon.c
    gsmphones.c
    gsmstate.c
    api.c
    debug.c
    misc/misc.c
    misc/cfg.c
    misc/coding/coding.c
    service/sms/gsmsms.c
    service/sms/gsmems.c
    service/sms/gsmmulti.c
    service/gsmcal.c
    service/gsmdata.c
    service/gsmpbk.c
    service/gsmring.c
    service/gsmlogo.c
    service/gsmmisc.c
    service/gsmnet.c
    service/backup/gsmback.c
    service/backup/backldif.c
    service/backup/backlmb.c
    service/backup/backtext.c
    service/backup/backvcs.c
    service/backup/backvcf.c
    service/backup/backics.c
    service/backup/backvnt.c
    device/bluetoth/bluetoth.c
    device/irda/irda.c
    device/usb/usb.c
    device/devfunc.c
    protocol/at/at.c
    protocol/alcatel/alcabus.c
    protocol/nokia/mbus2.c
    protocol/nokia/fbus2.c
    protocol/nokia/phonet.c
    protocol/obex/obex.c
    protocol/symbian/gnapbus.c
    protocol/s60/s60.c
    phone/pfunc.c
    phone/at/atgen.c
    phone/at/at-sms.c
    phone/at/siemens.c
    phone/at/samsung.c
    phone/at/motorola.c
    phone/at/sonyericsson.c
    phone/alcatel/alcatel.c
    phone/atobex/atobex.c
    phone/nokia/dct3/n0650.c
    phone/nokia/dct3/n6110.c
    phone/nokia/dct3/n7110.c
    phone/nokia/dct3/n9210.c
    phone/nokia/dct3/dct3func.c
    phone/nokia/dct4s40/n3320.c
    phone/nokia/dct4s40/dct4func.c
    phone/nokia/dct4s40/6510/n6510.c
    phone/nokia/dct4s40/6510/6510cal.c
    phone/nokia/dct4s40/6510/6510file.c
    phone/nokia/wd2/n3650.c
    phone/nokia/nauto.c
    phone/nokia/nfunc.c
    phone/nokia/nfuncold.c
    phone/obex/obexgen.c
    phone/obex/mobex.c
    phone/symbian/gnapgen.c
    phone/s60/s60phone.c)

# Own or glib based MD5 implementation
if (GLIB_FOUND)
    list (APPEND LIBRARY_SRC misc/coding/md5-glib.c)
else (GLIB_FOUND)
    list (APPEND LIBRARY_SRC misc/coding/md5.c)
endif (GLIB_FOUND)

if (WITH_BACKUP)
    list (APPEND LIBRARY_SRC phone/dummy/dummy.c)
endif (WITH_BACKUP)
if (BLUEZ_FOUND)
    list (APPEND LIBRARY_SRC device/bluetoth/bluez.c)
endif (BLUEZ_FOUND)
if (BSD_BLUE_FOUND)
    list (APPEND LIBRARY_SRC device/bluetoth/blue_bsd.c)
endif (BSD_BLUE_FOUND)
if (OSX_BLUE_FOUND)
    list (APPEND LIBRARY_SRC device/bluetoth/blue_osx.c)
endif (OSX_BLUE_FOUND)
if (WIN32 AND NOT CYGWIN)
    list (APPEND LIBRARY_SRC device/bluetoth/blue_w32.c)
endif (WIN32 AND NOT CYGWIN)

if (CYGWIN OR NOT WIN32 AND NOT DJGPP)
    list (APPEND LIBRARY_SRC device/serial/ser_unx.c)
endif (CYGWIN OR NOT WIN32 AND NOT DJGPP)
if (DJGPP)
    list (APPEND LIBRARY_SRC device/serial/ser_djg.c)
endif (DJGPP)
if (WIN32 AND NOT CYGWIN)
    list (APPEND LIBRARY_SRC device/serial/ser_w32.c)
endif (WIN32 AND NOT CYGWIN)

# Library
add_library (libGammu ${LIBRARY_SRC})
set_target_properties (libGammu PROPERTIES
    VERSION ${GAMMU_SOVERSION}.${GAMMU_VERSION}
    SOVERSION ${GAMMU_SOVERSION}
    OUTPUT_NAME Gammu)
if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
    set_target_properties (libGammu PROPERTIES COMPILE_FLAGS -fPIC)
endif (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
if(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)
    SET_TARGET_PROPERTIES(libGammu PROPERTIES LINK_FLAGS
        "-Wl,--output-def,${CMAKE_CURRENT_BINARY_DIR}/libGammu.def")
    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libGammu.def
            DESTINATION "${INSTALL_LIB_DIR}"
            COMPONENT library)
endif(CMAKE_COMPILER_IS_MINGW AND BUILD_SHARED_LIBS)


target_link_libraries (libGammu string)

if (GLIB_FOUND)
    target_link_libraries (libGammu ${GLIB_LIBRARIES} ${GOBJECT_LIBRARIES})
    include_directories(${GLIB_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS})
endif (GLIB_FOUND)

if (BLUEZ_FOUND)
    target_link_libraries (libGammu ${BLUEZ_LIBRARIES})
    include_directories (${BLUEZ_INCLUDE_DIR})
endif (BLUEZ_FOUND)

if (LIBUSB_FOUND)
    target_link_libraries (libGammu ${LIBUSB_LIBRARIES})
    include_directories (${LIBUSB_INCLUDE_DIR})
endif (LIBUSB_FOUND)

if (BSD_BLUE_FOUND)
    target_link_libraries (libGammu ${BSD_BLUE_LIBRARIES})
    include_directories (${BSD_BLUE_INCLUDE_DIR})
endif (BSD_BLUE_FOUND)

if (OSX_BLUE_FOUND)
    target_link_libraries (libGammu ${OSX_BLUE_LIBS})
    include_directories (${OSX_BLUE_INCLUDE_DIR})
endif (OSX_BLUE_FOUND)

if (ICONV_FOUND)
    target_link_libraries (libGammu ${ICONV_LIBRARIES})
    include_directories (${ICONV_INCLUDE_DIR})
endif (ICONV_FOUND)

if (UNIX)
    target_link_libraries (libGammu ${MATH_LIBRARIES})
endif (UNIX)

if (LIBINTL_LIB_FOUND AND LIBINTL_LIBRARIES)
    target_link_libraries (libGammu ${LIBINTL_LIBRARIES})
    include_directories (${LIBINTL_INCLUDE_DIR})
endif (LIBINTL_LIB_FOUND AND LIBINTL_LIBRARIES)

# dirent emulation layer
if(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)
    target_link_libraries (libGammu win32dirent)
endif(WIN32 AND NOT CMAKE_COMPILER_IS_MINGW AND NOT CMAKE_COMPILER_IS_CYGWIN)

# Include search path
include_directories ("${CMAKE_CURRENT_BINARY_DIR}/../include")
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../common")

# Add libraries needed for windows build
if (WIN32 AND NOT CYGWIN)
    # Magic needed for SHGetFolderPathA
    target_link_libraries (libGammu shfolder shell32)
    # Win sock
    target_link_libraries (libGammu ws2_32)
    # These libraries are needed for serial driver
    target_link_libraries (libGammu setupapi advapi32)
endif (WIN32 AND NOT CYGWIN)

# Install instructions
install (TARGETS libGammu
        RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
        COMPONENT library
        LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
        COMPONENT library
        ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
        COMPONENT library
        )
Something went wrong with that request. Please try again.