c++ - Building a library while maintaining file structure with cmake and conan
问题描述
I'm building a library containing multiple .h files and 1 .cpp file, in a structure such as this
/include/A/B/f.h
/include/A/B/C/d.h
/include/G/h.h
/src/K/l.h
/src/K/l.cpp
I want to keep the relative path between each of the files after building locally, but they're all placed in a single folder /output/include without retaining any folder structure whatsoever :
/build/output/include/f.h
/build/output/include/d.h
/build/output/include/h.h
/build/output/include/l.h
This is what my install looks like :
install(TARGETS ${CMAKE_PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/output/bin"
LIBRARY DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/output/lib"
PUBLIC_HEADER DESTINATION "${CMAKE_CURENT_BINARY_DIR}/output/include"
}
I don't know exactly where to look as there is also the conanbuildinfo.cmake and cmake_install.cmake files generated by the cmake script I'm using (not done by me). If you need any more info please tell me because I'm pretty much new to cmake and conan and don't know which information is essential.
解决方案
推荐阅读
- java - 如何修复 JSSC 的 java.lang.UnsatisfiedLinkError?(需要硬浮动吗?)
- javascript - 用户完成输入后调用搜索功能
- javascript - 根据其他单元格在表格中显示按钮
- vue.js - Vuejs在调用api rest方法后为变量赋值的问题
- python - 有没有办法在后台(乳胶)运行python shell?
- java - 更改 JPanel 的颜色和尺寸不起作用
- ruby - 如何生成然后重定向到 Sinatra 中生成的链接?
- php - 用于检查 url 前缀的 preg_grep 模式
- swift - Swift 数字和单型集合
- javascript - 如何让我的按钮在显示国家/地区后正确显示一个国家/地区的完整描述