[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] target_sources vs. PUBLIC_HEADER for libraries
From:       Michael Ellery <mellery451 () gmail ! com>
Date:       2019-10-11 19:33:17
Message-ID: 5384F831-F47E-4F36-A31D-938074ED5FB0 () gmail ! com
[Download RAW message or body]

I'd like to make sure I understand two different aspects of header files management \
for libraries:

(1) typically you can add header files to target_sources, but it's only helpful for \
IDEs..so that the IDE will show the header files in its sources list, correct?. In \
theory, cmake does not actually need header files explicitly specified for dependency \
tracking, although I guess listing them makes it explicit.

(2) setting the PUBLIC_HEADER property for a target then makes header files available \
for installation via the PUBLIC_HEADER destination. Is this the preferred way to \
install the library interface/public headers? How do you handle a header directory \
hierarchy — for example maybe you have detail and impl subdirectories if you are \
following boost/stdlib conventions.

I found Craig's article about target_sources very helpful \
(https://crascit.com/2016/01/31/enhanced-source-file-handling-with-target_sources/), \
but I don't think it addresses the PUBLIC_HEADER installation use case.

Thanks,
Mike Ellery
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic