3DEngine/CMakeLists.txt

47 lines
1.3 KiB
CMake

# Configure with [fxsdk build-fx] or [fxsdk build-cg], which provide the
# toolchain file and module path of the fxSDK
cmake_minimum_required(VERSION 3.15)
project(3Dengine VERSION 1.0 LANGUAGES CXX C ASM)
include(GenerateG3A)
include(Fxconv)
find_package(Gint 2.10 REQUIRED)
find_package(LibProf 2.4 REQUIRED)
set(SOURCES
src/main.cpp
src/utilities/extrakeyboard.cpp
src/utilities/utilities.cpp
src/3dengine/fastmath_num.cpp
src/3dengine/vector3D_num16.cpp
src/3dengine/matrix3D_num16.cpp
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
# ...
)
set(ASSETS_fx
assets-fx/example.png
# ...
)
set(ASSETS_cg
assets-cg/example.png
# ...
)
fxconv_declare_assets(${ASSETS_cg} WITH_METADATA)
add_executable(3Dengine ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(3Dengine PRIVATE -Wall -Wextra -Wattributes -O3 -std=c++20)
target_link_options(3Dengine PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage -fno-use-cxa-atexit -fpermissive)
target_link_libraries(3Dengine -lnum LibProf::LibProf Gint::Gint -lstdc++)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET 3Dengine OUTPUT "3DEngine.g3a"
NAME "3D Engine" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()