CMakeLists.txt 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 9)
  12. add_definitions(-DFREESHOP_VERSION="2.1.4")
  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(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/GWEN/gwen/include
  31. ${PROJECT_SOURCE_DIR}/external/rapidjson/include
  32. ${PROJECT_SOURCE_DIR}/external/quirc/lib
  33. )
  34. FILE(GLOB_RECURSE TWEEN_ENGINE_SOURCE ${PROJECT_SOURCE_DIR}/external/tween-engine/src/*.cpp)
  35. FILE(GLOB_RECURSE GWEN_SOURCE ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/src/*.cpp)
  36. FILE(GLOB_RECURSE QUIRC_SOURCE ${PROJECT_SOURCE_DIR}/external/quirc/lib/*.c)
  37. set(SOURCE_FILES
  38. ${PROJECT_SOURCE_DIR}/src/main.cpp
  39. ${PROJECT_SOURCE_DIR}/src/AppItem.cpp
  40. ${PROJECT_SOURCE_DIR}/src/AppList.cpp
  41. ${PROJECT_SOURCE_DIR}/src/AppInfo.cpp
  42. ${PROJECT_SOURCE_DIR}/src/Config.cpp
  43. ${PROJECT_SOURCE_DIR}/src/IconSet.cpp
  44. ${PROJECT_SOURCE_DIR}/src/InstalledItem.cpp
  45. ${PROJECT_SOURCE_DIR}/src/InstalledOptions.cpp
  46. ${PROJECT_SOURCE_DIR}/src/InstalledList.cpp
  47. ${PROJECT_SOURCE_DIR}/src/FreeShop.cpp
  48. ${PROJECT_SOURCE_DIR}/src/Util.cpp
  49. ${PROJECT_SOURCE_DIR}/src/RichText.cpp
  50. ${PROJECT_SOURCE_DIR}/src/Download.cpp
  51. ${PROJECT_SOURCE_DIR}/src/DownloadQueue.cpp
  52. ${PROJECT_SOURCE_DIR}/src/AssetManager.hpp
  53. ${PROJECT_SOURCE_DIR}/src/Notification.cpp
  54. ${PROJECT_SOURCE_DIR}/src/TitleKeys.cpp
  55. ${PROJECT_SOURCE_DIR}/src/Keyboard/Keyboard.cpp
  56. ${PROJECT_SOURCE_DIR}/src/Keyboard/tinyxml2.cpp
  57. ${PROJECT_SOURCE_DIR}/src/GUI/AppItem.cpp
  58. ${PROJECT_SOURCE_DIR}/src/GUI/Button.cpp
  59. ${PROJECT_SOURCE_DIR}/src/GUI/NinePatch.cpp
  60. ${PROJECT_SOURCE_DIR}/src/GUI/Scrollable.cpp
  61. ${PROJECT_SOURCE_DIR}/src/GUI/ScrollBar.cpp
  62. ${PROJECT_SOURCE_DIR}/src/GUI/Settings.cpp
  63. ${PROJECT_SOURCE_DIR}/src/States/State.cpp
  64. ${PROJECT_SOURCE_DIR}/src/States/SleepState.cpp
  65. ${PROJECT_SOURCE_DIR}/src/States/StateStack.cpp
  66. ${PROJECT_SOURCE_DIR}/src/States/NewsState.cpp
  67. ${PROJECT_SOURCE_DIR}/src/States/DialogState.cpp
  68. ${PROJECT_SOURCE_DIR}/src/States/LoadingState.cpp
  69. ${PROJECT_SOURCE_DIR}/src/States/TitleState.cpp
  70. ${PROJECT_SOURCE_DIR}/src/States/BrowseState.cpp
  71. ${PROJECT_SOURCE_DIR}/src/States/QrScannerState.cpp
  72. ${PROJECT_SOURCE_DIR}/src/States/SyncState.cpp
  73. ${TWEEN_ENGINE_SOURCE}
  74. ${GWEN_SOURCE}
  75. ${PROJECT_SOURCE_DIR}/external/GWEN/gwen/Renderers/cpp3ds/cpp3ds.cpp
  76. ${QUIRC_SOURCE}
  77. )
  78. set(ARM_SOURCE_FILES
  79. ${PROJECT_SOURCE_DIR}/src/KeyboardApplet.cpp
  80. ${PROJECT_SOURCE_DIR}/src/Installer.cpp
  81. )
  82. set(EMU_SOURCE_FILES
  83. ${PROJECT_SOURCE_DIR}/src/Installer_emu.cpp
  84. )
  85. # Use either nihstro or picasso for your shader scripts
  86. set(SHADER_AS nihstro)
  87. FILE(GLOB_RECURSE SHADER_FILES ${PROJECT_SOURCE_DIR}/res/romfs/shaders/[^.]*.vsh)
  88. ##################################################
  89. # Don't usually need to change anything below
  90. ##################################################
  91. set(CPP3DS_ARM_FLAGS "-O2 -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft")
  92. set(CPP3DS_EMU_FLAGS "-O0")
  93. set(TEST_FLAGS "-O0 -coverage")
  94. set(CPP3DS_ARM_LIBS cpp3ds-window cpp3ds-network cpp3ds-graphics cpp3ds-audio cpp3ds-system citro3d ctru freetype png z vorbisidec ogg archive)
  95. 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)
  96. add_subdirectory(${CPP3DS}/cmake/template_arm build/arm)
  97. if(BUILD_EMULATOR)
  98. add_subdirectory(${CPP3DS}/cmake/template_emu build/emu)
  99. endif()
  100. if(BUILD_TESTS)
  101. add_subdirectory(test)
  102. endif()