cmake_minimum_required(VERSION 3.5) project(gba_display_bitmap CXX C ASM) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Enable link time optimization for this project and all libraries add_compile_options("-flto") 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") # Generated graphics source and header files file(GLOB proj_gfx_sources LIST_DIRECTORIES false CONFIGURE_DEPENDS graphics/bin/*.s) set(proj_gfx_include "graphics/bin") # Add sources to targe target_sources(${PROJECT_NAME} PRIVATE "${proj_sources}") target_sources(${PROJECT_NAME} PRIVATE "${proj_gfx_sources}") target_include_directories(${PROJECT_NAME} PRIVATE "${proj_include}") target_include_directories(${PROJECT_NAME} PRIVATE "${proj_gfx_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 etl) gba_create_rom(${PROJECT_NAME}) add_subdirectory(mtl) add_subdirectory(etl)