File tree Expand file tree Collapse file tree 3 files changed +20
-16
lines changed
Expand file tree Collapse file tree 3 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 1+ [submodule "DPP "]
2+ path = DPP
3+ url = https://github.com/brainboxdotcc/DPP
Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.6 )
1+ cmake_minimum_required (VERSION 3.15 )
22
33list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} /cmake)
44set (BOT_NAME "templatebot" )
@@ -50,19 +50,19 @@ if (DPP_FOUND)
5050 target_link_libraries (${BOT_NAME} ${DPP_LIBRARIES} )
5151 target_include_directories (${BOT_NAME} PUBLIC ${DPP_INCLUDE_DIR} )
5252else ()
53- message (WARNING "Could not find DPP install. Building from source instead." )
54- option (DPP_BUILD_TEST "" OFF )
55- include (FetchContent )
56-
57- FetchContent_Declare(
58- libdpp
59- GIT_REPOSITORY https://github.com/brainboxdotcc/DPP.git
60- GIT_TAG master )
61-
62- FetchContent_GetProperties(libdpp )
63- if ( NOT libdpp_POPULATED )
64- FetchContent_MakeAvailable(libdpp )
65- endif ()
66-
67- target_link_libraries ( ${BOT_NAME} dpp )
53+ find_package (Git )
54+ message (WARNING "Could not find DPP install. Building from source instead." )
55+ if (GIT_FOUND AND EXISTS " ${CMAKE_SOURCE_DIR} /.git" )
56+ execute_process ( COMMAND ${GIT_EXECUTABLE} submodule update --init
57+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
58+ RESULT_VARIABLE RESULT)
59+ if ( NOT RESULT EQUAL 0)
60+ message (FATAL_ERROR "Failed to update the D++ submodule. Code: ${RESULT} ." )
61+ else ()
62+ add_subdirectory (DPP )
63+ target_link_libraries ( ${BOT_NAME} dpp )
64+ endif ( )
65+ else ()
66+ message (FATAL_ERROR "Failed to find the git executable. Can't update the D++ submodule." )
67+ endif ( )
6868endif ()
You can’t perform that action at this time.
0 commit comments