CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. # Mimic the autoconf header
  11. FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autoconf)
  12. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/autoconf/config.h "")
  13. SET(CARLA_INCLUDE_DIRS
  14. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source
  15. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/includes
  16. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/utils
  17. ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/backend
  18. ${CMAKE_CURRENT_BINARY_DIR}/autoconf
  19. )
  20. ADD_LIBRARY(carla_native-plugin SHARED DummyCarla.cpp)
  21. TARGET_INCLUDE_DIRECTORIES(carla_native-plugin PUBLIC ${CARLA_INCLUDE_DIRS})
  22. INSTALL(TARGETS carla_native-plugin
  23. LIBRARY DESTINATION "${PLUGIN_DIR}/optional"
  24. RUNTIME DESTINATION "${PLUGIN_DIR}/optional"
  25. )
  26. SET(CARLA_LIBRARIES carla_native-plugin)
  27. # Set parent scope variables so carlarack and carlapatchbay can see them
  28. SET(CARLA_LIBRARIES ${CARLA_LIBRARIES} PARENT_SCOPE)
  29. endif()
  30. if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA)
  31. INCLUDE(BuildPlugin)
  32. INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
  33. LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
  34. LINK_LIBRARIES(${CARLA_LIBRARIES})
  35. BUILD_PLUGIN(carlabase carla.cpp carla.h MOCFILES carla.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png" LINK SHARED)
  36. SET_TARGET_PROPERTIES(carlabase
  37. PROPERTIES SKIP_BUILD_RPATH TRUE
  38. BUILD_WITH_INSTALL_RPATH TRUE
  39. INSTALL_RPATH_USE_LINK_PATH TRUE
  40. INSTALL_RPATH "${CARLA_RPATH}")
  41. IF(LMMS_HAVE_WEAKCARLA)
  42. ADD_DEPENDENCIES(carlabase carla_native-plugin)
  43. ENDIF()
  44. endif()