- Sidequest: Clean up header-only library dependencies with cmake.
This commit is contained in:
7
cmake/Catch2.cmake
Normal file
7
cmake/Catch2.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
Include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v2.13.7)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
@@ -1,17 +1,15 @@
|
||||
include(ExternalProject)
|
||||
# Download RapidJSON
|
||||
ExternalProject_Add(
|
||||
magic-enum
|
||||
PREFIX "third_party/magic-enum"
|
||||
GIT_REPOSITORY "https://github.com/Neargye/magic_enum"
|
||||
|
||||
project(magicEnum)
|
||||
|
||||
ExternalProject_Add(${PROJECT_NAME}-external
|
||||
GIT_REPOSITORY https://github.com/Neargye/magic_enum.git
|
||||
GIT_TAG "v0.7.3"
|
||||
TIMEOUT 10
|
||||
CONFIGURE_COMMAND ""
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_DIR ${THIRD_PARTY_DIR}/${PROJECT_NAME}
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
UPDATE_COMMAND ""
|
||||
)
|
||||
|
||||
# Magic Enums is a header-only
|
||||
ExternalProject_Get_Property(magic-enum source_dir)
|
||||
set(MAGIC_ENUM_INCLUDE_DIR ${source_dir}/include)
|
||||
CONFIGURE_COMMAND "")
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-external)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${THIRD_PARTY_DIR}/${PROJECT_NAME}/include)
|
||||
15
cmake/argparse.cmake
Normal file
15
cmake/argparse.cmake
Normal file
@@ -0,0 +1,15 @@
|
||||
include(ExternalProject)
|
||||
|
||||
project(argparse)
|
||||
|
||||
ExternalProject_Add(${PROJECT_NAME}-external
|
||||
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
|
||||
GIT_TAG "v2.1"
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_DIR ${THIRD_PARTY_DIR}/${PROJECT_NAME}
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
CONFIGURE_COMMAND "")
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-external)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${THIRD_PARTY_DIR}/${PROJECT_NAME}/include)
|
||||
@@ -1,21 +1,15 @@
|
||||
include(ExternalProject)
|
||||
# Download RapidJSON
|
||||
ExternalProject_Add(
|
||||
rapidjson
|
||||
PREFIX "third_party/rapidjson"
|
||||
GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
|
||||
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
|
||||
TIMEOUT 10
|
||||
CMAKE_ARGS
|
||||
-DRAPIDJSON_BUILD_TESTS=OFF
|
||||
-DRAPIDJSON_BUILD_DOC=OFF
|
||||
-DRAPIDJSON_BUILD_EXAMPLES=OFF
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
UPDATE_COMMAND ""
|
||||
)
|
||||
|
||||
# Prepare RapidJSON (RapidJSON is a header-only library)
|
||||
ExternalProject_Get_Property(rapidjson source_dir)
|
||||
set(RAPIDJSON_INCLUDE_DIR ${source_dir}/include)
|
||||
project(rapidjson)
|
||||
|
||||
ExternalProject_Add(${PROJECT_NAME}-external
|
||||
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
|
||||
GIT_TAG "v1.1.0"
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_DIR ${THIRD_PARTY_DIR}/${PROJECT_NAME}
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
CONFIGURE_COMMAND "")
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-external)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE ${THIRD_PARTY_DIR}/${PROJECT_NAME}/include)
|
||||
Reference in New Issue
Block a user