Skip to content
Open
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
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# CMakeLists.txt -*-CMake-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.27)
cmake_minimum_required(VERSION 3.27...4.3)

project(beman.optional VERSION 1.0.0 LANGUAGES CXX)

# Includes
include(CTest)
include(FetchContent)

set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}Targets)

option(
OPTIONAL_ENABLE_TESTING
"Enable building tests and test infrastructure"
${PROJECT_IS_TOP_LEVEL}
)

set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON)
set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL})

# Create the library target and named header set for beman.optional
add_library(beman.optional INTERFACE)
Expand Down Expand Up @@ -58,8 +58,8 @@ add_subdirectory(include/beman/optional)

add_subdirectory(examples)

find_package(beman-install-library REQUIRED)
beman_install_library(beman.optional FILE_SET beman_optional_headers)
include(infra/cmake/beman-install-library.cmake)
beman_install_library(beman.optional TARGETS beman.optional)

# Coverage
configure_file("cmake/gcovr.cfg.in" gcovr.cfg @ONLY)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ compile-headers: $(_build_path)/CMakeCache.txt ## Compile the headers
cmake --build $(_build_path) --config $(CONFIG) --target all_verify_interface_header_sets -- -k 0

install: $(_build_path)/CMakeCache.txt compile ## Install the project
cmake --install $(_build_path) --config $(CONFIG) --component beman.optional --verbose
cmake --install $(_build_path) --config $(CONFIG) --component optional_Development --verbose

.PHONY: clean-install
clean-install:
Expand Down
3 changes: 3 additions & 0 deletions infra/.beman_submodule
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[beman_submodule]
remote=https://github.com/bemanproject/infra.git
commit_hash=63cb577f6484f13ce3349de49ad5ce27e20bf1da
32 changes: 0 additions & 32 deletions infra/.github/workflows/beman-submodule.yml

This file was deleted.

21 changes: 1 addition & 20 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ so it does not respect the usual structure of a Beman library repository nor The

* `cmake/`: CMake modules and toolchain files used by Beman libraries.
* `containers/`: Containers used for CI builds and tests in the Beman org.
* `tools/`: Tools used to manage the infrastructure and the codebase (e.g., linting, formatting, etc.).

## Usage

This repository is intended to be used as a beman-submodule in other Beman repositories. See
[the Beman Submodule documentation](./tools/beman-submodule/README.md) for details.
[the beman-submodule documentation](https://github.com/bemanproject/beman-submodule) for details.


### CMake Modules
Expand Down Expand Up @@ -53,21 +52,3 @@ Some options for the project and target will also be supported:
* `BEMAN_INSTALL_CONFIG_FILE_PACKAGES` - a list of package names (e.g., `beman.something`) for which to install the config file
(default: all packages)
* `<BEMAN_NAME>_INSTALL_CONFIG_FILE_PACKAGE` - a per-project option to enable/disable config file installation (default: `ON` if the project is top-level, `OFF` otherwise). For instance for `beman.something`, the option would be `BEMAN_SOMETHING_INSTALL_CONFIG_FILE_PACKAGE`.

#### `beman_cmake_instrumentation`

The cmake modules in this library are intended to provide access to CMake instrumentation data in Google Trace format which is visualizable with chrome://tracing and https://ui.perfetto.dev.

Instrumentation may be enabled either by adding to the CMAKE_PROJECT_TOP_LEVEL_INCLUDES
```sh
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=infra/cmake/bemancmakeinstrumentation.cmake
```
or by calling explicitly within the CMakeList.txt file.
```cmake
find_package(BemanCMakeInstrumentation)
configure_beman_cmake_instrumentation()
```

In either form, CMake will call `instrumentation.sh` which will copy the trace data in json format into a `.trace` subdirectory within the build directory.

Multiple calls to `configure_beman_cmake_instrumentation` will only configure the callback hooks once, so it is safe to include multiple times, including by TOP_LEVEL_INCLUDE.
12 changes: 12 additions & 0 deletions infra/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# cmake/Config.cmake.in -*-makefile-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

include(CMakeFindDependencyMacro)

@BEMAN_FIND_DEPENDENCIES@

@PACKAGE_INIT@

include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)

check_required_components(@PROJECT_NAME@)
180 changes: 0 additions & 180 deletions infra/cmake/beman-install-library-config.cmake

This file was deleted.

Loading
Loading