Blob Blame History Raw
diff -rupN clementine-1.0.1.old/CMakeLists.txt clementine-1.0.1/CMakeLists.txt
--- clementine-1.0.1.old/CMakeLists.txt	2012-01-22 07:43:26.000000000 -0500
+++ clementine-1.0.1/CMakeLists.txt	2012-01-22 22:52:58.904546367 -0500
@@ -367,12 +367,20 @@ if(NOT CHROMAPRINT_FOUND)
   endif(WIN32)
 endif(NOT CHROMAPRINT_FOUND)
 
+# Use system sha2 if it's available
+find_path(SHA2_INCLUDE_DIRS sha2.h)
+find_library(SHA2_LIBRARIES sha2)
+if(NOT SHA2_INCLUDE_DIRS OR NOT SHA2_LIBRARIES)
+  add_subdirectory(3rdparty/sha2)
+  set(SHA2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/sha2)
+  set(SHA2_LIBRARIES sha2)
+endif(NOT SHA2_INCLUDE_DIRS OR NOT SHA2_LIBRARIES)
+
 # Subdirectories
 add_subdirectory(src)
 if (WIN32)
   add_subdirectory(3rdparty/qtwin)
 endif (WIN32)
-add_subdirectory(3rdparty/sha2)
 add_subdirectory(3rdparty/universalchardet)
 add_subdirectory(tests)
 add_subdirectory(dist)
diff -rupN clementine-1.0.1.old/src/CMakeLists.txt clementine-1.0.1/src/CMakeLists.txt
--- clementine-1.0.1.old/src/CMakeLists.txt	2012-01-22 07:43:26.000000000 -0500
+++ clementine-1.0.1/src/CMakeLists.txt	2012-01-22 22:54:02.369214800 -0500
@@ -12,7 +12,7 @@ endif(BUILD_WERROR)
 
 include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(../3rdparty/gmock/gtest/include)
-include_directories(../3rdparty/sha2)
+include_directories(${SHA2_INCLUDE_DIRS})
 if(WIN32)
   include_directories(../3rdparty/qtwin)
 endif(WIN32)
@@ -961,7 +961,7 @@ add_dependencies(clementine_lib pot)
 
 target_link_libraries(clementine_lib
   chardet
-  sha2
+  ${SHA2_LIBRARIES}
   ${CHROMAPRINT_LIBRARIES}
   ${ECHONEST_LIBRARIES}
   ${GOBJECT_LIBRARIES}