The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
5.3KB

  1. # ==============================================================================
  2. #
  3. # This file is part of the JUCE library.
  4. # Copyright (c) 2020 - Raw Material Software Limited
  5. #
  6. # JUCE is an open source library subject to commercial or open-source
  7. # licensing.
  8. #
  9. # By using JUCE, you agree to the terms of both the JUCE 6 End-User License
  10. # Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  11. #
  12. # End User License Agreement: www.juce.com/juce-6-licence
  13. # Privacy Policy: www.juce.com/juce-privacy-policy
  14. #
  15. # Or: You may also use this code under the terms of the GPL v3 (see
  16. # www.gnu.org/licenses).
  17. #
  18. # JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  19. # EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  20. # DISCLAIMED.
  21. #
  22. # ==============================================================================
  23. cmake_minimum_required(VERSION 3.12)
  24. project(JUCE VERSION 6.0.0 LANGUAGES C CXX)
  25. set_property(GLOBAL PROPERTY USE_FOLDERS YES)
  26. set(JUCE_MODULES_DIR "${JUCE_SOURCE_DIR}/modules" CACHE INTERNAL
  27. "The path to JUCE modules")
  28. include(extras/Build/CMake/JUCEHelperTargets.cmake)
  29. include(extras/Build/CMake/JUCEUtils.cmake)
  30. juce_disable_default_flags()
  31. set_directory_properties(PROPERTIES
  32. JUCE_COMPANY_NAME "JUCE"
  33. JUCE_COMPANY_WEBSITE "juce.com"
  34. JUCE_COMPANY_EMAIL "info@juce.com"
  35. JUCE_COMPANY_COPYRIGHT "Copyright (c) 2020 - Raw Material Software Limited")
  36. option(JUCE_COPY_PLUGIN_AFTER_BUILD
  37. "Whether or not plugins should be installed to the system after building" OFF)
  38. set_property(GLOBAL PROPERTY JUCE_COPY_PLUGIN_AFTER_BUILD ${JUCE_COPY_PLUGIN_AFTER_BUILD})
  39. set(CMAKE_CXX_EXTENSIONS FALSE)
  40. add_subdirectory(modules)
  41. add_subdirectory(extras/Build)
  42. # If you want to build the JUCE examples with VST2/AAX support, you'll need to make the VST2/AAX
  43. # headers visible to the juce_audio_processors module. You can either set the paths on the command
  44. # line, (e.g. -DJUCE_GLOBAL_AAX_SDK_PATH=/path/to/sdk) if you're just building the JUCE examples, or
  45. # you can call the `juce_set_*_sdk_path` functions in your own CMakeLists after importing JUCE.
  46. if(JUCE_GLOBAL_AAX_SDK_PATH)
  47. juce_set_aax_sdk_path("${JUCE_GLOBAL_AAX_SDK_PATH}")
  48. endif()
  49. if(JUCE_GLOBAL_VST2_SDK_PATH)
  50. juce_set_vst2_sdk_path("${JUCE_GLOBAL_VST2_SDK_PATH}")
  51. endif()
  52. # We don't build anything other than the juceaide by default, because we want to keep configuration
  53. # speedy and the number of targets low. If you want to add targets for the extra projects and
  54. # example PIPs (there's a lot of them!), specify -DJUCE_BUILD_EXAMPLES=ON and/or
  55. # -DJUCE_BUILD_EXTRAS=ON when initially generating your build tree.
  56. option(JUCE_BUILD_EXTRAS "Add build targets for the Projucer and other tools" OFF)
  57. if(JUCE_BUILD_EXTRAS)
  58. add_subdirectory(extras)
  59. endif()
  60. option(JUCE_BUILD_EXAMPLES "Add build targets for the DemoRunner and PIPs" OFF)
  61. if(JUCE_BUILD_EXAMPLES)
  62. add_subdirectory(examples)
  63. endif()
  64. # ==================================================================================================
  65. # Install configuration
  66. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14")
  67. set(extra_version_arg ARCH_INDEPENDENT)
  68. endif()
  69. include(CMakePackageConfigHelpers)
  70. write_basic_package_version_file("${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
  71. VERSION ${JUCE_VERSION}
  72. COMPATIBILITY ExactVersion
  73. ${extra_version_arg})
  74. set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING
  75. "The location, relative to the install prefix, where the JUCE config file will be installed")
  76. install(EXPORT JUCE NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
  77. set(JUCE_EXPORT_FILE_NAME "JUCE.cmake")
  78. set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules")
  79. set(UTILS_INSTALL_DIR "${JUCE_INSTALL_DESTINATION}")
  80. set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}")
  81. configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
  82. "${JUCE_BINARY_DIR}/JUCEConfig.cmake"
  83. PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
  84. INSTALL_DESTINATION "${JUCE_INSTALL_DESTINATION}")
  85. set(JUCE_EXPORT_FILE_NAME "JUCEBuildTree.cmake")
  86. set(JUCE_MODULE_PATH "${JUCE_MODULES_DIR}")
  87. export(EXPORT JUCE NAMESPACE juce:: FILE "${JUCE_EXPORT_FILE_NAME}")
  88. set(UTILS_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extras/Build/CMake")
  89. get_target_property(JUCEAIDE_PATH juceaide IMPORTED_LOCATION)
  90. configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
  91. "${JUCE_BINARY_DIR}/JUCEExportConfig.cmake"
  92. PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
  93. INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
  94. INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
  95. install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
  96. "${JUCE_BINARY_DIR}/JUCEConfig.cmake"
  97. "${JUCE_CMAKE_UTILS_DIR}/LaunchScreen.storyboard"
  98. "${JUCE_CMAKE_UTILS_DIR}/PIPAudioProcessor.cpp.in"
  99. "${JUCE_CMAKE_UTILS_DIR}/PIPComponent.cpp.in"
  100. "${JUCE_CMAKE_UTILS_DIR}/PIPConsole.cpp.in"
  101. "${JUCE_CMAKE_UTILS_DIR}/RecentFilesMenuTemplate.nib"
  102. "${JUCE_CMAKE_UTILS_DIR}/UnityPluginGUIScript.cs.in"
  103. "${JUCE_CMAKE_UTILS_DIR}/copyDir.cmake"
  104. "${JUCE_CMAKE_UTILS_DIR}/JUCEUtils.cmake"
  105. DESTINATION "${JUCE_INSTALL_DESTINATION}")