cmake_minimum_required(VERSION 3.24)
project(
Botpp
VERSION 0.1
DESCRIPTION "A Discord bot that plays music"
LANGUAGES CXX
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")
include(FetchContent)
FetchContent_Declare(
dpp
GIT_REPOSITORY https://github.com/brainboxdotcc/DPP.git
GIT_TAG v10.0.29
)
FetchContent_MakeAvailable(dpp)
FetchContent_Declare(
libogg
URL http://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz
)
FetchContent_MakeAvailable(libogg)
FetchContent_Declare(
opus
GIT_REPOSITORY https://github.com/xiph/opus.git
GIT_TAG v1.3.1
)
FetchContent_MakeAvailable(opus)
FetchContent_Declare(
opusfile
GIT_REPOSITORY https://github.com/xiph/opusfile.git
GIT_TAG v0.12
)
FetchContent_MakeAvailable(opusfile)
FetchContent_Declare(
liboggz
URL http://downloads.xiph.org/releases/liboggz/liboggz-1.1.1.tar.gz
)
FetchContent_MakeAvailable(liboggz)
FetchContent_Declare(
openssl
GIT_REPOSITORY https://github.com/openssl/openssl.git
GIT_TAG openssl-3.3.0
)
FetchContent_MakeAvailable(openssl)
FetchContent_Declare(
ffmpeg
GIT_REPOSITORY https://git.ffmpeg.org/ffmpeg.git
GIT_TAG n7.1-dev
)
FetchContent_MakeAvailable(ffmpeg)
add_executable(${PROJECT_NAME}
bot.cpp
)
message(STATUS "ffmpeg_INCLUDE_DIRS: ${ffmpeg_SOURCE_DIR}")
target_include_directories(${PROJECT_NAME} PRIVATE
${dpp_SOURCE_DIR}/include
${libogg_SOURCE_DIR}/include
${opus_SOURCE_DIR}/include
${opusfile_SOURCE_DIR}/include
${openssl_SOURCE_DIR}/include
${liboggz_SOURCE_DIR}/include
${ffmpeg_SOURCE_DIR}/libavformat
${ffmpeg_SOURCE_DIR}/libavcodec
${ffmpeg_SOURCE_DIR}/libavutil
)
target_link_libraries(${PROJECT_NAME} PRIVATE
dpp
opus
opusfile
ogg
oggz
avformat
avcodec
avutil
)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 23
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS ON
)
target_link_directories(${PROJECT_NAME} PRIVATE
${ffmpeg_SOURCE_DIR}/libavformat
${ffmpeg_SOURCE_DIR}/libavcodec
${ffmpeg_SOURCE_DIR}/libavutil
)
#linker error, help
7 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
the problem is that the enviroment is picking up my brew installation from openssl that is outdated
I am fetching 3.3.X and my brew has 3.2.X
and also the one from brew is under rosetta so is different architecture
!solved