2 Star 1 Fork 1

houzh/Miniwin

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
download.cmake 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
侯歌 提交于 2022-03-25 18:31 +08:00 . disable externalproject_add.update_command
###########################################################################
# Copyright 2017 Florian Reiterer
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################
set(download_template [=[
cmake_minimum_required(VERSION 2.8.2)
project(@name@ NONE)
include(ExternalProject)
ExternalProject_Add(@name@
BINARY_DIR "@download_dir@"
SOURCE_DIR "@source_dir@"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
UPDATE_COMMAND ""
@ARGN@
)
]=])
function(download directory)
get_filename_component(name "${directory}" NAME)
message(STATUS "Downloading/updating ${name}")
get_filename_component(directory "${directory}" ABSOLUTE)
set(download_dir "${directory}/download")
set(source_dir "${directory}/src")
string(CONFIGURE "${download_template}" cmake_lists @ONLY)
file(WRITE "${download_dir}/CMakeLists.txt" "${cmake_lists}")
execute_process(COMMAND ${CMAKE_COMMAND} .
RESULT_VARIABLE result
WORKING_DIRECTORY "${download_dir}"
)
if(result)
message(FATAL_ERROR "CMake step for ${name} failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY "${download_dir}"
)
if(result)
message(FATAL_ERROR "Build step for ${name} failed: ${result}")
endif()
endfunction()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/houstudio/Miniwin.git
git@gitee.com:houstudio/Miniwin.git
houstudio
Miniwin
Miniwin
master

搜索帮助