From bcdd6d88f7df3212d57eb93024fe5ada502bc49f Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周六, 30 11月 2019 19:48:06 +0800 Subject: [PATCH] cmake < 3.6 fix --- cmake/Findlcc.cmake | 94 +++++++++++++++++++++++------------------------ 1 files changed, 46 insertions(+), 48 deletions(-) diff --git a/cmake/Findlcc.cmake b/cmake/Findlcc.cmake index 728908c..b917f63 100644 --- a/cmake/Findlcc.cmake +++ b/cmake/Findlcc.cmake @@ -1,45 +1,44 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. +# Distributed under the OSI-approved BSD 3-Clause License. #[=======================================================================[.rst: -Findlcc -------- - -Find or build the lcc executable. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - -``license_generator::lcc`` - The lcc executable - -If lcc is not found this module will try to download it as a submodule -Git must be installed. - -Input variables -^^^^^^^^^^^^^^^^ - -``LCC_LOCATION`` Hint for locating the lcc executable - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``LCC_FOUND`` - True if the system has the Foo library. -``lcc_VERSION`` - -Cache Variables -^^^^^^^^^^^^^^^ - -The following cache variables will also be set: - -``LCC_EXECUTABLE`` - Path to the lcc executable. - +#Findlcc +#------- +# +#Find or build the lcc executable. +# +#Imported Targets +#^^^^^^^^^^^^^^^^ +# +#This module provides the following imported targets, if found: +# +#``license_generator::lcc`` +# The lcc executable +# +#If lcc is not found this module will try to download it as a submodule +#Git must be installed. +# +#Input variables +#^^^^^^^^^^^^^^^^ +# +#``LCC_LOCATION`` Hint for locating the lcc executable +# +#Result Variables +#^^^^^^^^^^^^^^^^ +# +#This will define the following variables: +# +#``LCC_FOUND`` +# True if the system has the Foo library. +#``lcc_VERSION`` +# +#Cache Variables +#^^^^^^^^^^^^^^^ +# +#The following cache variables will also be set: +# +#``LCC_EXECUTABLE`` +# Path to the lcc executable. +# #]=======================================================================] set(lcc_names lcc lcc.exe) @@ -49,7 +48,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 +64,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 +77,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