aboutsummaryrefslogtreecommitdiff
path: root/dep
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-06-20 22:43:22 +0200
committerShauren <shauren.trinity@gmail.com>2024-02-26 12:16:50 +0100
commitfaa8c9b7106dafdc7d79a8e4849d4191bdc8d37c (patch)
treec1534e57a935e2e9041a33e068c8eb75516f8ea2 /dep
parentc1f90390d94d99a32cb746a00dc7cef99f9ea6b0 (diff)
Build: Modernize mysql finding script
(cherry picked from commit ae6b9e6c41f882f6c0a48a6352b73b3ae098e012)
Diffstat (limited to 'dep')
-rw-r--r--dep/mysql/CMakeLists.txt15
1 files changed, 5 insertions, 10 deletions
diff --git a/dep/mysql/CMakeLists.txt b/dep/mysql/CMakeLists.txt
index 08a117bf173..ba4af695468 100644
--- a/dep/mysql/CMakeLists.txt
+++ b/dep/mysql/CMakeLists.txt
@@ -8,15 +8,10 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-if (NOT MYSQL_FOUND)
- message(FATAL_ERROR "MySQL wasn't found on your system but it's required to build the servers!")
-endif()
+find_package(MySQL REQUIRED COMPONENTS lib OPTIONAL_COMPONENTS binary)
-add_library(mysql STATIC IMPORTED GLOBAL)
+add_library(mysql INTERFACE)
-set_target_properties(mysql
- PROPERTIES
- IMPORTED_LOCATION
- "${MYSQL_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES
- "${MYSQL_INCLUDE_DIR}")
+target_link_libraries(mysql
+ INTERFACE
+ MySQL::MySQL)