From d55deccd2e7adbf3c0498ce9bf08de6dc8b4fb36 Mon Sep 17 00:00:00 2001 From: xx Date: Mon, 27 May 2024 10:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96cmakelist=EF=BC=8CMYSQL?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8e499d0..d8cfc0a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.5) + + + # Recursively get all source files file(GLOB_RECURSE SOURCE_FILES "${PROJECT_SOURCE_DIR}/src/*.cpp" @@ -8,8 +11,10 @@ file(GLOB_RECURSE HEADER_FILES "${PROJECT_SOURCE_DIR}/include/*.h" ) -include_directories(D:/3rdparty/mysql-connector-c++-8.2.0-winx64/include/jdbc) + if(MSVC) + set(MYSQL_CPPCONN_INCLUDE CACHE PATH "mysql-connector include") + include_directories(${MYSQL_CPPCONN_INCLUDE}) include_directories(${PROJECT_SOURCE_DIR}/3rdparty/HP-Socket/Windows/Include) add_compile_options(/utf-8) endif()