CMakeLists.txt (2632B)
1 cmake_minimum_required(VERSION 3.10) 2 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") 3 project(zynaddsubfx) 4 set(VERSION_MAJOR "3") 5 set(VERSION_MINOR "0") 6 set(VERSION_REVISION "7") 7 cmake_policy(SET CMP0072 NEW) 8 9 #Set data directory, if any 10 if(DEFINED ZYN_DATADIR) 11 add_definitions(-DZYN_DATADIR="${ZYN_DATADIR}") 12 endif() 13 14 option(ZYN_SYSTEM_RTOSC "Use system provided librtosc and librtosc-cpp" OFF) 15 16 #Include RTOSC 17 if(ZYN_SYSTEM_RTOSC) 18 include(FindPkgConfig) 19 pkg_check_modules(RTOSC REQUIRED librtosc) 20 pkg_check_modules(RTOSC_CPP REQUIRED librtosc-cpp) 21 include_directories(${RTOSC_INCLUDE_DIR}) 22 message(STATUS "Found system provided librtosc and librtosc-cpp...") 23 else() 24 if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt") 25 message(STATUS "RTOSC NOT FOUND") 26 message(STATUS "Attempting to checkout submodule") 27 find_package(Git REQUIRED) 28 execute_process(COMMAND git submodule update --init --recursive) 29 if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt") 30 message(FATAL_ERROR "FAILED TO CHECKOUT RTOSC\n" 31 "please check file permissions and your network") 32 endif() 33 else() 34 message(STATUS "Found Rtosc Submodule...") 35 endif() 36 37 set(RTOSC_NO_INSTALL TRUE) 38 include("rtosc/cmake/ColorMessage.cmake") 39 add_subdirectory(rtosc) 40 include_directories(rtosc/include) 41 endif() 42 43 enable_testing() 44 include(CTestConfig.cmake) 45 #Currently the only directories that use cmake 46 add_subdirectory(src) 47 add_subdirectory(doc) # Doxygen only 48 49 install(FILES AUTHORS.txt COPYING README.adoc 50 DESTINATION share/doc/zynaddsubfx 51 ) 52 install(FILES zynaddsubfx-jack-multi.desktop zynaddsubfx-jack.desktop zynaddsubfx-alsa.desktop zynaddsubfx-oss.desktop 53 DESTINATION share/applications) 54 install(FILES zynaddsubfx.svg 55 DESTINATION share/pixmaps) 56 install(FILES zynaddsubfx.png 57 DESTINATION share/pixmaps) 58 install(DIRECTORY instruments/banks 59 DESTINATION share/zynaddsubfx) 60 if(DEFINED ZYN_EXAMPLESDIR) 61 install(DIRECTORY instruments/examples 62 DESTINATION ${ZYN_EXAMPLESDIR}) 63 else() 64 install(DIRECTORY instruments/examples 65 DESTINATION share/zynaddsubfx) 66 endif() 67 install(DIRECTORY instruments/ZynAddSubFX.lv2presets 68 DESTINATION ${PluginLibDir}/lv2) 69 70 ## uninstall target 71 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" 72 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" 73 IMMEDIATE @ONLY) 74 add_custom_target(uninstall 75 "${CMAKE_COMMAND}" -P 76 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake") 77