zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

CMakeLists.txt (8649B)


      1 
      2 include_directories(${CMAKE_CURRENT_BINARY_DIR}
      3     ${CMAKE_SOURCE_DIR}/DPF/distrho .
      4     ${CMAKE_SOURCE_DIR}/DPF/dgl
      5     ${CMAKE_SOURCE_DIR}/DPF/dgl/src)
      6 
      7 if(NtkGui)
      8 
      9 # UI Enabled using NTK: embed + external
     10 add_library(ZynAddSubFX_lv2 SHARED
     11     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     12     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     13     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     14     ZynAddSubFX.cpp)
     15 
     16 add_library(ZynAddSubFX_lv2_ui SHARED
     17     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoUIMain.cpp
     18     ZynAddSubFX-UI.cpp)
     19 
     20 add_library(ZynAddSubFX_vst SHARED
     21     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     22     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     23     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     24     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoUIMain.cpp
     25     ZynAddSubFX.cpp
     26     ZynAddSubFX-UI.cpp)
     27 
     28 # TODO: Make this also check for Linux or MacOS
     29 elseif(FltkGui)
     30 
     31 # UI Enabled using FLTK: external only
     32 add_library(ZynAddSubFX_lv2 SHARED
     33     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     34     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     35     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     36     ZynAddSubFX.cpp)
     37 
     38 add_library(ZynAddSubFX_lv2_ui SHARED
     39     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoUIMain.cpp
     40     ZynAddSubFX-UI.cpp)
     41 
     42 add_library(ZynAddSubFX_vst SHARED
     43     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     44     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     45     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     46     ZynAddSubFX.cpp)
     47 
     48 elseif(ZestGui)
     49 
     50 # UI Enabled using Zest: internal only
     51 if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
     52 add_library(ZynAddSubFX_lv2 SHARED
     53     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     54     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     55     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     56     ZynAddSubFX.cpp)
     57 
     58 add_library(ZynAddSubFX_lv2_ui SHARED
     59     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Application.cpp
     60     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ApplicationPrivateData.cpp
     61     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Color.cpp
     62     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/EventHandlers.cpp
     63     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Geometry.cpp
     64     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ImageBase.cpp
     65     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ImageBaseWidgets.cpp
     66     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/OpenGL.cpp
     67     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Resources.cpp
     68     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/SubWidget.cpp
     69     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/SubWidgetPrivateData.cpp
     70     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/TopLevelWidget.cpp
     71     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/TopLevelWidgetPrivateData.cpp
     72     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Widget.cpp
     73     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/WidgetPrivateData.cpp
     74     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Window.cpp
     75     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/WindowPrivateData.cpp
     76     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/pugl.cpp
     77     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoUIMain.cpp
     78     ZynAddSubFX-UI-Zest.cpp)
     79 
     80 target_include_directories(
     81        ZynAddSubFX_lv2_ui
     82        PRIVATE
     83        ${CMAKE_SOURCE_DIR}/DPF/dgl/src/pugl-upstream/include/)
     84 
     85 endif()
     86 
     87 add_library(ZynAddSubFX_vst SHARED
     88     ${CMAKE_SOURCE_DIR}/src/globals.cpp
     89     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
     90     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
     91     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoUIMain.cpp
     92     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Application.cpp
     93     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ApplicationPrivateData.cpp
     94     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Color.cpp
     95     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/EventHandlers.cpp
     96     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Geometry.cpp
     97     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ImageBase.cpp
     98     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/ImageBaseWidgets.cpp
     99     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/OpenGL.cpp
    100     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Resources.cpp
    101     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/SubWidget.cpp
    102     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/SubWidgetPrivateData.cpp
    103     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/TopLevelWidget.cpp
    104     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/TopLevelWidgetPrivateData.cpp
    105     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Widget.cpp
    106     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/WidgetPrivateData.cpp
    107     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/Window.cpp
    108     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/WindowPrivateData.cpp
    109     ${CMAKE_SOURCE_DIR}/DPF/dgl/src/pugl.cpp
    110     ZynAddSubFX.cpp
    111     ZynAddSubFX-UI-Zest.cpp)
    112 
    113 target_include_directories(
    114        ZynAddSubFX_vst
    115        PRIVATE
    116        ${CMAKE_SOURCE_DIR}/DPF/dgl/src/pugl-upstream/include/)
    117 
    118 else()
    119 
    120 # UI Disabled
    121 add_library(ZynAddSubFX_lv2 SHARED
    122     ${CMAKE_SOURCE_DIR}/src/globals.cpp
    123     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
    124     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
    125     ZynAddSubFX.cpp)
    126 
    127 add_library(ZynAddSubFX_vst SHARED
    128     ${CMAKE_SOURCE_DIR}/src/globals.cpp
    129     ${CMAKE_SOURCE_DIR}/src/UI/ConnectionDummy.cpp
    130     ${CMAKE_SOURCE_DIR}/DPF/distrho/DistrhoPluginMain.cpp
    131     ZynAddSubFX.cpp)
    132 
    133 endif()
    134 
    135 if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    136     set_target_properties(ZynAddSubFX_lv2 PROPERTIES COMPILE_DEFINITIONS "DISTRHO_PLUGIN_TARGET_LV2")
    137     set_target_properties(ZynAddSubFX_lv2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lv2")
    138     set_target_properties(ZynAddSubFX_lv2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "lv2")
    139     set_target_properties(ZynAddSubFX_lv2 PROPERTIES OUTPUT_NAME "ZynAddSubFX")
    140     set_target_properties(ZynAddSubFX_lv2 PROPERTIES PREFIX "")
    141 endif()
    142 
    143 set_target_properties(ZynAddSubFX_vst PROPERTIES COMPILE_DEFINITIONS "DISTRHO_PLUGIN_TARGET_VST2")
    144 set_target_properties(ZynAddSubFX_vst PROPERTIES LIBRARY_OUTPUT_DIRECTORY "vst")
    145 set_target_properties(ZynAddSubFX_vst PROPERTIES RUNTIME_OUTPUT_DIRECTORY "vst")
    146 set_target_properties(ZynAddSubFX_vst PROPERTIES OUTPUT_NAME "ZynAddSubFX")
    147 set_target_properties(ZynAddSubFX_vst PROPERTIES PREFIX "")
    148 
    149 if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    150     set(PLATFORM_LIBRARIES ws2_32
    151             winmm
    152             glu32 
    153             gdi32
    154             opengl32
    155             wsock32
    156             "-static" iphlpapi
    157             "-static" winpthread)
    158 elseif(ZestGui)
    159     if(APPLE)
    160         set(PLATFORM_LIBRARIES)
    161     else()
    162         if(HAVE_LIBRT)
    163             set(PLATFORM_LIBRARIES X11 GL rt)
    164         else()
    165             set(PLATFORM_LIBRARIES X11 GL)
    166         endif()
    167     endif()
    168 elseif(NtkGui OR FltkGui)
    169     if(HAVE_LIBRT)
    170         set(PLATFORM_LIBRARIES X11 rt)
    171     else()
    172         set(PLATFORM_LIBRARIES X11)
    173     endif()
    174 else()
    175     if(HAVE_LIBRT)
    176         set(PLATFORM_LIBRARIES rt)
    177     endif()
    178 endif()
    179 
    180 if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    181     target_link_libraries(ZynAddSubFX_lv2 zynaddsubfx_core ${OS_LIBRARIES} ${LIBLO_LIBRARIES}
    182         ${PLATFORM_LIBRARIES})
    183 endif()
    184 if(APPLE)
    185     target_link_libraries(ZynAddSubFX_vst zynaddsubfx_core ${OS_LIBRARIES} ${LIBLO_LIBRARIES}
    186         ${PLATFORM_LIBRARIES} "-framework Cocoa" "-framework openGL" "-Wl,-exported_symbol,_VSTPluginMain")
    187 else()
    188     target_link_libraries(ZynAddSubFX_vst zynaddsubfx_core ${OS_LIBRARIES} ${LIBLO_LIBRARIES}
    189         ${PLATFORM_LIBRARIES})
    190 endif()
    191 if(ZestGui AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    192     if(APPLE)
    193         target_link_libraries(ZynAddSubFX_lv2_ui "-framework Cocoa" "-framework openGL" "-Wl,-exported_symbol,_lv2ui_descriptor")
    194         target_link_libraries(ZynAddSubFX_lv2 "-Wl,-exported_symbol,_lv2_descriptor" "-Wl,-exported_symbol,_lv2_generate_ttl")
    195     else()
    196         target_link_libraries(ZynAddSubFX_lv2_ui X11 GL)
    197     endif()
    198 endif()
    199 
    200 if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    201     install(TARGETS ZynAddSubFX_lv2 LIBRARY DESTINATION ${PluginLibDir}/lv2/ZynAddSubFX.lv2/)
    202     install(TARGETS ZynAddSubFX_vst LIBRARY DESTINATION ${PluginLibDir}/vst/)
    203 
    204     add_custom_command(TARGET ZynAddSubFX_lv2 POST_BUILD
    205         COMMAND ../../lv2-ttl-generator $<TARGET_FILE:ZynAddSubFX_lv2>
    206         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lv2)
    207 
    208     add_dependencies(ZynAddSubFX_lv2 lv2-ttl-generator)
    209 endif()
    210 
    211 install(FILES
    212     ${CMAKE_CURRENT_BINARY_DIR}/lv2/manifest.ttl
    213     ${CMAKE_CURRENT_BINARY_DIR}/lv2/presets.ttl
    214     ${CMAKE_CURRENT_BINARY_DIR}/lv2/ZynAddSubFX.ttl
    215     DESTINATION ${PluginLibDir}/lv2/ZynAddSubFX.lv2/)
    216 
    217 if((NtkGui OR FltkGui OR ZestGui) AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    218 set_target_properties(ZynAddSubFX_lv2_ui PROPERTIES COMPILE_DEFINITIONS "DISTRHO_PLUGIN_TARGET_LV2")
    219 set_target_properties(ZynAddSubFX_lv2_ui PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lv2")
    220 set_target_properties(ZynAddSubFX_lv2_ui PROPERTIES OUTPUT_NAME "ZynAddSubFX_ui")
    221 set_target_properties(ZynAddSubFX_lv2_ui PROPERTIES PREFIX "")
    222 
    223 install(TARGETS ZynAddSubFX_lv2_ui LIBRARY DESTINATION ${PluginLibDir}/lv2/ZynAddSubFX.lv2/)
    224 
    225 install(FILES
    226         ${CMAKE_CURRENT_BINARY_DIR}/lv2/ZynAddSubFX_ui.ttl
    227         DESTINATION ${PluginLibDir}/lv2/ZynAddSubFX.lv2/)
    228 endif()