CMakeLists.txt 4.6 KB

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