Skip to content

[RFC] [cmake] Add core/base headers to target HEADERS file_set #18419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,27 @@ set(BASE_SOURCES
src/TVirtualX.cxx
)

set(FULL_BASE_HEADERS ${BASE_HEADERS})
list(TRANSFORM FULL_BASE_HEADERS PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/inc/)

# only here complete list of headers can be propogated to parent cmake file
set_property(TARGET Core APPEND PROPERTY DICT_HEADERS ${BASE_HEADERS})

target_sources(Core PRIVATE ${BASE_SOURCES})

if(NOT CMAKE_VERSION VERSION_LESS "3.23.0") # https://discourse.cmake.org/t/file-set-xyz-is-listed-in-interface-file-sets-of-w-but-has-not-been-exported/9131/3
target_sources(
Core
PRIVATE
FILE_SET private_header_files
TYPE HEADERS
BASE_DIRS inc/ src/
FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/TListOfTypes.h
${FULL_BASE_HEADERS}
)
endif()

target_include_directories(Core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
)
Expand Down
Loading