PageRenderTime 22ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/thirdparty/liblastfm2/src/CMakeLists.txt

http://github.com/tomahawk-player/tomahawk
CMake | 124 lines | 108 code | 14 blank | 2 comment | 4 complexity | d8af84d8fa2c618c73c8dcb0ba130df4 MD5 | raw file
  1cmake_minimum_required(VERSION 2.6)
  2
  3# Macro to copy and rename headers
  4macro(copy_header from to)
  5  configure_file(
  6    ${CMAKE_CURRENT_SOURCE_DIR}/${from}
  7    ${CMAKE_CURRENT_BINARY_DIR}/lastfm/${to}
  8    COPY_ONLY
  9  )
 10endmacro(copy_header)
 11
 12# Copy headers
 13copy_header(core/misc.h misc.h)
 14copy_header(core/XmlQuery.h XmlQuery)
 15copy_header(core/UrlBuilder.h UrlBuilder)
 16copy_header(global.h global.h)
 17copy_header(radio/RadioTuner.h RadioTuner)
 18copy_header(radio/RadioStation.h RadioStation)
 19copy_header(scrobble/Audioscrobbler.h Audioscrobbler)
 20copy_header(scrobble/ScrobbleCache.h ScrobbleCache)
 21copy_header(scrobble/ScrobblePoint.h ScrobblePoint)
 22copy_header(types/AbstractType.h AbstractType)
 23copy_header(types/Album.h Album)
 24copy_header(types/Artist.h Artist)
 25copy_header(types/FingerprintId.h FingerprintId)
 26copy_header(types/Mbid.h Mbid)
 27copy_header(types/Playlist.h Playlist)
 28copy_header(types/Tag.h Tag)
 29copy_header(types/Track.h Track)
 30copy_header(types/User.h User)
 31copy_header(types/User.h UserList)
 32copy_header(types/Xspf.h Xspf)
 33copy_header(ws/ws.h ws.h)
 34copy_header(ws/InternetConnectionMonitor.h InternetConnectionMonitor)
 35copy_header(ws/NetworkAccessManager.h NetworkAccessManager)
 36
 37include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
 38
 39set(SOURCES
 40    scrobble/ScrobbleCache.cpp
 41    scrobble/Audioscrobbler.cpp
 42    types/FingerprintId.cpp
 43    types/Artist.cpp
 44    types/Tag.cpp
 45    types/Track.cpp
 46    types/User.cpp
 47    types/Xspf.cpp
 48    types/Album.cpp
 49    types/Playlist.cpp
 50    types/Mbid.cpp
 51    radio/RadioTuner.cpp
 52    radio/RadioStation.cpp
 53    core/UrlBuilder.cpp
 54    core/misc.cpp
 55    core/XmlQuery.cpp
 56    ws/NetworkAccessManager.cpp
 57    ws/ws.cpp
 58    ws/InternetConnectionMonitor.cpp
 59    ws/NetworkConnectionMonitor.cpp
 60)
 61
 62set(MOC_HEADERS
 63  scrobble/Audioscrobbler.h
 64  types/Track.h
 65  types/Xspf.h
 66  radio/RadioTuner.h
 67  ws/NetworkConnectionMonitor.h
 68  ws/InternetConnectionMonitor.h
 69  ws/NetworkAccessManager.h
 70)
 71
 72if(UNIX)
 73  if(APPLE)
 74    set(SOURCES ${SOURCES} ws/mac/MNetworkConnectionMonitor_mac.cpp)
 75    set(MOC_HEADERS ${MOC_HEADERS} ws/mac/MNetworkConnectionMonitor.h)
 76  else(APPLE)
 77    set(SOURCES ${SOURCES} ws/linux/LNetworkConnectionMonitor_linux.cpp)
 78    set(MOC_HEADERS ${MOC_HEADERS} ws/linux/LNetworkConnectionMonitor.h)
 79  endif(APPLE)
 80endif(UNIX)
 81if(WIN32)
 82  set(SOURCES ${SOURCES} ws/win/WNetworkConnectionMonitor_win.cpp ws/win/Pac.cpp ws/win/NdisEvents.cpp )
 83  set(MOC_HEADERS ${MOC_HEADERS} ws/win/WNetworkConnectionMonitor.h)
 84  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../winhttp)
 85endif(WIN32)
 86
 87qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})
 88
 89IF( WIN32 )
 90    add_library(tomahawk_lastfm2 SHARED
 91    ${SOURCES}
 92    ${MOC_SOURCES}
 93    )
 94ELSE()
 95    add_definitions(-fPIC)
 96    add_library(tomahawk_lastfm2 STATIC
 97    ${SOURCES}
 98    ${MOC_SOURCES}
 99    )
100ENDIF()
101
102target_link_libraries(tomahawk_lastfm2
103  ${QT_LIBRARIES}
104  ${QT_QTDBUS_LIBRARY}
105
106)
107
108set_target_properties(tomahawk_lastfm2 PROPERTIES COMPILE_FLAGS "-DLASTFM_OHAI_QMAKE"  )
109
110if(APPLE)
111  target_link_libraries(tomahawk_lastfm2
112    /System/Library/Frameworks/CoreFoundation.framework
113    /System/Library/Frameworks/SystemConfiguration.framework
114  )
115endif(APPLE)
116
117
118IF( WIN32 )
119    install(TARGETS tomahawk_lastfm2
120    RUNTIME DESTINATION bin
121    LIBRARY DESTINATION lib${LIB_SUFFIX}
122    ARCHIVE DESTINATION lib${LIB_SUFFIX}
123    )
124ENDIF()