more deps

This commit is contained in:
Green Sky 2024-08-03 11:10:56 +02:00
parent f66873a57a
commit 88a8261f68
No known key found for this signature in database
2 changed files with 80 additions and 0 deletions

View File

@ -26,6 +26,24 @@ if (NOT TARGET solanaceae_contact)
FetchContent_MakeAvailable(solanaceae_contact)
endif()
if (NOT TARGET solanaceae_message3)
FetchContent_Declare(solanaceae_message3
GIT_REPOSITORY https://github.com/Green-Sky/solanaceae_message3.git
GIT_TAG master
)
FetchContent_MakeAvailable(solanaceae_message3)
endif()
add_subdirectory(./toxcore)
if (NOT TARGET solanaceae_toxcore)
FetchContent_Declare(solanaceae_toxcore
GIT_REPOSITORY https://github.com/Green-Sky/solanaceae_toxcore.git
GIT_TAG master
)
FetchContent_MakeAvailable(solanaceae_toxcore)
endif()
# only need the contact stuff
if (NOT TARGET solanaceae_tox_contacts)
FetchContent_Declare(solanaceae_tox

62
external/toxcore/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,62 @@
cmake_minimum_required(VERSION 3.14...3.24 FATAL_ERROR)
include(FetchContent)
if (NOT TARGET toxcore)
set(EXPERIMENTAL_API ON CACHE BOOL "" FORCE)
set(UNITTEST OFF CACHE BOOL "" FORCE)
set(DHT_BOOTSTRAP OFF CACHE BOOL "" FORCE)
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
set(BUILD_TOXAV OFF CACHE BOOL "" FORCE)
set(ENABLE_SHARED OFF CACHE BOOL "" FORCE)
set(TOXCORE_COMMIT_HASH "102a1fa")
FetchContent_Declare(c-toxcore
GIT_REPOSITORY https://github.com/TokTok/c-toxcore
GIT_TAG ${TOXCORE_COMMIT_HASH}
FIND_PACKAGE_ARGS # for the future
)
FetchContent_MakeAvailable(c-toxcore)
# the sad case
add_library(toxcore INTERFACE)
if (TARGET toxcore_static)
target_link_libraries(toxcore INTERFACE toxcore_static)
else()
target_link_libraries(toxcore INTERFACE toxcore_shared)
endif()
target_compile_definitions(toxcore INTERFACE TOXCORE_COMMIT_HASH="${TOXCORE_COMMIT_HASH}")
# HACK: "install" api headers into binary dir
configure_file(
${c-toxcore_SOURCE_DIR}/toxcore/tox.h
${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox.h
@ONLY
)
configure_file(
${c-toxcore_SOURCE_DIR}/toxcore/tox_events.h
${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox_events.h
@ONLY
)
configure_file(
${c-toxcore_SOURCE_DIR}/toxcore/tox_private.h
${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox_private.h
@ONLY
)
configure_file(
${c-toxcore_SOURCE_DIR}/toxencryptsave/toxencryptsave.h
${CMAKE_CURRENT_BINARY_DIR}/include/tox/toxencryptsave.h
@ONLY
)
configure_file(
${c-toxcore_SOURCE_DIR}/toxav/toxav.h
${CMAKE_CURRENT_BINARY_DIR}/include/tox/toxav.h
@ONLY
)
target_include_directories(toxcore INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/include/)
endif()