Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
FetchContent for dependencies (#15)
Browse files Browse the repository at this point in the history
* Use FetchContent for dependencies

* Remove submodules

* 0.10.0
  • Loading branch information
seanmiddleditch authored May 4, 2019
1 parent 15b7b71 commit 1b493f9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "external/litexx"]
path = external/litexx
url = https://github.com/seanmiddleditch/litexx
[submodule "external/doctest"]
path = external/doctest
url = https://github.com/onqtam/doctest
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)

project(formatxx
VERSION 0.9.0
VERSION 0.10.0
LANGUAGES CXX
)

Expand Down
24 changes: 20 additions & 4 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
if(NOT TARGET litexx)
add_subdirectory(litexx EXCLUDE_FROM_ALL)
endif()
include(FetchContent)
FetchContent_Declare(doctest
GIT_REPOSITORY https://github.com/onqtam/doctest.git
GIT_TAG 2.3.1
GIT_SHALLOW ON
GIT_SUBMODULES ""
)
FetchContent_Declare(litexx
GIT_REPOSITORY https://github.com/seanmiddleditch/litexx.git
GIT_TAG 0.1.0
GIT_SHALLOW ON
GIT_SUBMODULES ""
)

if(FORMATXX_BUILD_TESTS AND NOT TARGET doctest)
FetchContent_Populate(doctest)
set(DOCTEST_WITH_TESTS OFF CACHE BOOL "enable doctest tests")
set(DOCTEST_WITH_MAIN_IN_STATIC_LIB OFF CACHE BOOL "enable doctest static library")
add_subdirectory(doctest EXCLUDE_FROM_ALL)
add_subdirectory(${doctest_SOURCE_DIR} ${doctest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

if(NOT TARGET litexx)
FetchContent_Populate(litexx)
add_subdirectory(${litexx_SOURCE_DIR} ${litexx_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
1 change: 0 additions & 1 deletion external/doctest
Submodule doctest deleted from b2611a
1 change: 0 additions & 1 deletion external/litexx
Submodule litexx deleted from 19c31a

0 comments on commit 1b493f9

Please sign in to comment.