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.

151 lines
6.2KB

  1. # ==============================================================================
  2. #
  3. # This file is part of the JUCE 7 technical preview.
  4. # Copyright (c) 2022 - 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 the technical preview this file cannot be licensed commercially.
  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.15)
  17. project(JUCE VERSION 6.1.6 LANGUAGES C CXX)
  18. include(CMakeDependentOption)
  19. set_property(GLOBAL PROPERTY USE_FOLDERS YES)
  20. set(JUCE_MODULES_DIR "${JUCE_SOURCE_DIR}/modules" CACHE INTERNAL
  21. "The path to JUCE modules")
  22. # This option will disable most of the JUCE helper functions and tools. This option exists to
  23. # facilitate existing CMake builds which handle things like bundle creation, icons, plists, and
  24. # binary data independently of JUCE. This option is not recommended - use at your own risk!
  25. option(JUCE_MODULES_ONLY "Only configure the JUCE modules" OFF)
  26. include(extras/Build/CMake/JUCEModuleSupport.cmake)
  27. # This option controls whether dummy targets are added to the build, where these targets contain all
  28. # of the source files for each JUCE module. If you're planning to use an IDE and want to be able to
  29. # browse all of JUCE's source files, this may be useful. However, it will increase the size of
  30. # generated IDE projects and might slow down configuration a bit. If you enable this, you should
  31. # probably also add `set_property(GLOBAL PROPERTY USE_FOLDERS YES)` to your top level CMakeLists,
  32. # otherwise the module sources will be added directly to the top level of the project, instead of in
  33. # a nice 'Modules' subfolder.
  34. cmake_dependent_option(JUCE_ENABLE_MODULE_SOURCE_GROUPS
  35. "Show all module sources in IDE projects" OFF
  36. "NOT JUCE_MODULES_ONLY" OFF)
  37. add_subdirectory(modules)
  38. if(JUCE_MODULES_ONLY)
  39. return()
  40. endif()
  41. include(extras/Build/CMake/JUCEUtils.cmake)
  42. set_directory_properties(PROPERTIES
  43. JUCE_COMPANY_NAME "JUCE"
  44. JUCE_COMPANY_WEBSITE "juce.com"
  45. JUCE_COMPANY_EMAIL "info@juce.com"
  46. JUCE_COMPANY_COPYRIGHT "Copyright (c) 2020 - Raw Material Software Limited")
  47. option(JUCE_COPY_PLUGIN_AFTER_BUILD
  48. "Whether or not plugins should be installed to the system after building" OFF)
  49. set_property(GLOBAL PROPERTY JUCE_COPY_PLUGIN_AFTER_BUILD ${JUCE_COPY_PLUGIN_AFTER_BUILD})
  50. set(CMAKE_CXX_EXTENSIONS FALSE)
  51. juce_disable_default_flags()
  52. add_subdirectory(extras/Build)
  53. # If you want to build the JUCE examples with VST2/AAX support, you'll need to make the VST2/AAX
  54. # headers visible to the juce_audio_processors module. You can either set the paths on the command
  55. # line, (e.g. -DJUCE_GLOBAL_AAX_SDK_PATH=/path/to/sdk) if you're just building the JUCE examples, or
  56. # you can call the `juce_set_*_sdk_path` functions in your own CMakeLists after importing JUCE.
  57. if(JUCE_GLOBAL_AAX_SDK_PATH)
  58. juce_set_aax_sdk_path("${JUCE_GLOBAL_AAX_SDK_PATH}")
  59. endif()
  60. if(JUCE_GLOBAL_VST2_SDK_PATH)
  61. juce_set_vst2_sdk_path("${JUCE_GLOBAL_VST2_SDK_PATH}")
  62. endif()
  63. # We don't build anything other than the juceaide by default, because we want to keep configuration
  64. # speedy and the number of targets low. If you want to add targets for the extra projects and
  65. # example PIPs (there's a lot of them!), specify -DJUCE_BUILD_EXAMPLES=ON and/or
  66. # -DJUCE_BUILD_EXTRAS=ON when initially generating your build tree.
  67. option(JUCE_BUILD_EXTRAS "Add build targets for the Projucer and other tools" OFF)
  68. if(JUCE_BUILD_EXTRAS)
  69. add_subdirectory(extras)
  70. endif()
  71. option(JUCE_BUILD_EXAMPLES "Add build targets for the DemoRunner and PIPs" OFF)
  72. if(JUCE_BUILD_EXAMPLES)
  73. add_subdirectory(examples)
  74. endif()
  75. # ==================================================================================================
  76. # Install configuration
  77. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14")
  78. set(extra_version_arg ARCH_INDEPENDENT)
  79. endif()
  80. include(CMakePackageConfigHelpers)
  81. write_basic_package_version_file("${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
  82. VERSION ${JUCE_VERSION}
  83. COMPATIBILITY ExactVersion
  84. ${extra_version_arg})
  85. set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING
  86. "The location, relative to the install prefix, where the JUCE config file will be installed")
  87. set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules")
  88. set(UTILS_INSTALL_DIR "${JUCE_INSTALL_DESTINATION}")
  89. set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}")
  90. configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
  91. "${JUCE_BINARY_DIR}/JUCEConfig.cmake"
  92. PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
  93. INSTALL_DESTINATION "${JUCE_INSTALL_DESTINATION}")
  94. set(JUCE_MODULE_PATH "${JUCE_MODULES_DIR}")
  95. set(UTILS_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extras/Build/CMake")
  96. get_target_property(JUCEAIDE_PATH juceaide IMPORTED_LOCATION)
  97. configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
  98. "${JUCE_BINARY_DIR}/JUCEExportConfig.cmake"
  99. PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
  100. INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
  101. INSTALL_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
  102. install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
  103. "${JUCE_BINARY_DIR}/JUCEConfig.cmake"
  104. "${JUCE_CMAKE_UTILS_DIR}/JUCECheckAtomic.cmake"
  105. "${JUCE_CMAKE_UTILS_DIR}/JUCEHelperTargets.cmake"
  106. "${JUCE_CMAKE_UTILS_DIR}/JUCEModuleSupport.cmake"
  107. "${JUCE_CMAKE_UTILS_DIR}/JUCEUtils.cmake"
  108. "${JUCE_CMAKE_UTILS_DIR}/LaunchScreen.storyboard"
  109. "${JUCE_CMAKE_UTILS_DIR}/PIPAudioProcessor.cpp.in"
  110. "${JUCE_CMAKE_UTILS_DIR}/PIPComponent.cpp.in"
  111. "${JUCE_CMAKE_UTILS_DIR}/PIPConsole.cpp.in"
  112. "${JUCE_CMAKE_UTILS_DIR}/RecentFilesMenuTemplate.nib"
  113. "${JUCE_CMAKE_UTILS_DIR}/UnityPluginGUIScript.cs.in"
  114. "${JUCE_CMAKE_UTILS_DIR}/checkBundleSigning.cmake"
  115. "${JUCE_CMAKE_UTILS_DIR}/copyDir.cmake"
  116. "${JUCE_CMAKE_UTILS_DIR}/juce_runtime_arch_detection.cpp"
  117. DESTINATION "${JUCE_INSTALL_DESTINATION}")