Skip to content

Commit

Permalink
Add global CMake for projects
Browse files Browse the repository at this point in the history
  • Loading branch information
pzehner committed Jan 14, 2025
1 parent bd85290 commit d1692bc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Contributing to the tutorials

## Add a new exercise
## Add a new exercise or a new project

### Exercise structure
### Directory structure

```
new_exercise/
Expand All @@ -18,14 +18,14 @@ new_exercise/

### Testing

Exercises should be tested in the CI.
To do so, edit `exercises/CMakeLists.txt` to append your exercise directory with `add_subdirectory`:
Exercises and projects should be tested in the CI.
To do so, edit `exercises/CMakeLists.txt` or `projects/CMakeLists.txt` to append your exercise directory with `add_subdirectory`:

```cmake
add_subdirectory(my_exercise)
```

In your `solution/CMakeLists.txt`, add your solution target as a test.
In your `solution/CMakeLists.txt` (or any build you want to test), add your solution target as a test.

```cmake
add_test(
Expand All @@ -34,4 +34,6 @@ add_test(
)
```

You can customise the `COMMAND` with any extra arguments for the test.

The new exercise will be automatically built and tested by the CI.
2 changes: 1 addition & 1 deletion exercises/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.21)

project(CexaKokkosTutorials LANGUAGES CXX)
project(CexaKokkosTutorialsExercises LANGUAGES CXX)

enable_testing()

Expand Down
9 changes: 9 additions & 0 deletions projects/01_wave/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required (VERSION 3.21)

project(01Wave LANGUAGES CXX)

add_subdirectory(exercise)
add_subdirectory(openmp)
add_subdirectory(sequential)
add_subdirectory(solution)

7 changes: 7 additions & 0 deletions projects/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required (VERSION 3.21)

project(CexaKokkosTutorialsProjects LANGUAGES CXX)

enable_testing()

add_subdirectory(01_wave)

0 comments on commit d1692bc

Please sign in to comment.