mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
update dependency
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
include(cmake/CPM.cmake)
|
||||
include(ExternalProject)
|
||||
|
||||
function(add_3rdparty)
|
||||
cmake_parse_arguments(add_3rdparty_args "EXCLUDE_FROM_ALL" "NAME" "" ${ARGN})
|
||||
set(NAME ${add_3rdparty_args_NAME})
|
||||
function(add_3rdparty NAME)
|
||||
set(oneValueArgs GIT_REPOSITORY GIT_TAG)
|
||||
cmake_parse_arguments(add_3rdparty_args "EXCLUDE_FROM_ALL" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/${NAME}/CMakeLists.txt")
|
||||
message(STATUS "Found third party locally for ${NAME}")
|
||||
@@ -13,12 +13,21 @@ function(add_3rdparty)
|
||||
set(addSubdirectoryExtraArgs "")
|
||||
endif()
|
||||
|
||||
add_subdirectory(
|
||||
"${CMAKE_SOURCE_DIR}/3rdparty/${NAME}"
|
||||
ExternalProject_Add(
|
||||
${NAME}-${PROJECT_NAME}
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${NAME}
|
||||
SOURCE_DIR "${CMAKE_SOURCE_DIR}/3rdparty/${NAME}"
|
||||
INSTALL_COMMAND ""
|
||||
${addSubdirectoryExtraArgs}
|
||||
"${add_3rdparty_args_UNPARSED_ARGUMENTS}"
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "Using CPM to download ${NAME}")
|
||||
CPMAddPackage(${ARGN})
|
||||
ExternalProject_Add(
|
||||
${NAME}-${PROJECT_NAME}
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${NAME}
|
||||
"${ARGN}"
|
||||
)
|
||||
endfunction()
|
||||
|
Reference in New Issue
Block a user