Files
ctrff-pub/CMakeLists.txt
tobid7 022d69dc8e Add Pica Texture Encoding Decoding
Supported Formats: A4, A8, L4, L8, RGB565, RGB888 RGBA8888 (for now)
Add a .clang-format
Move ctrff into a subdirectory
Replace the BCLIM creation part with Pica encoder
Fix non const RGB565ToRGBA issue
2026-01-06 21:51:51 +01:00

43 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.22)
project(ctrff)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
option(CTRFF_DESKTOP OFF "Buid for Desktop Platform")
option(CTRFF_3DS OFF "Build lib for 3ds")
if(${CTRFF_3DS})
set(CTRFF_DESKTOP OFF CACHE BOOL)
set(CTRFF_BUILD_GUI OFF CACHE BOOL)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{DEVKITPRO})
set(CMAKE_TOOLCHAIN_FILE "$ENV{DEVKITPRO}/cmake/3DS.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define DEVKITPRO to point to your SDK path!")
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-psabi -O3")
endif()
add_library(ctrff STATIC
source/3dsx.cpp
source/bclim.cpp
source/bcstm.cpp
source/bcwav.cpp
source/binutil.cpp
source/helper.cpp
source/lz11.cpp
source/pica.cpp
source/smdh.cpp
)
target_include_directories(ctrff PUBLIC include)
if(${CTRFF_DESKTOP})
add_subdirectory(tools)
endif()
install(TARGETS ctrff)
install(DIRECTORY include DESTINATION ".")