#
# Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#

add_subdirectory(shaders)

set(SOURCE_FILES
    main_state.h
    ocean_renderer.cpp
    ocean_renderer.h
    sky_renderer.cpp
    sky_renderer.h
    test_util.cpp
    test_util.h
    ui_renderer.cpp
	Camera.cpp
)

include_directories("${CMAKE_CURRENT_BINARY_DIR}")

# Static targets 

if (WIN32 AND NOT (NO_DX11 AND NO_DX12))
    add_executable(example_d3d11_static main_d3d11.cpp "${SOURCE_FILES}")
    target_link_libraries(example_d3d11_static NVWaveWorks_static_d3d11 nvrhi_d3d11 applib_d3d11)
    set_target_properties(example_d3d11_static PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_d3d11_static shaders_bytecode_dx)

    add_executable(example_d3d12_static main_d3d12.cpp "${SOURCE_FILES}")
    target_link_libraries(example_d3d12_static NVWaveWorks_static_d3d12 applib_d3d12)
    set_target_properties(example_d3d12_static PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_d3d12_static shaders_bytecode_dx)

    install(TARGETS example_d3d11_static example_d3d12_static DESTINATION "bin")
endif()

if ((VULKAN_FOUND OR Vulkan_FOUND) AND NOT NO_VULKAN)
    add_executable(example_vk_static main_vk.cpp "${SOURCE_FILES}")
    target_link_libraries(example_vk_static NVWaveWorks_static_vk applib_vk)
    set_target_properties(example_vk_static PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_vk_static shaders_bytecode_vk)

    install(TARGETS example_vk_static DESTINATION "bin")
endif()

# Dynamic targets 

if (WIN32 AND NOT (NO_DX11 AND NO_DX12))
    add_executable(example_d3d11_dynamic main_d3d11.cpp "${SOURCE_FILES}")
    target_link_libraries(example_d3d11_dynamic NVWaveWorks_shared nvrhi_d3d11 applib_d3d11)
    set_target_properties(example_d3d11_dynamic PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_d3d11_dynamic shaders_bytecode_dx)

    add_executable(example_d3d12_dynamic main_d3d12.cpp "${SOURCE_FILES}")
    target_link_libraries(example_d3d12_dynamic NVWaveWorks_shared applib_d3d12)
    set_target_properties(example_d3d12_dynamic PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_d3d11_dynamic shaders_bytecode_dx)

    install(TARGETS example_d3d11_dynamic example_d3d12_dynamic DESTINATION "bin")
endif()

if ((VULKAN_FOUND OR Vulkan_FOUND) AND NOT NO_VULKAN)
    add_executable(example_vk_dynamic main_vk.cpp "${SOURCE_FILES}")
    target_link_libraries(example_vk_dynamic NVWaveWorks_shared applib_vk)
    set_target_properties(example_vk_dynamic PROPERTIES FOLDER "WaveWorks_example")
    add_dependencies(example_vk_dynamic shaders_bytecode_vk)

    install(TARGETS example_vk_dynamic DESTINATION "bin")
endif()