例:
cmake_minimum_required(VERSION 3.9) project(test) set(CMAKE_BUILD_TYPE Debug) add_library(haha test.cpp) install(TARGET haha DESTINATION /home/linxisuo/project/test) install(DIRECTORY ${CMAKE_SOURCE_DIR}/test DESTINATION /home/linxisuo)
说明:
1.安装目标 :
install(TARGETS mylibrary DESTINATION lib)
2.安装指定目录或文件:
install(DIRECTORY ${CMAKE_SOURCE_DIR}/mydir DESTINATION share/mydir)
详细说明参考:https://blog.csdn.net/qq_21438461/article/details/133418766
标签:CMakeLists,CMAKE,DESTINATION,---,install,test,txt From: https://www.cnblogs.com/linxisuo/p/18172267