CMakeLists.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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("freeshop")
  6. set(APP_TITLE "freeShop")
  7. set(APP_DESCRIPTION "Open source eShop clone")
  8. set(APP_AUTHOR "arc13 / Cruel")
  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 3092)
  13. add_definitions(-DFREESHOP_VERSION="3.1.4")
  14. add_definitions(-DFREESHOP_DIR="sdmc:/3ds/data/freeShop")
  15. # CIA settings
  16. set(APP_UNIQUE_ID 0xF12EE) # This must be unique for your CIA project
  17. set(APP_PRODUCT_CODE ${PROJECT_NAME})
  18. set(BANNER ${PROJECT_SOURCE_DIR}/res/app/banner.bnr)
  19. set(BANNER_IMAGE ${PROJECT_SOURCE_DIR}/res/app/banner.png)
  20. set(BANNER_SOUND ${PROJECT_SOURCE_DIR}/res/app/banner.wav)
  21. 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)
  22. set(CIA_CONFIG ${PROJECT_SOURCE_DIR}/res/app/cia.rsf)
  23. # Include cpp3ds cmake module
  24. set(CPP3DS $ENV{CPP3DS})
  25. if(NOT CPP3DS)
  26. message(FATAL_ERROR "You need to set the env variable CPP3DS before compiling.")
  27. endif()
  28. set(CMAKE_MODULE_PATH "${CPP3DS}/cmake" ${CMAKE_MODULE_PATH})
  29. include(cpp3ds)
  30. include_directories(
  31. ${PROJECT_SOURCE_DIR}/external/tween-engine/include
  32. ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/include
  33. ${PROJECT_SOURCE_DIR}/external/rapidjson/include
  34. ${PROJECT_SOURCE_DIR}/external/quirc/lib
  35. )
  36. FILE(GLOB_RECURSE TWEEN_ENGINE_SOURCE ${PROJECT_SOURCE_DIR}/external/tween-engine/src/*.cpp)
  37. FILE(GLOB_RECURSE GWEN_SOURCE ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/src/*.cpp)
  38. FILE(GLOB_RECURSE QUIRC_SOURCE ${PROJECT_SOURCE_DIR}/external/quirc/lib/*.c)
  39. set(SOURCE_FILES
  40. ${PROJECT_SOURCE_DIR}/src/main.cpp
  41. ${PROJECT_SOURCE_DIR}/src/AppItem.cpp
  42. ${PROJECT_SOURCE_DIR}/src/AppList.cpp
  43. ${PROJECT_SOURCE_DIR}/src/AppInfo.cpp
  44. ${PROJECT_SOURCE_DIR}/src/AppStats.cpp
  45. ${PROJECT_SOURCE_DIR}/src/Config.cpp
  46. ${PROJECT_SOURCE_DIR}/src/IconSet.cpp
  47. ${PROJECT_SOURCE_DIR}/src/InstalledItem.cpp
  48. ${PROJECT_SOURCE_DIR}/src/InstalledOptions.cpp
  49. ${PROJECT_SOURCE_DIR}/src/InstalledList.cpp
  50. ${PROJECT_SOURCE_DIR}/src/FreeShop.cpp
  51. ${PROJECT_SOURCE_DIR}/src/MusicBCSTM.cpp
  52. ${PROJECT_SOURCE_DIR}/src/MusicMP3.cpp
  53. ${PROJECT_SOURCE_DIR}/src/Util.cpp
  54. ${PROJECT_SOURCE_DIR}/src/RichText.cpp
  55. ${PROJECT_SOURCE_DIR}/src/Download.cpp
  56. ${PROJECT_SOURCE_DIR}/src/DownloadQueue.cpp
  57. ${PROJECT_SOURCE_DIR}/src/AssetManager.hpp
  58. ${PROJECT_SOURCE_DIR}/src/Notification.cpp
  59. ${PROJECT_SOURCE_DIR}/src/TitleKeys.cpp
  60. ${PROJECT_SOURCE_DIR}/src/BotInformations.cpp
  61. ${PROJECT_SOURCE_DIR}/src/TopInformations.cpp
  62. ${PROJECT_SOURCE_DIR}/src/LoadInformations.cpp
  63. ${PROJECT_SOURCE_DIR}/src/Theme.cpp
  64. ${PROJECT_SOURCE_DIR}/src/Keyboard/Keyboard.cpp
  65. ${PROJECT_SOURCE_DIR}/src/Keyboard/tinyxml2.cpp
  66. ${PROJECT_SOURCE_DIR}/src/GUI/AppItem.cpp
  67. ${PROJECT_SOURCE_DIR}/src/GUI/Button.cpp
  68. ${PROJECT_SOURCE_DIR}/src/GUI/NinePatch.cpp
  69. ${PROJECT_SOURCE_DIR}/src/GUI/Scrollable.cpp
  70. ${PROJECT_SOURCE_DIR}/src/GUI/ScrollBar.cpp
  71. ${PROJECT_SOURCE_DIR}/src/GUI/Settings.cpp
  72. ${PROJECT_SOURCE_DIR}/src/States/State.cpp
  73. ${PROJECT_SOURCE_DIR}/src/States/SleepState.cpp
  74. ${PROJECT_SOURCE_DIR}/src/States/StateStack.cpp
  75. ${PROJECT_SOURCE_DIR}/src/States/NewsState.cpp
  76. ${PROJECT_SOURCE_DIR}/src/States/DialogState.cpp
  77. ${PROJECT_SOURCE_DIR}/src/States/LoadingState.cpp
  78. ${PROJECT_SOURCE_DIR}/src/States/TitleState.cpp
  79. ${PROJECT_SOURCE_DIR}/src/States/BrowseState.cpp
  80. ${PROJECT_SOURCE_DIR}/src/States/QrScannerState.cpp
  81. ${PROJECT_SOURCE_DIR}/src/States/SyncState.cpp
  82. ${TWEEN_ENGINE_SOURCE}
  83. ${GWEN_SOURCE}
  84. ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/Renderers/cpp3ds/cpp3ds.cpp
  85. ${QUIRC_SOURCE}
  86. )
  87. set(ARM_SOURCE_FILES
  88. ${PROJECT_SOURCE_DIR}/src/KeyboardApplet.cpp
  89. ${PROJECT_SOURCE_DIR}/src/Installer.cpp
  90. ${PROJECT_SOURCE_DIR}/src/MCU/Mcu.cpp
  91. )
  92. set(EMU_SOURCE_FILES
  93. ${PROJECT_SOURCE_DIR}/src/Installer_emu.cpp
  94. )
  95. # Use either nihstro or picasso for your shader scripts
  96. set(SHADER_AS nihstro)
  97. FILE(GLOB_RECURSE SHADER_FILES ${PROJECT_SOURCE_DIR}/res/romfs/shaders/[^.]*.vsh)
  98. ##################################################
  99. # Don't usually need to change anything below
  100. ##################################################
  101. set(CPP3DS_ARM_FLAGS "-g -O3 -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft")
  102. set(CPP3DS_EMU_FLAGS "-O0")
  103. set(TEST_FLAGS "-O0 -coverage")
  104. include_directories(${DEVKITPRO}/portlibs/armv6k/include)
  105. set(CPP3DS_ARM_LIBS cpp3ds-window cpp3ds-network cpp3ds-graphics cpp3ds-audio cpp3ds-system citro3d ctru freetype png z vorbisidec ogg archive faad fmt mpg123)
  106. 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 mpg123)
  107. add_subdirectory(${CPP3DS}/cmake/template_arm build/arm)
  108. if(BUILD_EMULATOR)
  109. add_subdirectory(${CPP3DS}/cmake/template_emu build/emu)
  110. endif()
  111. if(BUILD_TESTS)
  112. add_subdirectory(test)
  113. endif()