-
-
Notifications
You must be signed in to change notification settings - Fork 203
CMake: improvements #325
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
CMake: improvements #325
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| cmake_minimum_required(VERSION 3.14) | ||
| cmake_minimum_required(VERSION 3.21) | ||
| cmake_policy(SET CMP0048 NEW) # enable project VERSION | ||
| cmake_policy(SET CMP0056 NEW) # honor link flags in try_compile() | ||
| list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
|
@@ -48,11 +48,11 @@ option(ENABLE_PYTHON "enable building python module" off) | |
| option(ENABLE_GUILE "enable building guile module" off) | ||
| option(ENABLE_BOOST_COROUTINE "run benchmarks with boost coroutine" off) | ||
|
|
||
| option(immer_BUILD_TESTS "Build tests" ON) | ||
| option(immer_BUILD_TESTS "Build tests" "${PROJECT_IS_TOP_LEVEL}") | ||
| option(immer_BUILD_PERSIST_TESTS "Build experimental persist tests" off) | ||
| option(immer_BUILD_EXAMPLES "Build examples" ON) | ||
| option(immer_BUILD_DOCS "Build docs" ON) | ||
| option(immer_BUILD_EXTRAS "Build extras" ON) | ||
| option(immer_BUILD_EXAMPLES "Build examples" "${PROJECT_IS_TOP_LEVEL}") | ||
| option(immer_BUILD_DOCS "Build docs" "${PROJECT_IS_TOP_LEVEL}") | ||
| option(immer_BUILD_EXTRAS "Build extras" "${PROJECT_IS_TOP_LEVEL}") | ||
| option(immer_INSTALL_FUZZERS "Install fuzzers" off) | ||
| option(immer_ENABLE_EXCEPTIONS | ||
| "Always enable exceptions regardless of detected compiler support" OFF) | ||
|
|
@@ -122,6 +122,7 @@ endif() | |
|
|
||
| # the library | ||
| add_library(immer INTERFACE) | ||
| add_library(immer::immer ALIAS immer) | ||
| target_include_directories( | ||
| immer | ||
| INTERFACE $<BUILD_INTERFACE:${immer_BINARY_DIR}/> | ||
|
|
@@ -138,7 +139,111 @@ if(immer_DISABLE_EXCEPTIONS) | |
| target_compile_definitions(immer INTERFACE IMMER_NO_EXCEPTIONS) | ||
| endif() | ||
|
|
||
| install(TARGETS immer EXPORT ImmerConfig) | ||
| target_sources(immer PUBLIC FILE_SET HEADERS | ||
| FILES | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exposing the headers to IDE project files ... quite a bit of a quality-of-life improvement
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if I forget to update it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. afaict it is mainly cosmetic, i.e. it will allow IDEs to populate targets with headers and aid indexers (at least that's how it's used with qtcreator/clangd). if a file is missing, it won't show up in IDEs, but afaict that's it ... |
||
| immer/algorithm.hpp | ||
| immer/array.hpp | ||
| immer/array_transient.hpp | ||
| immer/atom.hpp | ||
| immer/box.hpp | ||
| immer/config.hpp | ||
| immer/detail/arrays/no_capacity.hpp | ||
| immer/detail/arrays/node.hpp | ||
| immer/detail/arrays/with_capacity.hpp | ||
| immer/detail/combine_standard_layout.hpp | ||
| immer/detail/hamts/bits.hpp | ||
| immer/detail/hamts/champ.hpp | ||
| immer/detail/hamts/champ_iterator.hpp | ||
| immer/detail/hamts/node.hpp | ||
| immer/detail/iterator_facade.hpp | ||
| immer/detail/rbts/bits.hpp | ||
| immer/detail/rbts/node.hpp | ||
| immer/detail/rbts/operations.hpp | ||
| immer/detail/rbts/position.hpp | ||
| immer/detail/rbts/rbtree.hpp | ||
| immer/detail/rbts/rbtree_iterator.hpp | ||
| immer/detail/rbts/rrbtree.hpp | ||
| immer/detail/rbts/rrbtree_iterator.hpp | ||
| immer/detail/rbts/visitor.hpp | ||
| immer/detail/ref_count_base.hpp | ||
| immer/detail/type_traits.hpp | ||
| immer/detail/util.hpp | ||
| immer/experimental/detail/dvektor_impl.hpp | ||
| immer/experimental/dvektor.hpp | ||
| immer/extra/cereal/immer_array.hpp | ||
| immer/extra/cereal/immer_box.hpp | ||
| immer/extra/cereal/immer_map.hpp | ||
| immer/extra/cereal/immer_set.hpp | ||
| immer/extra/cereal/immer_table.hpp | ||
| immer/extra/cereal/immer_vector.hpp | ||
| immer/extra/io.hpp | ||
| immer/extra/persist/cereal/archives.hpp | ||
| immer/extra/persist/cereal/load.hpp | ||
| immer/extra/persist/cereal/policy.hpp | ||
| immer/extra/persist/cereal/save.hpp | ||
| immer/extra/persist/detail/alias.hpp | ||
| immer/extra/persist/detail/array/pool.hpp | ||
| immer/extra/persist/detail/box/pool.hpp | ||
| immer/extra/persist/detail/cereal/compact_map.hpp | ||
| immer/extra/persist/detail/cereal/input_archive_util.hpp | ||
| immer/extra/persist/detail/cereal/persistable.hpp | ||
| immer/extra/persist/detail/cereal/pools.hpp | ||
| immer/extra/persist/detail/cereal/wrap.hpp | ||
| immer/extra/persist/detail/champ/champ.hpp | ||
| immer/extra/persist/detail/champ/input.hpp | ||
| immer/extra/persist/detail/champ/output.hpp | ||
| immer/extra/persist/detail/champ/pool.hpp | ||
| immer/extra/persist/detail/champ/traits.hpp | ||
| immer/extra/persist/detail/common/pool.hpp | ||
| immer/extra/persist/detail/names.hpp | ||
| immer/extra/persist/detail/node_ptr.hpp | ||
| immer/extra/persist/detail/rbts/input.hpp | ||
| immer/extra/persist/detail/rbts/output.hpp | ||
| immer/extra/persist/detail/rbts/pool.hpp | ||
| immer/extra/persist/detail/rbts/traits.hpp | ||
| immer/extra/persist/detail/rbts/traverse.hpp | ||
| immer/extra/persist/detail/traits.hpp | ||
| immer/extra/persist/detail/transform.hpp | ||
| immer/extra/persist/detail/type_traverse.hpp | ||
| immer/extra/persist/errors.hpp | ||
| immer/extra/persist/hash_container_conversion.hpp | ||
| immer/extra/persist/transform.hpp | ||
| immer/extra/persist/types.hpp | ||
| immer/extra/persist/xxhash/xxhash.hpp | ||
| immer/extra/persist/xxhash/xxhash_64.cpp | ||
| immer/flex_vector.hpp | ||
| immer/flex_vector_transient.hpp | ||
| immer/heap/cpp_heap.hpp | ||
| immer/heap/debug_size_heap.hpp | ||
| immer/heap/free_list_heap.hpp | ||
| immer/heap/gc_heap.hpp | ||
| immer/heap/heap_policy.hpp | ||
| immer/heap/identity_heap.hpp | ||
| immer/heap/malloc_heap.hpp | ||
| immer/heap/split_heap.hpp | ||
| immer/heap/tags.hpp | ||
| immer/heap/thread_local_free_list_heap.hpp | ||
| immer/heap/unsafe_free_list_heap.hpp | ||
| immer/lock/no_lock_policy.hpp | ||
| immer/lock/spinlock_policy.hpp | ||
| immer/map.hpp | ||
| immer/map_transient.hpp | ||
| immer/memory_policy.hpp | ||
| immer/refcount/enable_intrusive_ptr.hpp | ||
| immer/refcount/no_refcount_policy.hpp | ||
| immer/refcount/refcount_policy.hpp | ||
| immer/refcount/unsafe_refcount_policy.hpp | ||
| immer/set.hpp | ||
| immer/set_transient.hpp | ||
| immer/table.hpp | ||
| immer/table_transient.hpp | ||
| immer/transience/gc_transience_policy.hpp | ||
| immer/transience/no_transience_policy.hpp | ||
| immer/vector.hpp | ||
| immer/vector_transient.hpp | ||
| ) | ||
|
|
||
| install(TARGETS immer EXPORT ImmerConfig FILE_SET HEADERS) | ||
| install(EXPORT ImmerConfig DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Immer") | ||
| install(DIRECTORY immer DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PROJECT_IS_TOP_LEVEL was introduced in 3.12. it could be emulated via
CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME, but i wonder if that's worth the effort: cmake 3.21 is from 2021, so widely available alreadyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