Skip to content

Commit

Permalink
Merge pull request #137 from elbeno/use-file-sets
Browse files Browse the repository at this point in the history
👷 Use `target_sources` instead of `target_include_directories`
  • Loading branch information
elbeno authored Sep 6, 2024
2 parents 6e04a58 + dacc6a1 commit 84cee66
Showing 1 changed file with 46 additions and 5 deletions.
51 changes: 46 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,56 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
endif()

add_library(stdx INTERFACE)
target_include_directories(stdx INTERFACE include)
target_compile_features(stdx INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
target_compile_options(
stdx
INTERFACE
$<$<CXX_COMPILER_ID:Clang>:-Wno-gnu-string-literal-operator-template>
$<$<CXX_COMPILER_ID:Clang>:-Wno-missing-braces>)
stdx INTERFACE $<$<CXX_COMPILER_ID:Clang>:-Wno-missing-braces>)
target_link_libraries_system(stdx INTERFACE boost_mp11 fmt::fmt-header-only)

target_sources(
stdx
INTERFACE FILE_SET
stdx
TYPE
HEADERS
BASE_DIRS
include
FILES
include/stdx/algorithm.hpp
include/stdx/bit.hpp
include/stdx/bitset.hpp
include/stdx/byterator.hpp
include/stdx/cached.hpp
include/stdx/compiler.hpp
include/stdx/concepts.hpp
include/stdx/ct_conversions.hpp
include/stdx/ct_format.hpp
include/stdx/ct_string.hpp
include/stdx/cx_map.hpp
include/stdx/cx_multimap.hpp
include/stdx/cx_queue.hpp
include/stdx/cx_set.hpp
include/stdx/cx_vector.hpp
include/stdx/detail/list_common.hpp
include/stdx/for_each_n_args.hpp
include/stdx/functional.hpp
include/stdx/function_traits.hpp
include/stdx/intrusive_forward_list.hpp
include/stdx/intrusive_list.hpp
include/stdx/iterator.hpp
include/stdx/memory.hpp
include/stdx/numeric.hpp
include/stdx/optional.hpp
include/stdx/panic.hpp
include/stdx/priority.hpp
include/stdx/ranges.hpp
include/stdx/span.hpp
include/stdx/tuple_algorithms.hpp
include/stdx/tuple_destructure.hpp
include/stdx/tuple.hpp
include/stdx/type_traits.hpp
include/stdx/udls.hpp
include/stdx/utility.hpp)

if(PROJECT_IS_TOP_LEVEL)
add_docs(docs)
add_subdirectory(test)
Expand Down

0 comments on commit 84cee66

Please sign in to comment.