Commit 0c46813f authored by David Faure's avatar David Faure
Browse files

Fixed compilation of libkcddb for people without musicbrainz.

Make configuration modular - all done from libkcddb, and the result is in config-musicbrainz.h

No need to define an OPTION() in Find*.cmake, since macro_optional_find_package() defines the option WITH_foo automatically.
CCMAIL: montel@kde.org

svn path=/trunk/KDE/kdemultimedia/libkcddb/; revision=526106
parent 63f6a1fe
kde4_header()
project(libkcddb)
add_subdirectory( test )
add_subdirectory( kcmcddb )
add_subdirectory( test )
add_subdirectory( kcmcddb )
set(libmusicbrainz_SRCS)
macro_optional_find_package(MusicBrainz)
if(MUSICBRAINZ_FOUND)
add_subdirectory(musicbrainz)
set(libmusicbrainz_SRCS ${libmusicbrainz_SRCS}
${CMAKE_SOURCE_DIR}/libkcddb/musicbrainz/musicbrainzlookup.cpp
${CMAKE_SOURCE_DIR}/libkcddb/musicbrainz/sha1.c
)
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)
endif(MUSICBRAINZ_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-musicbrainz.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-musicbrainz.h )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
########### next target ###############
......@@ -53,7 +54,10 @@ kde4_add_kcfg_files(kcddb_LIB_SRCS configbase.kcfgc )
kde4_add_library(kcddb SHARED ${kcddb_LIB_SRCS})
target_link_libraries(kcddb ${KDE4_KDE3SUPPORT_LIBS} musicbrainz )
target_link_libraries(kcddb ${KDE4_KDE3SUPPORT_LIBS})
if(MUSICBRAINZ_FOUND)
target_link_libraries(kcddb musicbrainz)
endif(MUSICBRAINZ_FOUND)
set_target_properties(kcddb PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install_targets(${LIB_INSTALL_DIR} kcddb )
......
......@@ -31,8 +31,8 @@
#include "cache.h"
#include "lookup.h"
#include "../config.h"
#if HAVE_MUSICBRAINZ
#include "config-musicbrainz.h"
#ifdef HAVE_MUSICBRAINZ
#include "musicbrainz/musicbrainzlookup.h"
#endif
......@@ -144,7 +144,7 @@ namespace KCDDB
cdInfoLookup = new SyncHTTPLookup();
else
{
#if HAVE_MUSICBRAINZ
#ifdef HAVE_MUSICBRAINZ
cdInfoLookup = new MusicBrainzLookup();
#else
kWarning() << "libkcddb not built with MusicBrainz support" << endl;
......@@ -184,7 +184,7 @@ namespace KCDDB
}
else
{
#if HAVE_MUSICBRAINZ
#ifdef HAVE_MUSICBRAINZ
cdInfoLookup = new MusicBrainzLookup();
connect( static_cast<MusicBrainzLookup *>( cdInfoLookup ),
......
/* have MusicBrainz */
#cmakedefine HAVE_MUSICBRAINZ 1
kde4_header()
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/.. ${KDE4_INCLUDES} )
########### next target ###############
......
kde4_header()
include_directories( ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
########### next target ###############
########### install files ###############
kde4_footer()
#original Makefile.am contents follow:
#INCLUDES = -I$(srcdir)/.. $(all_includes)
#
#noinst_LTLIBRARIES = libmusicbrainz.la
#libmusicbrainz_la_SOURCES = musicbrainzlookup.cpp sha1.c
#libmusicbrainz_la_LIBADD = -lmusicbrainz
#
#METASOURCES = AUTO
#
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment