CMakeLists.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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("clock")
  6. set(APP_TITLE "Clock")
  7. set(APP_DESCRIPTION "A simple clock app for the 3DS")
  8. set(APP_AUTHOR "arc13")
  9. set(APP_ICON ${PROJECT_SOURCE_DIR}/res/app/icon.png)
  10. set(APP_LOGO ${PROJECT_SOURCE_DIR}/res/app/logo.bcma.lz)
  11. # First one is Title Version, second is the readable version
  12. set(APP_VERSION 1041)
  13. add_definitions(-DCLOCK_DIR="sdmc:/3ds/data/Clock")
  14. # CIA settings
  15. set(APP_UNIQUE_ID 0xC10C4) # This must be unique for your CIA project
  16. set(APP_PRODUCT_CODE ${PROJECT_NAME})
  17. set(BANNER_IMAGE ${PROJECT_SOURCE_DIR}/res/app/banner.png)
  18. set(BANNER_SOUND ${PROJECT_SOURCE_DIR}/res/app/banner.wav)
  19. 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)
  20. set(CIA_CONFIG ${PROJECT_SOURCE_DIR}/res/app/cia.rsf)
  21. # Include cpp3ds cmake module
  22. set(CPP3DS $ENV{CPP3DS})
  23. if(NOT CPP3DS)
  24. message(FATAL_ERROR "You need to set the env variable CPP3DS before compiling.")
  25. endif()
  26. set(CMAKE_MODULE_PATH "${CPP3DS}/cmake" ${CMAKE_MODULE_PATH})
  27. include(cpp3ds)
  28. include_directories(
  29. ${PROJECT_SOURCE_DIR}/external/tween-engine/include
  30. ${PROJECT_SOURCE_DIR}/external/rapidjson/include
  31. )
  32. FILE(GLOB_RECURSE TWEEN_ENGINE_SOURCE ${PROJECT_SOURCE_DIR}/external/tween-engine/src/*.cpp)
  33. set(SOURCE_FILES
  34. ${PROJECT_SOURCE_DIR}/src/main.cpp
  35. ${PROJECT_SOURCE_DIR}/src/Clock.cpp
  36. ${PROJECT_SOURCE_DIR}/src/MusicBCSTM.cpp
  37. ${PROJECT_SOURCE_DIR}/src/MusicMP3.cpp
  38. ${PROJECT_SOURCE_DIR}/src/Util.cpp
  39. ${PROJECT_SOURCE_DIR}/src/AssetManager.hpp
  40. ${PROJECT_SOURCE_DIR}/src/Notification.cpp
  41. ${PROJECT_SOURCE_DIR}/src/TopInformations.cpp
  42. ${PROJECT_SOURCE_DIR}/src/ClockItem.cpp
  43. ${PROJECT_SOURCE_DIR}/src/CalendarBlock.cpp
  44. ${PROJECT_SOURCE_DIR}/src/Calendar.cpp
  45. ${PROJECT_SOURCE_DIR}/src/IconSet.cpp
  46. ${PROJECT_SOURCE_DIR}/src/Stopwatch.cpp
  47. ${PROJECT_SOURCE_DIR}/src/Chronometer.hpp
  48. ${PROJECT_SOURCE_DIR}/src/LapList.cpp
  49. ${PROJECT_SOURCE_DIR}/src/LapItem.cpp
  50. ${PROJECT_SOURCE_DIR}/src/Timer.cpp
  51. ${PROJECT_SOURCE_DIR}/src/AlarmItem.cpp
  52. ${PROJECT_SOURCE_DIR}/src/Alarm.cpp
  53. ${PROJECT_SOURCE_DIR}/src/Config.cpp
  54. ${PROJECT_SOURCE_DIR}/src/Keyboard/Keyboard.cpp
  55. ${PROJECT_SOURCE_DIR}/src/Keyboard/tinyxml2.cpp
  56. ${PROJECT_SOURCE_DIR}/src/GUI/Button.cpp
  57. ${PROJECT_SOURCE_DIR}/src/GUI/NinePatch.cpp
  58. ${PROJECT_SOURCE_DIR}/src/GUI/Scrollable.cpp
  59. ${PROJECT_SOURCE_DIR}/src/GUI/ScrollBar.cpp
  60. ${PROJECT_SOURCE_DIR}/src/States/State.cpp
  61. ${PROJECT_SOURCE_DIR}/src/States/StateStack.cpp
  62. ${PROJECT_SOURCE_DIR}/src/States/DefaultState.cpp
  63. ${PROJECT_SOURCE_DIR}/src/States/DialogState.cpp
  64. ${TWEEN_ENGINE_SOURCE}
  65. )
  66. set(ARM_SOURCE_FILES
  67. ${PROJECT_SOURCE_DIR}/src/KeyboardApplet.cpp
  68. )
  69. # Use either nihstro or picasso for your shader scripts
  70. set(SHADER_AS nihstro)
  71. FILE(GLOB_RECURSE SHADER_FILES ${PROJECT_SOURCE_DIR}/res/romfs/shaders/[^.]*.vsh)
  72. ##################################################
  73. # Don't usually need to change anything below
  74. ##################################################
  75. set(CPP3DS_ARM_FLAGS "-g -O3 -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft")
  76. set(CPP3DS_EMU_FLAGS "-O0")
  77. set(TEST_FLAGS "-O0 -coverage")
  78. include_directories(${DEVKITPRO}/portlibs/armv6k/include)
  79. set(CPP3DS_ARM_LIBS cpp3ds-window cpp3ds-network cpp3ds-graphics cpp3ds-audio cpp3ds-system citro3d ctru freetype png z vorbisidec ogg archive faad fmt)
  80. 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)
  81. add_subdirectory(${CPP3DS}/cmake/template_arm build/arm)
  82. if(BUILD_EMULATOR)
  83. add_subdirectory(${CPP3DS}/cmake/template_emu build/emu)
  84. endif()
  85. if(BUILD_TESTS)
  86. add_subdirectory(test)
  87. endif()