1- cmake_minimum_required (VERSION 3.14 )
1+ cmake_minimum_required (VERSION 3.21 )
22cmake_policy (SET CMP0048 NEW ) # enable project VERSION
33cmake_policy (SET CMP0056 NEW ) # honor link flags in try_compile()
44list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR } /cmake" )
@@ -48,11 +48,11 @@ option(ENABLE_PYTHON "enable building python module" off)
4848option (ENABLE_GUILE "enable building guile module" off )
4949option (ENABLE_BOOST_COROUTINE "run benchmarks with boost coroutine" off )
5050
51- option (immer_BUILD_TESTS "Build tests" ON )
51+ option (immer_BUILD_TESTS "Build tests" " ${PROJECT_IS_TOP_LEVEL} " )
5252option (immer_BUILD_PERSIST_TESTS "Build experimental persist tests" off )
53- option (immer_BUILD_EXAMPLES "Build examples" ON )
54- option (immer_BUILD_DOCS "Build docs" ON )
55- option (immer_BUILD_EXTRAS "Build extras" ON )
53+ option (immer_BUILD_EXAMPLES "Build examples" " ${PROJECT_IS_TOP_LEVEL} " )
54+ option (immer_BUILD_DOCS "Build docs" " ${PROJECT_IS_TOP_LEVEL} " )
55+ option (immer_BUILD_EXTRAS "Build extras" " ${PROJECT_IS_TOP_LEVEL} " )
5656option (immer_INSTALL_FUZZERS "Install fuzzers" off )
5757option (immer_ENABLE_EXCEPTIONS
5858 "Always enable exceptions regardless of detected compiler support" OFF )
@@ -122,6 +122,7 @@ endif()
122122
123123# the library
124124add_library (immer INTERFACE )
125+ add_library (immer::immer ALIAS immer )
125126target_include_directories (
126127 immer
127128 INTERFACE $<BUILD_INTERFACE :${immer_BINARY_DIR } />
@@ -138,7 +139,111 @@ if(immer_DISABLE_EXCEPTIONS)
138139 target_compile_definitions (immer INTERFACE IMMER_NO_EXCEPTIONS )
139140endif ()
140141
141- install (TARGETS immer EXPORT ImmerConfig)
142+ target_sources (immer PUBLIC FILE_SET HEADERS
143+ FILES
144+ immer/algorithm.hpp
145+ immer/array.hpp
146+ immer/array_transient.hpp
147+ immer/atom.hpp
148+ immer/box.hpp
149+ immer/config.hpp
150+ immer/detail/arrays/no_capacity.hpp
151+ immer/detail/arrays/node.hpp
152+ immer/detail/arrays/with_capacity.hpp
153+ immer/detail/combine_standard_layout.hpp
154+ immer/detail/hamts/bits.hpp
155+ immer/detail/hamts/champ.hpp
156+ immer/detail/hamts/champ_iterator.hpp
157+ immer/detail/hamts/node.hpp
158+ immer/detail/iterator_facade.hpp
159+ immer/detail/rbts/bits.hpp
160+ immer/detail/rbts/node.hpp
161+ immer/detail/rbts/operations.hpp
162+ immer/detail/rbts/position.hpp
163+ immer/detail/rbts/rbtree.hpp
164+ immer/detail/rbts/rbtree_iterator.hpp
165+ immer/detail/rbts/rrbtree.hpp
166+ immer/detail/rbts/rrbtree_iterator.hpp
167+ immer/detail/rbts/visitor.hpp
168+ immer/detail/ref_count_base.hpp
169+ immer/detail/type_traits.hpp
170+ immer/detail/util.hpp
171+ immer/experimental/detail/dvektor_impl.hpp
172+ immer/experimental/dvektor.hpp
173+ immer/extra/cereal/immer_array.hpp
174+ immer/extra/cereal/immer_box.hpp
175+ immer/extra/cereal/immer_map.hpp
176+ immer/extra/cereal/immer_set.hpp
177+ immer/extra/cereal/immer_table.hpp
178+ immer/extra/cereal/immer_vector.hpp
179+ immer/extra/io.hpp
180+ immer/extra/persist/cereal/archives.hpp
181+ immer/extra/persist/cereal/load.hpp
182+ immer/extra/persist/cereal/policy.hpp
183+ immer/extra/persist/cereal/save.hpp
184+ immer/extra/persist/detail/alias.hpp
185+ immer/extra/persist/detail/array/pool.hpp
186+ immer/extra/persist/detail/box/pool.hpp
187+ immer/extra/persist/detail/cereal/compact_map.hpp
188+ immer/extra/persist/detail/cereal/input_archive_util.hpp
189+ immer/extra/persist/detail/cereal/persistable.hpp
190+ immer/extra/persist/detail/cereal/pools.hpp
191+ immer/extra/persist/detail/cereal/wrap.hpp
192+ immer/extra/persist/detail/champ/champ.hpp
193+ immer/extra/persist/detail/champ/input.hpp
194+ immer/extra/persist/detail/champ/output.hpp
195+ immer/extra/persist/detail/champ/pool.hpp
196+ immer/extra/persist/detail/champ/traits.hpp
197+ immer/extra/persist/detail/common/pool.hpp
198+ immer/extra/persist/detail/names.hpp
199+ immer/extra/persist/detail/node_ptr.hpp
200+ immer/extra/persist/detail/rbts/input.hpp
201+ immer/extra/persist/detail/rbts/output.hpp
202+ immer/extra/persist/detail/rbts/pool.hpp
203+ immer/extra/persist/detail/rbts/traits.hpp
204+ immer/extra/persist/detail/rbts/traverse.hpp
205+ immer/extra/persist/detail/traits.hpp
206+ immer/extra/persist/detail/transform.hpp
207+ immer/extra/persist/detail/type_traverse.hpp
208+ immer/extra/persist/errors.hpp
209+ immer/extra/persist/hash_container_conversion.hpp
210+ immer/extra/persist/transform.hpp
211+ immer/extra/persist/types.hpp
212+ immer/extra/persist/xxhash/xxhash.hpp
213+ immer/extra/persist/xxhash/xxhash_64.cpp
214+ immer/flex_vector.hpp
215+ immer/flex_vector_transient.hpp
216+ immer/heap/cpp_heap.hpp
217+ immer/heap/debug_size_heap.hpp
218+ immer/heap/free_list_heap.hpp
219+ immer/heap/gc_heap.hpp
220+ immer/heap/heap_policy.hpp
221+ immer/heap/identity_heap.hpp
222+ immer/heap/malloc_heap.hpp
223+ immer/heap/split_heap.hpp
224+ immer/heap/tags.hpp
225+ immer/heap/thread_local_free_list_heap.hpp
226+ immer/heap/unsafe_free_list_heap.hpp
227+ immer/lock/no_lock_policy.hpp
228+ immer/lock/spinlock_policy.hpp
229+ immer/map.hpp
230+ immer/map_transient.hpp
231+ immer/memory_policy.hpp
232+ immer/refcount/enable_intrusive_ptr.hpp
233+ immer/refcount/no_refcount_policy.hpp
234+ immer/refcount/refcount_policy.hpp
235+ immer/refcount/unsafe_refcount_policy.hpp
236+ immer/set.hpp
237+ immer/set_transient.hpp
238+ immer/table.hpp
239+ immer/table_transient.hpp
240+ immer/transience/gc_transience_policy.hpp
241+ immer/transience/no_transience_policy.hpp
242+ immer/vector.hpp
243+ immer/vector_transient.hpp
244+ )
245+
246+ install (TARGETS immer EXPORT ImmerConfig FILE_SET HEADERS)
142247install (EXPORT ImmerConfig DESTINATION "${CMAKE_INSTALL_LIBDIR} /cmake/Immer" )
143248install (DIRECTORY immer DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} " )
144249
0 commit comments