cmake_minimum_required(VERSION 3.5) project(gba_fractal CXX C ASM) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(EXCEPTIONS "Enable exceptions" ON) option(RTTI "Enable RTTI" ON) if (EXCEPTIONS STREQUAL OFF) add_compile_options("-fno-exceptions") message("NO EXCEPTIONS") endif() if (EXCEPTIONS STREQUAL OFF) add_compile_options("-fno-rtti") message("NO RTTI") endif() add_link_options("-Wl,--print-memory-usage") add_executable(${PROJECT_NAME}) # Normal source and header files file(GLOB proj_sources LIST_DIRECTORIES false CONFIGURE_DEPENDS src/*.cpp src/*.c src/*.s) set(proj_include "include") # Add sources to targe target_sources(${PROJECT_NAME} PRIVATE "${proj_sources}") target_include_directories(${PROJECT_NAME} PRIVATE "${proj_include}") # Find pkg-config packages find_package(PkgConfig REQUIRED) pkg_check_modules(TONC libtonc) # Add libtonc directories target_link_directories(${PROJECT_NAME} PRIVATE ${TONC_LIBRARY_DIRS}) target_include_directories(${PROJECT_NAME} PRIVATE ${TONC_INCLUDE_DIRS}) target_link_libraries(${PROJECT_NAME} tonc mtl) gba_create_rom(${PROJECT_NAME}) add_subdirectory(mtl)