[multimedia/amarok] /: Make building MySql optional

Tuomas Nurmi <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c3704bf08de5b5da78a7255df4181b4d68b44980 by Tuomas Nurmi, on behalf of Arturo GARCIA-VARGAS.
Committed on 30/07/2026 at 18:13.
Pushed by nurmi into branch 'master'.

Make building MySql optional

M  +8    -6    CMakeLists.txt
M  +3    -1    src/core-impl/collections/db/sql/CMakeLists.txt

https://invent.kde.org/multimedia/amarok/-/commit/c3704bf08de5b5da78a7255df4181b4d68b44980

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9dcb929ed3..0f6804527d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -222,19 +222,22 @@ if( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
     endif()
 endif()
 
+option(WITH_MYSQL "Build with MySQL/MariaDB storage backend" ON)
+
 add_subdirectory( data )
 add_subdirectory( images )
 
 if( WITH_PLAYER )
     find_package(Threads REQUIRED)
 
-    find_package(MySQL)
-
-    if( NOT MySQL_FOUND )
-        find_package(MariaDB REQUIRED)
+    if( WITH_MYSQL )
+        find_package(MySQL)
+        if( NOT MySQL_FOUND )
+            find_package(MariaDB REQUIRED)
+        endif()
     endif()
 
-    if( WITH_EMBEDDED_DB )
+    if( WITH_MYSQL AND WITH_EMBEDDED_DB )
         find_package(MariaDBd REQUIRED)
         set( BUILD_MYSQLE_COLLECTION TRUE )
         # zlib is required for mysql embedded
@@ -242,7 +245,6 @@ if( WITH_PLAYER )
         set_package_properties( ZLIB PROPERTIES DESCRIPTION "zlib" TYPE REQUIRED )
     else()
         add_definitions( "-DNO_MYSQL_EMBEDDED" )
-        message("Building without embedded MariaDB/MySQL as requested")
     endif()
 
 
diff --git a/src/core-impl/collections/db/sql/CMakeLists.txt b/src/core-impl/collections/db/sql/CMakeLists.txt
index cfb88ae092..392b0c50eb 100644
--- a/src/core-impl/collections/db/sql/CMakeLists.txt
+++ b/src/core-impl/collections/db/sql/CMakeLists.txt
@@ -41,4 +41,6 @@ endif()
 set_target_properties(amarok-sqlcollection PROPERTIES VERSION 1.0.0 SOVERSION 1 )
 install(TARGETS amarok-sqlcollection ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
 
-add_subdirectory( mysqlcollection )
+if(WITH_MYSQL)
+    add_subdirectory( mysqlcollection )
+endif()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.