Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25)
cmake_minimum_required(VERSION 3.28...4.2)

project(
beman.exemplar # CMake Project Name, which is also the name of the top-level
# targets (e.g., library, executable, etc.).
DESCRIPTION "A Beman Library Exemplar"
LANGUAGES CXX
VERSION 2.2.1
VERSION 0.1.0
)

# [CMAKE.SKIP_TESTS]
Expand All @@ -24,11 +24,13 @@ option(
${PROJECT_IS_TOP_LEVEL}
)

include(CTest)
# for find of beman-install-library
include(infra/cmake/beman-install-library-config.cmake)

add_subdirectory(src/beman/exemplar)

if(BEMAN_EXEMPLAR_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/exemplar)
endif()

Expand Down
8 changes: 5 additions & 3 deletions cookiecutter/{{cookiecutter.project_name}}/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25)
cmake_minimum_required(VERSION 3.28...4.2)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.28 is minimum for modules -- we should have that as minimum now

@wusatosi wusatosi Jan 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for commenting on closed PRs, we seems to be pretty aggressive on CMake versions, would this hurt our adaptability?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe-- but I think it's worth it for two reasons:

  • Consumers of these libraries probably need to build with fairly recent compilers/standards anyway because of the fact that these libraries are targeting standardization, so they're more likely to have up to date build tooling
  • CMake has been getting important features recently-- for example, even without modules, we need to require 3.28 because we use FILE_SETs now, which are much cleaner than previous mechanisms

@JeffGarland JeffGarland Jan 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also mention that most libraries are header only and we ignore the user drops headers into their project method of installing at your own risk. Which is to say, consumers don't necessarily use the cmake at all.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that use case is very "undefined" and not supported?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I think that's one persons view, not necessarily the consensus. And for me it should be a goal for a header only library to support as it's a frequent way to consume header only libraries. cmake is 100% our standard for bulding, packaging, and ci -- but that shouldn't prevent other common use cases. Let's say I had a Bazel project and I"m going to do the work to integrate it. For header only that means simply copy the files and putting them somewhere and doing and include. We might even want it for our own purposes. If I wanted to make an 'all the views super project' for beman I'd just need to clone the headers...


project(
beman.{{cookiecutter.project_name}} # CMake Project Name, which is also the name of the top-level
# targets (e.g., library, executable, etc.).
DESCRIPTION "{{cookiecutter.description}}"
LANGUAGES CXX
VERSION 2.2.1
VERSION 0.1.0
)

# [CMAKE.SKIP_TESTS]
Expand All @@ -24,11 +24,13 @@ option(
${PROJECT_IS_TOP_LEVEL}
)

include(CTest)
# for find of beman-install-library
include(infra/cmake/beman-install-library-config.cmake)

add_subdirectory(src/beman/{{cookiecutter.project_name}})

if(BEMAN_{{cookiecutter.project_name.upper()}}_BUILD_TESTS)
enable_testing()
add_subdirectory(tests/beman/{{cookiecutter.project_name}})
endif()

Expand Down