Skip to content

Commit

Permalink
Use CMP instead of FetchContent for external libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Laguna1989 committed Dec 18, 2023
1 parent 0e3a137 commit 98e6d46
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 47 deletions.
47 changes: 43 additions & 4 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
message(STATUS "Add CPM.cmake")
# download CPM.cmake
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v0.38.6/CPM.cmake
${CMAKE_BINARY_DIR}/cmake/CPM.cmake
EXPECTED_HASH SHA256=11c3fa5f1ba14f15d31c2fb63dbc8628ee133d81c8d764caad9a8db9e0bacb07
)
include(${CMAKE_BINARY_DIR}/cmake/CPM.cmake)

message(STATUS "Fetching external libraries started")


if (NOT EMSCRIPTEN)
add_subdirectory(openal-soft)
message(STATUS "Fetching openal-soft")
CPMAddPackage(
NAME openal-soft
GITHUB_REPOSITORY kcat/openal-soft
GIT_TAG 1.21.1
OPTIONS
"ALSOFT_UTILS OFF"
"ALSOFT_EXAMPLES OFF"
"ALSOFT_UPDATE_BUILD_VERSION OFF"
)
endif ()

add_subdirectory(libnyquist)
message(STATUS "Fetching libnyquist")
CPMAddPackage(
NAME libnyquist
GITHUB_REPOSITORY ddiakopoulos/libnyquist
GIT_TAG master
OPTIONS
"LIBNYQUIST_BUILD_EXAMPLE OFF"
)

if (OALPP_ENABLE_UNIT_TESTS)
add_subdirectory(catch2)
message(STATUS "Fetching catch2")
CPMAddPackage(
NAME catch2
GITHUB_REPOSITORY catchorg/Catch2
GIT_TAG v2.13.8
)
endif ()


if (OALPP_ENABLE_APPROVAL_TESTS)
add_subdirectory(approvaltestscpp)
message(STATUS "Fetching approvaltests")
CPMAddPackage(
NAME approvaltests
GITHUB_REPOSITORY approvals/ApprovalTests.cpp
GIT_TAG v.10.12.2
)
endif ()
9 changes: 0 additions & 9 deletions ext/approvaltestscpp/CMakeLists.txt

This file was deleted.

9 changes: 0 additions & 9 deletions ext/catch2/CMakeLists.txt

This file was deleted.

11 changes: 0 additions & 11 deletions ext/libnyquist/CMakeLists.txt

This file was deleted.

14 changes: 0 additions & 14 deletions ext/openal-soft/CMakeLists.txt

This file was deleted.

0 comments on commit 98e6d46

Please sign in to comment.