CMakeLists.txt 2.99 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(libkcddb)
2

3
4
add_subdirectory( test )
add_subdirectory( kcmcddb )
Laurent Montel's avatar
Laurent Montel committed
5

6
macro_optional_find_package(MusicBrainz)
Laurent Montel's avatar
Laurent Montel committed
7
8

if(MUSICBRAINZ_FOUND)
9
10
11
12
13
    set(HAVE_MUSICBRAINZ 1)
    set(libmusicbrainz_SRCS ${libmusicbrainz_SRCS} musicbrainz/musicbrainzlookup.cpp musicbrainz/sha1.c)
else(MUSICBRAINZ_FOUND)
    set(HAVE_MUSICBRAINZ 0)
    set(libmusicbrainz_SRCS)
Laurent Montel's avatar
Laurent Montel committed
14
endif(MUSICBRAINZ_FOUND)
15

16
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-musicbrainz.h )
17

18
include_directories(${CMAKE_BINARY_DIR}/libkcddb/ )
19
20
21
22


########### next target ###############

Laurent Montel's avatar
Laurent Montel committed
23
set(kcddb_LIB_SRCS ${libmusicbrainz_SRCS}
24
25
   cache.cpp 
   cdinfo.cpp 
26
   kcddbconfig.cpp 
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
   client.cpp 
   cddb.cpp 
   lookup.cpp 
   cddbplookup.cpp 
   synccddbplookup.cpp 
   asynccddbplookup.cpp 
   httplookup.cpp 
   synchttplookup.cpp 
   asynchttplookup.cpp 
   smtpsubmit.cpp 
   asyncsmtpsubmit.cpp 
   syncsmtpsubmit.cpp 
   submit.cpp 
   sites.cpp 
   httpsubmit.cpp 
   asynchttpsubmit.cpp 
   synchttpsubmit.cpp 
   categories.cpp 
   genres.cpp 
   cdinfodialog.cpp 
   cdinfoencodingwidget.cpp )

kde4_automoc(${kcddb_LIB_SRCS})

51
kde4_add_ui_files(kcddb_LIB_SRCS cdinfodialog.ui cdinfoencodingwidget.ui )
52
53
54
55
56

kde4_add_kcfg_files(kcddb_LIB_SRCS configbase.kcfgc )

kde4_add_library(kcddb SHARED ${kcddb_LIB_SRCS})

57
58
59
60
target_link_libraries(kcddb ${KDE4_KDE3SUPPORT_LIBS})
if(MUSICBRAINZ_FOUND)
    target_link_libraries(kcddb musicbrainz)
endif(MUSICBRAINZ_FOUND)
61
62

set_target_properties(kcddb PROPERTIES VERSION 1.0.0 SOVERSION 1 )
63
install(TARGETS kcddb  DESTINATION ${LIB_INSTALL_DIR} )
64
65
66
67


########### install files ###############

Laurent Montel's avatar
Laurent Montel committed
68
install( FILES cdinfo.h client.h kcddbconfig.h cddb.h ${CMAKE_CURRENT_BINARY_DIR}/configbase.h  DESTINATION ${INCLUDE_INSTALL_DIR}/libkcddb)
69
install( FILES libkcddb.kcfg  DESTINATION  ${KCFG_INSTALL_DIR} )
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89




#original Makefile.am contents follow:

#if build_MB
#  MB_DIR = musicbrainz
#  mb_lib = $(top_builddir)/libkcddb/musicbrainz/libmusicbrainz.la
#endif
#
#
#
#SUBDIRS = $(MB_DIR) . test kcmcddb
#
#INCLUDES = -I$(srcdir)/.. $(all_includes)
#
#lib_LTLIBRARIES = libkcddb.la
#
#libkcddb_la_SOURCES = \
90
#    cache.cpp cdinfo.cpp kcddbconfig.cpp client.cpp cddb.cpp lookup.cpp \
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#    cddbplookup.cpp synccddbplookup.cpp asynccddbplookup.cpp httplookup.cpp \
#    synchttplookup.cpp asynchttplookup.cpp smtpsubmit.cpp \
#    asyncsmtpsubmit.cpp syncsmtpsubmit.cpp configbase.kcfgc \
#    submit.cpp sites.cpp httpsubmit.cpp asynchttpsubmit.cpp \
#    synchttpsubmit.cpp categories.cpp genres.cpp \
#    cdinfodialog.cpp cdinfodialogbase.ui cdinfoencodingwidget.cpp \
#    cdinfoencodingwidgetbase.ui
#
#libkcddb_la_LDFLAGS = $(all_libraries) -version-info 1:0:0 -no-undefined
#libkcddb_la_LIBADD  = $(LIB_KDECORE) $(LIB_KIO) $(mb_lib)
#    
#
#METASOURCES = AUTO
#
#kde_kcfg_DATA = libkcddb.kcfg
#
#kcddbincludedir = $(includedir)/libkcddb
#kcddbinclude_HEADERS = \
109
#    cdinfo.h client.h kcddbconfig.h cddb.h configbase.h
110
111
112
113
#
#messages: rc.cpp
#	$(XGETTEXT) *.cpp -o $(podir)/libkcddb.pot
#
114
#kcddbconfig.lo: configbase.h