1 cmake_minimum_required(VERSION 3.0)
2 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
6 set(VERSION_REVISION "7")
8 #Set data directory, if any
9 if(DEFINED ZYN_DATADIR)
10 add_definitions(-DZYN_DATADIR="${ZYN_DATADIR}")
13 option(ZYN_SYSTEM_RTOSC "Use system provided librtosc and librtosc-cpp" OFF)
17 include(FindPkgConfig)
18 pkg_check_modules(RTOSC REQUIRED librtosc)
19 pkg_check_modules(RTOSC_CPP REQUIRED librtosc-cpp)
20 include_directories(${RTOSC_INCLUDE_DIR})
21 message(STATUS "Found system provided librtosc and librtosc-cpp...")
23 if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt")
24 message(STATUS "RTOSC NOT FOUND")
25 message(STATUS "Attempting to checkout submodule")
26 find_package(Git REQUIRED)
27 execute_process(COMMAND git submodule update --init --recursive)
28 if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt")
29 message(FATAL_ERROR "FAILED TO CHECKOUT RTOSC\n"
30 "please check file permissions and your network")
33 message(STATUS "Found Rtosc Submodule...")
36 set(RTOSC_NO_INSTALL TRUE)
37 include("rtosc/cmake/ColorMessage.cmake")
38 add_subdirectory(rtosc)
39 include_directories(rtosc/include)
43 include(CTestConfig.cmake)
44 #Currently the only directories that use cmake
46 add_subdirectory(doc) # Doxygen only
48 install(FILES AUTHORS.txt COPYING README.adoc
49 DESTINATION share/doc/zynaddsubfx
51 install(FILES zynaddsubfx-jack-multi.desktop zynaddsubfx-jack.desktop zynaddsubfx-alsa.desktop zynaddsubfx-oss.desktop
52 DESTINATION share/applications)
53 install(FILES zynaddsubfx.svg
54 DESTINATION share/pixmaps)
55 install(FILES zynaddsubfx.png
56 DESTINATION share/pixmaps)
57 install(DIRECTORY instruments/banks
58 DESTINATION share/zynaddsubfx)
59 if(DEFINED ZYN_EXAMPLESDIR)
60 install(DIRECTORY instruments/examples
61 DESTINATION ${ZYN_EXAMPLESDIR})
63 install(DIRECTORY instruments/examples
64 DESTINATION share/zynaddsubfx)
66 install(DIRECTORY instruments/ZynAddSubFX.lv2presets
67 DESTINATION ${PluginLibDir}/lv2)
70 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
71 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
73 add_custom_target(uninstall
75 "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")