Change ALSA device default to 'default' from hw:0
[zynaddsubfx-code.git] / CMakeLists.txt
blobe678d939c607319bd325fdbcfa1a270a9e33b5e7
1 cmake_minimum_required(VERSION 3.0)
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")
8 #Set data directory, if any
9 if(DEFINED ZYN_DATADIR)
10 add_definitions(-DZYN_DATADIR="${ZYN_DATADIR}")
11 endif()
13 option(ZYN_SYSTEM_RTOSC "Use system provided librtosc and librtosc-cpp" OFF)
15 #Include RTOSC
16 if(ZYN_SYSTEM_RTOSC)
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...")
22 else()
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")
31         endif()
32     else()
33         message(STATUS "Found Rtosc Submodule...")
34     endif()
36     set(RTOSC_NO_INSTALL TRUE)
37     include("rtosc/cmake/ColorMessage.cmake")
38     add_subdirectory(rtosc)
39     include_directories(rtosc/include)
40 endif()
42 enable_testing()
43 include(CTestConfig.cmake)
44 #Currently the only directories that use cmake
45 add_subdirectory(src)
46 add_subdirectory(doc) # Doxygen only
48 install(FILES AUTHORS.txt COPYING README.adoc
49         DESTINATION share/doc/zynaddsubfx
50         )
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})
62 else()
63 install(DIRECTORY instruments/examples
64     DESTINATION share/zynaddsubfx)
65 endif()
66 install(DIRECTORY instruments/ZynAddSubFX.lv2presets
67     DESTINATION ${PluginLibDir}/lv2)
69 ## uninstall target
70 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
71                "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
72                IMMEDIATE @ONLY)
73 add_custom_target(uninstall
74                   "${CMAKE_COMMAND}" -P
75                   "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")