2015-04-08 18:47:55 +00:00
|
|
|
# Minimum cmake version required
|
2020-05-11 10:38:59 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2015-04-08 18:47:55 +00:00
|
|
|
|
|
|
|
# Project configuration
|
2020-05-11 10:38:59 +00:00
|
|
|
project(Testbed)
|
2015-04-08 18:47:55 +00:00
|
|
|
|
2020-05-11 10:38:59 +00:00
|
|
|
add_subdirectory(nanogui/)
|
2015-04-08 18:47:55 +00:00
|
|
|
|
|
|
|
# Copy the shaders used for the demo into the build directory
|
2020-05-11 10:38:59 +00:00
|
|
|
file(COPY "shaders/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/shaders/")
|
2015-04-08 18:47:55 +00:00
|
|
|
|
2015-04-15 21:11:27 +00:00
|
|
|
# Copy the meshes used for the demo into the build directory
|
2020-05-11 10:38:59 +00:00
|
|
|
file(COPY "meshes/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/meshes/")
|
2015-04-15 21:11:27 +00:00
|
|
|
|
2015-04-08 18:47:55 +00:00
|
|
|
# Headers
|
2020-05-11 10:38:59 +00:00
|
|
|
include_directories("src/" "nanogui/include/" "opengl-framework/src/" "common/" "scenes/" ${NANOGUI_EXTRA_INCS})
|
2016-02-22 17:44:29 +00:00
|
|
|
|
|
|
|
# OpenGLFramework source files
|
2020-05-11 10:38:59 +00:00
|
|
|
set(OPENGLFRAMEWORK_SOURCES
|
2016-02-22 17:44:29 +00:00
|
|
|
opengl-framework/src/maths/Color.h
|
|
|
|
opengl-framework/src/maths/Matrix3.h
|
|
|
|
opengl-framework/src/maths/Matrix4.h
|
|
|
|
opengl-framework/src/maths/Vector2.h
|
|
|
|
opengl-framework/src/maths/Vector3.h
|
|
|
|
opengl-framework/src/maths/Vector4.h
|
|
|
|
opengl-framework/src/Camera.cpp
|
|
|
|
opengl-framework/src/Camera.h
|
|
|
|
opengl-framework/src/definitions.h
|
|
|
|
opengl-framework/src/FrameBufferObject.cpp
|
|
|
|
opengl-framework/src/FrameBufferObject.h
|
|
|
|
opengl-framework/src/Light.h
|
|
|
|
opengl-framework/src/Light.cpp
|
|
|
|
opengl-framework/src/Mesh.h
|
|
|
|
opengl-framework/src/Mesh.cpp
|
|
|
|
opengl-framework/src/MeshReaderWriter.h
|
|
|
|
opengl-framework/src/MeshReaderWriter.cpp
|
|
|
|
opengl-framework/src/Object3D.h
|
|
|
|
opengl-framework/src/Object3D.cpp
|
|
|
|
opengl-framework/src/openglframework.h
|
|
|
|
opengl-framework/src/Shader.h
|
|
|
|
opengl-framework/src/Shader.cpp
|
|
|
|
opengl-framework/src/Texture2D.h
|
|
|
|
opengl-framework/src/Texture2D.cpp
|
|
|
|
opengl-framework/src/TextureReaderWriter.h
|
|
|
|
opengl-framework/src/TextureReaderWriter.cpp
|
|
|
|
opengl-framework/src/VertexBufferObject.h
|
|
|
|
opengl-framework/src/VertexBufferObject.cpp
|
|
|
|
opengl-framework/src/VertexArrayObject.h
|
|
|
|
opengl-framework/src/VertexArrayObject.cpp
|
|
|
|
)
|
2015-04-08 18:47:55 +00:00
|
|
|
|
2015-04-15 21:11:27 +00:00
|
|
|
# Testbed source files
|
2020-05-11 10:38:59 +00:00
|
|
|
set(TESTBED_SOURCES
|
2015-04-15 21:11:27 +00:00
|
|
|
src/Main.cpp
|
|
|
|
src/TestbedApplication.h
|
|
|
|
src/TestbedApplication.cpp
|
|
|
|
src/Gui.h
|
|
|
|
src/Gui.cpp
|
|
|
|
src/Scene.h
|
|
|
|
src/Scene.cpp
|
2015-07-21 23:18:32 +00:00
|
|
|
src/SceneDemo.h
|
|
|
|
src/SceneDemo.cpp
|
2015-04-20 21:23:46 +00:00
|
|
|
src/Timer.h
|
|
|
|
src/Timer.cpp
|
2015-04-15 21:11:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Common source files
|
2020-05-11 10:38:59 +00:00
|
|
|
set(COMMON_SOURCES
|
2015-04-15 21:11:27 +00:00
|
|
|
common/Box.h
|
|
|
|
common/Box.cpp
|
|
|
|
common/Sphere.h
|
|
|
|
common/Sphere.cpp
|
|
|
|
common/Line.h
|
|
|
|
common/Line.cpp
|
|
|
|
common/Capsule.h
|
|
|
|
common/Capsule.cpp
|
|
|
|
common/ConvexMesh.h
|
|
|
|
common/ConvexMesh.cpp
|
2015-10-26 17:15:56 +00:00
|
|
|
common/ConcaveMesh.h
|
|
|
|
common/ConcaveMesh.cpp
|
2015-04-15 21:11:27 +00:00
|
|
|
common/Dumbbell.h
|
|
|
|
common/Dumbbell.cpp
|
2016-01-28 22:06:17 +00:00
|
|
|
common/HeightField.h
|
|
|
|
common/HeightField.cpp
|
2015-08-08 09:40:37 +00:00
|
|
|
common/PhysicsObject.h
|
|
|
|
common/PhysicsObject.cpp
|
2015-04-15 21:11:27 +00:00
|
|
|
common/VisualContactPoint.h
|
|
|
|
common/VisualContactPoint.cpp
|
2016-02-14 18:36:56 +00:00
|
|
|
common/PerlinNoise.h
|
|
|
|
common/PerlinNoise.cpp
|
2017-11-02 21:58:41 +00:00
|
|
|
common/AABB.h
|
|
|
|
common/AABB.cpp
|
2015-04-15 21:11:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Examples scenes source files
|
2020-05-11 10:38:59 +00:00
|
|
|
set(SCENES_SOURCES
|
2015-04-15 21:11:27 +00:00
|
|
|
scenes/cubes/CubesScene.h
|
|
|
|
scenes/cubes/CubesScene.cpp
|
|
|
|
scenes/joints/JointsScene.h
|
|
|
|
scenes/joints/JointsScene.cpp
|
|
|
|
scenes/raycast/RaycastScene.h
|
|
|
|
scenes/raycast/RaycastScene.cpp
|
|
|
|
scenes/collisionshapes/CollisionShapesScene.h
|
|
|
|
scenes/collisionshapes/CollisionShapesScene.cpp
|
2017-01-27 23:22:22 +00:00
|
|
|
scenes/collisiondetection/CollisionDetectionScene.h
|
|
|
|
scenes/collisiondetection/CollisionDetectionScene.cpp
|
2015-10-26 17:15:56 +00:00
|
|
|
scenes/concavemesh/ConcaveMeshScene.h
|
|
|
|
scenes/concavemesh/ConcaveMeshScene.cpp
|
2016-01-28 22:06:17 +00:00
|
|
|
scenes/heightfield/HeightFieldScene.h
|
|
|
|
scenes/heightfield/HeightFieldScene.cpp
|
2018-01-14 09:51:38 +00:00
|
|
|
scenes/cubestack/CubeStackScene.h
|
|
|
|
scenes/cubestack/CubeStackScene.cpp
|
2019-12-12 06:13:27 +00:00
|
|
|
scenes/pile/PileScene.h
|
|
|
|
scenes/pile/PileScene.cpp
|
2015-04-08 18:47:55 +00:00
|
|
|
)
|
|
|
|
|
2016-01-09 16:45:55 +00:00
|
|
|
# Add .user file to set debug path in Visual Studio
|
2020-05-11 10:38:59 +00:00
|
|
|
set(USER_FILE testbed.vcxproj.user)
|
|
|
|
set(VS_USERFILE_WORKING_DIRECTORY_DEBUG ${EXECUTABLE_OUTPUT_PATH})
|
|
|
|
set(OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${USER_FILE})
|
|
|
|
configure_file(VisualStudioUserTemplate.user ${USER_FILE} @ONLY)
|
2016-01-09 16:45:55 +00:00
|
|
|
|
2018-04-06 15:23:44 +00:00
|
|
|
# Compile definitions
|
2020-05-11 10:38:59 +00:00
|
|
|
add_definitions(${NANOGUI_EXTRA_DEFS})
|
2018-04-06 15:23:44 +00:00
|
|
|
|
2015-04-08 18:47:55 +00:00
|
|
|
# Create the executable
|
2020-05-11 10:38:59 +00:00
|
|
|
add_executable(testbed ${TESTBED_SOURCES} ${SCENES_SOURCES} ${COMMON_SOURCES} ${OPENGLFRAMEWORK_SOURCES})
|
2015-04-08 18:47:55 +00:00
|
|
|
|
2016-01-07 22:04:39 +00:00
|
|
|
# Enable C++11 features
|
|
|
|
set_property(TARGET testbed PROPERTY CXX_STANDARD 11)
|
|
|
|
set_property(TARGET testbed PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2015-04-08 18:47:55 +00:00
|
|
|
# Link with libraries
|
2020-05-11 10:38:59 +00:00
|
|
|
target_link_libraries(testbed reactphysics3d nanogui ${NANOGUI_EXTRA_LIBS})
|