62 lines
1.6 KiB
CMake
62 lines
1.6 KiB
CMake
# Copyright (c) 2022 Dominic Masters
|
|
#
|
|
# This software is released under the MIT License.
|
|
# https://opensource.org/licenses/MIT
|
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
set(CMAKE_C_STANDARD 99)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
|
|
|
# Variable Caches
|
|
set(DAWN_CACHE_TARGET "dawn-target")
|
|
|
|
# CMake tools
|
|
add_subdirectory(cmake)
|
|
|
|
# Set Common Build Variables
|
|
set(DAWN_ROOT_DIR "${CMAKE_SOURCE_DIR}")
|
|
set(DAWN_BUILD_DIR "${CMAKE_BINARY_DIR}")
|
|
set(DAWN_SOURCES_DIR "${DAWN_ROOT_DIR}/src")
|
|
set(DAWN_TEMP_DIR "${DAWN_BUILD_DIR}/temp")
|
|
set(DAWN_TOOLS_DIR "${DAWN_ROOT_DIR}/tools")
|
|
set(DAWN_ASSETS_DIR "${DAWN_ROOT_DIR}/assets")
|
|
set(DAWN_ASSETS_BUILD_DIR "${DAWN_BUILD_DIR}/assets")
|
|
|
|
# Variables
|
|
set(DAWN_TARGET_NAME "Dawn" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
|
set(DAWN_ASSETS "" CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
|
set(DAWN_BUILD_BINARY ${DAWN_BUILD_DIR}/Dawn CACHE INTERNAL ${DAWN_CACHE_TARGET})
|
|
|
|
# Initialize Project First.
|
|
project(Dawn
|
|
VERSION 1.0.0
|
|
LANGUAGES C CXX
|
|
)
|
|
|
|
add_executable(${DAWN_TARGET_NAME})
|
|
|
|
# Add tools
|
|
add_subdirectory(tools)
|
|
|
|
# Libraries
|
|
add_subdirectory(lib)
|
|
|
|
# Sources
|
|
add_subdirectory(src)
|
|
|
|
# Append assets
|
|
add_dependencies(${DAWN_TARGET_NAME} dawnassets)
|
|
|
|
if(DAWN_BUILD_SYSTEM STREQUAL "vita")
|
|
vita_create_self(${DAWN_TARGET_NAME}.self ${DAWN_BUILD_BINARY})
|
|
vita_create_vpk(
|
|
${DAWN_TARGET_NAME}.vpk
|
|
${DAWN_VITA_TITLEID}
|
|
${DAWN_TARGET_NAME}.self
|
|
VERSION ${DAWN_VITA_VERSION}
|
|
NAME ${DAWN_VITA_APP_NAME}
|
|
)
|
|
endif() |