forked from RealTimeChris/DiscordCoreAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (74 loc) · 3.48 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
#
# Copyright 2021, 2022 Chris M. (RealTimeChris)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
#
# CMakeLists.txt - The CMake script for building this library.
# May 13, 2021
# https://discordcoreapi.com
# Set this value...
set(_VCPKG_ROOT_DIR "")
# OR these values.
set(FFMPEG_DIR "C:/Vcpkg/installed/x64-windows/share/ffmpeg") # Set this one to the folder location of the file "FindFFMPEG.cmake".
set(Opus_DIR "C:/Vcpkg/installed/x64-windows/share/opus") # Set this one to the folder location of the file "OpusConfig.cmake".
set(simdjson_DIR "C:/Vcpkg/installed/x64-windows/share/simdjson") # Set this one to the folder location of the file "simdjson-config.cmake".
set(unofficial-sodium_DIR "C:/Vcpkg/installed/x64-windows/share/unofficial-sodium") # Set this one to the folder location of the file "unofficial-sodiumConfig.cmake".
set(OPENSSL_ROOT_DIR "C:/Vcpkg/installed/x64-windows/") # Set this one to the folder location of the include folder and library folders of OpenSSL.
cmake_minimum_required(VERSION 3.20)
set(PROJECT_NAME "DiscordCoreAPI")
set(LIB_NAME "${PROJECT_NAME}")
set(PRODUCT_VERSION "1.2.0")
set(DESCRIPTION "A Discord bot library, written in C++, using custom asynchronous coroutines.")
project(
"${PROJECT_NAME}"
VERSION "${PRODUCT_VERSION}"
LANGUAGES CXX
HOMEPAGE_URL "https://discordcoreapi.com"
DESCRIPTION "${DESCRIPTION}"
)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/CMake;${FFMPEG_DIR};${OpenSSL_DIR}")
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}")
if(EXISTS "${_VCPKG_INSTALLED_DIR}")
set(OS_NAME "${CMAKE_SYSTEM_NAME}")
string(TOLOWER "${OS_NAME}" OS_NAME)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${_VCPKG_ROOT_DIR}/installed/x64-${OS_NAME}/share/ffmpeg")
set(DEBUG_PREFIX "")
else()
set(DEBUG_PREFIX "debug/")
if (WIN32)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
cmake_path(GET CMAKE_ROOT ROOT_PATH ROOT_DRIVE)
if (DEFINED ENV{EnableASAN})
set(CMAKE_INSTALL_PREFIX "${ROOT_DRIVE}Users/$ENV{USERNAME}/CMake/${PROJECT_NAME}/ASAN" CACHE PATH "The CMake install prefix." FORCE)
else()
set(CMAKE_INSTALL_PREFIX "${ROOT_DRIVE}Users/$ENV{USERNAME}/CMake/${PROJECT_NAME}" CACHE PATH "The CMake install prefix." FORCE)
endif()
endif()
elseif(UNIX)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if (DEFINED ENV{EnableASAN})
set(CMAKE_INSTALL_PREFIX "/home/$ENV{USERNAME}/CMake/${PROJECT_NAME}/ASAN" CACHE PATH "The CMake install prefix." FORCE)
else()
set(CMAKE_INSTALL_PREFIX "/home/$ENV{USERNAME}/CMake/${PROJECT_NAME}" CACHE PATH "The CMake install prefix." FORCE)
endif()
endif()
else()
message(FATAL_ERROR "Sorry, but your OS is not supported!")
endif()
endif()
add_subdirectory(Library)