CMakeLists.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # For MacOS, use "OLD" RPATH install_name behavior
  2. # This can be changed to "NEW" safely if install_apple.sh.in
  3. # is updated to relink libcarlabase.dylib. MacOS 10.8 uses
  4. # cmake 3.9.6, so this can be done at any time.
  5. IF(NOT CMAKE_VERSION VERSION_LESS 3.9)
  6. CMAKE_POLICY(SET CMP0068 OLD)
  7. ENDIF()
  8. # If Carla was not provided by the system, make a dummy library instead
  9. if(LMMS_HAVE_WEAKCARLA)
  10. SET(CARLA_INCLUDE_DIRS
  11. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source
  12. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/includes
  13. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/utils
  14. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/backend
  15. )
  16. IF(LMMS_BUILD_WIN32)
  17. # use carla.dll
  18. SET(CMAKE_SHARED_LIBRARY_PREFIX "")
  19. SET(CARLA_NATIVE_LIB carla)
  20. ELSE()
  21. # use libcarla_native-plugin
  22. SET(CARLA_NATIVE_LIB carla_native-plugin)
  23. ENDIF()
  24. ADD_LIBRARY(${CARLA_NATIVE_LIB} SHARED DummyCarla.cpp)
  25. TARGET_INCLUDE_DIRECTORIES(${CARLA_NATIVE_LIB} PUBLIC ${CARLA_INCLUDE_DIRS})
  26. INSTALL(TARGETS ${CARLA_NATIVE_LIB}
  27. LIBRARY DESTINATION "${PLUGIN_DIR}/optional"
  28. RUNTIME DESTINATION "${PLUGIN_DIR}/optional"
  29. )
  30. SET(CARLA_LIBRARIES ${CARLA_NATIVE_LIB})
  31. # Set parent scope variables so carlarack and carlapatchbay can see them
  32. SET(CARLA_LIBRARIES ${CARLA_LIBRARIES} PARENT_SCOPE)
  33. endif()
  34. if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA)
  35. # Mimic the missing "config.h"
  36. SET(CARLA_INCLUDE_DIRS ${CARLA_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/CarlaConfig)
  37. SET(CARLA_INCLUDE_DIRS ${CARLA_INCLUDE_DIRS} PARENT_SCOPE)
  38. INCLUDE(BuildPlugin)
  39. INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
  40. LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
  41. LINK_LIBRARIES(${CARLA_LIBRARIES})
  42. BUILD_PLUGIN(carlabase carla.cpp carla.h
  43. MOCFILES carla.h
  44. EMBEDDED_RESOURCES artwork-patchbay.png artwork-rack.png
  45. EXPORT_BASE_NAME carlabase
  46. LINK SHARED)
  47. SET_TARGET_PROPERTIES(carlabase
  48. PROPERTIES SKIP_BUILD_RPATH TRUE
  49. BUILD_WITH_INSTALL_RPATH TRUE
  50. INSTALL_RPATH_USE_LINK_PATH TRUE
  51. INSTALL_RPATH "${CARLA_RPATH}")
  52. IF(LMMS_HAVE_WEAKCARLA)
  53. ADD_DEPENDENCIES(carlabase ${CARLA_NATIVE_LIB})
  54. ENDIF()
  55. endif()