Как правильно скопировать заголовочный файл статической библиотеки в / usr / include?
Я использую CMAKE с C и фактически создаю две очень маленькие статические библиотеки.
Моя цель:
The libraries are compiled and linked into *.a files. [THIS WORKS] Then I wish to copy that *.a files into /usr/local/lib [THIS ALSO WORKS] As far as I know about libraries (very little), they are linked using-lnameoflib
, which is a compiler flag. OK. I have prepared my CMakeLists.txt and it actually copies *.a files into /usr/local/lib. However, to be able to use them in a program, I also need to copy their header files into /usr/include, then I can include them the easy way #include <mylibheader.h>
. That's how I understand it now.
И мой вопрос - как правильно копировать заголовочные файлы в папку / usr / include с помощью CMAKE? Я хотел бы скопировать их автоматически, когдаmake install
выполняется, как * .a файлы.
Для обеих библиотек у меня есть знакомый CMakeLists.txt:
<code>project(programming-network) add_library(programming-network STATIC send_string.c recv_line.c ) INSTALL(TARGETS programming-network DESTINATION "lib" ) </code>