Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ includes/
# Object files
*.o
*.obj
*.blend
81 changes: 81 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,75 @@ endif()

set_target_properties(testCPUBunny PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output)

# Debug BVH executable
add_executable(debugBVH
"Marching Cubes/debugBVH.cpp"
shader.cpp
mesh.cpp
model.cpp
${GEOMETRY_SOURCES}
${GLAD_SOURCES}
)

target_include_directories(debugBVH PRIVATE
${CMAKE_SOURCE_DIR}/includes
${CMAKE_SOURCE_DIR}/includes/glad
${CMAKE_SOURCE_DIR}/includes/glm
${CMAKE_SOURCE_DIR}
)

target_link_directories(debugBVH PRIVATE ${CMAKE_SOURCE_DIR}/lib/assimp/lib)
target_link_libraries(debugBVH
OpenGL::GL
glfw
assimp-vc143-mt
zlibstatic
)

if(WIN32 AND MSVC)
target_compile_definitions(debugBVH PRIVATE
WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS)
target_compile_options(debugBVH PRIVATE /external:W0 /external:anglebrackets /external:templates-)
endif()

set_target_properties(debugBVH PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output)

# Rubik's Cube executable
add_executable(RubiksCube
"Rubiks/window.cpp"
"Rubiks/RubiksCube.cpp"
"Rubiks/input.cpp"
"Rubiks/mouse_selector.cpp"
shader.cpp
mesh.cpp
model.cpp
${GEOMETRY_SOURCES}
${GLAD_SOURCES}
)

target_include_directories(RubiksCube PRIVATE
${CMAKE_SOURCE_DIR}/includes
${CMAKE_SOURCE_DIR}/includes/glad
${CMAKE_SOURCE_DIR}/includes/glm
${CMAKE_SOURCE_DIR}
)

target_link_directories(RubiksCube PRIVATE ${CMAKE_SOURCE_DIR}/lib/assimp/lib)
target_link_libraries(RubiksCube
OpenGL::GL
glfw
assimp-vc143-mt
zlibstatic
)

if(WIN32 AND MSVC)
target_compile_definitions(RubiksCube PRIVATE
WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS)
target_compile_options(RubiksCube PRIVATE /external:W0 /external:anglebrackets /external:templates-)
endif()

set_target_properties(RubiksCube PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/output)

# Platform-specific compiler settings
if(WIN32 AND MSVC)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_USER_PROPS "")
Expand Down Expand Up @@ -314,4 +383,16 @@ if(WIN32)
"${SFML_BIN_DIR}/sfml-system-d-2.dll"
"${SFML_BIN_DIR}/openal32.dll"
$<TARGET_FILE_DIR:MarchingTest>)

# Copy Assimp DLL for debugBVH
add_custom_command(TARGET debugBVH POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/lib/assimp/bin/assimp-vc143-mt.dll"
$<TARGET_FILE_DIR:debugBVH>)

# Copy Assimp DLL for RubiksCube
add_custom_command(TARGET RubiksCube POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/lib/assimp/bin/assimp-vc143-mt.dll"
$<TARGET_FILE_DIR:RubiksCube>)
endif()
Loading