Dawn/CMakeLists.txt
2023-11-02 10:39:50 -05:00

58 lines
1.5 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")
# 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_TOOLS_DIR "${DAWN_ROOT_DIR}/tools")
set(DAWN_ASSETS_SOURCE_DIR "${DAWN_ROOT_DIR}/assets")
set(DAWN_ASSETS_BUILD_DIR "${DAWN_BUILD_DIR}/assets")
set(DAWN_GENERATED_DIR "${DAWN_BUILD_DIR}/generated")
set(DAWN_TEMP_DIR "${DAWN_BUILD_DIR}/temp")
# Add CMake Tools
add_subdirectory(cmake)
set(DAWN_BUILD_BINARY ${DAWN_BUILD_DIR}/src/${DAWN_BUILDING}/${DAWN_TARGET_NAME})
# Initialize Project First.
project(Dawn
VERSION 1.0.0
LANGUAGES C CXX
)
# Setup tests
add_executable(dawntests)
target_link_libraries(dawntests PRIVATE Catch2::Catch2WithMain)
target_compile_definitions(dawntests
PUBLIC
DAWN_ASSET_LOCATION="${DAWN_ROOT_DIR}/test/data"
)
# Add tools
add_subdirectory(tools)
# Add Libraries
add_subdirectory(lib)
# Add Project Files
add_subdirectory(src)
# Run tests
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
include(CTest)
include(Catch)
catch_discover_tests(dawntests)