From 4bf369c79abd4f990fc5738e618de12ebca58ccf Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 30 11月 2019 17:42:25 +0800 Subject: [PATCH] submodule --- cmake/Findlcc.cmake | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cmake/Findlcc.cmake b/cmake/Findlcc.cmake index 728908c..f38441f 100644 --- a/cmake/Findlcc.cmake +++ b/cmake/Findlcc.cmake @@ -49,7 +49,7 @@ if(LCC_LOCATION) # First search the PATH and specific locations. find_program(LCC_EXECUTABLE - NAMES ${lcc_names} HINTS ${LCC_LOCATION} DOC "lcc command line client") + NAMES ${lcc_names} HINTS ${LCC_LOCATION} DOC "lcc command line client") FIND_PACKAGE_HANDLE_STANDARD_ARGS(lcc FOUND_VAR LCC_FOUND REQUIRED_VARS LCC_EXECUTABLE FAIL_MESSAGE "Error finding lcc executable. variable LCC_LOCATION non set correctly.") @@ -65,12 +65,12 @@ option(GIT_SUBMODULE "Check submodules during build" ON) if(GIT_SUBMODULE) message(STATUS "Submodule update") -# execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -# RESULT_VARIABLE GIT_SUBMOD_RESULT) -# if(NOT GIT_SUBMOD_RESULT EQUAL "0") -# set(failure_messge "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") -# endif() + execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT) + if(NOT GIT_SUBMOD_RESULT EQUAL "0") + set(failure_messge "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") + endif() endif() endif() if(NOT EXISTS "${PROJECT_SOURCE_DIR}/extern/license-generator/CMakeLists.txt") @@ -78,7 +78,6 @@ endif() add_subdirectory("${PROJECT_SOURCE_DIR}/extern/license-generator") ENDIF(NOT lcc_FOUND) - set(LCC_EXECUTABLE $<TARGET_FILE:license_generator::lcc>) ENDIF(LCC_LOCATION) -- Gitblit v1.9.1