Update rtosc submodule
[zynaddsubfx-code.git] / CMakeLists.txt
blobb000e598c4a75abcfdf37fb6c2917c41923b3330
1 cmake_minimum_required(VERSION 2.8)
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 "5")
8 #Set data directory, if any
9 if(DEFINED ZYN_DATADIR)
10 add_definitions(-DZYN_DATADIR="${ZYN_DATADIR}")
11 endif()
13 #Include RTOSC
14 if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt")
15     message(STATUS "RTOSC NOT FOUND")
16     message(STATUS "Attempting to checkout submodule")
17     find_package(Git REQUIRED)
18     execute_process(COMMAND git submodule update --init)
19     if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rtosc/CMakeLists.txt")
20         message(FATAL_ERROR "FAILED TO CHECKOUT RTOSC\n"
21         "please check file permissions and your network")
22     endif()
23 else()
24     message(STATUS "Found Rtosc Submodule...")
25 endif()
27 set(RTOSC_NO_INSTALL TRUE)
28 include("rtosc/cmake/ColorMessage.cmake")
29 add_subdirectory(rtosc)
30 include_directories(rtosc/include)
32 enable_testing()
33 include(CTestConfig.cmake)
34 #Currently the only directories that use cmake
35 add_subdirectory(src)
36 add_subdirectory(doc) # Doxygen only
38 install(FILES AUTHORS.txt COPYING HISTORY.txt README.adoc
39         DESTINATION share/doc/zynaddsubfx
40         )
41 install(FILES zynaddsubfx-jack-multi.desktop zynaddsubfx-jack.desktop zynaddsubfx-alsa.desktop zynaddsubfx-oss.desktop
42     DESTINATION share/applications)
43 install(FILES zynaddsubfx.svg
44     DESTINATION share/pixmaps)
45 install(DIRECTORY instruments/banks
46     DESTINATION share/zynaddsubfx)
47 if(DEFINED ZYN_EXAMPLESDIR)
48 install(DIRECTORY instruments/examples
49     DESTINATION ${ZYN_EXAMPLESDIR})
50 else()
51 install(DIRECTORY instruments/examples
52     DESTINATION share/zynaddsubfx)
53 endif()
54 install(DIRECTORY instruments/ZynAddSubFX.lv2presets
55     DESTINATION ${PluginLibDir}/lv2)
57 ## uninstall target
58 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
59                "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
60                IMMEDIATE @ONLY)
61 add_custom_target(uninstall
62                   "${CMAKE_COMMAND}" -P
63                   "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")