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.

121 lines
4.9KB

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