#######################################
# Installation section #
#######################################
install(DIRECTORY config DESTINATION ${DATA_DIR}) //安装文件夹config到 DATA_DIR
install(DIRECTORY scripts DESTINATION ${DATA_DIR}) //安装文件夹scripts到 DATA_DIR
install(DIRECTORY Mods DESTINATION ${DATA_DIR}) //安装文件夹Mods到DATA_DIR
# that script is useless for Windows
#安装vcmibuilder 到BIN_DIR目录,然后修改权限
if(NOT WIN32)
install(FILES vcmibuilder DESTINATION ${BIN_DIR} PERMISSIONS
OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
endif()
每一个子目录都拥有自己的安装代码
比如在英雄无敌3源码中
client的cmakelist中有,安装vcmiclient 到 BIN_DIR
install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
至于DATA_DIR,BIN_DIR,LIB_DIR可以在CMakeCache.txt 中设置。
标签:BIN,解释,EXECUTE,cmake,安装文件,安装,DESTINATION,DATA,DIR From: https://www.cnblogs.com/zxdplay/p/16859517.html