update install command

This commit is contained in:
Kevin Yue 2021-09-13 14:31:04 +08:00
parent 405e84e40c
commit 0eb9cce8bb
2 changed files with 13 additions and 2 deletions

View File

@ -26,12 +26,14 @@ add_3rdparty(
NAME SingleApplication NAME SingleApplication
GITHUB_REPOSITORY itay-grudev/SingleApplication GITHUB_REPOSITORY itay-grudev/SingleApplication
VERSION 3.3.0 VERSION 3.3.0
EXCLUDE_FROM_ALL
) )
add_3rdparty( add_3rdparty(
NAME plog NAME plog
GITHUB_REPOSITORY SergiusTheBest/plog GITHUB_REPOSITORY SergiusTheBest/plog
GIT_TAG 1.1.5 GIT_TAG 1.1.5
EXCLUDE_FROM_ALL
) )
add_subdirectory(GPService) add_subdirectory(GPService)

View File

@ -1,13 +1,22 @@
include(cmake/CPM.cmake) include(cmake/CPM.cmake)
function(add_3rdparty) function(add_3rdparty)
cmake_parse_arguments(add_3rdparty_args "" "NAME" "" ${ARGN}) cmake_parse_arguments(add_3rdparty_args "EXCLUDE_FROM_ALL" "NAME" "" ${ARGN})
set(NAME ${add_3rdparty_args_NAME}) set(NAME ${add_3rdparty_args_NAME})
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/${NAME}/CMakeLists.txt") if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/${NAME}/CMakeLists.txt")
message(STATUS "Found third party locally for ${NAME}") message(STATUS "Found third party locally for ${NAME}")
add_subdirectory("${CMAKE_SOURCE_DIR}/3rdparty/${NAME}") if(${add_3rdparty_args_EXCLUDE_FROM_ALL})
set(addSubdirectoryExtraArgs EXCLUDE_FROM_ALL)
else()
set(addSubdirectoryExtraArgs "")
endif()
add_subdirectory(
"${CMAKE_SOURCE_DIR}/3rdparty/${NAME}"
${addSubdirectoryExtraArgs}
)
return() return()
endif() endif()
message(STATUS "Using CPM to download ${NAME}") message(STATUS "Using CPM to download ${NAME}")