-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
option(NUI_FETCH_FMT "Fetch fmt" ON) | ||
option(NUI_FIND_FMT "Find fmt first before fetch content" ON) | ||
option(NUI_FETCH_FMT "Try FetchContent for fmt" ON) | ||
set(NUI_FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt.git" CACHE STRING "fmt git repository") | ||
set(NUI_FMT_GIT_TAG "4e8640ed90ac8751d4a8ca500b893cc8c4bb9668" CACHE STRING "fmt git tag") | ||
set(NUI_FMT_GIT_TAG "7a8b54a0ef7ca1791b0a5491b6e0593e1cf2dd5e" CACHE STRING "fmt git tag") | ||
|
||
if (NUI_FETCH_FMT) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
fmt | ||
GIT_REPOSITORY ${NUI_FMT_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_FMT_GIT_TAG} | ||
) | ||
include("${CMAKE_CURRENT_LIST_DIR}/../fetcher.cmake") | ||
|
||
FetchContent_MakeAvailable(fmt) | ||
endif() | ||
nui_fetch_dependency( | ||
LIBRARY_NAME fmt | ||
FIND ${NUI_FIND_FMT} | ||
FETCH ${NUI_FETCH_FMT} | ||
GIT_REPOSITORY ${NUI_FMT_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_FMT_GIT_TAG} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
option(NUI_FIND_GTEST "Find gtest" ON) | ||
option(NUI_FETCH_GTEST "Fetch gtest" ON) | ||
set(NUI_GTEST_GIT_REPOSITORY "https://github.com/google/googletest.git" CACHE STRING "gtest git repository") | ||
set(NUI_GTEST_GIT_TAG "beb552fb47e9e8a6ddab20526663c2dddd601ec6" CACHE STRING "gtest git tag") | ||
|
||
if(NUI_FETCH_GTEST) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
gtest | ||
GIT_REPOSITORY ${NUI_GTEST_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_GTEST_GIT_TAG} | ||
) | ||
include("${CMAKE_CURRENT_LIST_DIR}/../fetcher.cmake") | ||
|
||
FetchContent_MakeAvailable(gtest) | ||
endif() | ||
nui_fetch_dependency( | ||
LIBRARY_NAME GTest | ||
FIND ${NUI_FIND_GTEST} | ||
FETCH ${NUI_FETCH_GTEST} | ||
GIT_REPOSITORY ${NUI_GTEST_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_GTEST_GIT_TAG} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
option(NUI_FETCH_NLOHMANN_JSON "Fetch nlohmann_json" ON) | ||
option(NUI_FIND_NLOHMANN_JSON "Try find_package to find nlohmann_json" ON) | ||
option(NUI_FETCH_NLOHMANN_JSON "Try fetch nlohmann json" ON) | ||
set(NUI_NLOHMANN_JSON_GIT_REPOSITORY "https://github.com/nlohmann/json.git" CACHE STRING "nlohmann_json git repository") | ||
set(NUI_NLOHMANN_JSON_GIT_TAG "8c391e04fe4195d8be862c97f38cfe10e2a3472e" CACHE STRING "nlohmann_json git tag") | ||
|
||
if(NUI_FETCH_NLOHMANN_JSON) | ||
include(FetchContent) | ||
FetchContent_Declare( | ||
nlohmann_json | ||
GIT_REPOSITORY ${NUI_NLOHMANN_JSON_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_NLOHMANN_JSON_GIT_TAG} | ||
) | ||
include("${CMAKE_CURRENT_LIST_DIR}/../fetcher.cmake") | ||
|
||
FetchContent_MakeAvailable(nlohmann_json) | ||
endif() | ||
nui_fetch_dependency( | ||
LIBRARY_NAME nlohmann_json | ||
FIND ${NUI_FIND_NLOHMANN_JSON} | ||
FETCH ${NUI_FETCH_NLOHMANN_JSON} | ||
GIT_REPOSITORY ${NUI_NLOHMANN_JSON_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_NLOHMANN_JSON_GIT_TAG} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
include(FetchContent) | ||
|
||
function(nui_fetch_dependency) | ||
cmake_parse_arguments( | ||
NUI_FETCH_ARGS | ||
"FIND;FETCH" | ||
"LIBRARY_NAME;PACKAGE_NAME;FETCH_NAME;GIT_REPOSITORY;GIT_TAG" | ||
"" | ||
${ARGN} | ||
) | ||
|
||
if (NOT NUI_FETCH_ARGS_PACKAGE_NAME) | ||
if (NOT NUI_FETCH_ARGS_LIBRARY_NAME) | ||
message(FATAL_ERROR "NUI_FETCH_ARGS_PACKAGE_NAME is not set") | ||
endif() | ||
set(NUI_FETCH_ARGS_PACKAGE_NAME ${NUI_FETCH_ARGS_LIBRARY_NAME}) | ||
endif() | ||
if (NOT NUI_FETCH_ARGS_FETCH_NAME) | ||
if (NOT NUI_FETCH_ARGS_LIBRARY_NAME) | ||
message(FATAL_ERROR "NUI_FETCH_ARGS_FETCH_NAME is not set") | ||
endif() | ||
set(NUI_FETCH_ARGS_FETCH_NAME ${NUI_FETCH_ARGS_LIBRARY_NAME}) | ||
endif() | ||
|
||
if (NUI_FETCH_ARGS_FIND) | ||
find_package(${NUI_FETCH_ARGS_PACKAGE_NAME} QUIET) | ||
|
||
if (${NUI_FETCH_ARGS_PACKAGE_NAME}_FOUND) | ||
return() | ||
endif() | ||
endif() | ||
|
||
if (NUI_FETCH_ARGS_FETCH AND ${NUI_FETCH_ARGS_FETCH}) | ||
message(STATUS "Fetching ${NUI_FETCH_ARGS_FETCH_NAME}") | ||
FetchContent_Declare( | ||
${NUI_FETCH_ARGS_FETCH_NAME} | ||
GIT_REPOSITORY ${NUI_FETCH_ARGS_GIT_REPOSITORY} | ||
GIT_TAG ${NUI_FETCH_ARGS_GIT_TAG} | ||
) | ||
FetchContent_MakeAvailable(${NUI_FETCH_ARGS_FETCH_NAME}) | ||
endif() | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters