Repository: bemanproject/any_view
Pull request #21: Switch to filesets and enable header verification
Author: login: nickelpro
Created: 2025-05-20T04:51:00Z | Merged: 2025-05-20T05:42:40Z

This is builds on / is an alternative to #19.

Removes `target_include_directories()` / `install(FILES)` in favor of `target_sources(FILE_SET HEADERS)`

Also fixes a number of outstanding issues with the existing CML:
  * **[CMAKE.PASSIVE_PROJECTS]**
  * **[CMAKE.CONFIG]**



Diff:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b6cf1f..8617a1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,14 +12,20 @@ project(
 # [CMAKE.SKIP_TESTS]
 option(
     BEMAN_ANY_VIEW_BUILD_TESTS
-    "Enable building tests and test infrastructure. Default: ON. Values: { ON, OFF }."
+    "Enable building tests and test infrastructure. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
     ${PROJECT_IS_TOP_LEVEL}
 )
 
 # [CMAKE.SKIP_EXAMPLES]
 option(
     BEMAN_ANY_VIEW_BUILD_EXAMPLES
-    "Enable building examples. Default: ON. Values: {ON, OFF}."
+    "Enable building examples. Default: ${PROJECT_IS_TOP_LEVEL}. Values: {ON, OFF}."
+    ${PROJECT_IS_TOP_LEVEL}
+)
+
+option(
+    BEMAN_ANY_VIEW_INSTALL_CONFIG_FILE_PACKAGE
+    "Enable creating and installing a CMake config-file package. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
     ${PROJECT_IS_TOP_LEVEL}
 )
 
@@ -44,37 +50,49 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
-
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include include
+        FILES
+            ${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/config.hpp
+            include/beman/any_view/detail/any_iterator.hpp
+            include/beman/any_view/detail/concepts.hpp
+            include/beman/any_view/detail/intrusive_small_ptr.hpp
+            include/beman/any_view/detail/iterator_adaptor.hpp
+            include/beman/any_view/detail/iterator_interface.hpp
+            include/beman/any_view/detail/type_traits.hpp
+            include/beman/any_view/detail/utility.hpp
+            include/beman/any_view/detail/view_adaptor.hpp
+            include/beman/any_view/detail/view_interface.hpp
+            include/beman/any_view/any_view_options.hpp
+            include/beman/any_view/any_view.hpp
+            include/beman/any_view/concepts.hpp
 )
 
-install(
-    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
-    FILES_MATCHING
-    PATTERN "${CMAKE_CURRENT_SOURCE_DIR}/include/beman/any_view/*.hpp"
-    PATTERN "${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/*.hpp"
-)
+include(GNUInstallDirs)
+
+install(TARGETS beman.any_view EXPORT beman.any_view-targets FILE_SET HEADERS)
+
+if(BEMAN_ANY_VIEW_INSTALL_CONFIG_FILE_PACKAGE)
+    install(
+        EXPORT beman.any_view-targets
+        FILE beman.any_view-config.cmake
+        DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/beman.any_view"
+        NAMESPACE beman::
+    )
+endif()
 
 function(beman_add_executable)
     set(options)
diff --git a/tests/beman/any_view/CMakeLists.txt b/tests/beman/any_view/CMakeLists.txt
index e4557e5..383dec6 100644
--- a/tests/beman/any_view/CMakeLists.txt
+++ b/tests/beman/any_view/CMakeLists.txt
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
+include(FetchContent)
 # Fetch Benchmark
 FetchContent_Declare(
     benchmark


Reviews:
user: login: github-actions[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-20T04:51:24Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T04:55:37Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T04:55:47Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T04:55:56Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T04:56:10Z
user: login: patrickroberts
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-20T04:57:29Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:01:24Z
user: login: wusatosi
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:01:59Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:05:04Z
user: login: github-actions[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-20T05:07:12Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:07:17Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:07:55Z
user: login: patrickroberts
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-05-20T05:22:34Z
user: login: nickelpro
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-20T05:23:48Z
user: login: github-actions[bot]
state: COMMENTED
author_association: NONE
submitted_at: 2025-05-20T05:29:37Z
user: login: patrickroberts
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-20T05:34:00Z

Review comments:
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
```

<!-- __reviewdog__:ChA3NTFiZjVjZTMzOTg0Mjk5EgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T04:51:23Z
author_association: NONE
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
    PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON EXPORT_NAME any_view
```

<!-- __reviewdog__:ChAzNmRjZWYxNTYzODQyYzgwEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T04:51:23Z
author_association: NONE
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
        BASE_DIRS ${CMAKE_BINARY_DIR}/include include
```

<!-- __reviewdog__:ChAzMzRhYzkwOWEwZTQ2YmVlEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T04:51:24Z
author_association: NONE
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_BINARY_DIR}/include/beman/any_view/config.hpp
+            include/beman/any_view/detail/any_iterator.hpp
+            include/beman/any_view/detail/concepts.hpp
+            include/beman/any_view/detail/intrusive_small_ptr.hpp
+            include/beman/any_view/detail/iterator_adaptor.hpp
+            include/beman/any_view/detail/iterator_interface.hpp
+            include/beman/any_view/detail/type_traits.hpp
+            include/beman/any_view/detail/utility.hpp
+            include/beman/any_view/detail/view_adaptor.hpp
+            include/beman/any_view/detail/view_interface.hpp
+            include/beman/any_view/any_view_options.hpp
+            include/beman/any_view/any_view.hpp
+            include/beman/any_view/concepts.hpp
 )
 
+include(GNUInstallDirs)
+
 install(
-    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
-    FILES_MATCHING
-    PATTERN "${CMAKE_CURRENT_SOURCE_DIR}/include/beman/any_view/*.hpp"
-    PATTERN "${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/*.hpp"
+    TARGETS beman.any_view
+    EXPORT beman.any_view-targets
+    FILE_SET HEADERS
 )
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
install(TARGETS beman.any_view EXPORT beman.any_view-targets FILE_SET HEADERS)
```

<!-- __reviewdog__:ChBlYzQ0NWM3MjQzODJiMTAyEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T04:51:24Z
author_association: NONE
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
path: CMakeLists.txt
user: login: nickelpro
body: Nope
created_at: 2025-05-20T04:55:37Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_BINARY_DIR}/include/beman/any_view/config.hpp
path: CMakeLists.txt
user: login: patrickroberts
body: Why `CMAKE_BINARY_DIR` instead of `PROJECT_BINARY_DIR`?
created_at: 2025-05-20T04:55:45Z
author_association: COLLABORATOR
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
path: CMakeLists.txt
user: login: nickelpro
body: Absolutely not
created_at: 2025-05-20T04:55:47Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: nickelpro
body: Wrong again
created_at: 2025-05-20T04:55:56Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_BINARY_DIR}/include/beman/any_view/config.hpp
+            include/beman/any_view/detail/any_iterator.hpp
+            include/beman/any_view/detail/concepts.hpp
+            include/beman/any_view/detail/intrusive_small_ptr.hpp
+            include/beman/any_view/detail/iterator_adaptor.hpp
+            include/beman/any_view/detail/iterator_interface.hpp
+            include/beman/any_view/detail/type_traits.hpp
+            include/beman/any_view/detail/utility.hpp
+            include/beman/any_view/detail/view_adaptor.hpp
+            include/beman/any_view/detail/view_interface.hpp
+            include/beman/any_view/any_view_options.hpp
+            include/beman/any_view/any_view.hpp
+            include/beman/any_view/concepts.hpp
 )
 
+include(GNUInstallDirs)
+
 install(
-    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
-    FILES_MATCHING
-    PATTERN "${CMAKE_CURRENT_SOURCE_DIR}/include/beman/any_view/*.hpp"
-    PATTERN "${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/*.hpp"
+    TARGETS beman.any_view
+    EXPORT beman.any_view-targets
+    FILE_SET HEADERS
 )
path: CMakeLists.txt
user: login: nickelpro
body: Under no circumstances
created_at: 2025-05-20T04:56:10Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
path: CMakeLists.txt
user: login: patrickroberts
body: Would prefer not to remove this, can you explain why this is relevant?
created_at: 2025-05-20T04:56:54Z
author_association: COLLABORATOR
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_BINARY_DIR}/include/beman/any_view/config.hpp
path: CMakeLists.txt
user: login: nickelpro
body: This should probably be `CMAKE_CURRENT_BINARY_DIR` actually, will fix

The reason is because that's where `configure_file()` is going to put its output:

>  relative path is treated with respect to the value of CMAKE_CURRENT_BINARY_DIR
created_at: 2025-05-20T05:01:24Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
path: CMakeLists.txt
user: login: wusatosi
body: Maybe because it might affect compile arguments, violating [CMAKE.PASSIVE_PROJECTS]
created_at: 2025-05-20T05:01:59Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
path: CMakeLists.txt
user: login: nickelpro
body: This determines the CXX standard that CMake will use, **[CMAKE.PASSIVE_PROJECTS]** states that:

> User-provided compilation flags, whether specified via presets, command-line options, or toolchains, must not be modified by CMake projects. Therefore, CMake projects may not set variables that impact compilation flags

If you want to build and test with extensions turned off, do so, but if the user wants extensions turned on globally via their toolchain file or whatever a project shouldn't modify that default.
created_at: 2025-05-20T05:05:04Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
        BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include include
```

<!-- __reviewdog__:ChBmNmIwNjZkY2U3YmZjNmRjEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T05:07:12Z
author_association: NONE
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_BINARY_DIR}/include/beman/any_view/config.hpp
path: CMakeLists.txt
user: login: nickelpro
body: Fixed
created_at: 2025-05-20T05:07:17Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: nickelpro
body: Yes, inlining these is still bad and confusing, thanks reviewdog
created_at: 2025-05-20T05:07:55Z
author_association: MEMBER
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: patrickroberts
body: Feel free to use [`# cmake-format: off`](https://cmake-format.readthedocs.io/en/latest/format-features.html#disable-formatting-locally) (and subsequently `# cmake-format: on`, please) around sections you have strong opinions contrary to the formatter, because doing so will be necessary to pass the lint check on CI.
created_at: 2025-05-20T05:22:34Z
author_association: COLLABORATOR
diff_hunk: @@ -44,38 +50,59 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
 
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: nickelpro
body: Thanks, didn't know the correct rain dance
created_at: 2025-05-20T05:23:48Z
author_association: MEMBER
diff_hunk: @@ -44,37 +50,60 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
-
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+# cmake-format doesn't understand key-value pairs or FILE_SET conventions
+# cmake-format: off
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
    PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON EXPORT_NAME any_view
