CMakeLists.txt 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. cmake_minimum_required(VERSION 2.8.11)
  2. option(BUILD_EMULATOR "Build with cpp3ds emulator (Qt5 required)" OFF)
  3. option(BUILD_TESTS "Build unit tests" OFF)
  4. # Project name without spaces or special characters
  5. project("cpp3ds-temp-re")
  6. set(APP_TITLE "CPPTemplate")
  7. set(APP_DESCRIPTION "CPP3DS Template 2.0")
  8. set(APP_AUTHOR "arc13")
  9. set(APP_ICON ${PROJECT_SOURCE_DIR}/res/app/icon.png)
  10. # First one is Title Version, second is the readable version
  11. set(APP_VERSION 1024)
  12. # CIA settings
  13. set(APP_UNIQUE_ID 0xC663D) # This must be unique for your CIA project
  14. set(APP_PRODUCT_CODE ${PROJECT_NAME})
  15. set(BANNER_IMAGE ${PROJECT_SOURCE_DIR}/res/app/banner.png)
  16. set(BANNER_SOUND ${PROJECT_SOURCE_DIR}/res/app/banner.wav)
  17. set(ICON_FLAGS --flags visible,ratingrequired,recordusage,savedata --cero 153 --esrb 153 --usk 153 --pegigen 153 --pegiptr 153 --pegibbfc 153 --cob 153 --grb 153 --cgsrr 153)
  18. set(CIA_CONFIG ${PROJECT_SOURCE_DIR}/res/app/cia.rsf)
  19. # Include cpp3ds cmake module
  20. set(CPP3DS $ENV{CPP3DS})
  21. if(NOT CPP3DS)
  22. message(FATAL_ERROR "You need to set the env variable CPP3DS before compiling.")
  23. endif()
  24. set(CMAKE_MODULE_PATH "${CPP3DS}/cmake" ${CMAKE_MODULE_PATH})
  25. include(cpp3ds)
  26. include_directories(
  27. ${PROJECT_SOURCE_DIR}/external/tween-engine/include
  28. )
  29. FILE(GLOB_RECURSE TWEEN_ENGINE_SOURCE ${PROJECT_SOURCE_DIR}/external/tween-engine/src/*.cpp)
  30. set(SOURCE_FILES
  31. ${PROJECT_SOURCE_DIR}/src/main.cpp
  32. ${PROJECT_SOURCE_DIR}/src/Template.cpp
  33. ${PROJECT_SOURCE_DIR}/src/MusicBCSTM.cpp
  34. ${PROJECT_SOURCE_DIR}/src/Util.cpp
  35. ${PROJECT_SOURCE_DIR}/src/AssetManager.hpp
  36. ${PROJECT_SOURCE_DIR}/src/Notification.cpp
  37. ${PROJECT_SOURCE_DIR}/src/Keyboard/Keyboard.cpp
  38. ${PROJECT_SOURCE_DIR}/src/Keyboard/tinyxml2.cpp
  39. ${PROJECT_SOURCE_DIR}/src/GUI/Button.cpp
  40. ${PROJECT_SOURCE_DIR}/src/GUI/NinePatch.cpp
  41. ${PROJECT_SOURCE_DIR}/src/GUI/Scrollable.cpp
  42. ${PROJECT_SOURCE_DIR}/src/GUI/ScrollBar.cpp
  43. ${PROJECT_SOURCE_DIR}/src/States/State.cpp
  44. ${PROJECT_SOURCE_DIR}/src/States/StateStack.cpp
  45. ${PROJECT_SOURCE_DIR}/src/States/DefaultState.cpp
  46. ${TWEEN_ENGINE_SOURCE}
  47. )
  48. set(ARM_SOURCE_FILES
  49. ${PROJECT_SOURCE_DIR}/src/KeyboardApplet.cpp
  50. )
  51. # Use either nihstro or picasso for your shader scripts
  52. set(SHADER_AS nihstro)
  53. FILE(GLOB_RECURSE SHADER_FILES ${PROJECT_SOURCE_DIR}/res/romfs/shaders/[^.]*.vsh)
  54. ##################################################
  55. # Don't usually need to change anything below
  56. ##################################################
  57. set(CPP3DS_ARM_FLAGS "-g -O3 -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft")
  58. set(CPP3DS_EMU_FLAGS "-O0")
  59. set(TEST_FLAGS "-O0 -coverage")
  60. include_directories(${DEVKITPRO}/portlibs/armv6k/include)
  61. set(CPP3DS_ARM_LIBS cpp3ds-window cpp3ds-network cpp3ds-graphics cpp3ds-audio cpp3ds-system citro3d ctru freetype png z vorbisidec ogg archive faad fmt)
  62. set(CPP3DS_EMU_LIBS cpp3ds-emu sfml-graphics sfml-window sfml-system sfml-audio openal GLEW GL jpeg freetype vorbisfile vorbis ogg ssl crypto pthread archive faad fmt)
  63. add_subdirectory(${CPP3DS}/cmake/template_arm build/arm)
  64. if(BUILD_EMULATOR)
  65. add_subdirectory(${CPP3DS}/cmake/template_emu build/emu)
  66. endif()
  67. if(BUILD_TESTS)
  68. add_subdirectory(test)
  69. endif()