Use FetchContent() instead of submodules

This commit is contained in:
Jonathan Müller 2021-02-17 13:44:04 +01:00
commit 27ac5b7003
4 changed files with 9 additions and 17 deletions

1
external/cxxopts vendored

@ -1 +0,0 @@
Subproject commit 073dd3e645fa0c853c3836f3788ca21c39af319d

View file

@ -2,15 +2,16 @@
# This file is subject to the license terms in the LICENSE file
# found in the top-level directory of this distribution.
include(FetchContent)
#
# install type safe
#
find_package(type_safe QUIET)
if(NOT type_safe_FOUND)
message(STATUS "Installing type_safe via submodule")
execute_process(COMMAND git submodule update --init -- external/type_safe
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/type_safe EXCLUDE_FROM_ALL)
message(STATUS "Fetching type_safe")
FetchContent_Declare(type_safe GIT_REPOSITORY https://github.com/foonathan/type_safe GIT_TAG origin/main)
FetchContent_MakeAvailable(type_safe)
endif()
#
@ -28,12 +29,11 @@ target_link_libraries(_cppast_tiny_process INTERFACE tiny-process-library::tiny-
# install cxxopts, if needed
#
if(build_tool)
message(STATUS "Installing cxxopts via submodule")
execute_process(COMMAND git submodule update --init -- external/cxxopts
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set(CXXOPTS_BUILD_TESTS OFF CACHE BOOL "")
set(CXXOPTS_BUILD_TESTS OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/cxxopts EXCLUDE_FROM_ALL)
message(STATUS "Fetching cxxopts")
FetchContent_Declare(cxxopts URL https://github.com/jarro2783/cxxopts/archive/v2.2.1.zip)
FetchContent_MakeAvailable(cxxopts)
endif()
#

1
external/type_safe vendored

@ -1 +0,0 @@
Subproject commit ac4dfc790f19f66097476bcae2fcd37d6fc05e23