summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRex Dieter <[email protected]>2015-06-20 17:28:06 -0500
committerRex Dieter <[email protected]>2015-06-20 17:28:06 -0500
commita6ef64de33a84d4842659241d8bda3b12190f8ca (patch)
tree255e61fe46c86b843c3c4be13656381a86e7fb81
parentf379c6b2b10bfdaf45c29cb61da1e9337806d8f0 (diff)
support >1 include dir for libmusicbrainz5
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/FindMusicBrainz5.cmake22
2 files changed, 15 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a311ea..a92ff28 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ macro_log_feature(MUSICBRAINZ5_FOUND "MusicBrainz5" "A library that provides acc
if(MUSICBRAINZ5_FOUND)
set(HAVE_MUSICBRAINZ5 1)
- include_directories(${MUSICBRAINZ5_INCLUDE_DIR})
+ include_directories(${MUSICBRAINZ5_INCLUDE_DIRS})
set(libmusicbrainz_SRCS ${libmusicbrainz_SRCS}
musicbrainz/musicbrainzlookup.cpp
diff --git a/cmake/FindMusicBrainz5.cmake b/cmake/FindMusicBrainz5.cmake
index 7970f48..4a223c1 100644
--- a/cmake/FindMusicBrainz5.cmake
+++ b/cmake/FindMusicBrainz5.cmake
@@ -1,7 +1,7 @@
# Module to find the musicbrainz-4 library
#
# It defines
-# MUSICBRAINZ5_INCLUDE_DIR - the include dir
+# MUSICBRAINZ5_INCLUDE_DIRS - the include dirs
# MUSICBRAINZ5_LIBRARIES - the required libraries
# MUSICBRAINZ5_FOUND - true if both of the above have been found
@@ -10,17 +10,23 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-if(MUSICBRAINZ5_INCLUDE_DIR AND MUSICBRAINZ5_LIBRARIES)
+if(MUSICBRAINZ5_INCLUDE_DIRS AND MUSICBRAINZ5_LIBRARIES)
set(MUSICBRAINZ5_FIND_QUIETLY TRUE)
-endif(MUSICBRAINZ5_INCLUDE_DIR AND MUSICBRAINZ5_LIBRARIES)
+endif(MUSICBRAINZ5_INCLUDE_DIRS AND MUSICBRAINZ5_LIBRARIES)
-FIND_PATH(MUSICBRAINZ5_INCLUDE_DIR musicbrainz5/Disc.h)
-
-FIND_LIBRARY( MUSICBRAINZ5_LIBRARIES NAMES musicbrainz5)
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ PKG_SEARCH_MODULE( MUSICBRAINZ5 libmusicbrainz5 )
+ELSE (NOT WIN32)
+ FIND_PATH( MUSICBRAINZ5_INCLUDE_DIRS musicbrainz5/Disc.h )
+ FIND_LIBRARY( MUSICBRAINZ5_LIBRARIES NAMES musicbrainz5 )
+ENDIF (NOT WIN32)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( MusicBrainz5 DEFAULT_MSG
- MUSICBRAINZ5_INCLUDE_DIR MUSICBRAINZ5_LIBRARIES)
+ MUSICBRAINZ5_INCLUDE_DIRS MUSICBRAINZ5_LIBRARIES)
-MARK_AS_ADVANCED(MUSICBRAINZ5_INCLUDE_DIR MUSICBRAINZ5_LIBRARIES)
+MARK_AS_ADVANCED(MUSICBRAINZ5_INCLUDE_DIRS MUSICBRAINZ5_LIBRARIES)