Hi! I tried using file sets for my project and I’m not sure how to proceed. I have public headers that I have inside include/
, and some private headers in src/
. I tried using file sets to describe both like so:
target_sources(mylib1
PRIVATE
src/a.cpp
src/b.cpp
PRIVATE FILE_SET HEADERS
BASE_DIRS src
FILES
src/a_impl.hpp
src/b_impl.hpp
PUBLIC FILE_SET HEADERS
BASE_DIRS include
FILES
include/mylib1/a.hpp
include/mylib1/b.hpp
)
However, doing so generates an error:
target_sources Scope PUBLIC for file set "HEADERS" does not match original
scope PRIVATE
What would be the proper way to do this? I’m planning to install those private headers alongside modules and modules partitions.