-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a proof of concept that turns exemplar into a template that generates skeleton Beman projects using the [cargo-generate tool](https://github.com/cargo-generate/cargo-generate). See https://github.com/camio/foobar.git for an example skeleton called "foobar" generated from this template. Use of this template requires a cargo-generate installation: 1. [Install Rust](https://www.rust-lang.org/tools/install) (a cargo-generate prerequisite) 2. `cargo install cargo-generate` (detailed instructions [here](https://cargo-generate.github.io/cargo-generate/installation.html)) Once `cargo-generate` is installed, run ``` cargo generate gh:camio/example --branch cargo-generate ``` and follow the prompts to generate a template.
- Loading branch information
Showing
13 changed files
with
63 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.github/workflows/pre-commit.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
add_library(beman.{{project-name}} STATIC) | ||
add_library(beman::{{project-name}} ALIAS beman.{{project-name}}) | ||
|
||
target_sources(beman.{{project-name}} PRIVATE identity.cpp) | ||
|
||
target_sources( | ||
beman.{{project-name}} | ||
PUBLIC | ||
FILE_SET HEADERS | ||
BASE_DIRS ${PROJECT_SOURCE_DIR}/include | ||
FILES ${PROJECT_SOURCE_DIR}/include/beman/{{project-name}}/identity.hpp | ||
) | ||
|
||
set_target_properties(beman.{{project-name}} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON) | ||
|
||
install( | ||
TARGETS beman.{{project-name}} | ||
EXPORT beman.{{project-name}} | ||
DESTINATION | ||
$<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_BINDIR} | ||
FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
) |
2 changes: 1 addition & 1 deletion
2
src/beman/exemplar/identity.cpp → src/beman/{{project-name}}/identity.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <beman/exemplar/identity.hpp> | ||
#include <beman/{{project-name}}/identity.hpp> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
include(GoogleTest) | ||
|
||
add_executable(beman.{{project-name}}.tests.identity) | ||
target_sources(beman.{{project-name}}.tests.identity PRIVATE identity.test.cpp) | ||
target_link_libraries( | ||
beman.{{project-name}}.tests.identity | ||
PRIVATE beman::{{project-name}} GTest::gtest GTest::gtest_main | ||
) | ||
|
||
gtest_add_tests(beman.{{project-name}}.tests.identity "" AUTO) |
4 changes: 2 additions & 2 deletions
4
tests/beman/exemplar/identity.test.cpp → .../beman/{{project-name}}/identity.test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters