Skip to content
Open
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
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@ if (BOOST_USE_MODULES)
target_include_directories(boost_pfr PUBLIC include)
else()
add_library(boost_pfr INTERFACE)
target_include_directories(boost_pfr INTERFACE include)

if (CMAKE_VERSION VERSION_LESS "3.23.0")
target_include_directories(boost_pfr INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
else()
file(GLOB_RECURSE PFR_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
target_sources(boost_pfr INTERFACE
FILE_SET HEADERS TYPE HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
FILES ${PFR_HEADERS}
)
endif()
endif()

add_library(Boost::pfr ALIAS boost_pfr)
Expand All @@ -45,4 +55,3 @@ if (BOOST_USE_MODULES AND BUILD_TESTING)
target_link_libraries(boost_pfr_module_usage_mu PRIVATE Boost::pfr)
add_test(NAME boost_pfr_module_usage_mu COMMAND boost_pfr_module_usage_mu)
endif()