2020-02-05 20:58:58 +01:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
|
|
2020-02-25 00:44:40 +01:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED 17)
|
|
|
|
|
|
2020-02-05 20:58:58 +01:00
|
|
|
# Handle superbuild first
|
|
|
|
|
option (USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON)
|
|
|
|
|
|
2020-02-25 00:44:40 +01:00
|
|
|
set(ENGINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/src/Engine)
|
|
|
|
|
set(EXTERNAL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/external)
|
|
|
|
|
set(SLANG_ROOT ${EXTERNAL_ROOT}/slang)
|
|
|
|
|
set(BOOST_ROOT ${EXTERNAL_ROOT}/boost)
|
|
|
|
|
set(GLM_ROOT ${EXTERNAL_ROOT}/glm)
|
|
|
|
|
set(GLFW_ROOT ${EXTERNAL_ROOT}/glfw)
|
|
|
|
|
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
|
|
|
|
|
set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
|
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
|
|
|
|
|
|
2020-02-05 20:58:58 +01:00
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
|
set(Boost_LIB_PREFIX lib)
|
2020-03-25 11:55:50 +01:00
|
|
|
|
2020-03-17 02:41:33 +01:00
|
|
|
set(ENKITS_BUILD_EXAMPLES OFF CACHE BOOL "Build basic example applications" )
|
|
|
|
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "GLFW lib only" )
|
|
|
|
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "GLFW lib only" )
|
|
|
|
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "GLFW lib only" )
|
|
|
|
|
set(GLFW_BUILD_INSTALL OFF CACHE BOOL "GLFW lib only" )
|
2020-02-05 20:58:58 +01:00
|
|
|
|
|
|
|
|
if (USE_SUPERBUILD)
|
|
|
|
|
project (SUPERBUILD NONE)
|
|
|
|
|
# execute the superbuild (this script will be invoked again without the
|
|
|
|
|
# USE_SUPERBUILD option this time)
|
|
|
|
|
include (cmake/SuperBuild.cmake)
|
|
|
|
|
return() # stop processing this file further
|
|
|
|
|
else()
|
|
|
|
|
project (Seele)
|
|
|
|
|
endif()
|
|
|
|
|
|
2020-03-17 02:41:33 +01:00
|
|
|
add_subdirectory(${GLFW_ROOT})
|
2020-02-05 20:58:58 +01:00
|
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
|
find_package(Boost REQUIRED COMPONENTS serialization)
|
|
|
|
|
|
2020-03-17 02:41:33 +01:00
|
|
|
include_directories(${GLFW_ROOT}/include)
|
2020-02-05 20:58:58 +01:00
|
|
|
include_directories(${GLM_INCLUDE_DIRS})
|
|
|
|
|
include_directories(${Vulkan_INCLUDE_DIR})
|
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
2020-02-25 00:44:40 +01:00
|
|
|
include_directories(${SLANG_INCLUDE_DIRS})
|
|
|
|
|
include_directories(src/Engine)
|
2020-02-05 20:58:58 +01:00
|
|
|
add_definitions(${GLM_DEFINITIONS})
|
2020-02-25 00:44:40 +01:00
|
|
|
add_definitions(${Vulkan_DEFINITIONS})
|
|
|
|
|
add_definitions(${Boost_DEFINITIONS})
|
2020-03-02 19:07:49 +01:00
|
|
|
add_compile_definitions(GLFW_WINDOWS)
|
2020-03-17 02:41:33 +01:00
|
|
|
if(WIN32)
|
|
|
|
|
add_compile_definitions(USE_EXTENSIONS)
|
|
|
|
|
endif()
|
2020-02-25 00:44:40 +01:00
|
|
|
add_executable(SeeleEngine "")
|
|
|
|
|
add_subdirectory(src/)
|
2020-02-05 20:58:58 +01:00
|
|
|
target_link_libraries(SeeleEngine ${Boost_LIBRARIES})
|
|
|
|
|
target_link_libraries(SeeleEngine ${Vulkan_LIBRARY})
|
2020-03-17 02:41:33 +01:00
|
|
|
target_link_libraries(SeeleEngine glfw ${GLFW_LIBRARIES})
|
2020-02-25 00:44:40 +01:00
|
|
|
target_link_libraries(SeeleEngine ${SLANG_LIBRARY})
|
|
|
|
|
|
|
|
|
|
add_subdirectory(test/)
|
|
|
|
|
|
|
|
|
|
add_custom_command(TARGET SeeleEngine POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEPENDENT_BINARIES} $<TARGET_FILE_DIR:SeeleEngine>)
|
2020-02-05 20:58:58 +01:00
|
|
|
|