Skip to content

Commit

Permalink
cmake: hack around target_sources / boost-cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
timblechmann committed Dec 17, 2023
1 parent a860ca7 commit 103b60e
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,32 @@ option(BOOST_LOCKFREE_BUILD_TESTS "Build boost::lockfree tests" OFF)
add_library(boost_lockfree INTERFACE)
add_library(Boost::lockfree ALIAS boost_lockfree)

# if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)
# set(Headers
# include/boost/lockfree/spsc_queue.hpp
# include/boost/lockfree/policies.hpp
# include/boost/lockfree/queue.hpp
# include/boost/lockfree/lockfree_forward.hpp
# include/boost/lockfree/detail/prefix.hpp
# include/boost/lockfree/detail/copy_payload.hpp
# include/boost/lockfree/detail/tagged_ptr_dcas.hpp
# include/boost/lockfree/detail/tagged_ptr.hpp
# include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp
# include/boost/lockfree/detail/atomic.hpp
# include/boost/lockfree/detail/freelist.hpp
# include/boost/lockfree/detail/parameter.hpp
# include/boost/lockfree/stack.hpp
# )
target_include_directories(boost_lockfree INTERFACE include)

# target_sources(boost_lockfree PUBLIC FILE_SET HEADERS FILES ${Headers} )
# endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)
set(Headers
include/boost/lockfree/spsc_queue.hpp
include/boost/lockfree/policies.hpp
include/boost/lockfree/queue.hpp
include/boost/lockfree/lockfree_forward.hpp
include/boost/lockfree/detail/prefix.hpp
include/boost/lockfree/detail/copy_payload.hpp
include/boost/lockfree/detail/tagged_ptr_dcas.hpp
include/boost/lockfree/detail/tagged_ptr.hpp
include/boost/lockfree/detail/tagged_ptr_ptrcompression.hpp
include/boost/lockfree/detail/atomic.hpp
include/boost/lockfree/detail/freelist.hpp
include/boost/lockfree/detail/parameter.hpp
include/boost/lockfree/stack.hpp
)

target_include_directories(boost_lockfree INTERFACE include)
target_sources(boost_lockfree PUBLIC FILE_SET HEADERS FILES ${Headers} )
set_target_properties(boost_lockfree INCLUDE_DIRECTORIES PROPERTIES )

# work around boost-cmake 'install'
set_target_properties(boost_lockfree INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include )
set_target_properties(boost_lockfree INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include )
endif()

target_link_libraries(boost_lockfree
INTERFACE
Expand Down

0 comments on commit 103b60e

Please sign in to comment.