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

Add waves #541

Merged
merged 6 commits into from
Jan 28, 2022
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
71 changes: 71 additions & 0 deletions examples/waves/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(ignition-rendering-waves)

include_directories(SYSTEM
${PROJECT_BINARY_DIR}
)

find_package(ignition-rendering6)

set(TARGET_THIRD_PARTY_DEPENDS "")

if (APPLE OR UNIX)
find_package(GLUT REQUIRED)
include_directories(SYSTEM ${GLUT_INCLUDE_DIRS})
link_directories(${GLUT_LIBRARY_DIRS})

find_package(OpenGL REQUIRED)
include_directories(SYSTEM ${OpenGL_INCLUDE_DIRS})
link_directories(${OpenGL_LIBRARY_DIRS})
set(TARGET_THIRD_PARTY_DEPENDS
${TARGET_THIRD_PARTY_DEPENDS}
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()

if (NOT APPLE)
find_package(GLEW REQUIRED)
if (WIN32)
set(TARGET_THIRD_PARTY_DEPENDS
${TARGET_THIRD_PARTY_DEPENDS}
GLEW::glew
)
else ()
set(TARGET_THIRD_PARTY_DEPENDS
${TARGET_THIRD_PARTY_DEPENDS}
GLEW
)
endif()
endif()

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting a compilation error from missing the example_config.hh.in in the waves example directory and I fixed it temporarily by just taking the file from the other examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, added file in 56309b1


if (WIN32)
find_package(FreeGLUT REQUIRED)
set(TARGET_THIRD_PARTY_DEPENDS ${TARGET_THIRD_PARTY_DEPENDS} FreeGLUT::freeglut)
endif()

add_executable(waves Main.cc GlutWindow.cc)

target_link_libraries(waves
${IGNITION-RENDERING_LIBRARIES}
${TARGET_THIRD_PARTY_DEPENDS}
)

if (WIN32)
set_target_properties(waves
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${PROJECT_BINARY_DIR}
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${PROJECT_BINARY_DIR}
)
endif()

add_custom_command(TARGET waves POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/media
$<TARGET_FILE_DIR:waves>/media)
Loading