CMakeLists.txt 3.6 KB

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