diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c8e98f..ab30865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,11 +199,10 @@ if(HAVE_OPEN_SSL) openssl::crypto::static) endif() -find_package(mysql REQUIRED) +find_package(mysql) add_library(TeaSpeak STATIC ${SOURCE_FILES} ${HEADER_FILES}) target_link_libraries(TeaSpeak PUBLIC - mysql::client::static threadpool::static jsoncpp_lib ${OPENSSL_LIBRARIES} tomcrypt::static @@ -211,8 +210,13 @@ target_link_libraries(TeaSpeak PUBLIC dl ) -target_compile_options(TeaSpeak PRIVATE "-Wall" "-DHAVE_MYSQL_H") - +if(mysql_FOUND) + message("Found MySQL") + target_link_libraries(TeaSpeak PUBLIC + mysql::client::static + ) + target_compile_options(TeaSpeak PRIVATE "-Wall" "-DHAVE_MYSQL_H") +endif() if (TEASPEAK_SERVER) target_link_libraries(TeaSpeak PUBLIC CXXTerminal::static) endif ()