Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/depth_camera: Fixed windows usage #1060

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/depth_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ if (NOT APPLE)
link_directories(${GLEW_LIBRARY_DIRS})
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()

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

Expand Down
5 changes: 5 additions & 0 deletions examples/depth_camera/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@
using namespace gz;
using namespace rendering;

#if not defined(_WIN32)
const std::string RESOURCE_PATH =
common::joinPaths(std::string(PROJECT_BINARY_PATH), "media");
#else
const std::string RESOURCE_PATH =
common::joinPaths(std::string(PROJECT_BINARY_PATH), "..", "media");
#endif

void buildScene(ScenePtr _scene)
{
Expand Down
13 changes: 12 additions & 1 deletion tutorials/23_depth_camera_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ This example shows how to use the depth camera.
In order to compile this tutorial, you need to install some prerequisites :

```bash
# Linux
sudo apt-get install build-essential freeglut3-dev libglew-dev

# Windows (via conda)
conda install glew --channel conda-forge
```

## Compile and run the example
Expand All @@ -20,13 +24,20 @@ cd gz-rendering/examples/depth_camera
mkdir build
cd build
cmake ..
make
# On Linux
cmake --build .
# On Windows
cmake --build . --config Release
```

Execute the example:

```{.sh}
# Linux
./depth_camera ogre

# Windows
.\Release\depth_camera.exe ogre
```

You'll see:
Expand Down
Loading