A better way for newest cmake version is to use target’s PUBLIC_HEADER
properties.
project(myproject)
add_library(mylib some.c another.c)
set_target_properties(mylib PROPERTIES PUBLIC_HEADER "some.h;another.h")
INSTALL(TARGETS mylib
LIBRARY DESTINATION some/libpath
PUBLIC_HEADER DESTINATION some/includepath
)
Some ref:
Related Contents:
- How to compile a static library in Linux?
- How to build x86 and/or x64 on Windows from command line with CMAKE?
- What is the use of .exp and what is the difference between .lib and .dll?
- How to copy directory from source tree to binary tree?
- Why are LIB files beasts of such a duplicitous nature?
- Convert a Static Library to a Shared Library?
- Combining several static libraries into one using CMake
- Why does GCC create a shared object instead of an executable binary according to file?
- How to link to the C math library with CMake?
- How to migrate this Make and Autotools project with multiple source subdirectories to CMake?
- Difference between static and shared libraries?
- What is a “static” function in C?
- Check substring exists in a string in C
- How to convert integer to string in C? [duplicate]
- What do people find difficult about C pointers? [closed]
- How can I remove a flag in C?
- In C, why do some people cast the pointer before freeing it?
- What is the difference between sigaction and signal?
- How do I pass a command line argument while starting up GDB in Linux? [duplicate]
- Returning a C string from a function
- How do I get bit-by-bit data from an integer value in C?
- GDB corrupted stack frame – How to debug?
- What should I do if two libraries provide a function with the same name generating a conflict?
- What is CHAR_BIT?
- Why should you use strncpy instead of strcpy?
- Is it guaranteed to be safe to perform memcpy(0,0,0)?
- Why do you program in assembly? [closed]
- Recommended GCC warning options for C [closed]
- How should I structure complex projects in C? [closed]
- What is PRIu64 in C?
- What are the most useful new features in C99? [closed]
- How to compile .c file with OpenSSL includes?
- Is NULL always false?
- Looking for a good hash table implementation in C [closed]
- Why is this code using strlen heavily 6.5x slower with GCC optimizations enabled?
- What is the difference between returning a char* and a char[] from a function? [duplicate]
- Code for printf function in C [duplicate]
- How can I use the tool ‘Include What You Use’ together with CMake to detect unused headers?
- Do I need to compile the header files in a C program?
- Contents of a static library
- “Use of a signed integer operand with a binary bitwise operator” – when using unsigned short
- Xlib and Firefox behavior
- Implementing a HashMap in C [closed]
- gcc, strict-aliasing, and horror stories [closed]
- Is “==” in sorted array not faster than unsorted array? [duplicate]
- C Switch-case curly braces after every case
- zero size malloc [duplicate]
- how to get doxygen to produce call & caller graphs for c functions
- CMake with subdirectories
- Writing binary number system in C code [duplicate]