Skip to content

Commit 8f2d612

Browse files
committed
Add global CMake for projects
1 parent 1d97744 commit 8f2d612

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Contributing to the tutorials
22

3-
## Add a new exercise
3+
## Add a new exercise or a new project
44

5-
### Exercise structure
5+
### Directory structure
66

77
```
88
new_exercise/
@@ -18,14 +18,14 @@ new_exercise/
1818

1919
### Testing
2020

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

2424
```cmake
2525
add_subdirectory(my_exercise)
2626
```
2727

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

3030
```cmake
3131
add_test(
@@ -34,4 +34,6 @@ add_test(
3434
)
3535
```
3636

37+
You can customise the `COMMAND` with any extra arguments for the test.
38+
3739
The new exercise will be automatically built and tested by the CI.

exercises/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.21)
22

3-
project(CexaKokkosTutorials LANGUAGES CXX)
3+
project(CexaKokkosTutorialsExercises LANGUAGES CXX)
44

55
enable_testing()
66

projects/01_wave/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required (VERSION 3.21)
2+
3+
project(01Wave LANGUAGES CXX)
4+
5+
add_subdirectory(exercise)
6+
add_subdirectory(openmp)
7+
add_subdirectory(sequential)
8+
add_subdirectory(solution)
9+

projects/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required (VERSION 3.21)
2+
3+
project(CexaKokkosTutorialsProjects LANGUAGES CXX)
4+
5+
enable_testing()
6+
7+
add_subdirectory(01_wave)

0 commit comments

Comments
 (0)