Skip to content

Commit 21993f0

Browse files
authored
examples/depth_camera: Fixed windows usage (#1060)
Signed-off-by: Martin Pecka <peci1@seznam.cz>
1 parent 6cf203d commit 21993f0

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

examples/depth_camera/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ if (NOT APPLE)
2020
link_directories(${GLEW_LIBRARY_DIRS})
2121
endif()
2222

23-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
23+
if(NOT WIN32)
24+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
25+
endif()
2426

2527
configure_file (example_config.hh.in ${PROJECT_BINARY_DIR}/example_config.hh)
2628

examples/depth_camera/Main.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@
3838
using namespace gz;
3939
using namespace rendering;
4040

41+
#if not defined(_WIN32)
4142
const std::string RESOURCE_PATH =
4243
common::joinPaths(std::string(PROJECT_BINARY_PATH), "media");
44+
#else
45+
const std::string RESOURCE_PATH =
46+
common::joinPaths(std::string(PROJECT_BINARY_PATH), "..", "media");
47+
#endif
4348

4449
void buildScene(ScenePtr _scene)
4550
{

tutorials/23_depth_camera_tutorial.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ This example shows how to use the depth camera.
77
In order to compile this tutorial, you need to install some prerequisites :
88

99
```bash
10+
# Linux
1011
sudo apt-get install build-essential freeglut3-dev libglew-dev
12+
13+
# Windows (via conda)
14+
conda install glew --channel conda-forge
1115
```
1216

1317
## Compile and run the example
@@ -20,13 +24,20 @@ cd gz-rendering/examples/depth_camera
2024
mkdir build
2125
cd build
2226
cmake ..
23-
make
27+
# On Linux
28+
cmake --build .
29+
# On Windows
30+
cmake --build . --config Release
2431
```
2532

2633
Execute the example:
2734

2835
```{.sh}
36+
# Linux
2937
./depth_camera ogre
38+
39+
# Windows
40+
.\Release\depth_camera.exe ogre
3041
```
3142

3243
You'll see:

0 commit comments

Comments
 (0)