CMakeLists.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 3091)
  13. add_definitions(-DFREESHOP_VERSION="3.1.3")
  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/Config.cpp
  45. ${PROJECT_SOURCE_DIR}/src/IconSet.cpp
  46. ${PROJECT_SOURCE_DIR}/src/InstalledItem.cpp
  47. ${PROJECT_SOURCE_DIR}/src/InstalledOptions.cpp
  48. ${PROJECT_SOURCE_DIR}/src/InstalledList.cpp
  49. ${PROJECT_SOURCE_DIR}/src/FreeShop.cpp
  50. ${PROJECT_SOURCE_DIR}/src/MusicBCSTM.cpp
  51. ${PROJECT_SOURCE_DIR}/src/MusicMP3.cpp
  52. ${PROJECT_SOURCE_DIR}/src/Util.cpp
  53. ${PROJECT_SOURCE_DIR}/src/RichText.cpp
  54. ${PROJECT_SOURCE_DIR}/src/Download.cpp
  55. ${PROJECT_SOURCE_DIR}/src/DownloadQueue.cpp
  56. ${PROJECT_SOURCE_DIR}/src/AssetManager.hpp
  57. ${PROJECT_SOURCE_DIR}/src/Notification.cpp
  58. ${PROJECT_SOURCE_DIR}/src/TitleKeys.cpp
  59. ${PROJECT_SOURCE_DIR}/src/BotInformations.cpp
  60. ${PROJECT_SOURCE_DIR}/src/TopInformations.cpp
  61. ${PROJECT_SOURCE_DIR}/src/LoadInformations.cpp
  62. ${PROJECT_SOURCE_DIR}/src/Theme.cpp
  63. ${PROJECT_SOURCE_DIR}/src/Keyboard/Keyboard.cpp
  64. ${PROJECT_SOURCE_DIR}/src/Keyboard/tinyxml2.cpp
  65. ${PROJECT_SOURCE_DIR}/src/GUI/AppItem.cpp
  66. ${PROJECT_SOURCE_DIR}/src/GUI/Button.cpp
  67. ${PROJECT_SOURCE_DIR}/src/GUI/NinePatch.cpp
  68. ${PROJECT_SOURCE_DIR}/src/GUI/Scrollable.cpp
  69. ${PROJECT_SOURCE_DIR}/src/GUI/ScrollBar.cpp
  70. ${PROJECT_SOURCE_DIR}/src/GUI/Settings.cpp
  71. ${PROJECT_SOURCE_DIR}/src/States/State.cpp
  72. ${PROJECT_SOURCE_DIR}/src/States/SleepState.cpp
  73. ${PROJECT_SOURCE_DIR}/src/States/StateStack.cpp
  74. ${PROJECT_SOURCE_DIR}/src/States/NewsState.cpp
  75. ${PROJECT_SOURCE_DIR}/src/States/DialogState.cpp
  76. ${PROJECT_SOURCE_DIR}/src/States/LoadingState.cpp
  77. ${PROJECT_SOURCE_DIR}/src/States/TitleState.cpp
  78. ${PROJECT_SOURCE_DIR}/src/States/BrowseState.cpp
  79. ${PROJECT_SOURCE_DIR}/src/States/QrScannerState.cpp
  80. ${PROJECT_SOURCE_DIR}/src/States/SyncState.cpp
  81. ${TWEEN_ENGINE_SOURCE}
  82. ${GWEN_SOURCE}
  83. ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/Renderers/cpp3ds/cpp3ds.cpp
  84. ${QUIRC_SOURCE}
  85. )
  86. set(ARM_SOURCE_FILES
  87. ${PROJECT_SOURCE_DIR}/src/KeyboardApplet.cpp
  88. ${PROJECT_SOURCE_DIR}/src/Installer.cpp
  89. ${PROJECT_SOURCE_DIR}/src/MCU/Mcu.cpp
  90. )
  91. set(EMU_SOURCE_FILES
  92. ${PROJECT_SOURCE_DIR}/src/Installer_emu.cpp
  93. )
  94. # Use either nihstro or picasso for your shader scripts
  95. set(SHADER_AS nihstro)
  96. FILE(GLOB_RECURSE SHADER_FILES ${PROJECT_SOURCE_DIR}/res/romfs/shaders/[^.]*.vsh)
  97. ##################################################
  98. # Don't usually need to change anything below
  99. ##################################################
  100. set(CPP3DS_ARM_FLAGS "-g -O3 -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft")
  101. set(CPP3DS_EMU_FLAGS "-O0")
  102. set(TEST_FLAGS "-O0 -coverage")
  103. include_directories(${DEVKITPRO}/portlibs/armv6k/include)
  104. 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)
  105. 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)
  106. add_subdirectory(${CPP3DS}/cmake/template_arm build/arm)
  107. if(BUILD_EMULATOR)
  108. add_subdirectory(${CPP3DS}/cmake/template_emu build/emu)
  109. endif()
  110. if(BUILD_TESTS)
  111. add_subdirectory(test)
  112. endif()