From a8a035a13a5ef5df7f896f1961b9812a8a3dff7b Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sat, 18 Dec 2010 18:36:56 +0000 Subject: [PATCH] Use the system libechonest if it's installed --- CMakeLists.txt | 11 +++++++++-- src/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 583c150c7..84971bb37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,7 +229,15 @@ else (USE_SYSTEM_QXT) endif (NOT APPLE) endif (USE_SYSTEM_QXT) -set(ECHONEST_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/3rdparty/libechonest) +# Use system libechonest if it's available +find_path(ECHONEST_INCLUDE_DIRS echonest/echonest_export.h) +find_library(ECHONEST_LIBRARIES echonest) +if(NOT ECHONEST_INCLUDE_DIRS OR NOT ECHONEST_LIBRARIES) + add_subdirectory(3rdparty/libechonest) + set(ECHONEST_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/3rdparty/libechonest) + set(ECHONEST_LIBRARIES echonest) +endif(NOT ECHONEST_INCLUDE_DIRS OR NOT ECHONEST_LIBRARIES) + # Subdirectories add_subdirectory(src) @@ -237,7 +245,6 @@ if (WIN32) add_subdirectory(3rdparty/qtwin) endif (WIN32) add_subdirectory(3rdparty/universalchardet) -add_subdirectory(3rdparty/libechonest) add_subdirectory(tests) add_subdirectory(dist) add_subdirectory(tools/ultimate_lyrics_parser) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06a8cb593..3f592bd83 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -770,7 +770,7 @@ add_dependencies(clementine_lib pot) target_link_libraries(clementine_lib chardet - echonest + ${ECHONEST_LIBRARIES} ${GOBJECT_LIBRARIES} ${GLIB_LIBRARIES} ${TAGLIB_LIBRARIES}