Skip to content

Commit

Permalink
project: replace git submodules with FetchContent
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Sep 27, 2022
1 parent 8b33e17 commit c30bba8
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ set_target_properties(phoenix
# when building tests, create a test executable and load it into CTest
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
enable_testing()
include(vendor/doctest/scripts/cmake/doctest.cmake)
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)

add_executable(phoenix-tests ${PHOENIX_TESTS})
target_link_libraries(phoenix-tests PRIVATE phoenix doctest_with_main)
Expand Down
76 changes: 71 additions & 5 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,77 @@ include(FetchContent)

option(BUILD_STATIC_LIBS ON)
option(BUILD_SHARED_LIBS OFF)


# add doctest
FetchContent_Declare(
doctest
URL https://github.com/doctest/doctest/archive/refs/tags/v2.4.9.zip
URL_HASH SHA1=d1563419fa370c34c90e028c2e903a70c8dc07b2
)

if (NOT doctest_POPULATED)
message(STATUS "Downloading doctest")
FetchContent_Populate(doctest)
add_subdirectory(${doctest_SOURCE_DIR} ${doctest_BINARY_DIR})
endif ()


# add mio
FetchContent_Declare(
mio
URL https://github.com/mandreyel/mio/archive/3f86a95c0784d73ce6815237ec33ed25f233b643.zip
URL_HASH SHA1=62a0e43b07a6b66e415ad01f4b225c72a3c9935b
)

if (NOT mio_POPULATED)
message(STATUS "Downloading mio")
FetchContent_Populate(mio)
add_subdirectory(${mio_SOURCE_DIR} ${mio_BINARY_DIR})
endif ()


# add lexy
FetchContent_Declare(
lexy
URL https://github.com/foonathan/lexy/releases/download/v2022.05.1/lexy-src.zip
URL_HASH SHA1=252185ebbf004047725f9ed98b4e8b6e4aa06d98
)

if (NOT lexy_POPULATED)
message(STATUS "Downloading lexy")
FetchContent_Populate(lexy)
add_subdirectory(${lexy_SOURCE_DIR} ${lexy_BINARY_DIR})
endif ()


# add fmt
FetchContent_Declare(
fmt
URL https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip
URL_HASH SHA1=8de922ba88fccaec1e7778bc069f342084573486
)

if (NOT fmt_POPULATED)
message(STATUS "Downloading fmt")
FetchContent_Populate(fmt)
add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR})
endif ()


# add glm
FetchContent_Declare(
glm
URL https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip
URL_HASH SHA1=45408897f419944fb28d8fd835791f237be2ec19
)

if (NOT glm_POPULATED)
message(STATUS "Downloading glm")
FetchContent_Populate(glm)
add_subdirectory(${glm_SOURCE_DIR} ${glm_BINARY_DIR})
endif ()

add_subdirectory(glm)
add_subdirectory(fmt)
add_subdirectory(doctest)
add_subdirectory(mio)
add_subdirectory(lexy)

# msvc: disable -wno-* flags
if (NOT MSVC)
Expand All @@ -22,6 +87,7 @@ FetchContent_Declare(
)

if (NOT libsquish_POPULATED)
message(STATUS "Downloading squish")
FetchContent_Populate(libsquish)

SET(BUILD_SQUISH_WITH_OPENMP OFF CACHE BOOL "" FORCE)
Expand Down
1 change: 0 additions & 1 deletion vendor/doctest
Submodule doctest deleted from bc5487
1 change: 0 additions & 1 deletion vendor/fmt
Submodule fmt deleted from 29c600
1 change: 0 additions & 1 deletion vendor/glm
Submodule glm deleted from cc9846
1 change: 0 additions & 1 deletion vendor/lexy
Submodule lexy deleted from 5799f0
1 change: 0 additions & 1 deletion vendor/mio
Submodule mio deleted from 3f86a9

0 comments on commit c30bba8

Please sign in to comment.