From faa8c9b7106dafdc7d79a8e4849d4191bdc8d37c Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Jun 2022 22:43:22 +0200 Subject: Build: Modernize mysql finding script (cherry picked from commit ae6b9e6c41f882f6c0a48a6352b73b3ae098e012) --- dep/mysql/CMakeLists.txt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'dep/mysql') 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) -- cgit v1.2.3