-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathCMakeLists.txt
40 lines (33 loc) · 1.55 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.13)
project(MySQLOO)
add_subdirectory(GmodLUA)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
file(GLOB_RECURSE MySQLOO_SRC "src/*.h" "src/*.cpp")
set(SOURCE_FILES ${MySQLOO_SRC} src/Main.cpp)
add_executable(MySQLOO ${SOURCE_FILES})
target_link_libraries(MySQLOO gmod-module-base)
target_include_directories(MySQLOO PRIVATE MySQL/include)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
if (WIN32)
find_library(MARIADB_CLIENT_LIB mariadbclient HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib64/windows")
else ()
find_library(MARIADB_CLIENT_LIB mariadbclient HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib64/linux")
find_library(CRYPTO_LIB crypto HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib64/linux")
find_library(SSL_LIB ssl HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib64/linux")
endif ()
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
if (WIN32)
find_library(MARIADB_CLIENT_LIB mariadbclient HINTS "${PROJECT_SOURCE_DIR}MySQL/lib/windows")
else ()
find_library(MARIADB_CLIENT_LIB mariadbclient HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib/linux")
find_library(CRYPTO_LIB crypto HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib/linux")
find_library(SSL_LIB ssl HINTS "${PROJECT_SOURCE_DIR}/MySQL/lib/linux")
endif ()
endif ()
if (WIN32)
target_link_libraries(MySQLOO ${MARIADB_CLIENT_LIB} crypt32 ws2_32 shlwapi bcrypt secur32)
else ()
find_package(Threads REQUIRED)
target_link_libraries(MySQLOO ${MARIADB_CLIENT_LIB} ${SSL_LIB} ${CRYPTO_LIB} Threads::Threads ${CMAKE_DL_LIBS})
endif ()
set_gmod_suffix_prefix(MySQLOO)