2019-04-30 16:42:59 +08:00
|
|
|
|
cmake_minimum_required(VERSION 3.0)
|
2018-11-26 20:22:19 +08:00
|
|
|
|
|
2018-11-27 14:30:52 +08:00
|
|
|
|
PROJECT(ULRE)
|
2018-11-26 20:22:19 +08:00
|
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
|
|
|
|
|
|
|
include(system_bit)
|
|
|
|
|
include(version)
|
|
|
|
|
include(compiler)
|
|
|
|
|
include(output_path)
|
2019-04-09 02:33:15 +08:00
|
|
|
|
include(FindVulkan)
|
2018-11-26 20:22:19 +08:00
|
|
|
|
|
|
|
|
|
check_system_bits()
|
|
|
|
|
check_system_version()
|
|
|
|
|
set_compiler_param()
|
|
|
|
|
set_output_directory()
|
2018-12-05 21:08:18 +08:00
|
|
|
|
|
2019-04-30 17:32:50 +08:00
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
|
add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN)
|
|
|
|
|
|
2019-04-09 02:33:15 +08:00
|
|
|
|
include_directories(${Vulkan_INCLUDE_DIRS})
|
2019-04-30 16:42:59 +08:00
|
|
|
|
|
2019-04-25 21:57:37 +08:00
|
|
|
|
SET(SPIRV_CROSS_PATH 3rdpty/SPIRV-Cross)
|
|
|
|
|
include_directories(${SPIRV_CROSS_PATH})
|
|
|
|
|
add_subdirectory(${SPIRV_CROSS_PATH})
|
2019-04-30 17:32:50 +08:00
|
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
|
|
|
|
|
add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
|
|
|
|
|
elseif(UNIX)
|
|
|
|
|
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
2019-04-30 16:42:59 +08:00
|
|
|
|
SET(RENDER_LIBRARY xcb)
|
2019-04-30 17:32:50 +08:00
|
|
|
|
else()
|
|
|
|
|
message(FATAL_ERROR "Unsupported Platform!")
|
2018-11-30 17:25:58 +08:00
|
|
|
|
ENDIF()
|
|
|
|
|
|
2019-04-09 02:33:15 +08:00
|
|
|
|
SET(VULKAN_LIB ${Vulkan_LIBRARIES})
|
|
|
|
|
|
2018-12-08 21:43:00 +08:00
|
|
|
|
add_definitions(-DMATH_USE_OPENGL)
|
|
|
|
|
add_definitions(-DMATH_RIGHTHANDED_CAMERA)
|
|
|
|
|
add_definitions(-DMATH_AVX)
|
2019-04-30 12:33:19 +08:00
|
|
|
|
add_definitions(-DGLFW_INCLUDE_VULKAN)
|
2018-12-08 21:43:00 +08:00
|
|
|
|
|
2019-03-22 23:04:14 +08:00
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdpty/MathGeoLib/src)
|
2019-04-29 17:17:31 +08:00
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdpty/NvTriStrip)
|
2019-03-22 23:04:14 +08:00
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
|
|
|
|
|
|
|
|
|
|
SET(ROOT_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/inc)
|
2018-11-27 15:43:32 +08:00
|
|
|
|
|
2018-11-27 14:30:52 +08:00
|
|
|
|
add_subdirectory(3rdpty/MathGeoLib)
|
2019-04-29 17:17:31 +08:00
|
|
|
|
add_subdirectory(3rdpty/NvTriStrip)
|
2018-11-27 20:03:07 +08:00
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
2018-12-05 21:08:18 +08:00
|
|
|
|
SET(ULRE ULRE.Base
|
2019-04-30 16:42:59 +08:00
|
|
|
|
ULRE.RenderDevice.Vulkan
|
2018-12-05 21:08:18 +08:00
|
|
|
|
ULRE.Platform
|
2018-11-30 13:57:57 +08:00
|
|
|
|
MathGeoLib
|
2019-04-30 16:42:59 +08:00
|
|
|
|
${RENDER_LIBRARY}
|
|
|
|
|
spirv-cross-core
|
|
|
|
|
${Vulkan_LIBRARY})
|
2018-11-30 13:57:57 +08:00
|
|
|
|
|
2018-11-27 15:43:32 +08:00
|
|
|
|
add_subdirectory(example)
|
2019-05-05 01:28:01 +08:00
|
|
|
|
add_executable(WIP WIP.cpp)
|