diff --git a/examples/heightmap/CMakeLists.txt b/examples/heightmap/CMakeLists.txt index c40dd33f8..c20213ff2 100644 --- a/examples/heightmap/CMakeLists.txt +++ b/examples/heightmap/CMakeLists.txt @@ -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 MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") +endif() configure_file (example_config.hh.in ${PROJECT_BINARY_DIR}/example_config.hh) diff --git a/examples/heightmap/Main.cc b/examples/heightmap/Main.cc index 82db73326..32ea61ea4 100644 --- a/examples/heightmap/Main.cc +++ b/examples/heightmap/Main.cc @@ -22,6 +22,8 @@ #include #include #include +#else + #include #endif #include @@ -39,8 +41,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 createImageHeightmaps(const ScenePtr _scene, VisualPtr _root) diff --git a/tutorials/21_heightmap.md b/tutorials/21_heightmap.md index 93b24fd5f..894ed4d49 100644 --- a/tutorials/21_heightmap.md +++ b/tutorials/21_heightmap.md @@ -6,7 +6,7 @@ It loads 2 different heightmaps (image and Digital Elevation Model (DEM)) with d ## Compile and run the example -Clone the source code, create a build directory and use `cmake` and `make` to compile the code: +Clone the source code, create a build directory and use `cmake` to compile the code: ```{.sh} git clone https://github.com/gazebosim/gz-rendering @@ -14,12 +14,19 @@ cd gz-rendering/examples/heightmap mkdir build cd build cmake .. -make +# Linux +cmake --build . +# Windows +cmake --build . --config Release ``` Example 1 (image heightmap): ```{.sh} +# Linux ./heightmap + +# Windows +.\Release\heightmap.exe ``` You'll see: