Skip to content

Commit 398f538

Browse files
committed
changed cmake instructiosn
1 parent 46d8b26 commit 398f538

File tree

3 files changed

+57
-20
lines changed

3 files changed

+57
-20
lines changed

docs/extra/cmake_advanced.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ add_compile_options(-std=c++17)
99
set(CMAKE_CXX_STANDARD 17)
1010
1111
# find components of a specific rmagine version
12-
# '2.2.1...' will get the newest rmagine which
13-
# is greater than 2.2.1
14-
find_package(rmagine 2.2.1...
12+
# '2.2.8' will get the newest rmagine which
13+
# is greater equal 2.2.8
14+
find_package(rmagine 2.2.8
1515
COMPONENTS
1616
core
1717
embree
@@ -27,6 +27,49 @@ target_link_libraries(my_rmagine_app
2727
)
2828
```
2929

30+
## CMake - Optional Components
31+
32+
```cmake
33+
add_compile_options(-std=c++17)
34+
set(CMAKE_CXX_STANDARD 17)
35+
36+
# find components of a specific rmagine version
37+
# '2.2.8' will get the newest rmagine which
38+
# is greater equal 2.2.8
39+
find_package(rmagine 2.2.8
40+
COMPONENTS
41+
core
42+
OPTIONAL_COMPONENTS
43+
embree
44+
cuda
45+
optix
46+
)
47+
48+
if(TARGET rmagine::embree)
49+
# Compile app with embree support,
50+
# if rmagine::embree was found
51+
add_executable(my_rmagine_embree_app
52+
src/my_rmagine_embree_app.cpp)
53+
target_link_libraries(my_rmagine_embree_app
54+
rmagine::core
55+
rmagine::embree
56+
)
57+
endif(TARGET rmagine::embree)
58+
59+
if(TARGET rmagine::optix)
60+
# Compile app with optix support,
61+
# if rmagine::optix was found
62+
add_executable(my_rmagine_optix_app
63+
src/my_rmagine_optix_app.cpp)
64+
target_link_libraries(my_rmagine_optix_app
65+
rmagine::core
66+
rmagine::cuda
67+
rmagine::optix
68+
)
69+
endif(TARGET rmagine::optix)
70+
```
71+
72+
3073
## CMake - FetchContent
3174

3275
Rmagine is compatible with CMake's FetchContent functionality. The following `CMakeListst.txt` shows how to use `FetchContent` and checks if the required targets have been built successfully.
@@ -39,24 +82,22 @@ add_compile_options(-std=c++17)
3982
set(CMAKE_CXX_STANDARD 17)
4083
4184
include(FetchContent)
42-
4385
set(FETCHCONTENT_QUIET FALSE)
44-
4586
FetchContent_Declare(
4687
rmagine
4788
GIT_REPOSITORY https://github.com/uos/rmagine.git
4889
GIT_TAG v2.2.9 # put 'main' here for latest
4990
GIT_PROGRESS TRUE
5091
)
51-
5292
FetchContent_MakeAvailable(rmagine)
5393
5494
if(NOT TARGET rmagine::embree)
5595
message(FATAL "Could not build rmagine's embree backand which is required for this executable")
5696
endif(NOT TARGET rmagine::embree)
5797
58-
add_executable(my_rmagine_app src/my_rmagine_app.cpp)
59-
target_link_libraries(my_rmagine_app
98+
add_executable(my_rmagine_embree_app
99+
src/my_rmagine_embree_app.cpp)
100+
target_link_libraries(my_rmagine_embree_app
60101
rmagine::core
61102
rmagine::embree)
62103
```

docs/installation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Rmagine provides an interface to integrate ray tracing libraries, we call backbo
2020

2121
### Embree Backbone (optional)
2222

23-
We support Embree in its latest version (test v4.0.1, v4.2.0):
23+
We support Embree in its latest version (tested: v4.0.1, v4.2.0):
2424

2525
```bash
2626
user@pc:~$ git clone https://github.com/embree/embree.git
@@ -34,7 +34,7 @@ For older Embree versions we refer to [this](/extra/embree3.md).
3434

3535
### OptiX Backbone (optional)
3636

37-
Rmagine supports NVIDIA OptiX versions of 7.2 or newer.
37+
Rmagine supports NVIDIA OptiX versions of 7.2 or newer (experimental support for OptiX 8).
3838
The OptiX-Library is installed via the GPU driver.
3939
The OptiX-Headers can be downloaded [here](https://developer.nvidia.com/designworks/optix/download).
4040
The Headers require a specific GPU driver and CUDA version to be installed on your system:
@@ -48,7 +48,6 @@ The Headers require a specific GPU driver and CUDA version to be installed on yo
4848
| 7.6 | 520.00 (untested) |
4949
| 7.7 | 530.41 |
5050

51-
5251
## Compilation
5352

5453
Download the Rmagine repository.

docs/integration.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ int main(int argc, char** argv)
2121
sim.setMap(map);
2222

2323
// go on (see workflow section)
24-
2524
return 0;
2625
}
2726
```
@@ -35,9 +34,9 @@ add_compile_options(-std=c++17)
3534
set(CMAKE_CXX_STANDARD 17)
3635
3736
# find components of a specific rmagine version
38-
# '2.2.1...' will get the newest rmagine which
39-
# is greater than 2.2.1
40-
find_package(rmagine 2.2.1...
37+
# '2.2.8' will get the newest rmagine which
38+
# is greater equal 2.2.8
39+
find_package(rmagine 2.2.8
4140
COMPONENTS
4241
core
4342
embree
@@ -72,7 +71,6 @@ int main(int argc, char** argv)
7271
sim.setMap(map);
7372

7473
// go on (see workflow section)
75-
7674
return 0;
7775
}
7876

@@ -87,9 +85,9 @@ add_compile_options(-std=c++17)
8785
set(CMAKE_CXX_STANDARD 17)
8886
8987
# find components of a specific rmagine version
90-
# '2.2.1...' will get the newest rmagine which
91-
# is greater than 2.2.1
92-
find_package(rmagine 2.2.1...
88+
# '2.2.8' will get the newest rmagine which
89+
# is greater equal 2.2.8
90+
find_package(rmagine 2.2.8
9391
COMPONENTS
9492
core
9593
cuda
@@ -107,5 +105,4 @@ target_link_libraries(my_rmagine_app
107105
)
108106
```
109107

110-
111108
For more details and alternate ways of integrating Rmagine into your CMake project we refer to: [CMake - Advanced](/extra/cmake_advanced.md).

0 commit comments

Comments
 (0)