加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
MrZhaosx 提交于 2020-09-24 19:40 . first commit
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
CMAKE_POLICY(SET CMP0004 NEW)
endif(COMMAND CMAKE_POLICY)
set (CMAKE_INSTALL_PREFIX /usr/share CACHE STRING "Install path prefix")
project (gazebo_models)
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
exec_program(date ARGS -u +%Y-%m-%-dT%H:%M:%S OUTPUT_VARIABLE CURRENT_DATE)
set (MODEL_URI_LIST "" CACHE INTERNAL "Model URI List" FORCE)
# Convert install prefix to an absolute path, to support the common case of
# doing this (which otherwise will fail during the install):`
# cmake -DCMAKE_INSTALL_PREFIX=~/.gazebo ..
get_filename_component(CMAKE_INSTALL_PREFIX_ABSOLUTE ${CMAKE_INSTALL_PREFIX}
ABSOLUTE)
file(GLOB_RECURSE MODEL_CFGS "model.config")
foreach (MODEL_CFG ${MODEL_CFGS})
get_filename_component(dir ${MODEL_CFG} DIRECTORY) # get dir of model.config
get_filename_component(dir ${dir} NAME) # get dirname only, not full path
add_custom_target(${dir} ALL COMMAND mkdir -p ${PROJECT_BINARY_DIR}/${dir}
COMMAND tar czvf ${PROJECT_BINARY_DIR}/${dir}/model.tar.gz ../${dir})
install (DIRECTORY ${dir} DESTINATION ${CMAKE_INSTALL_PREFIX_ABSOLUTE}/models)
install (FILES ${PROJECT_BINARY_DIR}/${dir}/model.tar.gz DESTINATION
${CMAKE_INSTALL_PREFIX_ABSOLUTE}/models/${dir})
set(MODEL_URI_LIST "${MODEL_URI_LIST}<uri>file://${dir}</uri>\n")
endforeach ()
configure_file("${CMAKE_SOURCE_DIR}/manifest.xml.in"
"${PROJECT_BINARY_DIR}/manifest.xml")
install (FILES "${PROJECT_BINARY_DIR}/manifest.xml" DESTINATION
${CMAKE_INSTALL_PREFIX_ABSOLUTE}/models/)
configure_file("${CMAKE_SOURCE_DIR}/database.config.in"
"${PROJECT_BINARY_DIR}/database.config")
install (FILES "${PROJECT_BINARY_DIR}/database.config" DESTINATION
${CMAKE_INSTALL_PREFIX_ABSOLUTE}/models/)
message (STATUS "Install path: ${CMAKE_INSTALL_PREFIX_ABSOLUTE}/models")
# This must always be last!
include(CPack)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化