CMakeLists.txt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Definitions for all external bundled libraries
  2. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
  3. include(DownloadExternals)
  4. # Catch
  5. add_library(catch-single-include INTERFACE)
  6. target_include_directories(catch-single-include INTERFACE catch/single_include)
  7. # Crypto++
  8. add_subdirectory(cryptopp)
  9. # libfmt
  10. add_subdirectory(fmt)
  11. # getopt
  12. if (MSVC)
  13. add_subdirectory(getopt)
  14. endif()
  15. # Glad
  16. add_subdirectory(glad)
  17. # inih
  18. add_subdirectory(inih)
  19. # lz4
  20. set(LZ4_BUNDLED_MODE ON)
  21. add_subdirectory(lz4/contrib/cmake_unofficial)
  22. target_include_directories(lz4_static INTERFACE ./lz4/lib)
  23. # MicroProfile
  24. add_library(microprofile INTERFACE)
  25. target_include_directories(microprofile INTERFACE ./microprofile)
  26. # Nihstro
  27. add_library(nihstro-headers INTERFACE)
  28. target_include_directories(nihstro-headers INTERFACE ./nihstro/include)
  29. # SoundTouch
  30. add_subdirectory(soundtouch)
  31. # The SoundTouch target doesn't export the necessary include paths as properties by default
  32. target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
  33. # Unicorn
  34. add_library(unicorn-headers INTERFACE)
  35. target_include_directories(unicorn-headers INTERFACE ./unicorn/include)
  36. # Xbyak
  37. if (ARCHITECTURE_x86_64)
  38. # Defined before "dynarmic" above
  39. add_library(xbyak INTERFACE)
  40. target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
  41. target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
  42. endif()
  43. # ENet
  44. add_subdirectory(enet)
  45. target_include_directories(enet INTERFACE ./enet/include)
  46. if (ENABLE_WEB_SERVICE)
  47. # msys installed curl is configured to use openssl, but that isn't portable
  48. # since it relies on having the bundled certs install in the home folder for SSL
  49. # by default on mingw, download the precompiled curl thats linked against windows native ssl
  50. if (MINGW AND CITRA_USE_BUNDLED_CURL)
  51. download_bundled_external("curl/" "curl-7_55_1" CURL_PREFIX)
  52. set(CURL_PREFIX "${CMAKE_BINARY_DIR}/externals/curl-7_55_1")
  53. set(CURL_FOUND YES)
  54. set(CURL_INCLUDE_DIR "${CURL_PREFIX}/include" CACHE PATH "Path to curl headers")
  55. set(CURL_LIBRARY "${CURL_PREFIX}/lib/libcurldll.a" CACHE PATH "Path to curl library")
  56. set(CURL_DLL_DIR "${CURL_PREFIX}/lib/" CACHE PATH "Path to curl.dll")
  57. set(USE_SYSTEM_CURL ON CACHE BOOL "")
  58. endif()
  59. # CPR
  60. set(BUILD_TESTING OFF CACHE BOOL "")
  61. set(BUILD_CPR_TESTS OFF CACHE BOOL "")
  62. add_subdirectory(cpr)
  63. target_include_directories(cpr INTERFACE ./cpr/include)
  64. # JSON
  65. add_library(json-headers INTERFACE)
  66. target_include_directories(json-headers INTERFACE ./json)
  67. endif()