```

<!-- __reviewdog__:ChBkMjA5ZTZmMTIzMDZkYmYzEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T05:29:37Z
author_association: NONE
diff_hunk: @@ -44,37 +50,60 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
-
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+# cmake-format doesn't understand key-value pairs or FILE_SET conventions
+# cmake-format: off
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
        BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/include include
```

<!-- __reviewdog__:ChBhN2M4YmFlYTZkMDE3ZjYxEgpwcmUtY29tbWl0 -->

created_at: 2025-05-20T05:29:37Z
author_association: NONE
diff_hunk: @@ -44,37 +50,60 @@ configure_file(
     @ONLY
 )
 
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-include(FetchContent)
-include(GNUInstallDirs)
-
 # [CMAKE.LIBRARY_NAME]
 add_library(beman.any_view INTERFACE)
 # [CMAKE.LIBRARY_ALIAS]
 add_library(beman::any_view ALIAS beman.any_view)
-target_include_directories(
+
+# cmake-format doesn't understand key-value pairs or FILE_SET conventions
+# cmake-format: off
+set_target_properties(
     beman.any_view
-    INTERFACE
-        $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
-        $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
-        $<INSTALL_INTERFACE:include>
+    PROPERTIES
+        VERIFY_INTERFACE_HEADER_SETS ON
+        EXPORT_NAME any_view
 )
 
-install(
-    TARGETS beman.any_view
-    EXPORT ${TARGETS_EXPORT_NAME}
-    DESTINATION
-    $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
+target_sources(
+    beman.any_view
+    PUBLIC
+        FILE_SET HEADERS
+        BASE_DIRS
+            ${CMAKE_CURRENT_BINARY_DIR}/include
+            include
+        FILES
+            ${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/config.hpp
+            include/beman/any_view/detail/any_iterator.hpp
+            include/beman/any_view/detail/concepts.hpp
+            include/beman/any_view/detail/intrusive_small_ptr.hpp
+            include/beman/any_view/detail/iterator_adaptor.hpp
+            include/beman/any_view/detail/iterator_interface.hpp
+            include/beman/any_view/detail/type_traits.hpp
+            include/beman/any_view/detail/utility.hpp
+            include/beman/any_view/detail/view_adaptor.hpp
+            include/beman/any_view/detail/view_interface.hpp
+            include/beman/any_view/any_view_options.hpp
+            include/beman/any_view/any_view.hpp
+            include/beman/any_view/concepts.hpp
 )
 
+include(GNUInstallDirs)
+
 install(
-    DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
-    FILES_MATCHING
-    PATTERN "${CMAKE_CURRENT_SOURCE_DIR}/include/beman/any_view/*.hpp"
-    PATTERN "${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/*.hpp"
+    TARGETS beman.any_view
+    EXPORT beman.any_view-targets
+    FILE_SET HEADERS
 )
path: CMakeLists.txt
user: login: github-actions[bot]
body: **[pre-commit]** <sub>reported by [reviewdog](https://github.com/reviewdog/reviewdog) :dog:</sub><br>
```suggestion
install(TARGETS beman.any_view EXPORT beman.any_view-targets FILE_SET HEADERS)
```

<!-- __reviewdog__:Cg84NmM2MjUzYWU3NTkzODkSCnByZS1jb21taXQ= -->

created_at: 2025-05-20T05:29:37Z
author_association: NONE

PR comments:
user: login: nickelpro
created_at: 2025-05-20T04:56:19Z
body: Reviewdog's CMake lints are actively harmful and should be ignored.
author_association: MEMBER
user: login: wusatosi
created_at: 2025-05-20T05:01:31Z
body: > Reviewdog's CMake lints are actively harmful and should be ignored.

This is one of the only CMake linter that is still being actively maintained... :|
author_association: MEMBER
user: login: nickelpro
created_at: 2025-05-20T05:31:19Z
body: Well so much for that plan. I'll do the suggestions just to get this through but honestly there's zero value to the cmake formatters / linters, none of them understand CMake semantics and they amount to (bad) whitespace formatters.
author_association: MEMBER
user: login: patrickroberts
created_at: 2025-05-20T05:33:44Z
body: > Well so much for that plan. I'll do the suggestions just to get this through but honestly there's zero value to the cmake formatters / linters, none of them understand CMake semantics and the amount to (bad) whitespace formatters.

Thanks, I'll play around and try to get it passing on my end with the formatting you attempted here, then open a follow-up PR.
author_association: COLLABORATOR